From f180792228726a0b346fad8211bf152cd24cceca Mon Sep 17 00:00:00 2001 From: DGamerL <108773801+DGamerL@users.noreply.github.com> Date: Mon, 17 Jul 2023 16:29:49 +0200 Subject: [PATCH] Added the old code (#21602) --- code/controllers/subsystem/SSjobs.dm | 15 ++++++++- code/game/jobs/job/engineering_jobs.dm | 2 ++ code/game/jobs/job/job.dm | 37 +++++++++++++++------ code/game/jobs/job/medical_jobs.dm | 1 + code/game/jobs/job/science_jobs.dm | 1 + code/game/jobs/job/security_jobs.dm | 9 ++++- code/game/jobs/job/supervisor.dm | 8 ++++- code/modules/client/preference/character.dm | 3 ++ code/modules/mob/new_player/new_player.dm | 5 ++- 9 files changed, 66 insertions(+), 15 deletions(-) diff --git a/code/controllers/subsystem/SSjobs.dm b/code/controllers/subsystem/SSjobs.dm index c452f4c1099..c3df11a2980 100644 --- a/code/controllers/subsystem/SSjobs.dm +++ b/code/controllers/subsystem/SSjobs.dm @@ -82,6 +82,8 @@ SUBSYSTEM_DEF(jobs) return FALSE if(job.barred_by_disability(player.client)) return FALSE + if(job.barred_by_missing_limbs(player.client)) + return FALSE var/position_limit = job.total_positions if(!latejoin) @@ -128,6 +130,9 @@ SUBSYSTEM_DEF(jobs) if(job.barred_by_disability(player.client)) Debug("FOC player has disability rendering them ineligible for job, Player: [player]") continue + if(job.barred_by_missing_limbs(player.client)) + Debug("FOC player has missing limbs rendering them ineligible for job, Player: [player]") + continue if(flag && !(flag in player.client.prefs.be_special)) Debug("FOC flag failed, Player: [player], Flag: [flag], ") continue @@ -170,6 +175,10 @@ SUBSYSTEM_DEF(jobs) Debug("GRJ player has disability rendering them ineligible for job, Player: [player]") continue + if(job.barred_by_missing_limbs(player.client)) + Debug("GRJ player has missing limbs rendering them ineligible for job, Player: [player]") + continue + if(player.mind && (job.title in player.mind.restricted_roles)) Debug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]") continue @@ -347,6 +356,10 @@ SUBSYSTEM_DEF(jobs) Debug("DO player has disability rendering them ineligible for job, Player: [player], Job:[job.title]") continue + if(job.barred_by_missing_limbs(player.client)) + Debug("DO player has missing limbs rendering them ineligible for job, Player: [player], Job:[job.title]") + continue + if(player.mind && (job.title in player.mind.restricted_roles)) Debug("DO incompatible with antagonist role, Player: [player], Job:[job.title]") continue @@ -553,7 +566,7 @@ SUBSYSTEM_DEF(jobs) if(job.get_exp_restrictions(player.client)) young++ continue - if(job.barred_by_disability(player.client)) + if(job.barred_by_disability(player.client) || job.barred_by_missing_limbs(player.client)) disabled++ continue if(player.client.prefs.active_character.GetJobDepartment(job, 1) & job.flag) diff --git a/code/game/jobs/job/engineering_jobs.dm b/code/game/jobs/job/engineering_jobs.dm index cd33c196810..34e92ca9726 100644 --- a/code/game/jobs/job/engineering_jobs.dm +++ b/code/game/jobs/job/engineering_jobs.dm @@ -20,6 +20,8 @@ ACCESS_CE, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT, ACCESS_MINISAT, ACCESS_MINERAL_STOREROOM) minimal_player_age = 21 exp_map = list(EXP_TYPE_ENGINEERING = 1200) + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) + missing_limbs_allowed = FALSE outfit = /datum/outfit/job/chief_engineer important_information = "This role requires you to coordinate a department. You are required to be familiar with Standard Operating Procedure (Engineering), basic job duties, and act professionally (roleplay)." diff --git a/code/game/jobs/job/job.dm b/code/game/jobs/job/job.dm index cd4c5ecf3b5..2b54af96240 100644 --- a/code/game/jobs/job/job.dm +++ b/code/game/jobs/job/job.dm @@ -57,7 +57,11 @@ // Assoc list of EXP_TYPE_ defines and the amount of time needed in those departments var/list/exp_map = list() - var/disabilities_allowed = 1 + /// Cannot pick this job if the character has these disabilities + var/list/blacklisted_disabilities = list() + /// If this job could have any amputated limbs + var/missing_limbs_allowed = TRUE + var/transfer_allowed = TRUE // If false, ID computer will always discourage transfers to this job, even if player is eligible var/hidden_from_job_prefs = FALSE // if true, job preferences screen never shows this job. @@ -114,17 +118,28 @@ return max(0, minimal_player_age - C.player_age) +/// Returns true if the character has a disability the selected job doesn't allow /datum/job/proc/barred_by_disability(client/C) - if(!C) - return 0 - if(disabilities_allowed) - return 0 - var/list/prohibited_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) - for(var/i = 1, i < prohibited_disabilities.len, i++) - var/this_disability = prohibited_disabilities[i] - if(C.prefs.active_character.disabilities & this_disability) - return 1 - return 0 + if(!C || !length(blacklisted_disabilities)) + return FALSE + for(var/disability in blacklisted_disabilities) + if(C.prefs.active_character.disabilities & disability) + return TRUE + return FALSE + +/// Returns true if the character has amputated limbs when their selected job doesn't allow it +/datum/job/proc/barred_by_missing_limbs(client/C) + if(!C || missing_limbs_allowed) + return FALSE + + var/organ_status + var/list/active_character_organs = C.prefs.active_character.organ_data + + for(var/organ_name in active_character_organs) + organ_status = active_character_organs[organ_name] + if(organ_status == "amputated") + return TRUE + return FALSE /datum/job/proc/is_position_available() return (current_positions < total_positions) || (total_positions == -1) diff --git a/code/game/jobs/job/medical_jobs.dm b/code/game/jobs/job/medical_jobs.dm index 83257ee8d54..6c0f384eeea 100644 --- a/code/game/jobs/job/medical_jobs.dm +++ b/code/game/jobs/job/medical_jobs.dm @@ -18,6 +18,7 @@ ACCESS_KEYCARD_AUTH, ACCESS_SEC_DOORS, ACCESS_PSYCHIATRIST, ACCESS_MAINT_TUNNELS, ACCESS_PARAMEDIC, ACCESS_MINERAL_STOREROOM) minimal_player_age = 21 exp_map = list(EXP_TYPE_MEDICAL = 1200) + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) outfit = /datum/outfit/job/cmo important_information = "This role requires you to coordinate a department. You are required to be familiar with Standard Operating Procedure (Medical), basic job duties, and act professionally (roleplay)." diff --git a/code/game/jobs/job/science_jobs.dm b/code/game/jobs/job/science_jobs.dm index 17adfb442ab..0ec12ca261c 100644 --- a/code/game/jobs/job/science_jobs.dm +++ b/code/game/jobs/job/science_jobs.dm @@ -19,6 +19,7 @@ ACCESS_RESEARCH, ACCESS_ROBOTICS, ACCESS_XENOBIOLOGY, ACCESS_AI_UPLOAD, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_TCOMSAT, ACCESS_EXPEDITION, ACCESS_XENOARCH, ACCESS_MINISAT, ACCESS_MAINT_TUNNELS, ACCESS_MINERAL_STOREROOM, ACCESS_NETWORK) minimal_player_age = 21 + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) exp_map = list(EXP_TYPE_SCIENCE = 1200) // All science-y guys get bonuses for maxing out their tech. required_objectives = list( diff --git a/code/game/jobs/job/security_jobs.dm b/code/game/jobs/job/security_jobs.dm index 3fa02496155..0b99f2e9f04 100644 --- a/code/game/jobs/job/security_jobs.dm +++ b/code/game/jobs/job/security_jobs.dm @@ -20,7 +20,8 @@ ACCESS_HEADS, ACCESS_HOS, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_EXPEDITION, ACCESS_WEAPONS) minimal_player_age = 21 exp_map = list(EXP_TYPE_SECURITY = 1200) - disabilities_allowed = 0 + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) + missing_limbs_allowed = FALSE outfit = /datum/outfit/job/hos important_information = "This role requires you to coordinate a department. You are required to be familiar with Standard Operating Procedure (Security), Space Law, basic job duties, and act professionally (roleplay)." @@ -65,6 +66,8 @@ minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_ARMORY, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_WEAPONS) minimal_player_age = 21 exp_map = list(EXP_TYPE_SECURITY = 600) + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) + missing_limbs_allowed = FALSE outfit = /datum/outfit/job/warden /datum/outfit/job/warden @@ -110,6 +113,8 @@ alt_titles = list("Forensic Technician") minimal_player_age = 14 exp_map = list(EXP_TYPE_CREW = 600) + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) + missing_limbs_allowed = FALSE outfit = /datum/outfit/job/detective important_information = "Track, investigate, and look cool while doing it." @@ -166,6 +171,8 @@ minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_WEAPONS) minimal_player_age = 14 exp_map = list(EXP_TYPE_CREW = 600) + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) + missing_limbs_allowed = FALSE outfit = /datum/outfit/job/officer important_information = "Space Law is the law, not a suggestion." diff --git a/code/game/jobs/job/supervisor.dm b/code/game/jobs/job/supervisor.dm index c67c9ab46eb..f340aa09caa 100644 --- a/code/game/jobs/job/supervisor.dm +++ b/code/game/jobs/job/supervisor.dm @@ -14,7 +14,7 @@ minimal_access = list() //See get_access() minimal_player_age = 30 exp_map = list(EXP_TYPE_COMMAND = 1200) - disabilities_allowed = 0 + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) outfit = /datum/outfit/job/captain important_information = "This role requires you to coordinate a department. You are required to be familiar with Standard Operating Procedure (Command), basic job duties, and act professionally (roleplay)." @@ -82,6 +82,7 @@ ACCESS_CREMATORIUM, ACCESS_KITCHEN, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_MAILSORTING, ACCESS_QM, ACCESS_HYDROPONICS, ACCESS_LAWYER, ACCESS_THEATRE, ACCESS_CHAPEL_OFFICE, ACCESS_LIBRARY, ACCESS_RESEARCH, ACCESS_MINING, ACCESS_HEADS_VAULT, ACCESS_MINING_STATION, ACCESS_CLOWN, ACCESS_MIME, ACCESS_HOP, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_EXPEDITION, ACCESS_WEAPONS, ACCESS_MINERAL_STOREROOM) + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) outfit = /datum/outfit/job/hop important_information = "This role requires you to coordinate a department. You are required to be familiar with Standard Operating Procedure (Service), basic job duties, and act professionally (roleplay)." @@ -130,6 +131,7 @@ ACCESS_CREMATORIUM, ACCESS_KITCHEN, ACCESS_CARGO, ACCESS_CARGO_BOT, ACCESS_MAILSORTING, ACCESS_QM, ACCESS_HYDROPONICS, ACCESS_LAWYER, ACCESS_THEATRE, ACCESS_CHAPEL_OFFICE, ACCESS_LIBRARY, ACCESS_RESEARCH, ACCESS_MINING, ACCESS_HEADS_VAULT, ACCESS_MINING_STATION, ACCESS_CLOWN, ACCESS_MIME, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_EXPEDITION, ACCESS_WEAPONS, ACCESS_NTREP) + blacklisted_disabilities = list(DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE) outfit = /datum/outfit/job/nanotrasenrep important_information = "This role requires you to advise the Command team about Standard Operating Procedure, Chain of Command, and report to Central Command about various matters. You are required to act in a manner befitting someone representing Nanotrasen." @@ -173,6 +175,8 @@ ACCESS_CLOWN, ACCESS_MIME, ACCESS_HOP, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_EXPEDITION, ACCESS_WEAPONS, ACCESS_BLUESHIELD) minimal_access = list(ACCESS_SEC_DOORS, ACCESS_MEDICAL, ACCESS_CONSTRUCTION, ACCESS_ENGINE, ACCESS_MAINT_TUNNELS, ACCESS_RESEARCH, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_HEADS, ACCESS_BLUESHIELD, ACCESS_WEAPONS) + blacklisted_disabilities = list(DISABILITY_FLAG_BLIND, DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE, DISABILITY_FLAG_DIZZY) + missing_limbs_allowed = FALSE outfit = /datum/outfit/job/blueshield important_information = "This role requires you to ensure the safety of the Heads of Staff, not the general crew. You may perform arrests only if the combatant is directly threatening a member of Command, the Nanotrasen Representative, or the Magistrate." @@ -218,6 +222,7 @@ ACCESS_THEATRE, ACCESS_CHAPEL_OFFICE, ACCESS_LIBRARY, ACCESS_RESEARCH, ACCESS_MINING, ACCESS_HEADS_VAULT, ACCESS_MINING_STATION, ACCESS_CLOWN, ACCESS_MIME, ACCESS_RC_ANNOUNCE, ACCESS_KEYCARD_AUTH, ACCESS_EXPEDITION, ACCESS_MAGISTRATE) minimal_access = list(ACCESS_SECURITY, ACCESS_SEC_DOORS, ACCESS_BRIG, ACCESS_COURT, ACCESS_MAINT_TUNNELS, ACCESS_LAWYER, ACCESS_MAGISTRATE, ACCESS_HEADS, ACCESS_RC_ANNOUNCE) + blacklisted_disabilities = list(DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE) outfit = /datum/outfit/job/judge important_information = "This role requires you to oversee legal matters and make important decisions about sentencing. You are required to have an extensive knowledge of Space Law and Security SOP and only operate within, not outside, the boundaries of the law." @@ -259,6 +264,7 @@ alt_titles = list("Human Resources Agent") minimal_player_age = 30 exp_map = list(EXP_TYPE_CREW = 600) + blacklisted_disabilities = list(DISABILITY_FLAG_DEAF, DISABILITY_FLAG_MUTE) outfit = /datum/outfit/job/lawyer important_information = "Your job is to deal with affairs regarding Standard Operating Procedure. You are NOT in charge of Space Law affairs, nor can you override it. You are not a prisoner defence lawyer." diff --git a/code/modules/client/preference/character.dm b/code/modules/client/preference/character.dm index 3596fc71c4a..679a8cbbe19 100644 --- a/code/modules/client/preference/character.dm +++ b/code/modules/client/preference/character.dm @@ -2005,6 +2005,9 @@ if(job.barred_by_disability(user.client)) html += "[rank] \[DISABILITY\]" continue + if(job.barred_by_missing_limbs(user.client)) + html += "[rank] \[MISSING LIMBS\]" + continue if(!job.player_old_enough(user.client)) var/available_in_days = job.available_in_days(user.client) html += "[rank] \[IN [(available_in_days)] DAYS]" diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 89c79e8a6a6..3974940769f 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -328,6 +328,9 @@ if(thisjob.barred_by_disability(client)) to_chat(src, alert("[rank] is not available due to your character's disability. Please try another.")) return 0 + if(thisjob.barred_by_missing_limbs(client)) + to_chat(src, alert("[rank] is not available due to your character having amputated limbs without a prosthetic replacement. Please try another.")) + return 0 SSjobs.AssignRole(src, rank, 1) @@ -483,7 +486,7 @@ "Supply" = list(jobs = list(), titles = GLOB.supply_positions, color = "#ead4ae"), ) for(var/datum/job/job in SSjobs.occupations) - if(job && IsJobAvailable(job.title) && !job.barred_by_disability(client)) + if(job && IsJobAvailable(job.title) && !job.barred_by_disability(client) && !job.barred_by_missing_limbs(client)) num_jobs_available++ activePlayers[job] = 0 var/categorized = 0