diff --git a/code/game/jobs/job/captain.dm b/code/game/jobs/job/captain.dm
index 596f078eca9..4c9c3b5822c 100644
--- a/code/game/jobs/job/captain.dm
+++ b/code/game/jobs/job/captain.dm
@@ -23,7 +23,10 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
economic_modifier = 20
minimum_character_age = 25
+ min_age_by_species = list(SPECIES_HUMAN_VATBORN = 12)
ideal_character_age = 70 // Old geezer captains ftw
+ ideal_age_by_species = list(SPECIES_HUMAN_VATBORN = 55) /// Vatborn live shorter, no other race eligible for captain besides human/skrell
+ banned_job_species = list(SPECIES_UNATHI, SPECIES_TAJ, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "mechanical", "digital")
outfit_type = /decl/hierarchy/outfit/job/captain
job_description = "The Site Manager manages the other Command Staff, and through them the rest of the station. Though they have access to everything, \
@@ -31,6 +34,7 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
have an understanding of Standard Operating Procedure, and is subject to it, and legal action, in the same way as every other crew member."
alt_titles = list("Overseer"= /datum/alt_title/overseer)
+
/*
/datum/job/captain/equip(var/mob/living/carbon/human/H)
. = ..()
@@ -66,7 +70,10 @@ var/datum/announcement/minor/captain_announcement = new(do_newscast = 1)
economic_modifier = 10
minimum_character_age = 25
+ min_age_by_species = list(SPECIES_UNATHI = 70, SPECIES_TESHARI = 20, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 12)
ideal_character_age = 50
+ ideal_age_by_species = list(SPECIES_UNATHI = 140, SPECIES_TESHARI = 27, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20)
+ banned_job_species = list(SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital", SPECIES_DIONA)
outfit_type = /decl/hierarchy/outfit/job/hop
job_description = "The Head of Personnel manages the Service department, the Exploration team, and most other civilians. They also \
diff --git a/code/game/jobs/job/civilian.dm b/code/game/jobs/job/civilian.dm
index febbd265b29..b80257fee53 100644
--- a/code/game/jobs/job/civilian.dm
+++ b/code/game/jobs/job/civilian.dm
@@ -99,6 +99,7 @@
economic_modifier = 5
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)
+ banned_job_species = list("digital", SPECIES_PROMETHEAN)
ideal_character_age = 40
@@ -231,6 +232,7 @@
access = list(access_lawyer, access_sec_doors, access_maint_tunnels, access_heads)
minimal_access = list(access_lawyer, access_sec_doors, access_heads)
minimal_player_age = 7
+ banned_job_species = list(SPECIES_PROMETHEAN, SPECIES_UNATHI, SPECIES_DIONA, SPECIES_TESHARI, SPECIES_ZADDAT, "digital")
outfit_type = /decl/hierarchy/outfit/job/internal_affairs_agent
job_description = "An Internal Affairs Agent makes sure that the crew is following Standard Operating Procedure. They also \
diff --git a/code/game/jobs/job/engineering.dm b/code/game/jobs/job/engineering.dm
index ae937d106b3..dd856bc6151 100644
--- a/code/game/jobs/job/engineering.dm
+++ b/code/game/jobs/job/engineering.dm
@@ -17,7 +17,10 @@
economic_modifier = 10
minimum_character_age = 25
+ min_age_by_species = list(SPECIES_UNATHI = 70, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 12)
ideal_character_age = 50
+ ideal_age_by_species = list(SPECIES_UNATHI = 140, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20)
+ banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital")
access = list(access_engine, access_engine_equip, access_tech_storage, access_maint_tunnels,
@@ -55,6 +58,7 @@
"Engine Technician" = /datum/alt_title/engine_tech, "Electrician" = /datum/alt_title/electrician)
minimal_player_age = 3
+ min_age_by_species = list(SPECIES_PROMETHEAN = 2)
outfit_type = /decl/hierarchy/outfit/job/engineering/engineer
job_description = "An Engineer keeps the station running. They repair damages, keep the atmosphere stable, and ensure that power is being \
@@ -94,6 +98,7 @@
minimal_access = list(access_eva, access_engine, access_atmospherics, access_maint_tunnels, access_emergency_storage, access_construction, access_external_airlocks)
minimal_player_age = 3
+ min_age_by_species = list(SPECIES_PROMETHEAN = 2)
outfit_type = /decl/hierarchy/outfit/job/engineering/atmos
job_description = "An Atmospheric Technician is primarily concerned with keeping the station's atmosphere breathable. They are expected to have a good \
diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm
index a1ca7564624..ab0bd5cd88d 100644
--- a/code/game/jobs/job/job.dm
+++ b/code/game/jobs/job/job.dm
@@ -22,7 +22,10 @@
var/department_accounts = null // Which department accounts should people with this position be given the pin for?
var/assignable = TRUE // Should it show up on things like the ID computer?
var/minimum_character_age = 0
+ var/list/min_age_by_species = null
var/ideal_character_age = 30
+ var/list/ideal_age_by_species = null
+ var/list/banned_job_species = null
var/has_headset = TRUE //Do people with this job need to be given headsets and told how to use them? E.g. Cyborgs don't.
var/account_allowed = 1 // Does this job type come with a station account?
@@ -158,4 +161,20 @@
if(mannequin.back)
var/obj/O = mannequin.back
mannequin.drop_from_inventory(O)
- qdel(O)
\ No newline at end of file
+ qdel(O)
+
+///Assigns minimum age by race & brain type. Code says Positronic = mechanical and Drone = digital because nothing can be simple.
+///Will first check based on brain type, then based on species.
+/datum/job/proc/get_min_age(species_name, brain_type)
+ return (brain_type && LAZYACCESS(min_age_by_species, brain_type)) || LAZYACCESS(min_age_by_species, species_name) || minimum_character_age
+
+/datum/job/proc/get_ideal_age(species_name, brain_type)
+ return (brain_type && LAZYACCESS(ideal_age_by_species, brain_type)) || LAZYACCESS(ideal_age_by_species, brain_type) || ideal_character_age
+
+/datum/job/proc/is_species_banned(species_name, brain_type)
+ if(banned_job_species == null)
+ return
+ if(species_name in banned_job_species)
+ return TRUE
+ if(brain_type in banned_job_species)
+ return TRUE
\ No newline at end of file
diff --git a/code/game/jobs/job/medical.dm b/code/game/jobs/job/medical.dm
index e74b0798b6a..6413e050f74 100644
--- a/code/game/jobs/job/medical.dm
+++ b/code/game/jobs/job/medical.dm
@@ -23,8 +23,11 @@
access_keycard_auth, access_sec_doors, access_psychiatrist, access_eva, access_external_airlocks, access_maint_tunnels)
minimum_character_age = 25
+ min_age_by_species = list(SPECIES_UNATHI = 70, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 12)
minimal_player_age = 10
ideal_character_age = 50
+ ideal_age_by_species = list(SPECIES_UNATHI = 140, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20)
+ banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital")
outfit_type = /decl/hierarchy/outfit/job/medical/cmo
job_description = "The CMO manages the Medical department and is a position requiring experience and skill; their goal is to ensure that their \
@@ -58,6 +61,8 @@
"Nurse" = /datum/alt_title/nurse,
"Virologist" = /datum/alt_title/virologist)
+ min_age_by_species = list(SPECIES_PROMETHEAN = 3)
+
//Medical Doctor Alt Titles
/datum/alt_title/surgeon
title = "Surgeon"
@@ -103,6 +108,7 @@
access = list(access_medical, access_medical_equip, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics)
minimal_access = list(access_medical, access_medical_equip, access_chemistry)
minimal_player_age = 3
+ min_age_by_species = list(SPECIES_PROMETHEAN = 3)
outfit_type = /decl/hierarchy/outfit/job/medical/chemist
job_description = "A Chemist produces and maintains a stock of basic to advanced chemicals for medical and occasionally research use. \
@@ -157,6 +163,7 @@
job_description = "A Psychiatrist provides mental health services to crew members in need. They may also be called upon to determine whatever \
ails the mentally unwell, frequently under Security supervision. They understand the effects of various psychoactive drugs."
alt_titles = list("Psychologist" = /datum/alt_title/psychologist)
+ banned_job_species = list(SPECIES_PROMETHEAN, SPECIES_DIONA)
//Psychiatrist Alt Titles
/datum/alt_title/psychologist
@@ -185,6 +192,9 @@
job_description = "A Paramedic is primarily concerned with the recovery of patients who are unable to make it to the Medical Department on their own. \
They may also be called upon to keep patients stable when Medical is busy or understaffed."
alt_titles = list("Emergency Medical Technician" = /datum/alt_title/emt)
+ banned_job_species = list(SPECIES_DIONA)
+
+ min_age_by_species = list(SPECIES_PROMETHEAN = 2)
// Paramedic Alt Titles
/datum/alt_title/emt
diff --git a/code/game/jobs/job/science.dm b/code/game/jobs/job/science.dm
index 79d1be6c3bf..7de947545d2 100644
--- a/code/game/jobs/job/science.dm
+++ b/code/game/jobs/job/science.dm
@@ -26,7 +26,10 @@
minimum_character_age = 25
minimal_player_age = 14
+ min_age_by_species = list(SPECIES_UNATHI = 70, "mechanical" = 10, SPECIES_HUMAN_VATBORN = 12)
ideal_character_age = 50
+ ideal_age_by_species = list(SPECIES_UNATHI = 140, "mechanical" = 20, SPECIES_HUMAN_VATBORN = 20)
+ banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital")
outfit_type = /decl/hierarchy/outfit/job/science/rd
job_description = "The Research Director manages and maintains the Research department. They are required to ensure the safety of the entire crew, \
@@ -35,6 +38,7 @@
are encouraged to allow their staff to perform their own duties."
alt_titles = list("Research Supervisor" = /datum/alt_title/research_supervisor)
+
// Research Director Alt Titles
/datum/alt_title/research_supervisor
title = "Research Supervisor"
@@ -55,6 +59,8 @@
economic_modifier = 7
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_xenoarch)
minimal_access = list(access_tox, access_tox_storage, access_research, access_xenoarch)
+ min_age_by_species = list(SPECIES_PROMETHEAN = 2)
+ banned_job_species = list("digital")
minimal_player_age = 14
@@ -98,8 +104,10 @@
economic_modifier = 7
access = list(access_robotics, access_tox, access_tox_storage, access_research, access_xenobiology, access_hydroponics)
minimal_access = list(access_research, access_xenobiology, access_hydroponics, access_tox_storage)
+ banned_job_species = list("digital")
minimal_player_age = 14
+ min_age_by_species = list(SPECIES_PROMETHEAN = 2)
outfit_type = /decl/hierarchy/outfit/job/science/xenobiologist
job_description = "A Xenobiologist studies esoteric lifeforms, usually in the relative safety of their lab. They attempt to find ways to benefit \
@@ -131,6 +139,8 @@ VR edit end*/
access = list(access_robotics, access_tox, access_tox_storage, access_tech_storage, access_morgue, access_research) //As a job that handles so many corpses, it makes sense for them to have morgue access.
minimal_access = list(access_robotics, access_tech_storage, access_morgue, access_research) //As a job that handles so many corpses, it makes sense for them to have morgue access.
minimal_player_age = 7
+ min_age_by_species = list(SPECIES_PROMETHEAN = 2)
+ banned_job_species = list("digital")
outfit_type = /decl/hierarchy/outfit/job/science/roboticist
job_description = "A Roboticist maintains and repairs the station's synthetics, including crew with prosthetic limbs. \
diff --git a/code/game/jobs/job/security.dm b/code/game/jobs/job/security.dm
index 631b81e16ea..fee0e9fa8ea 100644
--- a/code/game/jobs/job/security.dm
+++ b/code/game/jobs/job/security.dm
@@ -24,7 +24,11 @@
access_research, access_engine, access_mining, access_medical, access_construction, access_mailsorting,
access_heads, access_hos, access_RC_announce, access_keycard_auth, access_gateway, access_external_airlocks)
minimum_character_age = 25
+ min_age_by_species = list(SPECIES_HUMAN_VATBORN = 12)
minimal_player_age = 14
+ ideal_character_age = 50
+ ideal_age_by_species = list(SPECIES_HUMAN_VATBORN = 20)
+ banned_job_species = list(SPECIES_TESHARI, SPECIES_DIONA, SPECIES_PROMETHEAN, SPECIES_ZADDAT, "digital", SPECIES_UNATHI, "mechanical")
outfit_type = /decl/hierarchy/outfit/job/security/hos
job_description = " The Head of Security manages the Security Department, keeping the station safe and making sure the rules are followed. They are expected to \
@@ -32,6 +36,7 @@
perform the duties of absent Security roles, such as distributing gear from the Armory."
alt_titles = list("Security Commander" = /datum/alt_title/sec_commander, "Chief of Security" = /datum/alt_title/sec_chief)
+
// Head of Security Alt Titles
/datum/alt_title/sec_commander
title = "Security Commander"
@@ -57,6 +62,7 @@
access = list(access_security, access_eva, access_sec_doors, access_brig, access_armory, access_maint_tunnels, access_morgue, access_external_airlocks)
minimal_access = list(access_security, access_eva, access_sec_doors, access_brig, access_armory, access_maint_tunnels, access_external_airlocks)
minimal_player_age = 5
+ banned_job_species = list(SPECIES_ZADDAT, SPECIES_PROMETHEAN, SPECIES_TESHARI, SPECIES_DIONA)
outfit_type = /decl/hierarchy/outfit/job/security/warden
job_description = "The Warden watches over the physical Security Department, making sure the Brig and Armoury are secure and in order at all times. They oversee \
@@ -81,6 +87,7 @@
minimal_access = list(access_security, access_sec_doors, access_forensics_lockers, access_morgue, access_maint_tunnels, access_eva, access_external_airlocks)
economic_modifier = 5
minimal_player_age = 3
+ banned_job_species = list(SPECIES_ZADDAT, SPECIES_PROMETHEAN, SPECIES_DIONA)
outfit_type = /decl/hierarchy/outfit/job/security/detective
job_description = "A Detective works to help Security find criminals who have not properly been identified, through interviews and forensic work. \
@@ -110,6 +117,7 @@
access = list(access_security, access_eva, access_sec_doors, access_brig, access_maint_tunnels, access_morgue, access_external_airlocks)
minimal_access = list(access_security, access_eva, access_sec_doors, access_brig, access_maint_tunnels, access_external_airlocks)
minimal_player_age = 3
+ banned_job_species = list(SPECIES_ZADDAT, SPECIES_TESHARI, SPECIES_DIONA)
outfit_type = /decl/hierarchy/outfit/job/security/officer
job_description = "A Security Officer is concerned with maintaining the safety and security of the station as a whole, dealing with external threats and \
@@ -117,6 +125,8 @@
No one is above the Law, not Security or Command."
alt_titles = list("Junior Officer" = /datum/alt_title/junior_officer)
+ min_age_by_species = list(SPECIES_PROMETHEAN = 3)
+
// Security Officer Alt Titles
/datum/alt_title/junior_officer
title = "Junior Officer"
diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm
index 2e45691570e..b2d3b35fd3a 100644
--- a/code/game/jobs/job_controller.dm
+++ b/code/game/jobs/job_controller.dm
@@ -54,7 +54,7 @@ var/global/datum/controller/occupations/job_master
var/datum/job/job = GetJob(rank)
if(!job)
return 0
- if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age))
+ if((job.minimum_character_age || job.min_age_by_species) && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"])))
return 0
if(jobban_isbanned(player, rank))
return 0
@@ -97,9 +97,10 @@ 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))
+ if(job.minimum_character_age && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"])))
Debug("FOC character not old enough, Player: [player]")
continue
+<<<<<<< HEAD
//VOREStation Code Start
if(!job.player_has_enough_playtime(player.client))
Debug("FOC character not enough playtime, Player: [player]")
@@ -108,6 +109,11 @@ var/global/datum/controller/occupations/job_master
Debug("FOC is_job_whitelisted failed, Player: [player]")
continue
//VOREStation Code End
+=======
+ if(job.is_species_banned(player.client.prefs.species, player.client.prefs.organ_data["brain"]) == TRUE)
+ Debug("FOC character species invalid for job, Player: [player]")
+ continue
+>>>>>>> 67849757c8f... Merge pull request #8253 from Schnayy/ageupdates
if(flag && !(player.client.prefs.be_special & flag))
Debug("FOC flag failed, Player: [player], Flag: [flag], ")
continue
@@ -122,7 +128,10 @@ var/global/datum/controller/occupations/job_master
if(!job)
continue
- if(job.minimum_character_age && (player.client.prefs.age < job.minimum_character_age))
+ if((job.minimum_character_age || job.min_age_by_species) && (player.client.prefs.age < job.get_min_age(player.client.prefs.species, player.client.prefs.organ_data["brain"])))
+ continue
+
+ if(job.is_species_banned(player.client.prefs.species, player.client.prefs.organ_data["brain"]) == TRUE)
continue
if(istype(job, GetJob(USELESS_JOB))) // We don't want to give him assistant, that's boring! //VOREStation Edit - Visitor not Assistant
@@ -180,20 +189,18 @@ var/global/datum/controller/occupations/job_master
if(!V.client) continue
var/age = V.client.prefs.age
- if(age < job.minimum_character_age) // Nope.
+ if(age < job.get_min_age(V.client.prefs.species, V.client.prefs.organ_data["brain"])) // Nope.
continue
- switch(age)
- if(job.minimum_character_age to (job.minimum_character_age+10))
- weightedCandidates[V] = 3 // Still a bit young.
- if((job.minimum_character_age+10) to (job.ideal_character_age-10))
- weightedCandidates[V] = 6 // Better.
- if((job.ideal_character_age-10) to (job.ideal_character_age+10))
- weightedCandidates[V] = 10 // Great.
- if((job.ideal_character_age+10) to (job.ideal_character_age+20))
- weightedCandidates[V] = 6 // Still good.
- if((job.ideal_character_age+20) to INFINITY)
- weightedCandidates[V] = 3 // Geezer.
+ var/idealage = job.get_ideal_age(V.client.prefs.species, V.client.prefs.organ_data["brain"])
+ var/agediff = abs(idealage - age) // Compute the absolute difference in age from target
+ switch(agediff) /// If the math sucks, it's because I almost failed algebra in high school.
+ if(20 to INFINITY)
+ weightedCandidates[V] = 3 // Too far off
+ if(10 to 20)
+ weightedCandidates[V] = 6 // Nearer the mark, but not quite
+ if(0 to 10)
+ weightedCandidates[V] = 10 // On the mark
else
// If there's ABSOLUTELY NOBODY ELSE
if(candidates.len == 1) weightedCandidates[V] = 1
diff --git a/code/modules/client/preference_setup/occupation/occupation.dm b/code/modules/client/preference_setup/occupation/occupation.dm
index 116bd1a9ad8..6600aedcf6f 100644
--- a/code/modules/client/preference_setup/occupation/occupation.dm
+++ b/code/modules/client/preference_setup/occupation/occupation.dm
@@ -139,6 +139,7 @@
var/available_in_days = job.available_in_days(user.client)
. += "[rank]