From 1f65065ec0b128b7c484620aa5b837c7dd3b8f3e Mon Sep 17 00:00:00 2001 From: _0Steven <42909981+00-Steven@users.noreply.github.com> Date: Tue, 16 Jul 2024 03:58:59 +0200 Subject: [PATCH] Allows humans with a robotic voicebox installed, MMIs, and posibrains to use silicon emotes, and simple/basic bots to beep (#84912) ## About The Pull Request ### EDITED, see spoiler for previous about section. This pr adds the `TRAIT_SILICON_EMOTES_ALLOWED`, which is now used to determine what can perform silicons emotes instead of typechecks. We do this by adding a `trait_required` var to emotes, which if set is checked for in `can_run_emote(...)` and means the mob must have that trait to use the emote. We then adds this trait to all of the mobs previously capable of using silicon emotes and the beep emote, being: All silicons, basic bots, simple bots, orbies, and brain mobs. In addition, we add the trait to robotic voicebox users. Finally, it makes beeping a silicon emote. What this changes is that robotic voicebox users can beep and use other silicon emotes, basic and simple bots can actually beep, sentient orbies could use other silicon emotes, and brains can beep and use silicon emotes. Previously brains where on the allowed types list for beeping, but living emotes also blocked brains generally, so they couldn't _actually_ beep.
Previous About Section All this really does is add a new trait, `TRAIT_SILICON_EMOTES_ALLOWED`, which when given to a human allows them to use silicon emotes. It does this by adding the `/mob/living/carbon/human` type to the allowed types for these emotes, but then adding an additional check to `can_run_emote(...)` for these emotes to block it for humans if they don't have the trait. We add it to the typecache because the base checks for `can_run_emote(...)` would block if not for that, but we _do_ want the other checks it runs.
## Why It's Good For The Game I just think it'd be fun, really. Like, _I'd_ want to beep at people when I'm going out of my way to augment the shit out of my character. It's an item primarily accessible by roboticists and transhumanists, both of which are encouraged/required to interact with silicons, so I think this'd lead to fun interactions for those that do commit to getting the silicon-speech tongue replacement. Finally, I mean, it's a funky synthesizer that makes you sound like a silicon. Why shouldn't it let you synthesize these sounds too? Hell, even its attack verbs are beeping and booping already. ### EDITED, additional justification: It's weird for basic/simple bots to be able to use all other silicon emotes except beeping. MMI'd brains/posibrains being able to beep looked intentional, just broken. This fixes that. I feel we might as well just allow them to use other silicon emotes while we're at it. --- code/__DEFINES/traits/declarations.dm | 2 ++ code/_globalvars/traits/_traits.dm | 1 + code/_globalvars/traits/admin_tooling.dm | 1 + code/datums/emotes.dm | 4 ++++ code/modules/mob/living/basic/bots/_bots.dm | 2 +- code/modules/mob/living/basic/pets/orbie/orbie.dm | 1 + code/modules/mob/living/brain/brain.dm | 1 + code/modules/mob/living/emote.dm | 9 --------- code/modules/mob/living/silicon/robot/emote.dm | 11 +++++++++-- code/modules/mob/living/silicon/robot/robot.dm | 2 +- code/modules/mob/living/silicon/silicon.dm | 1 + code/modules/mob/living/simple_animal/bot/bot.dm | 1 + .../file_system/programs/virtual_pet.dm | 2 +- .../modules/surgery/organs/internal/tongue/_tongue.dm | 1 + 14 files changed, 25 insertions(+), 14 deletions(-) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index a2925ee2e5b..504e451f88c 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -234,6 +234,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_EXAMINE_FITNESS "reveal_power_level" /// These mobs have particularly hygienic tongues #define TRAIT_WOUND_LICKER "wound_licker" +/// Mobs with this trait are allowed to use silicon emotes +#define TRAIT_SILICON_EMOTES_ALLOWED "silicon_emotes_allowed" /// This trait designate that the mob was originally a monkey #define TRAIT_BORN_MONKEY "born_as_a_monkey" diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index d098e1c11fb..1cf3678dbd3 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -439,6 +439,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE, "TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG, "TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS, + "TRAIT_SILICON_EMOTES_ALLOWED" = TRAIT_SILICON_EMOTES_ALLOWED, "TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE, "TRAIT_SKITTISH" = TRAIT_SKITTISH, "TRAIT_SLEEPIMMUNE" = TRAIT_SLEEPIMMUNE, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index a0ec9987015..d3617ccc877 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -200,6 +200,7 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_SHOCKIMMUNE" = TRAIT_SHOCKIMMUNE, "TRAIT_SIGN_LANG" = TRAIT_SIGN_LANG, "TRAIT_SILENT_FOOTSTEPS" = TRAIT_SILENT_FOOTSTEPS, + "TRAIT_SILICON_EMOTES_ALLOWED" = TRAIT_SILICON_EMOTES_ALLOWED, "TRAIT_SIXTHSENSE" = TRAIT_SIXTHSENSE, "TRAIT_SKITTISH" = TRAIT_SKITTISH, "TRAIT_SLEEPIMMUNE" = TRAIT_SLEEPIMMUNE, diff --git a/code/datums/emotes.dm b/code/datums/emotes.dm index 7006d6d6daa..71631de2d98 100644 --- a/code/datums/emotes.dm +++ b/code/datums/emotes.dm @@ -44,6 +44,8 @@ var/list/mob_type_blacklist_typecache /// Types that can use this emote regardless of their state. var/list/mob_type_ignore_stat_typecache + /// Trait that is required to use this emote. + var/trait_required /// In which state can you use this emote? (Check stat.dm for a full list of them) var/stat_allowed = CONSCIOUS /// Sound to play when emote is called. @@ -297,6 +299,8 @@ * Returns a bool about whether or not the user can run the emote. */ /datum/emote/proc/can_run_emote(mob/user, status_check = TRUE, intentional = FALSE) + if(trait_required && !HAS_TRAIT(user, trait_required)) + return FALSE if(!is_type_in_typecache(user, mob_type_allowed_typecache)) return FALSE if(is_type_in_typecache(user, mob_type_blacklist_typecache)) diff --git a/code/modules/mob/living/basic/bots/_bots.dm b/code/modules/mob/living/basic/bots/_bots.dm index 86fe0b5cf57..aad840aa185 100644 --- a/code/modules/mob/living/basic/bots/_bots.dm +++ b/code/modules/mob/living/basic/bots/_bots.dm @@ -113,7 +113,7 @@ GLOBAL_LIST_INIT(command_strings, list( RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(handle_loop_movement)) RegisterSignal(src, COMSIG_ATOM_WAS_ATTACKED, PROC_REF(after_attacked)) RegisterSignal(src, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access)) - ADD_TRAIT(src, TRAIT_NO_GLIDE, INNATE_TRAIT) + add_traits(list(TRAIT_NO_GLIDE, TRAIT_SILICON_EMOTES_ALLOWED), INNATE_TRAIT) GLOB.bots_list += src // Give bots a fancy new ID card that can hold any access. diff --git a/code/modules/mob/living/basic/pets/orbie/orbie.dm b/code/modules/mob/living/basic/pets/orbie/orbie.dm index 735f63977d3..c0c6dd7b023 100644 --- a/code/modules/mob/living/basic/pets/orbie/orbie.dm +++ b/code/modules/mob/living/basic/pets/orbie/orbie.dm @@ -50,6 +50,7 @@ var/static/list/food_types = list(/obj/item/food/virtual_chocolate) AddComponent(/datum/component/obeys_commands, pet_commands) AddElement(/datum/element/basic_eating, food_types = food_types) + ADD_TRAIT(src, TRAIT_SILICON_EMOTES_ALLOWED, INNATE_TRAIT) RegisterSignal(src, COMSIG_ATOM_CAN_BE_PULLED, PROC_REF(on_pulled)) RegisterSignal(src, COMSIG_VIRTUAL_PET_LEVEL_UP, PROC_REF(on_level_up)) RegisterSignal(src, COMSIG_MOB_CLICKON, PROC_REF(on_click)) diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm index 1bacc08a8b6..17f5be02a91 100644 --- a/code/modules/mob/living/brain/brain.dm +++ b/code/modules/mob/living/brain/brain.dm @@ -16,6 +16,7 @@ forceMove(OB) if(!container?.mecha && (!container || container.immobilize)) //Unless inside a mecha, brains are rather helpless. add_traits(list(TRAIT_IMMOBILIZED, TRAIT_HANDS_BLOCKED), BRAIN_UNAIDED) + ADD_TRAIT(src, TRAIT_SILICON_EMOTES_ALLOWED, INNATE_TRAIT) /mob/living/brain/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents) var/obj/item/organ/internal/brain/brain_loc = loc diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm index 9ccc26eec6c..ae79d876272 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -715,15 +715,6 @@ /datum/emote/living/custom/replace_pronoun(mob/user, message) return message -/datum/emote/living/beep - key = "beep" - key_third_person = "beeps" - message = "beeps." - message_param = "beeps at %t." - sound = 'sound/machines/twobeep.ogg' - mob_type_allowed_typecache = list(/mob/living/brain, /mob/living/silicon, /mob/living/basic/orbie) - emote_type = EMOTE_AUDIBLE - /datum/emote/living/inhale key = "inhale" key_third_person = "inhales" diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm index fb7857d4585..22158647823 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -1,5 +1,5 @@ /datum/emote/silicon - mob_type_allowed_typecache = list(/mob/living/silicon, /mob/living/simple_animal/bot, /mob/living/basic/bot) + trait_required = TRAIT_SILICON_EMOTES_ALLOWED emote_type = EMOTE_AUDIBLE /datum/emote/silicon/boop @@ -7,6 +7,14 @@ key_third_person = "boops" message = "boops." +/datum/emote/silicon/beep + key = "beep" + key_third_person = "beeps" + message = "beeps." + message_param = "beeps at %t." + emote_type = EMOTE_AUDIBLE + sound = 'sound/machines/twobeep.ogg' + /datum/emote/silicon/buzz key = "buzz" key_third_person = "buzzes" @@ -15,7 +23,6 @@ emote_type = EMOTE_AUDIBLE sound = 'sound/machines/buzz-sigh.ogg' - /datum/emote/silicon/buzz2 key = "buzz2" message = "buzzes twice." diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 0c26e7c57e2..4813d97d12d 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -11,7 +11,7 @@ post_tipped_callback = CALLBACK(src, PROC_REF(after_tip_over)), \ post_untipped_callback = CALLBACK(src, PROC_REF(after_righted)), \ roleplay_friendly = TRUE, \ - roleplay_emotes = list(/datum/emote/silicon/buzz, /datum/emote/silicon/buzz2, /datum/emote/living/beep), \ + roleplay_emotes = list(/datum/emote/silicon/buzz, /datum/emote/silicon/buzz2, /datum/emote/silicon/beep), \ roleplay_callback = CALLBACK(src, PROC_REF(untip_roleplay))) set_wires(new /datum/wires/robot(src)) diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 9ca655740cd..6916c01f4d3 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -80,6 +80,7 @@ ) add_traits(traits_to_apply, ROUNDSTART_TRAIT) + ADD_TRAIT(src, TRAIT_SILICON_EMOTES_ALLOWED, INNATE_TRAIT) RegisterSignal(src, COMSIG_LIVING_ELECTROCUTE_ACT, PROC_REF(on_silicon_shocked)) /mob/living/silicon/Destroy() diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 49b44122ac0..50b30b09aa8 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -202,6 +202,7 @@ pa_system = new(src, automated_announcements = automated_announcements) pa_system.Grant(src) RegisterSignal(src, COMSIG_MOB_TRIED_ACCESS, PROC_REF(attempt_access)) + ADD_TRAIT(src, TRAIT_SILICON_EMOTES_ALLOWED, INNATE_TRAIT) /mob/living/simple_animal/bot/Destroy() GLOB.bots_list -= src diff --git a/code/modules/modular_computers/file_system/programs/virtual_pet.dm b/code/modules/modular_computers/file_system/programs/virtual_pet.dm index 7a0adba3cce..78a9148b013 100644 --- a/code/modules/modular_computers/file_system/programs/virtual_pet.dm +++ b/code/modules/modular_computers/file_system/programs/virtual_pet.dm @@ -432,7 +432,7 @@ GLOBAL_LIST_EMPTY(virtual_pets_list) /datum/emote/living/jump, /datum/emote/living/shiver, /datum/emote/spin, - /datum/emote/living/beep, + /datum/emote/silicon/beep, ) data["possible_emotes"] = list("none") for(var/datum/emote/target_emote as anything in possible_emotes) diff --git a/code/modules/surgery/organs/internal/tongue/_tongue.dm b/code/modules/surgery/organs/internal/tongue/_tongue.dm index 7904c4bea91..fa034acf22b 100644 --- a/code/modules/surgery/organs/internal/tongue/_tongue.dm +++ b/code/modules/surgery/organs/internal/tongue/_tongue.dm @@ -546,6 +546,7 @@ GLOBAL_LIST_INIT(english_to_zombie, list()) attack_verb_simple = list("beep", "boop") modifies_speech = TRUE taste_sensitivity = 25 // not as good as an organic tongue + organ_traits = list(TRAIT_SILICON_EMOTES_ALLOWED) voice_filter = "alimiter=0.9,acompressor=threshold=0.2:ratio=20:attack=10:release=50:makeup=2,highpass=f=1000" /obj/item/organ/internal/tongue/robot/could_speak_language(datum/language/language_path)