Skip to content

Commit

Permalink
add: grey rework (#6108)
Browse files Browse the repository at this point in the history
* grey rework

* review fixes

* fixes2

* end

* Update code/modules/surgery/organs/voice_translator.dm

Co-authored-by: Antoonij <[email protected]>

* Dae review

* HAS_TRAIT

* toxins.dm conflict

* again and again and again

* var rename(i love 2 line commits)

* code optimization, I guess

* again and again

* Smol code clean

* Den review

* Update code/modules/mob/living/carbon/human/species/grey.dm

Co-authored-by: PlayerUnknown14 <[email protected]>

* Update code/modules/research/designs/medical_designs.dm

Co-authored-by: PlayerUnknown14 <[email protected]>

* Update code/modules/surgery/organs/autoimplanter.dm

Co-authored-by: PlayerUnknown14 <[email protected]>

* Update code/modules/surgery/organs/autoimplanter.dm

Co-authored-by: PlayerUnknown14 <[email protected]>

* translation fix

* Update voice_translator.dm

* ru_names under desc

* end?

* Update code/modules/mob/living/carbon/human/species/grey.dm

Co-authored-by: PlayerUnknown14 <[email protected]>

* Update code/modules/surgery/organs/voice_translator.dm

Co-authored-by: PlayerUnknown14 <[email protected]>

* Compile error fix

---------

Co-authored-by: Antoonij <[email protected]>
Co-authored-by: PlayerUnknown14 <[email protected]>
  • Loading branch information
3 people authored Jan 6, 2025
1 parent 433c4a1 commit b192529
Show file tree
Hide file tree
Showing 44 changed files with 1,452 additions and 210 deletions.
7 changes: 7 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,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 Expand Up @@ -829,6 +833,9 @@
#define COMSIG_MINE_TRIGGERED "minegoboom"
///from [/obj/item/organ/internal/remove]:
#define COMSIG_ORGAN_REMOVED "organ_removed"
///from [/obj/item/organ/internal/cyberimp/mouth/translator/check_lang]
#define COMSIG_LANG_PRE_ACT "check_language"
#define COMSIG_LANG_SECURED (1<<0)

/// Defib-specific signals

Expand Down
3 changes: 3 additions & 0 deletions code/__DEFINES/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -461,3 +461,6 @@

/// For babylon fever disease.
#define DISEASE_MOB_LANGUAGE_PROCESSED (1<<0)

/// Eyes examine time mod
#define EXAMINE_INSTANT 0 // 0 seconds
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
11 changes: 11 additions & 0 deletions code/__DEFINES/traits/declarations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_ADVANCED_SURGICAL "advanced_surgical"
/// This trait makes it so that an item literally cannot be removed at all, or at least that's how it should be. Only deleted.
#define TRAIT_NODROP "nodrop"
/// Applied with attachment to the cyberimplant when it is inserted in mob with TRAIT_ADVANCED_CYBERIMPLANTS
#define TRAIT_CYBERIMP_IMPROVED "cyberimp_improved"

#define TRAIT_SHRAPNEL "shrapnel"

Expand Down Expand Up @@ -281,5 +283,14 @@ 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"
/// 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"

#define TRAIT_BLOB_ZOMBIFIED "blob_zombified"
3 changes: 3 additions & 0 deletions code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_WEATHER_IMMUNE" = TRAIT_WEATHER_IMMUNE,
),
/mob = list(
"TRAIT_ACID_PROTECTED" = TRAIT_ACID_PROTECTED,
"TRAIT_AI_UNTRACKABLE" = TRAIT_AI_UNTRACKABLE,
"TRAIT_BADASS" = TRAIT_BADASS,
"TRAIT_BLIND" = TRAIT_BLIND,
Expand Down Expand Up @@ -115,6 +116,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_NO_SPECIES_EXAMINE" = TRAIT_NO_SPECIES_EXAMINE,
"TRAIT_NO_SPELLS" = TRAIT_NO_SPELLS,
"TRAIT_NO_TRANSFORM" = TRAIT_NO_TRANSFORM,
"TRAIT_NO_VOCAL_CORDS" = TRAIT_NO_VOCAL_CORDS,
"TRAIT_OBESITY" = TRAIT_OBESITY,
"TRAIT_OPEN_MIND" = TRAIT_OPEN_MIND,
"TRAIT_PACIFISM" = TRAIT_PACIFISM,
Expand Down Expand Up @@ -146,6 +148,7 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_VENTCRAWLER_NUDE" = TRAIT_VENTCRAWLER_NUDE,
"TRAIT_VIRUSIMMUNE" = TRAIT_VIRUSIMMUNE,
"TRAIT_WATERBREATH" = TRAIT_WATERBREATH,
"TRAIT_WEAK_PULLING" = TRAIT_WEAK_PULLING,
"TRAIT_WINGDINGS" = TRAIT_WINGDINGS,
"TRAIT_XENO_HOST" = TRAIT_XENO_HOST,
"TRAIT_XRAY" = TRAIT_XRAY,
Expand Down
30 changes: 19 additions & 11 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -510,16 +510,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 @@ -742,16 +748,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: 4 additions & 0 deletions code/datums/diseases/_MobProcs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,7 @@
if(istype(Clothing) && prob(100 * (1 - Clothing.permeability_coefficient)))
return TRUE
return FALSE


/mob/proc/check_smart_brain()
return FALSE
16 changes: 13 additions & 3 deletions code/datums/diseases/viruses/babylon_fever.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,31 @@

stored_languages = LAZYCOPY(affected_mob.languages)

for(var/datum/language/lan as anything in affected_mob.languages)
var/obj/item/organ/internal/cyberimp/mouth/translator/translator = affected_mob.get_organ_slot(INTERNAL_ORGAN_SPEECH_TRANSLATOR)
if(translator?.given_languages)
stored_languages ^= translator.given_languages // you can't forget it, because it's on the chip in translator

for(var/datum/language/lan as anything in stored_languages)
affected_mob.remove_language(lan.name)


/datum/disease/virus/babylonian_fever/proc/store_language(datum/signal_source, language_name)
/datum/disease/virus/babylonian_fever/proc/store_language(datum/signal_source, language_name, lang_flags)
SIGNAL_HANDLER

if(lang_flags & COMSIG_LANG_SECURED)
return

var/datum/language/new_language = GLOB.all_languages[language_name]
LAZYOR(stored_languages, new_language)
return DISEASE_MOB_LANGUAGE_PROCESSED


/datum/disease/virus/babylonian_fever/proc/remove_language(datum/signal_source, language_name)
/datum/disease/virus/babylonian_fever/proc/remove_language(datum/signal_source, language_name, lang_flags)
SIGNAL_HANDLER

if(lang_flags & COMSIG_LANG_SECURED)
return

var/datum/language/rem_language = GLOB.all_languages[language_name]
LAZYREMOVE(stored_languages, rem_language)
return DISEASE_MOB_LANGUAGE_PROCESSED
3 changes: 2 additions & 1 deletion code/game/machinery/machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,8 @@ Class Procs:
. += span_notice("It appears heavily damaged.")
if(0 to 25)
. += span_warning("It's falling apart!")
if(user.research_scanner && component_parts)

if((user.research_scanner || user.check_smart_brain()) && component_parts)
. += display_parts(user)

/obj/machinery/proc/on_assess_perp(mob/living/carbon/human/perp)
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ 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.
if(user.research_scanner || user.check_smart_brain()) //Mob has a research scanner active.
var/msg = "*--------* <BR>"

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

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 FALSE
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
20 changes: 20 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
index_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,21 @@
allowed_roles = list(JOB_TITLE_HOP, JOB_TITLE_CAPTAIN)


// GREY //

/datum/gear/racial/language_chip
index_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))
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 @@ -356,13 +356,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 @@ -1675,6 +1676,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
6 changes: 4 additions & 2 deletions code/modules/mob/language.dm
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,8 @@

// Language handling.
/mob/proc/add_language(language_name)
if(SEND_SIGNAL(src, COMSIG_MOB_LANGUAGE_ADD, language_name) & DISEASE_MOB_LANGUAGE_PROCESSED)
var/result_flags = SEND_SIGNAL(src, COMSIG_LANG_PRE_ACT, language_name)
if(SEND_SIGNAL(src, COMSIG_MOB_LANGUAGE_ADD, language_name, result_flags) & DISEASE_MOB_LANGUAGE_PROCESSED)
return TRUE

var/datum/language/new_language = GLOB.all_languages[language_name]
Expand All @@ -926,7 +927,8 @@


/mob/proc/remove_language(language_name)
if(SEND_SIGNAL(src, COMSIG_MOB_LANGUAGE_REMOVE, language_name) & DISEASE_MOB_LANGUAGE_PROCESSED)
var/result_flags = SEND_SIGNAL(src, COMSIG_LANG_PRE_ACT, language_name)
if(SEND_SIGNAL(src, COMSIG_MOB_LANGUAGE_REMOVE, language_name, result_flags) & DISEASE_MOB_LANGUAGE_PROCESSED)
return TRUE

var/datum/language/rem_language = GLOB.all_languages[language_name]
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
7 changes: 7 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -962,3 +962,10 @@ so that different stomachs can handle things in different ways VB*/

co2overloadtime = 0


/mob/living/carbon/check_smart_brain()
var/obj/item/organ/internal/brain/mobs_brain = get_organ_slot(INTERNAL_ORGAN_BRAIN)
if(mobs_brain?.smart_mind)
return TRUE

return ..()
3 changes: 3 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,9 @@
if(CIH?.examine_extensions)
have_hud_exam |= CIH.examine_extensions

if(H.check_smart_brain())
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
Loading

0 comments on commit b192529

Please sign in to comment.