From 67d4ceffb09d2695e6629af713eacb00b164f101 Mon Sep 17 00:00:00 2001 From: "mport2004@gmail.com" Date: Wed, 12 Oct 2011 23:00:48 +0000 Subject: [PATCH] Job system should be working now. I had a '==' where a '&' should have been that would cause it to only work when you had one job of the same level and department selected. The loyalty implant box now spawn in the HoS' locker and not in nullspace. Gave the HoS' locker a secbelt. The revolver now use the proper bullet. Robotics spawn with their labcoat/toolbox. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@2346 316c924e-a436-60f5-8080-3fe189b3f50e --- code/game/jobs/job/engineering.dm | 2 + code/game/jobs/job/job.dm | 75 ---------------- code/game/jobs/job_controller.dm | 90 +++++++++++++------ code/game/machinery/autolathe.dm | 2 +- code/game/machinery/computer/computer.dm | 2 +- code/game/objects/closets/secure/security.dm | 27 +++--- code/game/objects/devices/PDA/uplink.dm | 2 +- .../game/objects/items/weapons/hydroponics.dm | 2 +- code/game/objects/items/weapons/uplinks.dm | 2 +- code/game/objects/storage/storage.dm | 2 +- code/modules/admin/admin.dm | 11 +++ code/modules/admin/admin_verbs.dm | 3 +- code/modules/admin/verbs/debug.dm | 6 +- code/modules/admin/verbs/striketeam.dm | 2 +- code/modules/mob/new_player/new_player.dm | 48 +++++----- code/modules/mob/new_player/preferences.dm | 3 +- code/modules/projectiles/ammunition.dm | 8 +- code/modules/projectiles/ammunition/boxes.dm | 9 ++ .../modules/projectiles/ammunition/bullets.dm | 6 ++ code/modules/projectiles/guns/projectile.dm | 2 +- 20 files changed, 146 insertions(+), 158 deletions(-) diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index 21378012d2..2a26e147da 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 1931a97679..e94dec88eb 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 4ad071fdd3..99ed006386 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 d1f4c52b1e..ef05c7ffd3 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 d1a78b3738..4d8d31c860 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 f3a8035aab..1889d36c36 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 cf42500963..6fca00f753 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 26486b4b2a..fd5663669c 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 1068f6c946..eb3d1a3d48 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 b7186cc3f3..866d9b6dde 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 3577d9e9a2..27ac367450 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.
" + if(job_master) + for(var/line in job_master.job_debug) + dat += "[line]
" + dat+= "*******

" + for(var/datum/job/job in job_master.occupations) + if(!job) continue + dat += "job: [job.title], current_positions: [job.current_positions], total_positions: [job.total_positions]
" + usr << browse(dat, "window=jobdebug;size=600x500") if("check_antagonist") if (ticker && ticker.current_state >= GAME_STATE_PLAYING) var/dat = "Round Status

Round Status

" @@ -1932,6 +1942,7 @@ dat += {" Coder Secrets

+Show Job Debug
Admin Log
"} usr << browse(dat, "window=secrets") diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 4c974262e0..b8e3ac45b9 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -386,9 +386,10 @@ verbs -= /client/proc/toggleprayers verbs -= /client/proc/jump_to_dead_group verbs -= /client/proc/Blobize - verbs += /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the enw clickproc is being tested) + verbs -= /client/proc/toggle_clickproc //TODO ERRORAGE (Temporary proc while the enw clickproc is being tested) verbs -= /client/proc/toggle_hear_deadcast verbs -= /client/proc/toggle_hear_radio + verbs -= /client/proc/tension_report return diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm index f850343bd5..cb7a417b87 100644 --- a/code/modules/admin/verbs/debug.dm +++ b/code/modules/admin/verbs/debug.dm @@ -426,7 +426,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_if_possible(new /obj/item/weapon/cloaking_device(M), M.slot_r_store) M.equip_if_possible(new /obj/item/weapon/gun/projectile(M), M.slot_r_hand) - M.equip_if_possible(new /obj/item/ammo_magazine(M), M.slot_l_store) + M.equip_if_possible(new /obj/item/ammo_magazine/a357(M), M.slot_l_store) if ("tournament chef") //Steven Seagal FTW M.equip_if_possible(new /obj/item/clothing/under/rank/chef(M), M.slot_w_uniform) @@ -545,7 +545,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that sec_briefcase.contents += new /obj/item/weapon/spacecash/c1000 sec_briefcase.contents += new /obj/item/weapon/gun/energy/crossbow sec_briefcase.contents += new /obj/item/weapon/gun/projectile/mateba - sec_briefcase.contents += new /obj/item/ammo_magazine + sec_briefcase.contents += new /obj/item/ammo_magazine/a357 sec_briefcase.contents += new /obj/item/weapon/plastique M.equip_if_possible(sec_briefcase, M.slot_l_hand) @@ -607,7 +607,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that M.equip_if_possible(new /obj/item/clothing/head/centhat(M), M.slot_head) M.equip_if_possible(new /obj/item/weapon/gun/projectile/mateba(M), M.slot_belt) M.equip_if_possible(new /obj/item/weapon/zippo(M), M.slot_r_store) - M.equip_if_possible(new /obj/item/ammo_magazine(M), M.slot_l_store) + M.equip_if_possible(new /obj/item/ammo_magazine/a357(M), M.slot_l_store) var/obj/item/weapon/card/id/W = new(M) W.name = "[M.real_name]'s ID Card" diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm index 767daa000b..3af6453fcb 100644 --- a/code/modules/admin/verbs/striketeam.dm +++ b/code/modules/admin/verbs/striketeam.dm @@ -160,7 +160,7 @@ var/global/sent_strike_team = 0 equip_if_possible(new /obj/item/weapon/storage/backpack/security(src), slot_back) equip_if_possible(new /obj/item/weapon/storage/box(src), slot_in_backpack) - equip_if_possible(new /obj/item/ammo_magazine(src), slot_in_backpack) + equip_if_possible(new /obj/item/ammo_magazine/a357(src), slot_in_backpack) equip_if_possible(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack) equip_if_possible(new /obj/item/weapon/storage/flashbang_kit(src), slot_in_backpack) equip_if_possible(new /obj/item/device/flashlight(src), slot_in_backpack) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 4be3a35f32..8520524c5c 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -208,34 +208,32 @@ new_player_panel() -/* proc/IsJobAvailable(rank) - if(((occupations[rank] < 0) || (countJob(rank) < occupations[rank])) && !jobban_isbanned(src,rank)) - return 1 - else - return 0*/ + proc/IsJobAvailable(rank) + var/datum/job/job = job_master.GetJob(rank) + if(!job) return 0 + if(job.current_positions >= job.total_positions) return 0 + if(jobban_isbanned(src,rank)) return 0 + return 1 proc/AttemptLateSpawn(rank) - var/datum/job/job = job_master.GetJob(rank) - if(job && (job.current_positions < job.total_positions)) - var/mob/living/carbon/human/character = create_character() - var/icon/char_icon = getFlatIcon(character,0)//We're creating out own cache so it's not needed. - if(job_master.AssignRole(character, rank, 1)) - job_master.EquipRank(character, rank, 1) - if(character.mind) - if(character.mind.assigned_role != "Cyborg") - ManifestLateSpawn(character,char_icon) - if(ticker) - character.loc = pick(latejoin) - AnnounceArrival(character, rank) - if(character.mind) - if(character.mind.assigned_role == "Cyborg") - character.Robotize() - else//Adds late joiners to minds so they can be linked to objectives. - ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. - del(src) - else + if(!IsJobAvailable(rank)) src << alert("[rank] is not available. Please try another.") + return 0 + + var/mob/living/carbon/human/character = create_character() + var/icon/char_icon = getFlatIcon(character,0)//We're creating out own cache so it's not needed. + job_master.AssignRole(character, rank, 1) + job_master.EquipRank(character, rank, 1) + character.loc = pick(latejoin) + AnnounceArrival(character, rank) + + if(character.mind.assigned_role != "Cyborg") + ManifestLateSpawn(character,char_icon) + ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. + else + character.Robotize() + del(src) proc/AnnounceArrival(var/mob/living/carbon/human/character, var/rank) @@ -319,7 +317,7 @@ var/dat = "" dat += "Choose from the following open positions:
" for(var/datum/job/job in job_master.occupations) - if(job && ((job.title == "Assistant") || (job.current_positions < job.total_positions))) + if(job && IsJobAvailable(job.title)) dat += "[job.title]
" src << browse(dat, "window=latechoices;size=300x640;can_close=0") diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index ad634bade4..32034a2719 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -337,7 +337,8 @@ datum/preferences else if(link_tags["job"]) SetJob(user, link_tags["job"]) else - SetChoices(user) + if(job_master) + SetChoices(user) return 1 diff --git a/code/modules/projectiles/ammunition.dm b/code/modules/projectiles/ammunition.dm index 76b6f9d51b..e1cc91a41e 100644 --- a/code/modules/projectiles/ammunition.dm +++ b/code/modules/projectiles/ammunition.dm @@ -1,14 +1,14 @@ /obj/item/ammo_casing name = "bullet casing" - desc = "A .357 bullet casing." + desc = "A bullet casing." icon = 'ammo.dmi' icon_state = "s-casing" flags = FPRINT | TABLEPASS | CONDUCT | ONBELT throwforce = 1 w_class = 1.0 var - caliber = "357" //Which kind of guns it can be loaded into - projectile_type = "/obj/item/projectile"//The bullet type to create when New() is called + caliber = "" //Which kind of guns it can be loaded into + projectile_type = ""//The bullet type to create when New() is called obj/item/projectile/BB = null //The loaded bullet @@ -46,7 +46,7 @@ //Boxes of ammo /obj/item/ammo_magazine name = "ammo box (.357)" - desc = "A box of .357 ammo" + desc = "A box of ammo" icon_state = "357" icon = 'ammo.dmi' flags = FPRINT | TABLEPASS | CONDUCT | ONBELT diff --git a/code/modules/projectiles/ammunition/boxes.dm b/code/modules/projectiles/ammunition/boxes.dm index ae8fe85553..ad5ecbd4a3 100644 --- a/code/modules/projectiles/ammunition/boxes.dm +++ b/code/modules/projectiles/ammunition/boxes.dm @@ -1,3 +1,12 @@ +/obj/item/ammo_magazine/a357 + name = "ammo box (.357)" + desc = "A box of .357 ammo" + icon_state = "357" + ammo_type = "/obj/item/ammo_casing/a357" + max_ammo = 8 + + + /obj/item/ammo_magazine/a75 name = "ammo magazine (.75)" icon_state = "gyro" diff --git a/code/modules/projectiles/ammunition/bullets.dm b/code/modules/projectiles/ammunition/bullets.dm index 1c9802a7c4..b9f118a2e8 100644 --- a/code/modules/projectiles/ammunition/bullets.dm +++ b/code/modules/projectiles/ammunition/bullets.dm @@ -1,3 +1,9 @@ +/obj/item/ammo_casing/a357 + desc = "A .357 bullet casing." + caliber = "357" + projectile_type = "/obj/item/projectile/bullet" + + /obj/item/ammo_casing/a418 desc = "A .418 bullet casing." caliber = "357" diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index 878c697c40..a5ccf826cc 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -8,7 +8,7 @@ m_amt = 1000 var - ammo_type = "/obj/item/ammo_casing" + ammo_type = "/obj/item/ammo_casing/a357" list/loaded = list() max_shells = 7 load_method = 0 //0 = Single shells or quick loader, 1 = magazine