Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: grey rework #6108

Open
wants to merge 23 commits into
base: master220
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
4fef394
grey rework
Samirakis Oct 31, 2024
74d29b1
review fixes
Samirakis Nov 1, 2024
e19f8c0
fixes2
Samirakis Nov 1, 2024
8fa4eb6
end
Samirakis Nov 2, 2024
e992a00
Update code/modules/surgery/organs/voice_translator.dm
Samirakis Nov 2, 2024
535e7cf
Dae review
Samirakis Nov 2, 2024
5286b4d
HAS_TRAIT
Samirakis Nov 3, 2024
87c30dd
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Nov 3, 2024
736fa11
toxins.dm conflict
Samirakis Nov 3, 2024
d24dd34
again and again and again
Samirakis Nov 3, 2024
1ed337e
var rename(i love 2 line commits)
Samirakis Nov 3, 2024
0e605b2
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Nov 4, 2024
3bdd106
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Nov 5, 2024
46088c7
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Nov 5, 2024
8551c7b
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Nov 6, 2024
4d29fd0
code optimization, I guess
Samirakis Nov 12, 2024
9cbab31
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Nov 12, 2024
51e1fd9
again and again
Samirakis Nov 12, 2024
1ea6f0c
Smol code clean
Samirakis Nov 13, 2024
4415fab
Den review
Samirakis Nov 13, 2024
aaefc83
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Nov 18, 2024
ff0b8ac
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Dec 19, 2024
efe1887
Merge remote-tracking branch 'upstream/master220' into grey_species_r…
Samirakis Dec 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,10 @@
#define COMSIG_OBJ_POSSESSED "obj_possessed"
///from base of /proc/release(): (mob/user)
#define COMSIG_OBJ_RELEASED "obj_released"
///from [/obj/structure/sink/attack_hand]
#define COMSIG_SINK_ACT "sink_act"
/// returns on succes of species special sink_act()
#define COMSIG_SINK_ACT_SUCCESS (1<<0)

// /obj/machinery signals

Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/organ_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#define INTERNAL_ORGAN_EYE_SHIELD_DEVICE "eye_shield"
#define INTERNAL_ORGAN_EYE_LING "eye_ling"
#define INTERNAL_ORGAN_BREATHING_TUBE "breathing_tube"
#define INTERNAL_ORGAN_SPEECH_TRANSLATOR "voice_translator"
#define INTERNAL_ORGAN_STOMACH "stomach"
#define INTERNAL_ORGAN_HEART_DRIVE "heartdrive"
#define INTERNAL_ORGAN_BRAIN_ANTIDROP "brain_antidrop"
Expand Down
9 changes: 9 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,12 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_SPECIES_LIMBS "only_species_limbs"
/// Phohibits using the "Book Of Babel"
#define TRAIT_NO_BABEL "cannot_use_babel"
/// Improves the function of some cyberimps for the Grey species
/// Rename and split into several if you want to make a different functionality to another species/etc
#define TRAIT_ADVANCED_CYBERIMPLANTS "advanced_cyberimplants"
/// Any movement of non-item objects or mobs expends stamina (10 run, 5 walk)
#define TRAIT_WEAK_PULLING "weak_pulling"
Samirakis marked this conversation as resolved.
Show resolved Hide resolved
/// Makes species acid proof(not it's items), affects: acetic, sulfiric, fluorosulfuric acids
#define TRAIT_ACID_PROTECTED "acid_protected"
/// Species with no vocal cords can't speak without translator
#define TRAIT_NO_VOCAL_CORDS "no_vocal_cords"
30 changes: 19 additions & 11 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -507,16 +507,22 @@
/datum/action/item_action/toggle_research_scanner
name = "Toggle Research Scanner"


/datum/action/item_action/toggle_research_scanner/Trigger(left_click = TRUE)
if(IsAvailable())
owner.research_scanner = !owner.research_scanner
to_chat(owner, "<span class='notice'>Research analyzer is now [owner.research_scanner ? "active" : "deactivated"].</span>")
return TRUE
if(!..())
return FALSE

owner.research_scanner = !owner.research_scanner
to_chat(owner, span_notice("Вы [owner.research_scanner ? "включили" : "отключили"] исследовательский анализатор."))

return TRUE


/datum/action/item_action/toggle_research_scanner/Remove(mob/living/L)
if(owner)
owner.research_scanner = 0
..()

. = ..()


/datum/action/item_action/toggle_research_scanner/ApplyIcon()
Expand Down Expand Up @@ -739,16 +745,18 @@
/datum/action/innate/research_scanner
name = "Toggle Research Scanner"

/datum/action/innate/research_scanner/Trigger(left_click = TRUE)
if(IsAvailable())
owner.research_scanner = !owner.research_scanner
to_chat(owner, "<span class='notice'>Research analyzer is now [owner.research_scanner ? "active" : "deactivated"].</span>")
return TRUE
/datum/action/innate/research_scanner/Activate()
owner.research_scanner = !owner.research_scanner
to_chat(owner, span_notice("Вы [owner.research_scanner ? "включили" : "отключили"] исследовательский анализатор."))

return TRUE


/datum/action/innate/research_scanner/Remove(mob/living/L)
if(owner)
owner.research_scanner = 0
..()

. = ..()


/datum/action/innate/research_scanner/ApplyIcon()
Expand Down
4 changes: 3 additions & 1 deletion code/game/machinery/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ Class Procs:
. += span_notice("It appears heavily damaged.")
if(0 to 25)
. += span_warning("It's falling apart!")
if(user.research_scanner && component_parts)

var/obj/item/organ/internal/brain/mobs_brain = user.get_organ_slot(INTERNAL_ORGAN_BRAIN)
if((user.research_scanner || mobs_brain?.smart_mind) && component_parts)
. += display_parts(user)

/obj/machinery/proc/on_assess_perp(mob/living/carbon/human/perp)
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,8 @@ GLOBAL_DATUM_INIT(fire_overlay, /mutable_appearance, mutable_appearance('icons/g

. = ..(user, "", "It is a [size] item.")

if(user.research_scanner) //Mob has a research scanner active.
var/obj/item/organ/internal/brain/mobs_brain = user.get_organ_slot(INTERNAL_ORGAN_BRAIN)
if(user.research_scanner || mobs_brain?.smart_mind) //Mob has a research scanner active.
var/msg = "*--------* <BR>"

if(origin_tech)
Expand Down
6 changes: 5 additions & 1 deletion code/game/objects/items/devices/radio/radio.dm
Original file line number Diff line number Diff line change
Expand Up @@ -382,9 +382,13 @@ GLOBAL_LIST_INIT(default_medbay_channels, list(
return 0

if(M.is_muzzled())
var/obj/item/organ/internal/cyberimp/mouth/translator/translator = M.get_organ_slot(INTERNAL_ORGAN_SPEECH_TRANSLATOR)
if(translator) // you can't speak in radio with translator and gag
return FALSE

var/obj/item/clothing/mask/muzzle/muzzle = M.wear_mask
if(muzzle.radio_mute)
return 0
return FALSE

var/jammed = FALSE
var/turf/position = get_turf(src)
Expand Down
4 changes: 4 additions & 0 deletions code/game/objects/structures/watercloset.dm
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@

user.visible_message("<span class='notice'>[user] washes [user.p_their()] [washing_face ? "face" : "hands"] using [src].</span>", \
"<span class='notice'>You wash your [washing_face ? "face" : "hands"] using [src].</span>")

if(SEND_SIGNAL(user, COMSIG_SINK_ACT) & COMSIG_SINK_ACT_SUCCESS) // special sink acts
return

if(washing_face)
if(ishuman(user))
var/mob/living/carbon/human/H = user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
// Cybernetic implants get removed first (to deal with NODROP stuff)
for(var/obj/item/organ/internal/cyberimp/I in H.internal_organs)
// Greys get to keep their implant
if(isgrey(H) && istype(I, /obj/item/organ/internal/cyberimp/brain/speech_translator))
if(istype(I, /obj/item/organ/internal/cyberimp/mouth/translator/grey_retraslator))
continue
// Try removing it
I = I.remove(H)
Expand Down
23 changes: 23 additions & 0 deletions code/modules/client/preference/loadout/loadout_racial.dm
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
return "\[Species: [english_list(whitelisted_species)]\] "


// TAJARAN //

/datum/gear/racial/taj
display_name = "embroidered veil"
description = "A common traditional nano-fiber veil worn by many Tajaran, It is rare and offensive to see it on other races."
Expand Down Expand Up @@ -95,3 +97,24 @@
allowed_roles = list(JOB_TITLE_HOP, JOB_TITLE_CAPTAIN)


// GREY //

/datum/gear/racial/language_chip
display_name = "selected language chip"
description = "Крошечный чип-переводчик с индикатором, содержащий в себе один из языков. Разработан греями, устанавливается в импланты-переводчики."
path = /obj/item/translator_chip/sol
whitelisted_species = list(SPECIES_GREY)


/datum/gear/racial/language_chip/New()
. = ..()

var/list/available_chips = list()
for(var/obj/item/translator_chip/chip as anything in subtypesof(/obj/item/translator_chip))
if(chip.wingdings_decoder) // you can select it in the prefs, so no need to double
continue

available_chips[chip.stored_language_rus] = chip

gear_tweaks += new /datum/gear_tweak/path(available_chips, src)

11 changes: 8 additions & 3 deletions code/modules/client/preference/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -357,13 +357,14 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
if(SPECIES_VOX)
dat += "<b>N2 Tank:</b> <a href='byond://?_src_=prefs;preference=speciesprefs;task=input'>[speciesprefs ? "Large N2 Tank" : "Specialized N2 Tank"]</a><br>"
if(SPECIES_GREY)
dat += "<b>Wingdings:</b> Set in disabilities<br>"
dat += "<b>Voice Translator:</b> <a href='byond://?_src_=prefs;preference=speciesprefs;task=input'>[speciesprefs ? "Yes" : "No"]</a><br>"
dat += "<b>Wingdings:</b> <a href='byond://?_src_=prefs;preference=toggle_wingdings;task=input'>[disabilities & DISABILITY_FLAG_WINGDINGS ? "Yes" : "No"]</a><br>"
dat += "<b>Install Wingdings Decoder:</b> <a href='byond://?_src_=prefs;preference=speciesprefs;task=input'>[speciesprefs ? "Yes" : "No"]</a><br>"
if(SPECIES_MACNINEPERSON)
dat += "<b>Synthetic Shell:</b> <a href='byond://?_src_=prefs;preference=ipcloadouts;task=input'>Selections</a><br>"
if(SPECIES_WRYN)
dat += "<b>Comb Deafness:</b> <a href='byond://?_src_=prefs;preference=speciesprefs;task=input'>[speciesprefs ? "Yes" : "No"]</a><br>"
dat += "<b>Secondary Language:</b> <a href='byond://?_src_=prefs;preference=language;task=input'>[language]</a><br>"
if(species != SPECIES_GREY)
dat += "<b>Secondary Language:</b> <a href='byond://?_src_=prefs;preference=language;task=input'>[language]</a><br>"
if(S.autohiss_basic_map)
dat += "<b>Auto-accent:</b> <a href='byond://?_src_=prefs;preference=autohiss_mode;task=input'>[autohiss_mode == AUTOHISS_FULL ? "Full" : (autohiss_mode == AUTOHISS_BASIC ? "Basic" : "Off")]</a><br>"
dat += "<b>Blood Type:</b> <a href='byond://?_src_=prefs;preference=b_type;task=input'>[b_type]</a><br>"
Expand Down Expand Up @@ -1710,6 +1711,10 @@ GLOBAL_LIST_INIT(special_role_times, list( //minimum age (in days) for accounts
autohiss_mode = AUTOHISS_OFF
if("speciesprefs")
speciesprefs = !speciesprefs //Starts 0, so if someone clicks the button up top there, this won't be 0 anymore. If they click it again, it'll go back to 0.
if("toggle_wingdings")
var/dflag = text2num(DISABILITY_FLAG_WINGDINGS)
if(dflag >= 0)
disabilities ^= text2num(DISABILITY_FLAG_WINGDINGS)
if("language")
// var/languages_available
var/list/new_languages = list("None")
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/brain/brain_item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
var/mmi_icon_state = "mmi_full"
/// If it's a fake brain without a mob assigned that should still be treated like a real brain.
var/decoy_brain = FALSE
/// TRUE giving to a user sci hud and active research scanner
var/smart_mind = FALSE

/obj/item/organ/internal/brain/xeno
name = "xenomorph brain"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,10 @@
if(CIH?.examine_extensions)
have_hud_exam |= CIH.examine_extensions

var/obj/item/organ/internal/brain/mobs_brain = H.get_organ_slot(INTERNAL_ORGAN_BRAIN)
if(mobs_brain?.smart_mind)
have_hud_exam |= EXAMINE_HUD_SCIENCE

return (have_hud_exam & hud_exam)

else if(isrobot(M) || isAI(M)) //Stand-in/Stopgap to prevent pAIs from freely altering records, pending a more advanced Records system
Expand Down
47 changes: 47 additions & 0 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#define PULL_STAMINADAM_WALK 4
#define PULL_STAMINADAM_RUN 6
#define PUSH_STAMINADAM_WALK 3
#define PUSH_STAMINADAM_RUN 4


/mob/living/carbon/human/Moved(atom/old_loc, movement_dir, forced, list/old_locs, momentum_change = TRUE)
. = ..()
if(!forced && (!old_loc || !old_loc.has_gravity()) && has_gravity())
Expand Down Expand Up @@ -29,6 +35,7 @@
if(.) // did we actually move?
if(body_position != LYING_DOWN && !buckled && !throwing)
update_splints()

var/break_bones_chance = get_bones_symptom_prob()
if(break_bones_chance && (m_intent == MOVE_INTENT_RUN || pulling))
if(prob(break_bones_chance))
Expand All @@ -42,6 +49,40 @@
else if(prob(30))
playsound(src, "bonebreak", 10, TRUE)

// If we sooo weak to pull or push something, except items or tiny mobs, get stamina damage
var/weak_mob = FALSE
if((pulling || now_pushing) && (TRAIT_WEAK_PULLING in dna?.species.inherent_traits))
weak_mob = TRUE

if(weak_mob)
var/stamina_damage = 0
var/small_pushed = TRUE
// Handle pulling all non /obj/item stuff or tiny mobs
if(pulling && isliving(pulling))
var/mob/living/pulled_mob = pulling
if(pulled_mob.mob_size) // small or bigger mobs
small_pushed = FALSE

if(pulling && !(small_pushed || isitem(pulling)))
if(m_intent == MOVE_INTENT_WALK)
stamina_damage += PULL_STAMINADAM_WALK
else
stamina_damage += PULL_STAMINADAM_RUN

if(staminaloss > 69)
balloon_alert(src, "слишком тяжело тащить!")
stop_pulling()

// Handle pushing, NOT swapping sides with mobs in help intent
if(now_pushing)
if(!(isliving(now_pushing) && a_intent == INTENT_HELP))
if(m_intent == MOVE_INTENT_WALK)
stamina_damage += PUSH_STAMINADAM_WALK
else
stamina_damage += PUSH_STAMINADAM_RUN

apply_damage(stamina_damage, STAMINA)

if(!has_gravity())
return .

Expand Down Expand Up @@ -202,3 +243,9 @@
return FALSE

return ..()


#undef PULL_STAMINADAM_WALK
#undef PULL_STAMINADAM_RUN
#undef PUSH_STAMINADAM_WALK
#undef PUSH_STAMINADAM_RUN
42 changes: 30 additions & 12 deletions code/modules/mob/living/carbon/human/human_say.dm
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,29 @@


/mob/living/carbon/human/IsVocal()
var/obj/item/organ/internal/cyberimp/brain/speech_translator/translator = locate() in internal_organs
if(translator?.active)
return TRUE
var/obj/item/organ/internal/cyberimp/mouth/translator/translator = get_organ_slot(INTERNAL_ORGAN_SPEECH_TRANSLATOR)
if(translator?.active && !mind?.miming)
return TRUE // Cyberimps don't care if you need to breathe at all, but make some respect to mimes

if(HAS_TRAIT(src, TRAIT_MUTE))
return FALSE

if(TRAIT_NO_VOCAL_CORDS in dna?.species.inherent_traits)
return FALSE

// how do species that don't breathe talk? magic, that's what.
var/breathes = !HAS_TRAIT(src, TRAIT_NO_BREATH)
var/obj/item/organ/internal/lungs = get_organ_slot(INTERNAL_ORGAN_LUNGS)
if((breathes && !lungs) || (breathes && lungs && lungs.is_dead()))
return FALSE

if(getOxyLoss() > 10 || AmountLoseBreath() >= 8 SECONDS)
emote("gasp")
return FALSE

if(mind)
return !mind.miming

return TRUE


Expand Down Expand Up @@ -131,21 +139,22 @@

/mob/living/carbon/human/handle_speech_problems(list/message_pieces, verb)
var/span = ""
var/check_mute = TRUE
var/check_wingdings = TRUE

var/obj/item/organ/internal/cyberimp/brain/speech_translator/translator = locate() in internal_organs
if(translator?.active && !HAS_TRAIT(src, TRAIT_MUTE))
span = translator.speech_span
for(var/datum/multilingual_say_piece/S in message_pieces)
S.message = "<span class='[span]'>[S.message]</span>"
verb = translator.speech_verb
return list("verb" = verb)
var/obj/item/organ/internal/cyberimp/mouth/translator/translator = get_organ_slot(INTERNAL_ORGAN_SPEECH_TRANSLATOR)
if(translator?.active) // Yes, we can speak even muted, unless being EMPed
check_mute = FALSE

if(translator.can_wingdings) // Active wingdings chip allowed us to speak normally
check_wingdings = FALSE

if(HAS_TRAIT(src, TRAIT_COMIC) \
|| (locate(/obj/item/organ/internal/cyberimp/brain/clown_voice) in internal_organs) \
|| HAS_TRAIT(src, TRAIT_JESTER))
span = "sans"

if(HAS_TRAIT(src, TRAIT_WINGDINGS))
if(check_wingdings && HAS_TRAIT(src, TRAIT_WINGDINGS))
span = "wingdings"

var/list/parent = ..()
Expand All @@ -155,8 +164,9 @@
if(S.speaking?.flags & NO_STUTTER)
continue

if(HAS_TRAIT(src, TRAIT_MUTE))
if(check_mute && (HAS_TRAIT(src, TRAIT_MUTE)))
S.message = ""
continue

if(istype(wear_mask, /obj/item/clothing/mask/horsehead))
var/obj/item/clothing/mask/horsehead/hoers = wear_mask
Expand All @@ -166,13 +176,21 @@
if(dna)
for(var/datum/dna/gene/gene as anything in GLOB.dna_genes)
if(gene.is_active(src))
if(!check_wingdings && istype(gene, /datum/dna/gene/disability/wingdings))
continue

S.message = gene.OnSay(src, S.message)

if(check_mute && (TRAIT_NO_VOCAL_CORDS in dna.species.inherent_traits)) // Species neither have vocal cords nor translator
S.message = ""
continue

var/braindam = getBrainLoss()
if(braindam >= 60)
if(prob(braindam / 4))
S.message = stutter(S.message)
verb = "gibbers"

if(prob(braindam))
S.message = uppertext(S.message)
verb = "yells loudly"
Expand Down
Loading