From b57d885abdf03edbad1b0b103d7fe836dfe16c66 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:53:39 +0200 Subject: [PATCH] [MIRROR] Holding a tactical item (cardboard cutout, plants) now gives TRAIT_UNKNOWN, replaces your name with the name of the tactical item (#29350) * Holding a tactical item (cardboard cutout, plants) now gives TRAIT_UNKNOWN, replaces your name with the name of the tactical item (#85567) ## About The Pull Request I added TRAIT_UNKNOWN to the code for picking up and dropping potted plants. Picking them up will make you totally anonymous (and suspicious). This is the same thing that infiltrator suit and heretic shadow cloak does. I also added in some code that changes your displayed name to the name of the item, and then I had to jiggle ID code a bit so it wouldn't display your worn ID; it'll now display the forced name of the tactical object. ## Why It's Good For The Game Becoming an absolute master of disguise by hiding with a potted plant is hilarious. Causing people to become immensely paranoid of anyone holding a potted plant is very on-brand. Dropping the potted plant to reveal you're in full infiltrator gear or heretic aura is also a funny double bluff. The total anonymity afforded by this is balanced out by the fact that you have to use both hands to hold the plant so you can't defend yourself at all if you're making use of it. ## Changelog :cl: Bisar add: The interns remembered to water the plants around the station; their foilage is so thick that it totally hides the identity of anyone holding them! /:cl: --------- Co-authored-by: Ubuntu * Holding a tactical item (cardboard cutout, plants) now gives TRAIT_UNKNOWN, replaces your name with the name of the tactical item --------- Co-authored-by: Joshua Kidder <49173900+Metekillot@users.noreply.github.com> Co-authored-by: Ubuntu --- .../signals/signals_mob/signals_mob_carbon.dm | 4 ++++ code/datums/components/tactical.dm | 24 +++++++++++++++++++ code/game/machinery/newscaster/newspaper.dm | 9 +++++++ .../objects/items/kirby_plants/kirbyplants.dm | 1 - .../equipment/gear/abductor_clothing.dm | 2 ++ .../mob/living/carbon/human/human_helpers.dm | 10 +++++++- 6 files changed, 48 insertions(+), 2 deletions(-) diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm index 051953bd7e5..2a936bbbbd9 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm @@ -133,6 +133,10 @@ #define VISIBLE_NAME_FACE 1 //Index for the name of the id #define VISIBLE_NAME_ID 2 + //Index for whether their name is being overriden instead of obsfuscated + #define VISIBLE_NAME_FORCED 3 +///from /mob/living/carbon/human/get_id_name; only returns if the mob has TRAIT_UNKNOWN and it's being overriden: (identity) +#define COMSIG_HUMAN_GET_FORCED_NAME "human_get_forced_name" // Mob transformation signals ///Called when a human turns into a monkey, from /mob/living/carbon/proc/finish_monkeyize() diff --git a/code/datums/components/tactical.dm b/code/datums/components/tactical.dm index 59df008b2b1..a6e8eb5854c 100644 --- a/code/datums/components/tactical.dm +++ b/code/datums/components/tactical.dm @@ -42,6 +42,9 @@ RegisterSignal(parent, COMSIG_ITEM_DROPPED, PROC_REF(unmodify)) RegisterSignal(parent, COMSIG_ATOM_UPDATED_ICON, PROC_REF(on_icon_update)) RegisterSignal(parent, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved)) + RegisterSignal(user, COMSIG_HUMAN_GET_VISIBLE_NAME, PROC_REF(on_name_inquiry)) + RegisterSignal(user, COMSIG_HUMAN_GET_FORCED_NAME, PROC_REF(on_name_inquiry)) + ADD_TRAIT(user, TRAIT_UNKNOWN, ref(src)) current_slot = slot @@ -62,6 +65,24 @@ image.plane = FLOAT_PLANE user.add_alt_appearance(/datum/atom_hud/alternate_appearance/basic/everyone, "sneaking_mission[REF(src)]", image) + +/datum/component/tactical/proc/on_name_inquiry(obj/item/source, list/identity) + SIGNAL_HANDLER + + var/tactical_disguise_power = INFINITY // it's a flawless plan: they'll never look behind this unassuming potted plant + if(identity[VISIBLE_NAME_FORCED]) + if(identity[VISIBLE_NAME_FORCED] >= tactical_disguise_power) // my disguise is too powerful for you, traveler! but seriously this is bad + stack_trace("A name forcing signal ([identity[VISIBLE_NAME_FACE]]) has a priority collision with [src].") + else + identity[VISIBLE_NAME_FORCED] = tactical_disguise_power + else + identity[VISIBLE_NAME_FORCED] = tactical_disguise_power + + var/obj/item/flawless_disguise = parent + identity[VISIBLE_NAME_FACE] = flawless_disguise.name + identity[VISIBLE_NAME_ID] = flawless_disguise.name // for Unknown (as 'potted plant') says + + /datum/component/tactical/proc/unmodify(obj/item/source, mob/user) SIGNAL_HANDLER if(!source) @@ -76,9 +97,12 @@ COMSIG_ITEM_DROPPED, COMSIG_MOVABLE_MOVED, COMSIG_ATOM_UPDATED_ICON, + COMSIG_HUMAN_GET_VISIBLE_NAME, + COMSIG_HUMAN_GET_FORCED_NAME, )) current_slot = null user.remove_alt_appearance("sneaking_mission[REF(src)]") + REMOVE_TRAIT(user, TRAIT_UNKNOWN, ref(src)) ///Checks if a mob is holding us, and if so we will modify our appearance to properly match w/ the mob. /datum/component/tactical/proc/tactical_update(obj/item/source) diff --git a/code/game/machinery/newscaster/newspaper.dm b/code/game/machinery/newscaster/newspaper.dm index 2bd8187b9f8..c381f2f5063 100644 --- a/code/game/machinery/newscaster/newspaper.dm +++ b/code/game/machinery/newscaster/newspaper.dm @@ -132,6 +132,15 @@ /// Called when someone tries to figure out what our identity is, but they can't see it because of the newspaper /obj/item/newspaper/proc/holder_checked_name(mob/living/carbon/human/source, list/identity) SIGNAL_HANDLER + + var/newspaper_obscurity_priority = 100 // how powerful obscuring your appearance with a newspaper is + if(identity[VISIBLE_NAME_FORCED]) + if(identity[VISIBLE_NAME_FORCED] > newspaper_obscurity_priority) // the other set forced name is forcier than breaking news + return + else if(identity[VISIBLE_NAME_FORCED] == newspaper_obscurity_priority) + stack_trace("A name-setting signal operation ([identity[VISIBLE_NAME_FACE]]) has a priority collision with [src].") + else + identity[VISIBLE_NAME_FORCED] = newspaper_obscurity_priority identity[VISIBLE_NAME_FACE] = "" identity[VISIBLE_NAME_ID] = "" diff --git a/code/game/objects/items/kirby_plants/kirbyplants.dm b/code/game/objects/items/kirby_plants/kirbyplants.dm index 75363eedaf4..3becb1ecb61 100644 --- a/code/game/objects/items/kirby_plants/kirbyplants.dm +++ b/code/game/objects/items/kirby_plants/kirbyplants.dm @@ -1,4 +1,3 @@ - /obj/item/kirbyplants name = "potted plant" //icon = 'icons/obj/fluff/flora/plants.dmi' // ORIGINAL diff --git a/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm b/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm index c54ce6937d8..e5951473df0 100644 --- a/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm +++ b/code/modules/antagonists/abductor/equipment/gear/abductor_clothing.dm @@ -103,6 +103,8 @@ /obj/item/clothing/suit/armor/abductor/vest/proc/return_disguise_name(mob/living/carbon/human/source, list/identity) SIGNAL_HANDLER + if(identity[VISIBLE_NAME_FORCED]) // name-forcing overrides disguise + return identity[VISIBLE_NAME_FACE] = disguise.name identity[VISIBLE_NAME_ID] = "" diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 8541f4f7424..e74b0dda690 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -58,10 +58,13 @@ //repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a separate proc as it'll be useful elsewhere /mob/living/carbon/human/get_visible_name(add_id_name = TRUE, force_real_name = FALSE) - var/list/identity = list(null, null) + var/list/identity = list(null, null, null) SEND_SIGNAL(src, COMSIG_HUMAN_GET_VISIBLE_NAME, identity) var/signal_face = LAZYACCESS(identity, VISIBLE_NAME_FACE) var/signal_id = LAZYACCESS(identity, VISIBLE_NAME_ID) + var/force_set = LAZYACCESS(identity, VISIBLE_NAME_FORCED) + if(force_set) // our name is overriden by something + return signal_face // no need to null-check, because force_set will always set a signal_face var/face_name = !isnull(signal_face) ? signal_face : get_face_name("") var/id_name = !isnull(signal_id) ? signal_id : get_id_name("") if (force_real_name) @@ -107,6 +110,11 @@ var/obj/item/card/id/id = wear_id if(HAS_TRAIT(src, TRAIT_UNKNOWN)) . = if_no_id //You get NOTHING, no id name, good day sir + var/list/identity = list(null, null, null) + SEND_SIGNAL(src, COMSIG_HUMAN_GET_FORCED_NAME, identity) + if(identity[VISIBLE_NAME_FORCED]) + . = identity[VISIBLE_NAME_FACE] // to return forced names when unknown, instead of ID + return if(istype(wallet)) id = wallet.front_id if(istype(id))