From 2f89b304d35a54848d7d83839e4a337910535a49 Mon Sep 17 00:00:00 2001 From: HMBGERDO <61080616+HMBGERDO@users.noreply.github.com> Date: Fri, 2 Jun 2023 19:00:05 +0200 Subject: [PATCH] garrote tweak (#21092) --- code/__DEFINES/status_effects.dm | 1 + code/datums/status_effects/debuffs.dm | 3 +++ code/game/objects/items/weapons/garrote.dm | 5 ++++- code/modules/mob/living/damage_procs.dm | 2 ++ code/modules/mob/living/living_status_procs.dm | 9 +++++++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm index 2f058039a47..fab0781ad7c 100644 --- a/code/__DEFINES/status_effects.dm +++ b/code/__DEFINES/status_effects.dm @@ -127,6 +127,7 @@ #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_NO_OXY_HEAL /datum/status_effect/transient/no_oxy_heal #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/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index ce30731ee02..840f8e40816 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -677,6 +677,9 @@ /datum/status_effect/transient/silence/absolute // this one will mute all emote sounds including gasps id = "abssilenced" +/datum/status_effect/transient/no_oxy_heal + id = "no_oxy_heal" + /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 1fd88f56902..d52ec0c5066 100644 --- a/code/game/objects/items/weapons/garrote.dm +++ b/code/game/objects/items/weapons/garrote.dm @@ -154,7 +154,10 @@ strangling.AbsoluteSilence(6 SECONDS) // Non-improvised effects - strangling.apply_damage(4, OXY, "head") + if(G.state == GRAB_KILL) + strangling.PreventOxyHeal(6 SECONDS) + strangling.AdjustLoseBreath(6 SECONDS) + strangling.apply_damage(4, OXY, "head") /obj/item/twohanded/garrote/suicide_act(mob/user) diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm index 1ff68e08ac3..fc18091e6e0 100644 --- a/code/modules/mob/living/damage_procs.dm +++ b/code/modules/mob/living/damage_procs.dm @@ -157,6 +157,8 @@ if(HAS_TRAIT(src, TRAIT_NOBREATH)) oxyloss = 0 return FALSE + if(amount < 0 && has_status_effect(STATUS_EFFECT_NO_OXY_HEAL)) + return FALSE var/old_oxyloss = oxyloss oxyloss = max(oxyloss + amount, 0) if(old_oxyloss == oxyloss) diff --git a/code/modules/mob/living/living_status_procs.dm b/code/modules/mob/living/living_status_procs.dm index 0133b128f4e..87d4f424998 100644 --- a/code/modules/mob/living/living_status_procs.dm +++ b/code/modules/mob/living/living_status_procs.dm @@ -425,6 +425,15 @@ STATUS EFFECTS /mob/living/proc/SetAbsoluteSilence(amount) SET_STATUS_EFFECT_STRENGTH(STATUS_EFFECT_ABSSILENCED, amount) +/mob/living/proc/PreventedOxyHeal() + RETURN_STATUS_EFFECT_STRENGTH(STATUS_EFFECT_NO_OXY_HEAL) + +/mob/living/proc/PreventOxyHeal(amount) + SetPreventOxyHeal(max(PreventedOxyHeal(), amount)) + +/mob/living/proc/SetPreventOxyHeal(amount) + SET_STATUS_EFFECT_STRENGTH(STATUS_EFFECT_NO_OXY_HEAL, amount) + /mob/living/proc/AdjustSilence(amount, bound_lower = 0, bound_upper = INFINITY) SetSilence(directional_bounded_sum(AmountSilenced(), amount, bound_lower, bound_upper))