'Do Not Revive' verb for Ghosts (#15934)

* DNR

* Review things

Bound to be something I missed, but testing all seems to work fine.

* Aliven't
This commit is contained in:
SabreML
2021-05-02 15:42:56 +01:00
committed by GitHub
parent 1167e6441a
commit 6481a50506
6 changed files with 66 additions and 16 deletions
@@ -387,6 +387,30 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
to_chat(usr, "AntagHud Toggled OFF")
M.antagHUD = FALSE
/mob/dead/observer/verb/set_dnr()
set name = "Set DNR"
set category = "Ghost"
set desc = "Prevent your character from being revived."
if(!isobserver(src)) // Somehow
return
if(!can_reenter_corpse)
to_chat(src, "<span class='warning'>You are already set to DNR!</span>")
return
if(!mind || QDELETED(mind.current))
to_chat(src, "<span class='warning'>You have no body.</span>")
return
if(mind.current.stat != DEAD)
to_chat(src, "<span class='warning'>Your body is still alive!</span>")
return
var/choice = alert(src, "If you enable this, your body will be unrevivable for the remainder of the round.", "Are you sure?", "Yes", "No")
if(choice == "Yes")
to_chat(src, "<span class='boldnotice'>Do Not Revive state enabled.</span>")
can_reenter_corpse = FALSE
if(!QDELETED(mind.current)) // Could change while they're choosing
mind.current.med_hud_set_status()
/mob/dead/observer/proc/dead_tele()
set category = "Ghost"
set name = "Teleport"
+1 -1
View File
@@ -215,7 +215,7 @@
if(stat == DEAD)
if(M != src)
M.visible_message("<span class='notice'>[M] desperately shakes [src] trying to wake [p_them()] up, but sadly there is no reaction!</span>", \
"<span class='notice'>You shake [src] trying to wake [p_them()] sadly they appear to be too far gone!</span>")
"<span class='notice'>You shake [src] trying to wake [p_them()], sadly they appear to be too far gone!</span>")
return
if(health >= HEALTH_THRESHOLD_CRIT)
if(src == M && ishuman(src))
@@ -774,6 +774,11 @@
if(M.getBruteLoss() + M.getFireLoss() + M.getCloneLoss() >= 150)
M.delayed_gib()
return
var/mob/dead/observer/ghost = M.get_ghost(TRUE)
if(ghost && !ghost.can_reenter_corpse) // DNR or AntagHUD
M.visible_message("<span class='warning'>[M] twitches slightly, but is otherwise unresponsive!</span>")
return
if(!M.suiciding && !HAS_TRAIT(M, TRAIT_HUSK) && !HAS_TRAIT(M, TRAIT_BADDNA))
var/time_dead = world.time - M.timeofdeath
M.visible_message("<span class='warning'>[M] seems to rise from the dead!</span>")