From b7c800727e6a993bb587970af653b986b363286e Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Tue, 31 Dec 2024 23:42:03 -0500 Subject: [PATCH] fixes some ipc mindflayer shenanigan (#27719) --- code/modules/surgery/organs/augments_internal.dm | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/code/modules/surgery/organs/augments_internal.dm b/code/modules/surgery/organs/augments_internal.dm index 90698ed3b91..b9084c82162 100644 --- a/code/modules/surgery/organs/augments_internal.dm +++ b/code/modules/surgery/organs/augments_internal.dm @@ -678,6 +678,10 @@ COOLDOWN_DECLARE(reviver_cooldown) /// How long till we can try to defib again COOLDOWN_DECLARE(defib_cooldown) + /// This check is an aditional minute delay applied to nuggeted IPCS, so they are not endlessly instantly reviving. + COOLDOWN_DECLARE(nugget_contingency) + /// The trigger when nuggeted is detected. Resets when revived. Prevents the cooldown from being applied again. + var/applied_nugget_cooldown = FALSE /obj/item/organ/internal/cyberimp/chest/reviver/hardened name = "Hardened reviver implant" @@ -699,12 +703,18 @@ COOLDOWN_START(src, reviver_cooldown, revive_cost) reviving = FALSE to_chat(owner, "Your reviver implant shuts down and starts recharging. It will be ready again in [DisplayTimeText(revive_cost)].") + applied_nugget_cooldown = FALSE else addtimer(CALLBACK(src, PROC_REF(heal)), 3 SECONDS) return - if(!COOLDOWN_FINISHED(src, reviver_cooldown) || owner.suiciding) // don't heal while you're in cooldown! + if(!COOLDOWN_FINISHED(src, reviver_cooldown) || owner.suiciding || !COOLDOWN_FINISHED(src, nugget_contingency)) // don't heal while you're in cooldown! return if(owner.health <= 0 || owner.stat == DEAD) + if(ismachineperson(owner)) + if(!applied_nugget_cooldown && length(owner.bodyparts) <= 2) + COOLDOWN_START(src, nugget_contingency, 1 MINUTES) + applied_nugget_cooldown = TRUE + return revive_cost = 0 reviving = TRUE has_defibed = FALSE