From e64215ddb1587576afc85718b53b7e0262e6f124 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 8 Aug 2016 23:04:26 -0700 Subject: [PATCH] Update 7 - Fix: Drones now get assigned_role = Drone. - Tweak: AI is no longer considered a head job for playtime system configuration purposes. - Tweak: Job gating (when enabled - its off by default) is based on Crew playtime now. This is for all jobs, including heads and AI. Gating based on department playtime is still possible, but based on a separate config option that's also turned off by default. --- code/controllers/configuration.dm | 4 +++ code/game/jobs/job/engineering.dm | 3 ++- code/game/jobs/job/job.dm | 1 + code/game/jobs/job/medical.dm | 3 ++- code/game/jobs/job/science.dm | 3 ++- code/game/jobs/job/security.dm | 3 ++- code/game/jobs/job/silicon.dm | 4 +-- code/game/jobs/job/supervisor.dm | 11 +++++--- code/game/jobs/job_exp.dm | 26 ++++++++++++------- code/modules/client/preference/preferences.dm | 2 +- .../mob/living/silicon/robot/drone/drone.dm | 1 + config/example/config.txt | 11 +++++--- 12 files changed, 47 insertions(+), 25 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 67939f227b5..f1734d664f6 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -130,6 +130,7 @@ var/use_exp_tracking = 0 var/use_exp_restrictions_heads = 0 var/use_exp_restrictions_heads_hours = 0 + var/use_exp_restrictions_heads_department = 0 var/use_exp_restrictions_other = 0 var/use_exp_restrictions_admin_bypass = 0 @@ -254,6 +255,9 @@ if("use_exp_restrictions_heads_hours") config.use_exp_restrictions_heads_hours = text2num(value) + if("use_exp_restrictions_heads_department") + config.use_exp_restrictions_heads_department = 1 + if("use_exp_restrictions_other") config.use_exp_restrictions_other = 1 diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index dd88a6496ab..9c182ad86c3 100644 --- a/code/game/jobs/job/engineering.dm +++ b/code/game/jobs/job/engineering.dm @@ -18,7 +18,8 @@ access_ce, access_RC_announce, access_keycard_auth, access_tcomsat, access_minisat, access_mechanic, access_mineral_storeroom) minimal_player_age = 21 exp_requirements = 600 - exp_type = EXP_TYPE_ENGINEERING + exp_type = EXP_TYPE_CREW + exp_type_department = EXP_TYPE_ENGINEERING equip(var/mob/living/carbon/human/H) if(!H) return 0 diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index 209127d9abe..8b372b13f9d 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -43,6 +43,7 @@ var/exp_requirements = 0 var/exp_type = "" + var/exp_type_department = "" var/admin_only = 0 var/spawn_ert = 0 diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index d623a79a3d1..f4b382db34b 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -16,7 +16,8 @@ access_keycard_auth, access_sec_doors, access_psychiatrist, access_maint_tunnels, access_paramedic, access_mineral_storeroom) minimal_player_age = 21 exp_requirements = 600 - exp_type = EXP_TYPE_MEDICAL + exp_type = EXP_TYPE_CREW + exp_type_department = EXP_TYPE_MEDICAL equip(var/mob/living/carbon/human/H) if(!H) return 0 diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm index 090b6a2adef..8c3f26304db 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -18,7 +18,8 @@ access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_xenoarch, access_minisat, access_maint_tunnels, access_mineral_storeroom) minimal_player_age = 21 exp_requirements = 600 - exp_type = EXP_TYPE_SCIENCE + exp_type = EXP_TYPE_CREW + exp_type_department = EXP_TYPE_SCIENCE // All science-y guys get bonuses for maxing out their tech. required_objectives=list( diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm index aed67eaa442..dd52f651cba 100644 --- a/code/game/jobs/job/security.dm +++ b/code/game/jobs/job/security.dm @@ -18,7 +18,8 @@ access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_pilot, access_weapons) minimal_player_age = 21 exp_requirements = 600 - exp_type = EXP_TYPE_SECURITY + exp_type = EXP_TYPE_CREW + exp_type_department = EXP_TYPE_SECURITY equip(var/mob/living/carbon/human/H) if(!H) return 0 diff --git a/code/game/jobs/job/silicon.dm b/code/game/jobs/job/silicon.dm index 5461fb1d9b9..eedb50a8412 100644 --- a/code/game/jobs/job/silicon.dm +++ b/code/game/jobs/job/silicon.dm @@ -8,8 +8,8 @@ supervisors = "your laws" req_admin_notify = 1 minimal_player_age = 30 - exp_requirements = 300 - exp_type = EXP_TYPE_SILICON + exp_requirements = 600 + exp_type = EXP_TYPE_CREW equip(var/mob/living/carbon/human/H) if(!H) return 0 diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index 876706d114d..ee176d1a607 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -13,7 +13,8 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) minimal_access = list() //See get_access() minimal_player_age = 30 exp_requirements = 600 - exp_type = EXP_TYPE_COMMAND + exp_type = EXP_TYPE_CREW + exp_type_department = EXP_TYPE_COMMAND equip(var/mob/living/carbon/human/H) if(!H) return 0 H.equip_or_collect(new /obj/item/device/radio/headset/heads/captain/alt(H), slot_l_ear) @@ -62,7 +63,8 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) req_admin_notify = 1 minimal_player_age = 21 exp_requirements = 600 - exp_type = EXP_TYPE_SUPPLY + exp_type = EXP_TYPE_CREW + exp_type_department = EXP_TYPE_SUPPLY access = list(access_security, access_sec_doors, access_brig, access_court, access_forensics_lockers, access_medical, access_engine, access_change_ids, access_ai_upload, access_eva, access_heads, access_all_personal_lockers, access_maint_tunnels, access_bar, access_janitor, access_construction, access_morgue, @@ -242,8 +244,9 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) minimal_access = list(access_lawyer, access_court, access_sec_doors, access_maint_tunnels) alt_titles = list("Lawyer","Public Defender") minimal_player_age = 30 - exp_requirements = 300 - exp_type = EXP_TYPE_SECURITY + exp_requirements = 600 + exp_type = EXP_TYPE_CREW + exp_type_department = EXP_TYPE_SECURITY idtype = /obj/item/weapon/card/id/security equip(var/mob/living/carbon/human/H) diff --git a/code/game/jobs/job_exp.dm b/code/game/jobs/job_exp.dm index 1658fd3759b..028cc37f8ae 100644 --- a/code/game/jobs/job_exp.dm +++ b/code/game/jobs/job_exp.dm @@ -40,21 +40,29 @@ var/isexempt = text2num(play_records[EXP_TYPE_EXEMPT]) if(isexempt) return 0 - var/my_exp = text2num(play_records[exp_type]) - var/job_requirement = text2num(exp_requirements) - if(config.use_exp_restrictions_heads_hours && ((title in command_positions) || title == "AI")) - job_requirement = config.use_exp_restrictions_heads_hours * 60 + var/my_exp = text2num(play_records[get_exp_req_type()]) + var/job_requirement = text2num(get_exp_req_amount()) if(my_exp >= job_requirement) return 0 else return (job_requirement - my_exp) +/datum/job/proc/get_exp_req_amount() + if(title in command_positions) + if(config.use_exp_restrictions_heads_hours) + return config.use_exp_restrictions_heads_hours * 60 + return exp_requirements +/datum/job/proc/get_exp_req_type() + if(title in command_positions) + if(config.use_exp_restrictions_heads_department && exp_type_department) + return exp_type_department + return exp_type /proc/job_is_xp_locked(jobtitle) - if(!config.use_exp_restrictions_heads && ((jobtitle in command_positions) || jobtitle == "AI")) + if(!config.use_exp_restrictions_heads && jobtitle in command_positions) return 0 - if(!config.use_exp_restrictions_other && !((jobtitle in command_positions) || jobtitle == "AI")) + if(!config.use_exp_restrictions_other && !(jobtitle in command_positions)) return 0 return 1 @@ -103,10 +111,8 @@ else if(!job.available_in_playtime(mob.client)) jobs_unlocked += job.title else - var/xp_req = job.exp_requirements - if(config.use_exp_restrictions_heads_hours && ((job.title in command_positions) || job.title == "AI")) - xp_req = config.use_exp_restrictions_heads_hours * 60 - jobs_locked += "[job.title] [get_exp_format(text2num(play_records[job.exp_type]))] / [get_exp_format(xp_req)] [job.exp_type] EXP)" + var/xp_req = job.get_exp_req_amount() + jobs_locked += "[job.title] [get_exp_format(text2num(play_records[job.get_exp_req_type()]))] / [get_exp_format(xp_req)] as [job.get_exp_req_type()])" if(jobs_unlocked.len) return_text += "

Jobs Unlocked: