mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-28 07:20:09 +01:00
Additional respawn refactoring.
Removes a non-utilized config setting. Adds a config setting to set the respawn timer, defaults to 30 minutes as today. Makes the MayRespawn() proc utilize this config setting. Makes more uses of MayRespawn() check the respawn delay.
This commit is contained in:
@@ -462,7 +462,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "<span class='warning'>Spawning as a mouse is currently disabled.</span>"
|
||||
return
|
||||
|
||||
if(!MayRespawn(1))
|
||||
if(!MayRespawn(1, round(config.respawn_delay / 6)))
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
@@ -470,13 +470,6 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
src << "<span class='warning'>You may not spawn as a mouse on this Z-level.</span>"
|
||||
return
|
||||
|
||||
var/timedifference = world.time - timeofdeath
|
||||
if(timeofdeath && timedifference <= mouse_respawn_time * 600)
|
||||
var/timedifference_text
|
||||
timedifference_text = time2text(mouse_respawn_time * 600 - timedifference,"mm:ss")
|
||||
src << "<span class='warning'>You may only spawn again as a mouse more than [mouse_respawn_time] minutes after your death. You have [timedifference_text] left.</span>"
|
||||
return
|
||||
|
||||
var/response = alert(src, "Are you -sure- you want to become a mouse?","Are you sure you want to squeek?","Squeek!","Nope!")
|
||||
if(response != "Squeek!") return //Hit the wrong key...again.
|
||||
|
||||
@@ -710,7 +703,7 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
if (ghostimage)
|
||||
client.images -= ghostimage //remove ourself
|
||||
|
||||
mob/dead/observer/MayRespawn(var/feedback = 0)
|
||||
mob/dead/observer/MayRespawn(var/feedback = 0, var/respawn_time = 0)
|
||||
if(!client)
|
||||
return 0
|
||||
if(mind && mind.current && mind.current.stat != DEAD && can_reenter_corpse)
|
||||
@@ -721,6 +714,13 @@ mob/dead/observer/MayRespawn(var/feedback = 0)
|
||||
if(feedback)
|
||||
src << "<span class='warning'>antagHUD restrictions prevent you from respawning.</span>"
|
||||
return 0
|
||||
|
||||
var/timedifference = world.time - timeofdeath
|
||||
if(respawn_time && timeofdeath && timedifference < respawn_time MINUTES)
|
||||
var/timedifference_text = time2text(respawn_time MINUTES - timedifference,"mm:ss")
|
||||
src << "<span class='warning'>You must have been dead for [respawn_time] minute\s to respawn. You have [timedifference_text] left.</span>"
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
/atom/proc/extra_ghost_link()
|
||||
|
||||
Reference in New Issue
Block a user