Files
Leshana 4f138abfcc Converts Resleeving Transcore to be a subsystem
* Since the transcore has a ticker process, it really should be a subsystem.  Converted it over.  However, because its ticker is so fast, I did not bother implementing MC_TICK_CHECK into it.  Therefore it has the SS_NO_TICK_CHECK flag.
* Because its a subsystem, the global variable is now SStranscore instead of transcore.
* Because subsystems are so easy to debug, I removed the "TC" debugging variable from the machines that used it.
* Organized a few files.  The transcore subsystem is in the subsystems folder.  Defines had to be moved to defines folder so they are included first.
2017-06-11 18:32:40 -04:00

69 lines
2.6 KiB
Plaintext

var/global/list/prevent_respawns = list()
/hook/death/proc/quit_notify(mob/dead)
if(ishuman(dead))
to_chat(dead,"<span class='notice'>You're dead! If you don't intend to continue playing this round as this character, please use the <b>Quit This Round</b> verb in the OOC tab to free your job slot.</span>")
return TRUE
/mob/observer/dead/verb/cleanup()
set name = "Quit This Round"
set category = "OOC"
set desc = "Free your job slot, remove yourself from the manifest, and prevent respawning as this character for this round."
var/confirm = alert("This will free up your job slot, remove you from the manifest, and prevent you from respawning with this character for the round. You can rejoin as another \
character if you like. Do this now?","Quit This Round","Quit Round","Cancel")
if(confirm != "Quit Round")
return
//Why are you clicking this button?
if(!mind || !mind.assigned_role)
to_chat(src,"<span class='warning'>Either you haven't played this round, or you already used this verb.</span>")
return
//Add them to the nope list
prevent_respawns += mind.name
//Update any existing objectives involving this mob.
for(var/datum/objective/O in all_objectives)
if(O.target == src.mind)
if(O.owner && O.owner.current)
to_chat(O.owner.current,"<span class='warning'>You get the feeling your target is no longer within your reach...</span>")
qdel(O)
//Resleeving cleanup
if(src.mind.name in SStranscore.backed_up)
var/datum/transhuman/mind_record/MR = SStranscore.backed_up[src.mind.name]
SStranscore.stop_backup(MR)
if(src.mind.name in SStranscore.body_scans) //This uses mind names to avoid people cryo'ing a printed body to delete body scans.
var/datum/transhuman/body_record/BR = SStranscore.body_scans[src.mind.name]
SStranscore.remove_body(BR)
//Job slot cleanup
var/job = src.mind.assigned_role
job_master.FreeRole(job)
//Their objectives cleanup
if(src.mind.objectives.len)
qdel(src.mind.objectives)
src.mind.special_role = null
//Cut the PDA manifest (ugh)
if(PDA_Manifest.len)
PDA_Manifest.Cut()
for(var/datum/data/record/R in data_core.medical)
if((R.fields["name"] == src.real_name))
qdel(R)
for(var/datum/data/record/T in data_core.security)
if((T.fields["name"] == src.real_name))
qdel(T)
for(var/datum/data/record/G in data_core.general)
if((G.fields["name"] == src.real_name))
qdel(G)
//This removes them from being 'active' list on join screen
src.mind.assigned_role = null
//Feedback
to_chat(src,"<span class='notice'>Your job has been free'd up, and you can rejoin as another character or quit. Thanks for using this verb, it helps the server!</span>")