diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm
index 21378012d24..2a26e147daf 100644
--- a/code/game/jobs/job/engineering.dm
+++ b/code/game/jobs/job/engineering.dm
@@ -84,5 +84,7 @@
H.equip_if_possible(new /obj/item/clothing/under/rank/roboticist(H), H.slot_w_uniform)
H.equip_if_possible(new /obj/item/clothing/shoes/black(H), H.slot_shoes)
H.equip_if_possible(new /obj/item/device/pda/engineering(H), H.slot_belt)
+ H.equip_if_possible(new /obj/item/clothing/suit/labcoat(H), H.slot_wear_suit)
H.equip_if_possible(new /obj/item/clothing/gloves/black(H), H.slot_gloves)
+ H.equip_if_possible(new /obj/item/weapon/storage/toolbox/mechanical(H), H.slot_l_hand)
return 1
\ No newline at end of file
diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm
index 1931a976797..e94dec88ebc 100644
--- a/code/game/jobs/job/job.dm
+++ b/code/game/jobs/job/job.dm
@@ -17,78 +17,3 @@
proc/equip(var/mob/living/carbon/human/H)
return 1
-
-
-var/datum/jobs/jobs = new/datum/jobs()
-
-/datum/jobs
- var/list/datum/job/all_jobs = list()
-
- proc/get_all_jobs()
- return all_jobs
-
- //This proc returns all the jobs which are NOT admin only
- proc/get_normal_jobs()
-// var/list/datum/job/normal_jobs = list()
-// for(var/datum/job/J in all_jobs)
-// if(!J.admin_only)
-// normal_jobs += J
-// return normal_jobs
-
- //This proc returns all the jobs which are admin only
- proc/get_admin_jobs()
-// var/list/datum/job/admin_jobs = list()
-// for(var/datum/job/J in all_jobs)
-// if(J.admin_only)
-// admin_jobs += J
-// return admin_jobs
-
- //This proc returns the job datum of the job with the alias or job title given as the argument. Returns an empty string otherwise.
- proc/get_job(var/alias)
-// for(var/datum/job/J in all_jobs)
-// if(J.is_job_alias(alias))
-// return J
- return ""
-
- //This proc returns a string with the default job title for the job with the given alias. Returns an empty string otherwise.
- proc/get_job_title(var/alias)
-// for(var/datum/job/J in all_jobs)
-// if(J.is_job_alias(alias))
-// return J.title
- return ""
-/*
- //This proc returns all the job datums of the workers whose boss has the alias provided. (IE Engineer under Chief Engineer, etc.)
- proc/get_jobs_under(var/boss_alias)
- var/boss_title = get_job_title(boss_alias)
- var/list/datum/job/employees = list()
- for(var/datum/job/J in all_jobs)
- if(boss_title in J.bosses)
- employees += J
- return employees*/
-
- //This proc returns the chosen vital and high priority jobs that the person selected. It goes from top to bottom of the list, until it finds a job which does not have such priority.
- //Example: Choosing (in this order): CE, Captain, Engineer, RD will only return CE and Captain, as RD is assumed as being an unwanted choice.
- //This proc is used in the allocation algorithm when deciding vital and high priority jobs.
-/* proc/get_prefered_high_priority_jobs()
- var/list/datum/job/hp_jobs = list()
- for(var/datum/job/J in all_jobs)
- if(J.assignment_priority == HIGH_PRIORITY_JOB || J.assignment_priority == VITAL_PRIORITY_JOB)
- hp_jobs += J
- else
- break
- return hp_jobs
-
- //If only priority is given, it will return the jobs of only that priority, if end_priority is set it will return the jobs with their priority higher or equal to var/priority and lower or equal to end_priority. end_priority must be higher than 0.
- proc/get_jobs_by_priority(var/priority, var/end_priority = 0)
- var/list/datum/job/priority_jobs = list()
- if(end_priority)
- if(end_priority < priority)
- return
- for(var/datum/job/J in all_jobs)
- if(J.assignment_priority >= priority && J.assignment_priority <= end_priority)
- priority_jobs += J
- else
- for(var/datum/job/J in all_jobs)
- if(J.assignment_priority == priority)
- priority_jobs += J
- return priority_jobs*/
\ No newline at end of file
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index 4ad071fdd3b..99ed0063864 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -6,6 +6,8 @@ var/global/datum/controller/occupations/job_master
list/occupations = list()
//Players who need jobs
list/unassigned = list()
+ //Debug info
+ list/job_debug = list()
proc/SetupOccupations(var/faction = "Station")
@@ -22,38 +24,53 @@ var/global/datum/controller/occupations/job_master
return 1
- proc/GetJob(var/name)
- if(!name) return null
+ proc/Debug(var/text)
+ if(!Debug2) return 0
+ job_debug.Add(text)
+// world << text
+ return 1
+
+
+ proc/GetJob(var/rank)
+ if(!rank) return null
for(var/datum/job/J in occupations)
if(!J) continue
- if(J.title == name) return J
+ if(J.title == rank) return J
return null
- proc/AssignRole(var/mob/new_player/player, var/job, var/latejoin = 0)
- if((player) && (player.mind) && (job))
- var/datum/job/J = GetJob(job)
- if(jobban_isbanned(player, job)) return 0
- if( J && ( (J.current_positions < J.total_positions) || ((J.current_positions < J.spawn_positions) && !latejoin)) )
- player.mind.assigned_role = J.title
+ proc/AssignRole(var/mob/new_player/player, var/rank, var/latejoin = 0)
+ Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
+ if((player) && (player.mind) && (rank))
+ var/datum/job/job = GetJob(rank)
+ if(!job) return 0
+ if(jobban_isbanned(player, rank)) return 0
+ var/position_limit = job.total_positions
+ if(!latejoin)
+ position_limit = job.spawn_positions
+ if(job.current_positions < position_limit)
+ Debug("Player: [player] is now Rank: [rank], JCP:[job.current_positions], JPL:[position_limit]")
+ player.mind.assigned_role = rank
unassigned -= player
- J.current_positions++
+ job.current_positions++
return 1
+ Debug("AR has failed, Player: [player], Rank: [rank]")
return 0
proc/FindOccupationCandidates(datum/job/job, level, flag)
+ Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
var/list/candidates = list()
for(var/mob/new_player/player in unassigned)
- if(jobban_isbanned(player, job.title)) continue
- if(flag && (!player.preferences.be_special & flag)) continue
- switch(level)
- if(1)
- if(job.flag == player.preferences.GetJobDepartment(job, level)) candidates += player
- if(2)
- if(job.flag == player.preferences.GetJobDepartment(job, level)) candidates += player
- if(3)
- if(job.flag == player.preferences.GetJobDepartment(job, level)) candidates += player
+ if(jobban_isbanned(player, job.title))
+ Debug("FOC isbanned failed, Player: [player]")
+ continue
+ if(flag && (!player.preferences.be_special & flag))
+ Debug("FOC flag failed, Player: [player], Flag: [flag], ")
+ continue
+ if(player.preferences.GetJobDepartment(job, level) & job.flag)
+ Debug("FOC pass, Player: [player], Level:[level]")
+ candidates += player
return candidates
@@ -115,6 +132,7 @@ var/global/datum/controller/occupations/job_master
**/
proc/DivideOccupations()
//Setup new player list and get the jobs list
+ Debug("Running DO")
SetupOccupations()
//Get the players who are ready
@@ -122,41 +140,57 @@ var/global/datum/controller/occupations/job_master
if((player) && (player.client) && (player.ready) && (player.mind) && (!player.mind.assigned_role))
unassigned += player
+ Debug("DO, Len: [unassigned.len]")
if(unassigned.len == 0) return 0
//Shuffle players and jobs
unassigned = shuffle(unassigned)
// occupations = shuffle(occupations) check and see if we can do this one
- //Select one head
- FillHeadPosition()
-
- //Check for an AI
- FillAIPosition()
-
//Assistants are checked first
+ Debug("DO, Running Assistant Check 1")
var/datum/job/assist = new /datum/job/assistant()
var/list/assistant_candidates = FindOccupationCandidates(assist, 3)
+ Debug("AC1, Candidates: [assistant_candidates.len]")
for(var/mob/new_player/player in assistant_candidates)
+ Debug("AC1 pass, Player: [player]")
AssignRole(player, "Assistant")
+ assistant_candidates -= player
+ Debug("DO, AC1 end")
+
+ //Select one head
+ Debug("DO, Running Head Check")
+ FillHeadPosition()
+ Debug("DO, Head Check end")
+
+ //Check for an AI
+ Debug("DO, Running AI Check")
+ FillAIPosition()
+ Debug("DO, AI Check end")
//Other jobs are now checked
+ Debug("DO, Running Standard Check")
for(var/level = 1 to 3)
for(var/datum/job/job in occupations)
+ Debug("Checking job: [job]")
if(!job) continue
if(!unassigned.len) break
if(job.current_positions >= job.spawn_positions) continue
var/list/candidates = FindOccupationCandidates(job, level)
while(candidates.len && (job.current_positions < job.spawn_positions))
var/mob/new_player/candidate = pick(candidates)
- if(!AssignRole(candidate, job.title))
- candidates -= candidate
+ Debug("Selcted: [candidate], for: [job.title]")
+ AssignRole(candidate, job.title)
+ candidates -= candidate
+ Debug("DO, Standard Check end")
+ Debug("DO, Running AC2")
for(var/mob/new_player/player in unassigned)
+ Debug("AC2 Assistant located, Player: [player]")
AssignRole(player, "Assistant")
return 1
- proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late)
+ proc/EquipRank(var/mob/living/carbon/human/H, var/rank, var/joined_late = 0)
if(!H) return 0
var/datum/job/job = GetJob(rank)
if(job)
diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index d1f4c52b1ef..ef05c7ffd34 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -264,7 +264,7 @@ var/global/list/autolathe_recipes_hidden = list( \
new /obj/item/device/radio/electropack(), \
new /obj/item/weapon/weldingtool/largetank(), \
new /obj/item/weapon/handcuffs(), \
- new /obj/item/ammo_magazine(), \
+ new /obj/item/ammo_magazine/a357(), \
new /obj/item/ammo_casing/shotgun(), \
new /obj/item/ammo_casing/shotgun/dart(), \
/* new /obj/item/weapon/shield/riot(), */ \
diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm
index d1a78b37389..4d8d31c860a 100644
--- a/code/game/machinery/computer/computer.dm
+++ b/code/game/machinery/computer/computer.dm
@@ -244,7 +244,7 @@ Pod/Blast Doors computer
carddesc += ""
carddesc += "Assignment: "
- jobs = "[target_rank]" //CHECK THIS
+ var/jobs = "[target_rank]" //CHECK THIS
var/accesses = ""
if(istype(src,/obj/machinery/computer/card/centcom))
diff --git a/code/game/objects/closets/secure/security.dm b/code/game/objects/closets/secure/security.dm
index f3a8035aabe..1889d36c367 100644
--- a/code/game/objects/closets/secure/security.dm
+++ b/code/game/objects/closets/secure/security.dm
@@ -6,16 +6,16 @@
New()
..()
sleep(2)
- new /obj/item/clothing/suit/captunic( src )
- new /obj/item/clothing/head/helmet/cap( src )
- new /obj/item/clothing/under/rank/captain( src )
- new /obj/item/clothing/suit/armor/vest( src )
- new /obj/item/clothing/gloves/captain( src )
- new /obj/item/clothing/head/helmet/swat( src )
- new /obj/item/clothing/shoes/brown( src )
- new /obj/item/device/radio/headset/heads/captain( src )
+ new /obj/item/clothing/suit/captunic(src)
+ new /obj/item/clothing/head/helmet/cap(src)
+ new /obj/item/clothing/under/rank/captain(src)
+ new /obj/item/clothing/suit/armor/vest(src)
+ new /obj/item/clothing/gloves/captain(src)
+ new /obj/item/clothing/head/helmet/swat(src)
+ new /obj/item/clothing/shoes/brown(src)
+ new /obj/item/device/radio/headset/heads/captain(src)
new /obj/item/weapon/reagent_containers/food/drinks/flask(src)
- new /obj/item/weapon/gun/energy/gun( src )
+ new /obj/item/weapon/gun/energy/gun(src)
return
@@ -55,12 +55,13 @@
new /obj/item/clothing/head/helmet(src)
new /obj/item/device/radio/headset/heads/hos(src)
new /obj/item/weapon/shield/riot(src)
+ new /obj/item/weapon/storage/lockbox/loyalty(src)
+ new /obj/item/weapon/storage/flashbang_kit(src)
+ new /obj/item/weapon/storage/belt/security(src)
+ new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/gun/energy/gun(src)
new /obj/item/device/flash(src)
new /obj/item/clothing/glasses/sunglasses/sechud(src)
- new /obj/item/weapon/storage/flashbang_kit(src)
- new /obj/item/weapon/storage/lockbox/loyalty()
- new /obj/item/weapon/melee/baton(src)
return
@@ -77,8 +78,8 @@
new /obj/item/clothing/suit/armor/vest(src)
new /obj/item/clothing/head/helmet/warden(src)
new /obj/item/device/radio/headset/headset_sec(src)
- new /obj/item/weapon/storage/belt/security(src)
new /obj/item/weapon/storage/flashbang_kit(src)
+ new /obj/item/weapon/storage/belt/security(src)
new /obj/item/weapon/melee/baton(src)
new /obj/item/weapon/gun/energy/taser(src)
new /obj/item/clothing/glasses/sunglasses/sechud(src)
diff --git a/code/game/objects/devices/PDA/uplink.dm b/code/game/objects/devices/PDA/uplink.dm
index cf425009637..6fca00f753b 100644
--- a/code/game/objects/devices/PDA/uplink.dm
+++ b/code/game/objects/devices/PDA/uplink.dm
@@ -98,7 +98,7 @@
if("revolver_ammo")
if (uses >= 2)
uses -= 2
- new /obj/item/ammo_magazine(get_turf(hostpda))
+ new /obj/item/ammo_magazine/a357(get_turf(hostpda))
if("suffocation_revolver_ammo")
if (uses >= 3)
uses -= 3
diff --git a/code/game/objects/items/weapons/hydroponics.dm b/code/game/objects/items/weapons/hydroponics.dm
index 26486b4b2a7..fd5663669c3 100644
--- a/code/game/objects/items/weapons/hydroponics.dm
+++ b/code/game/objects/items/weapons/hydroponics.dm
@@ -84,7 +84,7 @@ Deathnettle
user.take_organ_damage(0,force)
/obj/item/weapon/grown/nettle/afterattack(atom/A as mob|obj, mob/user as mob)
- if (force > 0)
+ if(force > 0)
force -= rand(1,(force/3)+1) // When you whack someone with it, leaves fall off
else
usr << "All the leaves have fallen off the nettle from violent whacking."
diff --git a/code/game/objects/items/weapons/uplinks.dm b/code/game/objects/items/weapons/uplinks.dm
index 1068f6c9461..eb3d1a3d486 100644
--- a/code/game/objects/items/weapons/uplinks.dm
+++ b/code/game/objects/items/weapons/uplinks.dm
@@ -92,7 +92,7 @@ SYNDICATE UPLINK
if("revolver_ammo")
if (src.uses >= 2)
src.uses -= 2
- new /obj/item/ammo_magazine(get_turf(src))
+ new /obj/item/ammo_magazine/a357(get_turf(src))
if("suffocation_revolver_ammo")
if (uses >= 3)
uses -= 3
diff --git a/code/game/objects/storage/storage.dm b/code/game/objects/storage/storage.dm
index b7186cc3f3d..866d9b6dde8 100644
--- a/code/game/objects/storage/storage.dm
+++ b/code/game/objects/storage/storage.dm
@@ -280,7 +280,7 @@
if ("guns")
new /obj/item/weapon/gun/projectile(src)
- new /obj/item/ammo_magazine(src)
+ new /obj/item/ammo_magazine/a357(src)
new /obj/item/weapon/card/emag(src)
new /obj/item/weapon/plastique(src)
return
diff --git a/code/modules/admin/admin.dm b/code/modules/admin/admin.dm
index 3577d9e9a2f..27ac3674503 100644
--- a/code/modules/admin/admin.dm
+++ b/code/modules/admin/admin.dm
@@ -1443,6 +1443,16 @@
for(var/sig in lawchanges)
dat += "[sig]
"
usr << browse(dat, "window=lawchanges;size=800x500")
+ if("list_job_debug")
+ var/dat = "Job Debug info.