From 6c8e83714732a24574433f22429a758928e01386 Mon Sep 17 00:00:00 2001 From: shellspeed1 <46614774+shellspeed1@users.noreply.github.com> Date: Fri, 27 Sep 2019 12:38:53 -0700 Subject: [PATCH] adds stasis effect --- code/datums/status_effects/debuffs.dm | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index e930c77c..a470f814 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -80,6 +80,44 @@ desc = "You've fallen asleep. Wait a bit and you should wake up. Unless you don't, considering how helpless you are." icon_state = "asleep" +//STASIS +/datum/status_effect/incapacitating/stasis + id = "stasis" + duration = -1 + tick_interval = 10 + alert_type = /obj/screen/alert/status_effect/stasis + var/last_dead_time + +/datum/status_effect/incapacitating/stasis/proc/update_time_of_death() + if(last_dead_time) + var/delta = world.time - last_dead_time + var/new_timeofdeath = owner.timeofdeath + delta + owner.timeofdeath = new_timeofdeath + owner.tod = station_time_timestamp(wtime=new_timeofdeath) + last_dead_time = null + if(owner.stat == DEAD) + last_dead_time = world.time + +/datum/status_effect/incapacitating/stasis/on_creation(mob/living/new_owner, set_duration, updating_canmove) + . = ..() + update_time_of_death() + +/datum/status_effect/incapacitating/stasis/tick() + update_time_of_death() + +/datum/status_effect/incapacitating/stasis/on_remove() + update_time_of_death() + return ..() + +/datum/status_effect/incapacitating/stasis/be_replaced() + update_time_of_death() + return ..() + +/obj/screen/alert/status_effect/stasis + name = "Stasis" + desc = "Your biological functions have halted. You could live forever this way, but it's pretty boring." + icon_state = "stasis" + //OTHER DEBUFFS /datum/status_effect/his_wrath //does minor damage over time unless holding His Grace id = "his_wrath"