mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-17 19:07:26 +01:00
Job subsystem & Player Spawn Tweaks (#2403)
Converts the job controller into a subsystem, including absolute paths. Also cleans up some mob despawn code. changes: The job master is now a subsystem. Job init moved out of EMI. Custom loadout now properly overrides job equipment on spawn. Odin despawn timers are now deleted on arrival shuttle launch. Cryogenic storage despawn is now handled by the job controller. Backpack equipping has been fully moved to equip_backpack(). equip_backpack() will now equip departmental backpacks. Job backpack selection is now set via. vars instead of overriding a proc. Fixes #2180.
This commit is contained in:
@@ -919,7 +919,7 @@ var/list/admin_verbs_cciaa = list(
|
||||
set category = "Admin"
|
||||
if(holder)
|
||||
var/list/jobs = list()
|
||||
for (var/datum/job/J in job_master.occupations)
|
||||
for (var/datum/job/J in SSjobs.occupations)
|
||||
if (J.current_positions >= J.total_positions && J.total_positions != -1)
|
||||
jobs += J.title
|
||||
if (!jobs.len)
|
||||
@@ -927,7 +927,7 @@ var/list/admin_verbs_cciaa = list(
|
||||
return
|
||||
var/job = input("Please select job slot to free", "Free job slot") as null|anything in jobs
|
||||
if (job)
|
||||
job_master.FreeRole(job)
|
||||
SSjobs.FreeRole(job)
|
||||
message_admins("A job slot for [job] has been opened by [key_name_admin(usr)]")
|
||||
return
|
||||
|
||||
|
||||
+14
-21
@@ -407,9 +407,6 @@
|
||||
if(!M.ckey) //sanity
|
||||
usr << "This mob has no ckey"
|
||||
return
|
||||
if(!job_master)
|
||||
usr << "Job Master has not been setup!"
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
var/header = "<head><title>Job-Ban Panel: [M.name]</title></head>"
|
||||
@@ -428,7 +425,7 @@
|
||||
jobs += "<tr align='center' bgcolor='ccccff'><th colspan='[length(command_positions)]'><a href='?src=\ref[src];jobban3=commanddept;jobban4=\ref[M]'>Command Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in command_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
@@ -449,7 +446,7 @@
|
||||
jobs += "<tr bgcolor='ffddf0'><th colspan='[length(security_positions)]'><a href='?src=\ref[src];jobban3=securitydept;jobban4=\ref[M]'>Security Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in security_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
@@ -470,7 +467,7 @@
|
||||
jobs += "<tr bgcolor='fff5cc'><th colspan='[length(engineering_positions)]'><a href='?src=\ref[src];jobban3=engineeringdept;jobban4=\ref[M]'>Engineering Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in engineering_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
@@ -491,7 +488,7 @@
|
||||
jobs += "<tr bgcolor='ffeef0'><th colspan='[length(medical_positions)]'><a href='?src=\ref[src];jobban3=medicaldept;jobban4=\ref[M]'>Medical Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in medical_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
@@ -512,7 +509,7 @@
|
||||
jobs += "<tr bgcolor='e79fff'><th colspan='[length(science_positions)]'><a href='?src=\ref[src];jobban3=sciencedept;jobban4=\ref[M]'>Science Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in science_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
@@ -533,7 +530,7 @@
|
||||
jobs += "<tr bgcolor='dddddd'><th colspan='[length(civilian_positions)]'><a href='?src=\ref[src];jobban3=civiliandept;jobban4=\ref[M]'>Civilian Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in civilian_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
@@ -560,7 +557,7 @@
|
||||
jobs += "<tr bgcolor='ccffcc'><th colspan='[length(nonhuman_positions)+1]'><a href='?src=\ref[src];jobban3=nonhumandept;jobban4=\ref[M]'>Non-human Positions</a></th></tr><tr align='center'>"
|
||||
for(var/jobPos in nonhuman_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/job = job_master.GetJob(jobPos)
|
||||
var/datum/job/job = SSjobs.GetJob(jobPos)
|
||||
if(!job) continue
|
||||
|
||||
if(jobban_isbanned(M, job.title))
|
||||
@@ -637,54 +634,50 @@
|
||||
alert("You cannot perform this action. You must be of a higher administrative rank!")
|
||||
return
|
||||
|
||||
if(!job_master)
|
||||
usr << "Job Master has not been setup!"
|
||||
return
|
||||
|
||||
//get jobs for department if specified, otherwise just returnt he one job in a list.
|
||||
var/list/joblist = list()
|
||||
switch(href_list["jobban3"])
|
||||
if("commanddept")
|
||||
for(var/jobPos in command_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("securitydept")
|
||||
for(var/jobPos in security_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("engineeringdept")
|
||||
for(var/jobPos in engineering_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("medicaldept")
|
||||
for(var/jobPos in medical_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("sciencedept")
|
||||
for(var/jobPos in science_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("civiliandept")
|
||||
for(var/jobPos in civilian_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
if("nonhumandept")
|
||||
joblist += "pAI"
|
||||
for(var/jobPos in nonhuman_positions)
|
||||
if(!jobPos) continue
|
||||
var/datum/job/temp = job_master.GetJob(jobPos)
|
||||
var/datum/job/temp = SSjobs.GetJob(jobPos)
|
||||
if(!temp) continue
|
||||
joblist += temp.title
|
||||
else
|
||||
|
||||
@@ -430,13 +430,13 @@
|
||||
if (isnull(selected_job))
|
||||
return
|
||||
|
||||
var/datum/job/job = job_master.GetJob(selected_job)
|
||||
var/datum/job/job = SSjobs.GetJob(selected_job)
|
||||
if(!job)
|
||||
return
|
||||
|
||||
job.equip(M)
|
||||
job.apply_fingerprints(M)
|
||||
job_master.spawnId(M, selected_job)
|
||||
SSjobs.spawnId(M, selected_job)
|
||||
|
||||
if ("standard space gear")
|
||||
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
|
||||
|
||||
@@ -451,7 +451,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
antag_data.add_antagonist(new_character.mind)
|
||||
antag_data.place_mob(new_character)
|
||||
else
|
||||
job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)
|
||||
SSjobs.EquipRank(new_character, new_character.mind.assigned_role, 1)
|
||||
|
||||
//Announces the character on all the systems, based on the record.
|
||||
if(!issilicon(new_character))//If they are not a cyborg/AI.
|
||||
@@ -623,9 +623,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
|
||||
if (!holder)
|
||||
src << "Only administrators may use this command."
|
||||
return
|
||||
if(job_master)
|
||||
for(var/datum/job/job in job_master.occupations)
|
||||
src << "[job.title]: [job.total_positions]"
|
||||
|
||||
for(var/datum/job/job in SSjobs.occupations)
|
||||
src << "[job.title]: [job.total_positions]"
|
||||
feedback_add_details("admin_verb","LFS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
/client/proc/cmd_admin_explosion(atom/O as obj|mob|turf in range(world.view))
|
||||
|
||||
@@ -6,17 +6,15 @@
|
||||
usr << "This option is currently only usable during pregame. This may change at a later date."
|
||||
return
|
||||
|
||||
if(job_master)
|
||||
var/datum/job/job = job_master.GetJob("AI")
|
||||
if(!job)
|
||||
usr << "Unable to locate the AI job"
|
||||
return
|
||||
if(SSticker.triai)
|
||||
SSticker.triai = 0
|
||||
usr << "Only one AI will be spawned at round start."
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled off triple AIs at round start.</span>", 1)
|
||||
else
|
||||
SSticker.triai = 1
|
||||
usr << "There will be an AI Triumvirate at round start."
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled on triple AIs at round start.</span>", 1)
|
||||
return
|
||||
var/datum/job/job = SSjobs.GetJob("AI")
|
||||
if(!job)
|
||||
usr << "Unable to locate the AI job"
|
||||
return
|
||||
if(SSticker.triai)
|
||||
SSticker.triai = 0
|
||||
usr << "Only one AI will be spawned at round start."
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled off triple AIs at round start.</span>", 1)
|
||||
else
|
||||
SSticker.triai = 1
|
||||
usr << "There will be an AI Triumvirate at round start."
|
||||
message_admins("<span class='notice'>[key_name_admin(usr)] has toggled on triple AIs at round start.</span>", 1)
|
||||
|
||||
Reference in New Issue
Block a user