From 61a2b76eee0fe7dcb070b210324ff9cf875f36f5 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 9 Nov 2022 03:08:02 +0100 Subject: [PATCH] [MIRROR] Zombies can now succumb [MDB IGNORE] (#17411) * Zombies can now succumb (#70883) fixes #70877 Mobs with NODEATH can now succumb if they choose. The only mobs with NODEATH are all zombies, memento mori and penthrite, of which zombies are the only one that can ever enter hardcrit. I think it's fair to let them die if they want. High-functioning zombies can't succumb by whispering, but pressing the succumb UI without whispering will succumb you :cl: tweak: Mobs with NODEATH can now succumb (this is literally only zombies) /:cl: * Zombies can now succumb Co-authored-by: Time-Green --- code/__DEFINES/traits.dm | 2 ++ code/_onclick/hud/alert.dm | 9 +++++++-- .../carbon/human/species_types/zombies.dm | 18 ++++++++++++++++++ code/modules/mob/living/init_signals.dm | 2 +- code/modules/mob/living/living.dm | 9 +++++++-- code/modules/mob/living/living_say.dm | 2 +- 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/code/__DEFINES/traits.dm b/code/__DEFINES/traits.dm index 17d1156122a..be7be0ce5b3 100644 --- a/code/__DEFINES/traits.dm +++ b/code/__DEFINES/traits.dm @@ -244,6 +244,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_NOSOFTCRIT "nosoftcrit" #define TRAIT_MINDSHIELD "mindshield" #define TRAIT_DISSECTED "dissected" +/// Lets the user succumb even if they got NODEATH +#define TRAIT_SUCCUMB_OVERRIDE "succumb_override" /// Can hear observers #define TRAIT_SIXTHSENSE "sixth_sense" #define TRAIT_FEARLESS "fearless" diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 5ab20c2f409..6d09d471109 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -413,8 +413,13 @@ or shoot a gun to move around via Newton's 3rd Law of Motion." if(!.) return var/mob/living/living_owner = owner - var/last_whisper = tgui_input_text(usr, "Do you have any last words?", "Goodnight, Sweet Prince") - if(isnull(last_whisper) || !CAN_SUCCUMB(living_owner)) + var/last_whisper + if(!HAS_TRAIT(living_owner, TRAIT_SUCCUMB_OVERRIDE)) + last_whisper = tgui_input_text(usr, "Do you have any last words?", "Goodnight, Sweet Prince") + if(isnull(last_whisper)) + if(!HAS_TRAIT(living_owner, TRAIT_SUCCUMB_OVERRIDE)) + return + if(!CAN_SUCCUMB(living_owner) && !HAS_TRAIT(living_owner, TRAIT_SUCCUMB_OVERRIDE)) return if(length(last_whisper)) living_owner.say("#[last_whisper]") diff --git a/code/modules/mob/living/carbon/human/species_types/zombies.dm b/code/modules/mob/living/carbon/human/species_types/zombies.dm index 54095f9a6e9..74c2eb3326f 100644 --- a/code/modules/mob/living/carbon/human/species_types/zombies.dm +++ b/code/modules/mob/living/carbon/human/species_types/zombies.dm @@ -16,6 +16,7 @@ TRAIT_NOBREATH, TRAIT_NOCLONELOSS, TRAIT_NODEATH, + TRAIT_SUCCUMB_OVERRIDE, TRAIT_NOHUNGER, TRAIT_NOMETABOLISM, TRAIT_RADIMMUNE, @@ -89,6 +90,23 @@ /// The cooldown before the zombie can start regenerating COOLDOWN_DECLARE(regen_cooldown) + inherent_traits = list( + TRAIT_EASILY_WOUNDED, + TRAIT_EASYDISMEMBER, + TRAIT_FAKEDEATH, + TRAIT_LIMBATTACHMENT, + TRAIT_NOBREATH, + TRAIT_NOCLONELOSS, + TRAIT_NODEATH, + TRAIT_NOHUNGER, + TRAIT_NOMETABOLISM, + TRAIT_RADIMMUNE, + TRAIT_RESISTCOLD, + TRAIT_RESISTHIGHPRESSURE, + TRAIT_RESISTLOWPRESSURE, + TRAIT_TOXIMMUNE, + ) + /datum/species/zombie/infectious/check_roundstart_eligible() return FALSE diff --git a/code/modules/mob/living/init_signals.dm b/code/modules/mob/living/init_signals.dm index fd7c347c20c..fb9f426c5a9 100644 --- a/code/modules/mob/living/init_signals.dm +++ b/code/modules/mob/living/init_signals.dm @@ -188,7 +188,7 @@ */ /mob/living/proc/update_succumb_action() SIGNAL_HANDLER - if (CAN_SUCCUMB(src)) + if (CAN_SUCCUMB(src) || HAS_TRAIT(src, TRAIT_SUCCUMB_OVERRIDE)) throw_alert(ALERT_SUCCUMB, /atom/movable/screen/alert/succumb) else clear_alert(ALERT_SUCCUMB) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e89e6b33558..860e97d03cf 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -460,8 +460,13 @@ /mob/living/verb/succumb(whispered as null) set hidden = TRUE if (!CAN_SUCCUMB(src)) - to_chat(src, text="You are unable to succumb to death! This life continues.", type=MESSAGE_TYPE_INFO) - return + if(HAS_TRAIT(src, TRAIT_SUCCUMB_OVERRIDE)) + if(whispered) + to_chat(src, text="You are unable to succumb to death! Unless you just press the UI button.", type=MESSAGE_TYPE_INFO) + return + else + to_chat(src, text="You are unable to succumb to death! This life continues.", type=MESSAGE_TYPE_INFO) + return log_message("Has [whispered ? "whispered his final words" : "succumbed to death"] with [round(health, 0.1)] points of health!", LOG_ATTACK) adjustOxyLoss(health - HEALTH_THRESHOLD_DEAD) updatehealth() diff --git a/code/modules/mob/living/living_say.dm b/code/modules/mob/living/living_say.dm index ac0ff07d6fa..103cd9fbdcf 100644 --- a/code/modules/mob/living/living_say.dm +++ b/code/modules/mob/living/living_say.dm @@ -487,7 +487,7 @@ GLOBAL_LIST_INIT(message_modes_stat_limits, list( /mob/living/say_mod(input, list/message_mods = list()) if(message_mods[WHISPER_MODE] == MODE_WHISPER) . = verb_whisper - else if(message_mods[WHISPER_MODE] == MODE_WHISPER_CRIT) + else if(message_mods[WHISPER_MODE] == MODE_WHISPER_CRIT && !HAS_TRAIT(src, TRAIT_SUCCUMB_OVERRIDE)) . = "[verb_whisper] in [p_their()] last breath" else if(message_mods[MODE_SING]) . = verb_sing