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))