From e491aa9c2e75c1a8742a8b7d5d466098e3597904 Mon Sep 17 00:00:00 2001 From: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> Date: Sat, 25 Feb 2023 08:12:56 +0100 Subject: [PATCH] Fiber Garrote now mutes all emotes when garroting target (#20393) * added check for STATUS_EFFECT_SILENCED when we want to emit emote sound. If /mob/living has this flag, emote wont emit sound. Less ways to spam sounds when you supposed to be silent * Revert "added check for STATUS_EFFECT_SILENCED when we want to emit emote sound. If /mob/living has this flag, emote wont emit sound. Less ways to spam sounds when you supposed to be silent" This reverts commit bc093ba01fb6324e38d8a31402ded1debd572e12. * new status effect absolute silence, applying when using fiber garrote to silence all emote sounds * comments update, status set function standartisation * Update code/datums/emote.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --------- Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/__DEFINES/status_effects.dm | 1 + code/datums/emote.dm | 4 ++++ code/datums/status_effects/debuffs.dm | 3 +++ code/game/objects/items/weapons/garrote.dm | 2 +- code/modules/mob/living/living_status_procs.dm | 9 +++++++++ 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index bf1947250a1..5267e29a608 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -124,6 +124,7 @@ #define STATUS_EFFECT_DROWSINESS /datum/status_effect/transient/drowsiness #define STATUS_EFFECT_DRUNKENNESS /datum/status_effect/transient/drunkenness #define STATUS_EFFECT_SILENCED /datum/status_effect/transient/silence +#define STATUS_EFFECT_ABSSILENCED /datum/status_effect/transient/silence/absolute #define STATUS_EFFECT_JITTER /datum/status_effect/transient/jittery #define STATUS_EFFECT_CULT_SLUR /datum/status_effect/transient/cult_slurring #define STATUS_EFFECT_STAMMER /datum/status_effect/transient/stammering diff --git a/code/datums/emote.dm b/code/datums/emote.dm index d2d443954e2..0ee5a322992 100644 --- a/code/datums/emote.dm +++ b/code/datums/emote.dm @@ -593,6 +593,10 @@ return FALSE if((emote_type & EMOTE_MOUTH) && !can_vocalize_emotes(user)) return FALSE + if(isliving(user)) + var/mob/living/liveuser = user + if(liveuser.has_status_effect(STATUS_EFFECT_ABSSILENCED)) + return FALSE return TRUE /datum/emote/proc/remove_ending_punctuation(msg) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index bfa26243a99..4304987d455 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -674,6 +674,9 @@ . = ..() REMOVE_TRAIT(owner, TRAIT_MUTE, id) +/datum/status_effect/transient/silence/absolute // this one will mute all emote sounds including gasps + id = "abssilenced" + /datum/status_effect/transient/jittery id = "jittering" diff --git a/code/game/objects/items/weapons/garrote.dm b/code/game/objects/items/weapons/garrote.dm index f176a6e4e41..8f214cb2925 100644 --- a/code/game/objects/items/weapons/garrote.dm +++ b/code/game/objects/items/weapons/garrote.dm @@ -153,7 +153,7 @@ return - strangling.Silence(6 SECONDS) // Non-improvised effects + strangling.AbsoluteSilence(6 SECONDS) // Non-improvised effects strangling.apply_damage(4, OXY, "head") diff --git a/code/modules/mob/living/living_status_procs.dm b/code/modules/mob/living/living_status_procs.dm index e1f04dfc1b8..0133b128f4e 100644 --- a/code/modules/mob/living/living_status_procs.dm +++ b/code/modules/mob/living/living_status_procs.dm @@ -416,6 +416,15 @@ STATUS EFFECTS /mob/living/proc/SetSilence(amount) SET_STATUS_EFFECT_STRENGTH(STATUS_EFFECT_SILENCED, amount) +/mob/living/proc/AmountAbsoluteSilenced() + RETURN_STATUS_EFFECT_STRENGTH(STATUS_EFFECT_ABSSILENCED) + +/mob/living/proc/AbsoluteSilence(amount) + SetAbsoluteSilence(max(amount, AmountAbsoluteSilenced())) + +/mob/living/proc/SetAbsoluteSilence(amount) + SET_STATUS_EFFECT_STRENGTH(STATUS_EFFECT_ABSSILENCED, amount) + /mob/living/proc/AdjustSilence(amount, bound_lower = 0, bound_upper = INFINITY) SetSilence(directional_bounded_sum(AmountSilenced(), amount, bound_lower, bound_upper))