diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index a26c0248b81..a7209d9f643 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -297,25 +297,26 @@ to_chat(src, "You are unable to succumb to death! This life continues!") return - var/last_words = tgui_input_text(src, "Do you have any last words?", "Goodnight, Sweet Prince", encode = FALSE) + last_words = null // In case we kept some from last time + var/final_words = tgui_input_text(src, "Do you have any last words?", "Goodnight, Sweet Prince", encode = FALSE) - if(isnull(last_words) && cancel_on_no_words) + if(isnull(final_words) && cancel_on_no_words) to_chat(src, "You decide you aren't quite ready to die.") return if(stat == DEAD) - // cancel em out if they died while they had the message box up - last_words = null + return + if(health >= HEALTH_THRESHOLD_CRIT) to_chat(src, "You are unable to succumb to death! This life continues!") - last_words = null return - if(!isnull(last_words)) - create_log(MISC_LOG, "gave their final words, [last_words]") - src.last_words = last_words // sorry - whisper(last_words) - add_attack_logs(src, src, "[src] has [!isnull(last_words) ? "whispered [p_their()] final words" : "succumbed to death"] with [round(health, 0.1)] points of health!") + if(!isnull(final_words)) + create_log(MISC_LOG, "gave their final words, [last_words]") + last_words = final_words + whisper(final_words) + + add_attack_logs(src, src, "[src] has [!isnull(final_words) ? "whispered [p_their()] final words" : "succumbed to death"] with [round(health, 0.1)] points of health!") create_log(MISC_LOG, "has succumbed to death with [round(health, 0.1)] points of health") adjustOxyLoss(max(health - HEALTH_THRESHOLD_DEAD, 0)) @@ -325,7 +326,8 @@ if(health < HEALTH_THRESHOLD_DEAD) break take_overall_damage(max(5, health - HEALTH_THRESHOLD_DEAD), 0) - if(!isnull(last_words)) + + if(!isnull(final_words)) addtimer(CALLBACK(src, PROC_REF(death)), 1 SECONDS) else death() @@ -335,7 +337,6 @@ /mob/living/proc/InCritical() return (health < HEALTH_THRESHOLD_CRIT && health > HEALTH_THRESHOLD_DEAD && stat == UNCONSCIOUS) - /mob/living/ex_act(severity) ..() flash_eyes()