From f0841202174b5df3966f7d7477226a952788e82f Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Fri, 19 Jul 2024 09:24:39 +0200 Subject: [PATCH] [MIRROR] Allows humans with a robotic voicebox installed, MMIs, and posibrains to use silicon emotes, and simple/basic bots to beep (#28878) * Allows humans with a robotic voicebox installed, MMIs, and posibrains to use silicon emotes, and simple/basic bots to beep * modular stuff --------- Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com> Co-authored-by: SpaceLoveSs13 <68121607+SpaceLoveSs13@users.noreply.github.com> --- 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 +- .../mob/living/basic/pets/orbie/orbie.dm | 1 + code/modules/mob/living/brain/brain.dm | 1 + code/modules/mob/living/emote.dm | 9 -- .../modules/mob/living/silicon/robot/emote.dm | 13 +- .../modules/mob/living/silicon/robot/robot.dm | 2 +- code/modules/mob/living/silicon/silicon.dm | 1 + .../mob/living/simple_animal/bot/bot.dm | 1 + .../file_system/programs/virtual_pet.dm | 2 +- .../surgery/organs/internal/tongue/_tongue.dm | 1 + .../modules/emote_panel/code/emote_panel.dm | 2 +- .../modules/emotes/code/synth_emotes.dm | 122 ++---------------- .../modules/synths/code/bodyparts/brain.dm | 1 + .../code/bodyparts/internal_computer/brain.dm | 1 + 18 files changed, 42 insertions(+), 125 deletions(-) diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 1401937df33..fe9e3d4282e 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -233,6 +233,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 9682ac9ee17..2d1085d8bbd 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -445,6 +445,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 684e81b5654..8dea5b2d375 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -199,6 +199,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 8365ddb7a19..d0de582a920 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. @@ -361,6 +363,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 82de1477f83..7a0a001fb4b 100644 --- a/code/modules/mob/living/emote.dm +++ b/code/modules/mob/living/emote.dm @@ -718,15 +718,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 41855a0db87..22158647823 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -1,6 +1,5 @@ -/* SKYRAT EDIT REMOVAL /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 @@ -8,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" @@ -16,7 +23,6 @@ emote_type = EMOTE_AUDIBLE sound = 'sound/machines/buzz-sigh.ogg' - /datum/emote/silicon/buzz2 key = "buzz2" message = "buzzes twice." @@ -63,4 +69,3 @@ message = "activates their slow clap processor." emote_type = EMOTE_AUDIBLE sound = 'sound/machines/slowclap.ogg' -*/ diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 89c1d7ae285..0ef78780ee6 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/living/human/buzz, /datum/emote/living/human/buzz2, /datum/emote/living/beep, /datum/emote/living/human/beep2), /* SKYRAT EDIT CHANGE - ORIGINAL: 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 7862d9cb442..cde99e84c1f 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 e4ce3b126fc..6467beac078 100644 --- a/code/modules/surgery/organs/internal/tongue/_tongue.dm +++ b/code/modules/surgery/organs/internal/tongue/_tongue.dm @@ -567,6 +567,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) diff --git a/modular_skyrat/modules/emote_panel/code/emote_panel.dm b/modular_skyrat/modules/emote_panel/code/emote_panel.dm index f06a7ba2df8..dc83d823ded 100644 --- a/modular_skyrat/modules/emote_panel/code/emote_panel.dm +++ b/modular_skyrat/modules/emote_panel/code/emote_panel.dm @@ -231,7 +231,7 @@ available_emotes += human_emotes // Checking if should apply Synth emotes var/mob/living/carbon/human/current_mob = src - if(current_mob.dna.species.type in allowed_species_synth) + if(!HAS_TRAIT(current_mob, TRAIT_SILICON_EMOTES_ALLOWED)) available_emotes += synth_emotes // Checking if can wag tail var/obj/item/organ/external/tail/tail = current_mob.get_organ_slot(ORGAN_SLOT_EXTERNAL_TAIL) diff --git a/modular_skyrat/modules/emotes/code/synth_emotes.dm b/modular_skyrat/modules/emotes/code/synth_emotes.dm index 464d9f4e541..63f96c0ca33 100644 --- a/modular_skyrat/modules/emotes/code/synth_emotes.dm +++ b/modular_skyrat/modules/emotes/code/synth_emotes.dm @@ -1,57 +1,28 @@ -/datum/emote/living/human - mob_type_allowed_typecache = list(/mob/living/carbon/human, /mob/living/silicon) - -/datum/emote/living/human/dwoop - key = "dwoop" - key_third_person = "dwoops" - message = "chirps happily!" - vary = TRUE - sound = 'modular_skyrat/modules/emotes/sound/emotes/dwoop.ogg' - allowed_species = list(/datum/species/synthetic) +/datum/emote/silicon cooldown = 2 SECONDS -/datum/emote/living/human/yes +/datum/emote/living/human/dwoop + key = "dwoop" + key_third_person = "dwoops" + message = "chirps happily!" + vary = TRUE + sound = 'modular_skyrat/modules/emotes/sound/emotes/dwoop.ogg' + allowed_species = list(/datum/species/synthetic) + cooldown = 2 SECONDS + +/datum/emote/silicon/yes key = "yes" message = "emits an affirmative blip." vary = TRUE sound = 'modular_skyrat/modules/emotes/sound/emotes/synth_yes.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS -/datum/emote/living/human/no +/datum/emote/silicon/no key = "no" message = "emits a negative blip." vary = TRUE sound = 'modular_skyrat/modules/emotes/sound/emotes/synth_no.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS -/datum/emote/living/human/boop - key = "boop" - key_third_person = "boops" - message = "boops." - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/buzz - key = "buzz" - key_third_person = "buzzes" - message = "buzzes." - message_param = "buzzes at %t." - emote_type = EMOTE_AUDIBLE - sound = 'sound/machines/buzz-sigh.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -// This one is special, since it comes from TG and can be used by some basic mobs too. Handle it modularly. -/datum/emote/living/beep - allowed_species = list(/datum/species/synthetic) - -/datum/emote/living/beep/New() - mob_type_allowed_typecache += list(/mob/living/carbon/human) - return ..() - -/datum/emote/living/human/beep2 +/datum/emote/silicon/beep2 key = "beep2" key_third_person = "beeps sharply" message = "beeps sharply." @@ -59,74 +30,9 @@ emote_type = EMOTE_AUDIBLE vary = TRUE sound = 'modular_skyrat/modules/emotes/sound/emotes/twobeep.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS -/datum/emote/living/human/buzz2 - key = "buzz2" - message = "buzzes twice." - emote_type = EMOTE_AUDIBLE - sound = 'sound/machines/buzz-two.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/chime - key = "chime" - key_third_person = "chimes" - message = "chimes." - emote_type = EMOTE_AUDIBLE - sound = 'sound/machines/chime.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/honk - key = "honk" - key_third_person = "honks" - message = "honks." - emote_type = EMOTE_AUDIBLE - vary = TRUE - sound = 'sound/items/bikehorn.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/ping - key = "ping" - key_third_person = "pings" - message = "pings." - message_param = "pings at %t." - emote_type = EMOTE_AUDIBLE - sound = 'sound/machines/ping.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/sad - key = "sad" - message = "plays a sad trombone..." - emote_type = EMOTE_AUDIBLE - sound = 'sound/misc/sadtrombone.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/warn - key = "warn" - message = "blares an alarm!" - emote_type = EMOTE_AUDIBLE - sound = 'sound/machines/warning-buzzer.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/slowclaps - key = "slowclap" - message = "activates their slow clap processor." - emote_type = EMOTE_AUDIBLE - sound = 'sound/machines/slowclap.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS - -/datum/emote/living/human/laughtrack +/datum/emote/silicon/laughtrack key = "laughtrack" message = "plays a laughtrack." emote_type = EMOTE_AUDIBLE sound = 'sound/items/sitcomlaugh2.ogg' - allowed_species = list(/datum/species/synthetic) - cooldown = 2 SECONDS diff --git a/modular_skyrat/modules/synths/code/bodyparts/brain.dm b/modular_skyrat/modules/synths/code/bodyparts/brain.dm index 340fe183377..d4f062bc178 100644 --- a/modular_skyrat/modules/synths/code/bodyparts/brain.dm +++ b/modular_skyrat/modules/synths/code/bodyparts/brain.dm @@ -9,6 +9,7 @@ icon_state = "posibrain-ipc" /// The last time (in ticks) a message about brain damage was sent. Don't touch. var/last_message_time = 0 + organ_traits = list(TRAIT_SILICON_EMOTES_ALLOWED) /obj/item/organ/internal/brain/synth/on_mob_insert(mob/living/carbon/brain_owner, special, movement_flags = NO_ID_TRANSFER) . = ..() diff --git a/modular_skyrat/modules/synths/code/bodyparts/internal_computer/brain.dm b/modular_skyrat/modules/synths/code/bodyparts/internal_computer/brain.dm index e9698a5fd06..08daebc3ed7 100644 --- a/modular_skyrat/modules/synths/code/bodyparts/internal_computer/brain.dm +++ b/modular_skyrat/modules/synths/code/bodyparts/internal_computer/brain.dm @@ -5,6 +5,7 @@ /obj/item/organ/internal/brain/synth/Initialize(mapload) . = ..() internal_computer = new(src) + ADD_TRAIT(src, TRAIT_SILICON_EMOTES_ALLOWED, INNATE_TRAIT) /obj/item/organ/internal/brain/synth/Destroy() QDEL_NULL(internal_computer)