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:
Lohikar
2017-05-23 12:10:30 +03:00
committed by skull132
parent f0766fa72d
commit 4d6d382967
30 changed files with 1080 additions and 1128 deletions
@@ -19,7 +19,7 @@ var/global/list/empty_playable_ai_cores = list()
//Handle job slot/tater cleanup.
var/job = mind.assigned_role
job_master.FreeRole(job)
SSjobs.FreeRole(job)
if(mind.objectives.len)
qdel(mind.objectives)
+5 -5
View File
@@ -302,7 +302,7 @@
vote_on_poll(pollid, optionid, 1)
proc/IsJobAvailable(rank)
var/datum/job/job = job_master.GetJob(rank)
var/datum/job/job = SSjobs.GetJob(rank)
if(!job) return 0
if(!job.is_position_available()) return 0
if(jobban_isbanned(src,rank)) return 0
@@ -329,11 +329,11 @@
spawning = 1
close_spawn_windows()
job_master.AssignRole(src, rank, 1)
SSjobs.AssignRole(src, rank, 1)
var/mob/living/character = create_character() //creates the human and transfers vars and mind
character = job_master.EquipPersonal(character, rank, 1,spawning_at) //equips the human
character = SSjobs.EquipPersonal(character, rank, 1,spawning_at) //equips the human
UpdateFactionList(character)
@@ -358,7 +358,7 @@
return
//Find our spawning point.
var/join_message = job_master.LateSpawn(character, rank)
var/join_message = SSjobs.LateSpawn(character, rank)
character.lastarea = get_area(loc)
// Moving wheelchair if they have one
@@ -404,7 +404,7 @@
dat += "<font color='red'>The station is currently undergoing crew transfer procedures.</font><br>"
dat += "Choose from the following open/valid positions:<br>"
for(var/datum/job/job in job_master.occupations)
for(var/datum/job/job in SSjobs.occupations)
if(job && IsJobAvailable(job.title))
var/active = 0
// Only players with the job assigned and AFK for less than 10 minutes count as active