From 787427eeb204ff456e074052820dee56c6307479 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 13 Sep 2023 16:47:44 -0700 Subject: [PATCH] cloaked mobs don't give off visible messages --- code/__DEFINES/traits.dm | 3 +++ code/game/machinery/ARES/ARES_step_triggers.dm | 4 ++-- code/game/objects/items/storage/backpack.dm | 2 ++ code/modules/cm_preds/yaut_bracers.dm | 4 +++- .../modules/mob/living/carbon/xenomorph/castes/Lurker.dm | 6 ++++-- code/modules/mob/mob.dm | 9 ++++++++- 6 files changed, 22 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 793e7b6b2f35..a6248c260313 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -179,6 +179,8 @@ #define TRAIT_HARDCORE "t_hardcore" /// If the mob is able to use the vulture rifle or spotting scope #define TRAIT_VULTURE_USER "t_vulture_user" +/// If the mob is cloaked in any form +#define TRAIT_CLOAKED "t_cloaked" // -- ability traits -- /// Xenos with this trait cannot have plasma transfered to them @@ -278,6 +280,7 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_LISPING" = TRAIT_LISPING, "TRAIT_CANNOT_EAT" = TRAIT_CANNOT_EAT, "TRAIT_VULTURE_USER" = TRAIT_VULTURE_USER, + "TRAIT_CLOAKED" = TRAIT_CLOAKED, ), /mob/living/carbon/xenomorph = list( "TRAIT_ABILITY_NO_PLASMA_TRANSFER" = TRAIT_ABILITY_NO_PLASMA_TRANSFER, diff --git a/code/game/machinery/ARES/ARES_step_triggers.dm b/code/game/machinery/ARES/ARES_step_triggers.dm index 335a877f9f25..51480371be51 100644 --- a/code/game/machinery/ARES/ARES_step_triggers.dm +++ b/code/game/machinery/ARES/ARES_step_triggers.dm @@ -25,7 +25,7 @@ return FALSE if(!(ishuman(passer) || isxeno(passer))) return FALSE - if(passer.alpha <= 100)//Can't be seen/detected to trigger alert. + if(HAS_TRAIT(passer, TRAIT_CLOAKED)) return FALSE if(pass_jobs) if(passer.job in pass_jobs) @@ -117,7 +117,7 @@ return FALSE if(!passer) return FALSE - if(passer.alpha <= 100)//Can't be seen/detected to trigger alert. + if(HAS_TRAIT(passer, TRAIT_CLOAKED))//Can't be seen/detected to trigger alert. return FALSE var/area/pass_area = get_area(get_step(passer, passer.dir)) if(istype(pass_area, /area/almayer/command/airoom))//Don't want it to freak out over someone /entering/ the area. Only leaving. diff --git a/code/game/objects/items/storage/backpack.dm b/code/game/objects/items/storage/backpack.dm index e0b3a4bde9dc..4544f7d9e8f3 100644 --- a/code/game/objects/items/storage/backpack.dm +++ b/code/game/objects/items/storage/backpack.dm @@ -741,6 +741,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r RegisterSignal(H, COMSIG_HUMAN_EXTINGUISH, PROC_REF(wrapper_fizzle_camouflage)) camo_active = TRUE + ADD_TRAIT(H, TRAIT_CLOAKED, "scout_cloak") H.visible_message(SPAN_DANGER("[H] vanishes into thin air!"), SPAN_NOTICE("You activate your cloak's camouflage."), max_distance = 4) playsound(H.loc, 'sound/effects/cloak_scout_on.ogg', 15, TRUE) H.unset_interaction() @@ -779,6 +780,7 @@ GLOBAL_LIST_EMPTY_TYPED(radio_packs, /obj/item/storage/backpack/marine/satchel/r cloak_cooldown = world.time + 10 SECONDS camo_active = FALSE + REMOVE_TRAIT(H, TRAIT_CLOAKED, "scout_cloak") H.visible_message(SPAN_DANGER("[H] shimmers into existence!"), SPAN_WARNING("Your cloak's camouflage has deactivated!"), max_distance = 4) playsound(H.loc, 'sound/effects/cloak_scout_off.ogg', 15, TRUE) diff --git a/code/modules/cm_preds/yaut_bracers.dm b/code/modules/cm_preds/yaut_bracers.dm index c9976c7fea89..7429283742df 100644 --- a/code/modules/cm_preds/yaut_bracers.dm +++ b/code/modules/cm_preds/yaut_bracers.dm @@ -571,6 +571,7 @@ return FALSE cloaked = TRUE + ADD_TRAIT(M, TRAIT_CLOAKED, "pred_cloak") RegisterSignal(M, COMSIG_HUMAN_EXTINGUISH, PROC_REF(wrapper_fizzle_camouflage)) RegisterSignal(M, COMSIG_HUMAN_PRE_BULLET_ACT, PROC_REF(bullet_hit)) @@ -617,7 +618,8 @@ cloak_malfunction = world.time + decloak_timer cloaked = FALSE - log_game("[key_name_admin(usr)] has disabled their cloaking device.") + REMOVE_TRAIT(user, TRAIT_CLOAKED, "pred_cloak") + log_game("[key_name_admin(user)] has disabled their cloaking device.") user.visible_message(SPAN_WARNING("[user] shimmers into existence!"), SPAN_WARNING("Your cloaking device deactivates.")) playsound(user.loc, 'sound/effects/pred_cloakoff.ogg', 15, 1) user.alpha = initial(user.alpha) diff --git a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm index 8dda6755cca8..59a0145030bb 100644 --- a/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm +++ b/code/modules/mob/living/carbon/xenomorph/castes/Lurker.dm @@ -120,6 +120,7 @@ if (LPA && istype(LPA)) LPA.knockdown = TRUE // pounce knocks down LPA.freeze_self = TRUE + ADD_TRAIT(bound_xeno, TRAIT_CLOAKED, "lurker_cloak") bound_xeno.stealth = TRUE can_go_invisible = FALSE invis_start_time = world.time @@ -130,6 +131,7 @@ LPA.knockdown = FALSE // pounce no longer knocks down LPA.freeze_self = FALSE bound_xeno.stealth = FALSE + REMOVE_TRAIT(bound_xeno, TRAIT_CLOAKED, "lurker_cloak") // SLIGHTLY hacky because we need to maintain lots of other state on the lurker // whenever invisibility is on/off CD and when it's active. @@ -166,8 +168,8 @@ return var/mob/living/carbon/human/bumped_into = movable_atom - if(bumped_into.alpha < 100) //ignore invisible scouts and preds + if(HAS_TRAIT(bumped_into, TRAIT_CLOAKED)) //ignore invisible scouts and preds return - + to_chat(bound_xeno, SPAN_XENOHIGHDANGER("You bumped into someone and lost your invisibility!")) lurker_invisibility_action.invisibility_off() diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 4dfa0644aa21..10643dbce7b6 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -148,10 +148,15 @@ if(max_distance) view_dist = max_distance for(var/mob/M as anything in viewers(view_dist, src)) var/msg = message - if(self_message && M==src) + if(self_message && M == src) msg = self_message if(flags & CHAT_TYPE_TARGETS_ME) flags = CHAT_TYPE_BEING_HIT + + else if((M != src) && HAS_TRAIT(src, TRAIT_CLOAKED)) + debug_msg("cloaked hid message") + continue + M.show_message( msg, SHOW_MESSAGE_VISIBLE, blind_message, SHOW_MESSAGE_AUDIBLE, flags) CHECK_TICK @@ -186,6 +191,8 @@ var/view_dist = 7 if(max_distance) view_dist = max_distance for(var/mob/M as anything in viewers(view_dist, src)) + if(HAS_TRAIT(src, TRAIT_CLOAKED)) + continue M.show_message(message, SHOW_MESSAGE_VISIBLE, blind_message, SHOW_MESSAGE_AUDIBLE, message_flags) // Show a message to all mobs in earshot of this atom