dnr prevention
This commit is contained in:
@@ -29,6 +29,8 @@ GLOBAL_LIST_EMPTY(preferences_datums)
|
||||
var/respawn_restrictions_active = FALSE
|
||||
/// time of death we consider for respawns
|
||||
var/respawn_time_of_death = -INFINITY
|
||||
/// did they DNR? used to prevent respawns.
|
||||
var/dnr_triggered = FALSE
|
||||
|
||||
// Intra-round persistence end
|
||||
|
||||
|
||||
@@ -428,12 +428,14 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
to_chat(usr, "<span class='warning'>You're already stuck out of your body!</span>")
|
||||
return FALSE
|
||||
|
||||
var/response = alert(src, "Are you sure you want to prevent (almost) all means of resuscitation? This cannot be undone. ","Are you sure you want to stay dead?","Yes","No")
|
||||
var/response = alert(src, "Are you sure you want to prevent (almost) all means of resuscitation? This cannot be undone. THIS WILL ALSO STOP YOU FROM RESPAWNING!!!","Are you sure you want to stay dead and never respawn?","Yes","No")
|
||||
|
||||
if(response != "Yes")
|
||||
return
|
||||
|
||||
can_reenter_corpse = FALSE
|
||||
to_chat(src, "You can no longer be brought back into your body.")
|
||||
client.prefs?.dnr_triggered = TRUE
|
||||
to_chat(src, "You can no longer be brought back into your body or respawn.")
|
||||
return TRUE
|
||||
|
||||
/mob/dead/observer/proc/notify_cloning(var/message, var/sound, var/atom/source, flashwindow = TRUE)
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
log_admin("[key_name(src)] gave [key_name(O)] a full respawn and sent them back to the lobby.")
|
||||
to_chat(O, "<span class='userdanger'>You have been given a full respawn.</span>")
|
||||
O.do_respawn(FALSE)
|
||||
O.client.prefs.dnr_triggered = FALSE
|
||||
else if(istype(M, /mob/dead/new_player))
|
||||
var/mob/dead/new_player/NP = M
|
||||
var/confirm = alert(src, "Remove [NP]'s respawn restrictions?", "Remove Restrictions", "Yes", "No")
|
||||
@@ -41,6 +42,7 @@
|
||||
message_admins("[key_name_admin(src)] removed [ckey]'s respawn restrictions.")
|
||||
log_admin("[key_name(src)] removed [ckey]'s respawn restrictions")
|
||||
NP.client.prefs.respawn_restrictions_active = FALSE
|
||||
NP.client.prefs.dnr_triggered = FALSE
|
||||
to_chat(NP, "<span class='boldnotie'>Your respawn restrictions have been removed.")
|
||||
else
|
||||
CRASH("Invalid mobtype")
|
||||
@@ -107,6 +109,10 @@
|
||||
to_chat(src, "<span class='warning'>Respawns are disabled in configuration.</span>")
|
||||
return
|
||||
|
||||
if(client.prefs.dnr_triggered)
|
||||
to_chat(src, "<span class='danger'>You cannot respawn as you have enabled DNR.</span>")
|
||||
return
|
||||
|
||||
var/timeleft = time_left_to_respawn()
|
||||
if(timeleft)
|
||||
to_chat(src, "<span class='warning'>It's been too short of a time since you died/observed! Please wait [round(timeleft / 600, 0.1)] more minutes.</span>")
|
||||
|
||||
Reference in New Issue
Block a user