Decreases notification timing for transcore, allows delaying

This commit is contained in:
Heroman
2021-06-15 17:00:31 +10:00
parent 61dfa77962
commit aead06bc44
3 changed files with 30 additions and 10 deletions
+8 -8
View File
@@ -15,7 +15,7 @@ SUBSYSTEM_DEF(transcore)
init_order = INIT_ORDER_TRANSCORE
// THINGS
var/overdue_time = 15 MINUTES
var/overdue_time = 5 MINUTES
var/current_step = SSTRANSCORE_IMPLANTS
@@ -113,8 +113,11 @@ SUBSYSTEM_DEF(transcore)
curr_MR.dead_state = MR_NORMAL
else
if(curr_MR.dead_state != MR_DEAD) //First time switching to dead
db.notify(curr_MR.mindname)
curr_MR.last_notification = world.time
if(curr_MR.do_notify)
db.notify(curr_MR.mindname)
curr_MR.last_notification = world.time
else
curr_MR.last_notification = world.time - 5 MINUTES
curr_MR.dead_state = MR_DEAD
if(MC_TICK_CHECK)
@@ -250,12 +253,9 @@ SUBSYSTEM_DEF(transcore)
return 1
// Send a past-due notification to the medical radio channel.
/datum/transcore_db/proc/notify(var/name, var/repeated = FALSE)
/datum/transcore_db/proc/notify(var/name)
ASSERT(name)
if(repeated)
global_announcer.autosay("This is a repeat notification that [name] is past-due for a mind backup.", "TransCore Oversight", "Medical")
else
global_announcer.autosay("[name] is past-due for a mind backup.", "TransCore Oversight", "Medical")
global_announcer.autosay("[name] is past-due for a mind backup.", "TransCore Oversight", "Medical")
// Called from mind_record to add itself to the transcore.
/datum/transcore_db/proc/add_backup(var/datum/transhuman/mind_record/MR)
+21 -2
View File
@@ -70,15 +70,34 @@
var/datum/transhuman/mind_record/record = db.backed_up[src.mind.name]
if(!(record.dead_state == MR_DEAD))
to_chat(src, "<span class='warning'>Your backup is not past-due yet.</span>")
else if((world.time - record.last_notification) < 10 MINUTES)
else if((world.time - record.last_notification) < 5 MINUTES)
to_chat(src, "<span class='warning'>Too little time has passed since your last notification.</span>")
else
db.notify(record.mindname, TRUE)
db.notify(record.mindname)
record.last_notification = world.time
to_chat(src, "<span class='notice'>New notification has been sent.</span>")
else
to_chat(src,"<span class='warning'>No backup record could be found, sorry.</span>")
/mob/observer/dead/verb/backup_delay()
set category = "Ghost"
set name = "Delay Transcore Notification"
set desc = "You can use this to avoid automatic backup notification happening. Manual notification can still be used."
if(!mind)
to_chat(src,"<span class='warning'>Your ghost is missing game values that allow this functionality, sorry.</span>")
return
var/datum/transcore_db/db = SStranscore.db_by_mind_name(mind.name)
if(db)
var/datum/transhuman/mind_record/record = db.backed_up[src.mind.name]
if(record.dead_state == MR_DEAD || !(record.do_notify))
to_chat(src, "<span class='warning'>The notification has already happened or been delayed.</span>")
else
record.do_notify = FALSE
to_chat(src, "<span class='notice'>Overdue mind backup notification delayed successfully.</span>")
else
to_chat(src,"<span class='warning'>No backup record could be found, sorry.</span>")
/mob/observer/dead/verb/findghostpod() //Moves the ghost instead of just changing the ghosts's eye -Nodrak
set category = "Ghost"
set name = "Find Ghost Pod"
@@ -15,6 +15,7 @@
var/dead_state = 0
var/last_update = 0
var/last_notification
var/do_notify = TRUE
//Backend
var/ckey = ""