From 2108d2a3dada44051b7c27d459f86179cb71f2e2 Mon Sep 17 00:00:00 2001 From: Qwertytoforty <52090703+Qwertytoforty@users.noreply.github.com> Date: Sat, 17 May 2025 09:59:36 -0400 Subject: [PATCH] modsuits now deactivate when dead / don't do a do_after (#29184) --- code/__HELPERS/mob_helpers.dm | 5 +++-- code/modules/mod/mod_activation.dm | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/code/__HELPERS/mob_helpers.dm b/code/__HELPERS/mob_helpers.dm index 5064c6ffaf9..521bb3d0ba8 100644 --- a/code/__HELPERS/mob_helpers.dm +++ b/code/__HELPERS/mob_helpers.dm @@ -393,8 +393,9 @@ * This will create progress bar that lasts for 5 seconds. If the user doesn't move or otherwise do something that would cause the checks to fail in those 5 seconds, do_stuff() would execute. * The Proc returns TRUE upon success (the progress bar reached the end), or FALSE upon failure (the user moved or some other check failed) * param {boolean} hidden - By default, any action 1 second or longer shows a cog over the user while it is in progress. If hidden is set to TRUE, the cog will not be shown. + * If allow_sleeping_or_dead is true, dead and sleeping mobs will continue. Good if you want to show a progress bar to the user but it doesn't need them to do anything, like modsuits. */ -/proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1, allow_moving = 0, must_be_held = 0, list/extra_checks = list(), use_default_checks = TRUE, allow_moving_target = FALSE, hidden = FALSE) +/proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1, allow_moving = 0, must_be_held = 0, list/extra_checks = list(), use_default_checks = TRUE, allow_moving_target = FALSE, hidden = FALSE, allow_sleeping_or_dead = FALSE) if(!user) return FALSE var/atom/Tloc = null @@ -443,7 +444,7 @@ . = FALSE break - if(!user || user.stat || check_for_true_callbacks(extra_checks)) + if(!user || (user.stat && !allow_sleeping_or_dead) || check_for_true_callbacks(extra_checks)) . = FALSE break diff --git a/code/modules/mod/mod_activation.dm b/code/modules/mod/mod_activation.dm index ad1e2a9364f..5a6c859b50e 100644 --- a/code/modules/mod/mod_activation.dm +++ b/code/modules/mod/mod_activation.dm @@ -157,27 +157,27 @@ mod_link.end_call() activating = TRUE to_chat(wearer, "MODsuit [active ? "shutting down" : "starting up"].") - if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE)) + if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE, hidden = TRUE, allow_sleeping_or_dead = TRUE)) if(has_wearer()) to_chat(wearer, "[boots] [active ? "relax their grip on your legs" : "seal around your feet"].") playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) seal_part(boots, seal = !active) - if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE)) + if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE, hidden = TRUE, allow_sleeping_or_dead = TRUE)) if(has_wearer()) to_chat(wearer, "[gauntlets] [active ? "become loose around your fingers" : "tighten around your fingers and wrists"].") playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) seal_part(gauntlets, seal = !active) - if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE)) + if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE, hidden = TRUE, allow_sleeping_or_dead = TRUE)) if(has_wearer()) to_chat(wearer, "[chestplate] [active ? "releases your chest" : "cinches tightly against your chest"].") playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) seal_part(chestplate, seal = !active) - if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE)) + if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE, hidden = TRUE, allow_sleeping_or_dead = TRUE)) if(has_wearer()) to_chat(wearer, "[helmet] hisses [active ? "open" : "closed"].") playsound(src, 'sound/mecha/mechmove03.ogg', 25, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) seal_part(helmet, seal = !active) - if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE)) + if(do_after(wearer, activation_step_time, FALSE, target = src, allow_moving = TRUE, use_default_checks = FALSE, hidden = TRUE, allow_sleeping_or_dead = TRUE)) if(has_wearer()) to_chat(wearer, "Systems [active ? "shut down. Parts unsealed. Goodbye" : "started up. Parts sealed. Welcome"], [wearer].") finish_activation(on = !active)