diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm index 6c4e3b8f6e..5ac35742b2 100644 --- a/code/game/jobs/job/captain.dm +++ b/code/game/jobs/job/captain.dm @@ -18,6 +18,10 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) minimal_access = list() //See get_access() minimal_player_age = 14 economic_modifier = 20 + + ideal_character_age = 70 // Old geezer captains ftw + + equip(var/mob/living/carbon/human/H) if(!H) return 0 H.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(H), slot_l_ear) @@ -63,6 +67,8 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1) req_admin_notify = 1 minimal_player_age = 10 economic_modifier = 10 + ideal_character_age = 50 + access = list(access_security, access_sec_doors, access_brig, 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, diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm index 5fe43b0a43..eea5534751 100644 --- a/code/game/jobs/job/civilian.dm +++ b/code/game/jobs/job/civilian.dm @@ -101,6 +101,8 @@ access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station) minimal_access = list(access_maint_tunnels, access_mailsorting, access_cargo, access_cargo_bot, access_qm, access_mining, access_mining_station) + ideal_character_age = 40 + equip(var/mob/living/carbon/human/H) if(!H) return 0 diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm index 27cd6a753e..20a5c1e5d1 100644 --- a/code/game/jobs/job/engineering.dm +++ b/code/game/jobs/job/engineering.dm @@ -12,6 +12,10 @@ idtype = /obj/item/weapon/card/id/silver req_admin_notify = 1 economic_modifier = 10 + + ideal_character_age = 50 + + access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels, access_teleporter, access_external_airlocks, access_atmospherics, access_emergency_storage, access_eva, access_heads, access_construction, access_sec_doors, diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index b84b673a40..2f6ab79644 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -19,6 +19,8 @@ var/minimal_player_age = 0 // If you have use_age_restriction_for_jobs config option enabled and the database set up, this option will add a requirement for players to be at least minimal_player_age days old. (meaning they first signed in at least that many days before.) var/department = null // Does this position have a department tag? var/head_position = 0 // Is this position Command? + var/minimum_character_age = 17 + var/ideal_character_age = 30 var/account_allowed = 1 // Does this job type come with a station account? var/economic_modifier = 2 // With how much does this job modify the initial account amount? diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm index 179a4c4fea..35c2b4aa07 100644 --- a/code/game/jobs/job/medical.dm +++ b/code/game/jobs/job/medical.dm @@ -18,7 +18,9 @@ minimal_access = list(access_medical, access_medical_equip, access_morgue, access_genetics, access_heads, access_chemistry, access_virology, access_cmo, access_surgery, access_RC_announce, access_keycard_auth, access_sec_doors, access_psychiatrist, access_eva, access_external_airlocks, access_maint_tunnels) + minimal_player_age = 10 + ideal_character_age = 50 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 05690d4339..f5b1f4ed29 100644 --- a/code/game/jobs/job/science.dm +++ b/code/game/jobs/job/science.dm @@ -20,7 +20,9 @@ access_tox_storage, access_teleporter, access_sec_doors, access_research, access_robotics, access_xenobiology, access_ai_upload, access_tech_storage, access_RC_announce, access_keycard_auth, access_tcomsat, access_gateway, access_xenoarch) + minimal_player_age = 14 + ideal_character_age = 50 equip(var/mob/living/carbon/human/H) if(!H) return 0 diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 37f00428dd..122ca43aa3 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -49,9 +49,15 @@ var/global/datum/controller/occupations/job_master 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 - if(!job.player_old_enough(player.client)) return 0 + if(!job) + return 0 + if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + return 0 + if(jobban_isbanned(player, rank)) + return 0 + if(!job.player_old_enough(player.client)) + return 0 + var/position_limit = job.total_positions if(!latejoin) position_limit = job.spawn_positions @@ -82,6 +88,9 @@ var/global/datum/controller/occupations/job_master if(!job.player_old_enough(player.client)) Debug("FOC player not old enough, Player: [player]") continue + if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + Debug("FOC character not old enough, Player: [player]") + continue if(flag && (!player.client.prefs.be_special & flag)) Debug("FOC flag failed, Player: [player], Flag: [flag], ") continue @@ -96,6 +105,9 @@ var/global/datum/controller/occupations/job_master if(!job) continue + if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age)) + continue + if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring! continue @@ -137,30 +149,24 @@ var/global/datum/controller/occupations/job_master // Build a weighted list, weight by age. var/list/weightedCandidates = list() - - // Different head positions have different good ages. - var/good_age_minimal = 25 - var/good_age_maximal = 60 - if(command_position == "Captain") - good_age_minimal = 30 - good_age_maximal = 70 // Old geezer captains ftw - for(var/mob/V in candidates) // Log-out during round-start? What a bad boy, no head position for you! if(!V.client) continue var/age = V.client.prefs.age + + if(age < job.minimum_character_age) // Nope. + continue + switch(age) - if(good_age_minimal - 10 to good_age_minimal) + if(job.minimum_character_age to (job.minimum_character_age+10)) weightedCandidates[V] = 3 // Still a bit young. - if(good_age_minimal to good_age_minimal + 10) + if((job.minimum_character_age+10) to (job.ideal_character_age-10)) weightedCandidates[V] = 6 // Better. - if(good_age_minimal + 10 to good_age_maximal - 10) + if((job.ideal_character_age-10) to (job.ideal_character_age+10)) weightedCandidates[V] = 10 // Great. - if(good_age_maximal - 10 to good_age_maximal) + if((job.ideal_character_age+10) to (job.ideal_character_age+20)) weightedCandidates[V] = 6 // Still good. - if(good_age_maximal to good_age_maximal + 10) - weightedCandidates[V] = 6 // Bit old, don't you think? - if(good_age_maximal to good_age_maximal + 50) + if((job.ideal_character_age+20) to INFINITY) weightedCandidates[V] = 3 // Geezer. else // If there's ABSOLUTELY NOBODY ELSE diff --git a/code/modules/client/preference_setup/occupation/occupation.dm b/code/modules/client/preference_setup/occupation/occupation.dm index 561ffb3ec4..92c6320c64 100644 --- a/code/modules/client/preference_setup/occupation/occupation.dm +++ b/code/modules/client/preference_setup/occupation/occupation.dm @@ -89,6 +89,9 @@ var/available_in_days = job.available_in_days(user.client) . += "[rank] \[IN [(available_in_days)] DAYS]" continue + if(job.minimum_character_age && user.client && (user.client.prefs.age < job.minimum_character_age)) + . += "[rank] \[MINIMUM CHARACTER AGE: [job.minimum_character_age]]" + continue if((pref.job_civilian_low & ASSISTANT) && (rank != "Assistant")) . += "[rank]" continue diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index ee5e786db8..cb09a4a029 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -375,9 +375,11 @@ else // Crew transfer initiated dat += "The station is currently undergoing crew transfer procedures.
" - dat += "Choose from the following open positions:
" + dat += "Choose from the following open/valid positions:
" for(var/datum/job/job in job_master.occupations) if(job && IsJobAvailable(job.title)) + if(job.minimum_character_age && (client.prefs.age < job.minimum_character_age)) + continue var/active = 0 // Only players with the job assigned and AFK for less than 10 minutes count as active for(var/mob/M in player_list) if(M.mind && M.client && M.mind.assigned_role == job.title && M.client.inactivity <= 10 * 60 * 10)