mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-20 19:44:09 +01:00
Adds an action button for succumbing, broadcasts last words (#24501)
* succumb * Apply suggestions from code review Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> * capitalize * clear the alert, and no more last words when you're already dead! * Update code/modules/mob/living/death.dm --------- Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
This commit is contained in:
@@ -662,6 +662,11 @@
|
||||
healthdoll.overlays -= (cached_overlays - new_overlays)
|
||||
healthdoll.cached_healthdoll_overlays = new_overlays
|
||||
|
||||
if(health <= HEALTH_THRESHOLD_CRIT)
|
||||
throw_alert("succumb", /atom/movable/screen/alert/succumb)
|
||||
else
|
||||
clear_alert("succumb")
|
||||
|
||||
#undef BODYPART_PAIN_REDUCTION
|
||||
|
||||
/mob/living/carbon/human/proc/handle_nutrition_alerts() //This is a terrible abuse of the alert system; something like this should be a HUD element
|
||||
|
||||
@@ -87,10 +87,14 @@
|
||||
var/mob/M = P
|
||||
if((M.client?.prefs.toggles2 & PREFTOGGLE_2_DEATHMESSAGE) && (isobserver(M) || M.stat == DEAD))
|
||||
to_chat(M, "<span class='deadsay'><b>[mind.name]</b> has died at <b>[area_name]</b>. (<a href='?src=[M.UID()];jump=\ref[T]'>JMP</a>)</span>")
|
||||
if(last_words)
|
||||
to_chat(M, "<span class='deadsay'><b>[p_their(TRUE)] last words were:</b> \"[last_words]\"</span>")
|
||||
|
||||
if(SSticker && SSticker.mode)
|
||||
SSticker.mode.check_win()
|
||||
|
||||
clear_alert("succumb")
|
||||
|
||||
// u no we dead
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -291,18 +291,30 @@
|
||||
|
||||
/mob/living/verb/succumb()
|
||||
set hidden = TRUE
|
||||
// if you use the verb you better mean it
|
||||
do_succumb(FALSE)
|
||||
|
||||
/mob/living/proc/do_succumb(cancel_on_no_words)
|
||||
if(stat == DEAD)
|
||||
to_chat(src, "<span class='notice'>It's too late, you're already dead!</span>")
|
||||
return
|
||||
if(health >= HEALTH_THRESHOLD_CRIT)
|
||||
to_chat(src, "<span class='warning'>You are unable to succumb to death! This life continues!</span>")
|
||||
return
|
||||
|
||||
var/last_words = tgui_input_text(src, "Do you have any last words?", "Goodnight, Sweet Prince", encode = FALSE)
|
||||
|
||||
if(isnull(last_words) && cancel_on_no_words)
|
||||
to_chat(src, "<span class='notice'>You decide you aren't quite ready to die.</span>")
|
||||
return
|
||||
|
||||
if(stat == DEAD)
|
||||
// cancel em out if they died while they had the message box up
|
||||
last_words = null
|
||||
|
||||
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!")
|
||||
|
||||
@@ -97,6 +97,9 @@
|
||||
|
||||
var/datum/middleClickOverride/middleClickOverride = null
|
||||
|
||||
/// Famous last words -- if succumbing, what the user's last words were
|
||||
var/last_words
|
||||
|
||||
/*
|
||||
Taste Vars
|
||||
*/
|
||||
|
||||
@@ -176,3 +176,7 @@
|
||||
overlay_fullscreen("brute", /atom/movable/screen/fullscreen/brute, severity)
|
||||
else
|
||||
clear_fullscreen("brute")
|
||||
if(health <= HEALTH_THRESHOLD_CRIT)
|
||||
throw_alert("succumb", /atom/movable/screen/alert/succumb)
|
||||
else
|
||||
clear_alert("succumb")
|
||||
|
||||
Reference in New Issue
Block a user