From a0cb8660e7b436a49b1a5db8f9dc1976ad193911 Mon Sep 17 00:00:00 2001 From: KorPhaeron Date: Thu, 26 Oct 2017 14:39:38 -0500 Subject: [PATCH] Changes to protect human authority --- code/__HELPERS/unsorted.dm | 4 +++- code/controllers/subsystem/job.dm | 12 ------------ code/modules/client/preferences.dm | 17 ++++++++++------- code/modules/client/preferences_savefile.dm | 2 ++ code/modules/jobs/job_types/job.dm | 9 ++++++--- code/modules/mob/dead/new_player/new_player.dm | 2 -- config/game_options.txt | 4 ---- 7 files changed, 21 insertions(+), 29 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 4a9588a6859..6e6dab8ff05 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -200,6 +200,8 @@ Turf and target are separate in case you want to teleport some distance from a t newname = C.prefs.custom_names[role] else switch(role) + if("human") + newname = random_unique_name(gender) if("clown") newname = pick(GLOB.clown_names) if("mime") @@ -514,7 +516,7 @@ Turf and target are separate in case you want to teleport some distance from a t processing_list.Cut(1, 2) //Byond does not allow things to be in multiple contents, or double parent-child hierarchies, so only += is needed //This is also why we don't need to check against assembled as we go along - processing_list += A.contents + processing_list += A.contents assembled += A return assembled diff --git a/code/controllers/subsystem/job.dm b/code/controllers/subsystem/job.dm index 74221def4b4..6250f688b78 100644 --- a/code/controllers/subsystem/job.dm +++ b/code/controllers/subsystem/job.dm @@ -107,9 +107,6 @@ SUBSYSTEM_DEF(job) if(player.mind && job.title in player.mind.restricted_roles) Debug("FOC incompatible with antagonist role, Player: [player]") continue - if(CONFIG_GET(flag/enforce_human_authority) && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features)) - Debug("FOC non-human failed, Player: [player]") - continue if(player.client.prefs.GetJobDepartment(job, level) & job.flag) Debug("FOC pass, Player: [player], Level:[level]") candidates += player @@ -144,11 +141,6 @@ SUBSYSTEM_DEF(job) Debug("GRJ incompatible with antagonist role, Player: [player], Job: [job.title]") continue - if(CONFIG_GET(flag/enforce_human_authority) && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features)) - Debug("GRJ non-human failed, Player: [player]") - continue - - if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1) Debug("GRJ Random job given, Player: [player], Job: [job]") if(AssignRole(player, job.title)) @@ -319,10 +311,6 @@ SUBSYSTEM_DEF(job) Debug("DO incompatible with antagonist role, Player: [player], Job:[job.title]") continue - if(CONFIG_GET(flag/enforce_human_authority) && !player.client.prefs.pref_species.qualifies_for_rank(job.title, player.client.prefs.features)) - Debug("DO non-human failed, Player: [player], Job:[job.title]") - continue - // If the player wants that job on this level, then try give it to him. if(player.client.prefs.GetJobDepartment(job, level) & job.flag) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index a0fe3f288ef..0bb8b6f28a0 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -69,7 +69,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/datum/species/pref_species = new /datum/species/human() //Mutant race var/list/features = list("mcolor" = "FFF", "tail_lizard" = "Smooth", "tail_human" = "None", "snout" = "Round", "horns" = "None", "ears" = "None", "wings" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None", "legs" = "Normal Legs") - var/list/custom_names = list("clown", "mime", "ai", "cyborg", "religion", "deity") + var/list/custom_names = list("human", "clown", "mime", "ai", "cyborg", "religion", "deity") var/prefered_security_department = SEC_DEPT_RANDOM //Mob preview @@ -112,6 +112,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) /datum/preferences/New(client/C) parent = C + custom_names["human"] = random_unique_name() custom_names["ai"] = pick(GLOB.ai_names) custom_names["cyborg"] = pick(GLOB.ai_names) custom_names["clown"] = pick(GLOB.clown_names) @@ -185,6 +186,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Age: [age]
" dat += "Special Names:
" + dat += "Backup Human Name: [custom_names["human"]] " dat += "Clown: [custom_names["clown"]] " dat += "Mime:[custom_names["mime"]]
" dat += "AI: [custom_names["ai"]] " @@ -548,12 +550,6 @@ GLOBAL_LIST_EMPTY(preferences_datums) if((job_civilian_low & ASSISTANT) && (rank != "Assistant") && !jobban_isbanned(user, "Assistant")) HTML += "[rank]" continue - if(CONFIG_GET(flag/enforce_human_authority) && !user.client.prefs.pref_species.qualifies_for_rank(rank, user.client.prefs.features)) - if(user.client.prefs.pref_species.id == "human") - HTML += "[rank] \[MUTANT\]" - else - HTML += "[rank] \[NON-HUMAN\]" - continue if((rank in GLOB.command_positions) || (rank == "AI"))//Bold head jobs HTML += "[rank]" else @@ -1066,6 +1062,13 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(new_loc) uplink_spawn_loc = new_loc + if("human_name") + var/new_human_name = reject_bad_name( input(user, "Choose your character's backup human name, used in the event you are assigned a command role as another species:", "Character Preference") as text|null ) + if(new_human_name) + custom_names["human"] = new_human_name + else + to_chat(user, "Invalid name. Your name should be at least 2 and at most [MAX_NAME_LEN] characters long. It may only contain the characters A-Z, a-z, -, ' and .") + if("clown_name") var/new_clown_name = reject_bad_name( input(user, "Choose your character's clown name:", "Character Preference") as text|null ) if(new_clown_name) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 80edb8bcd02..1317228c1a4 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -291,6 +291,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car else S["feature_human_tail"] >> features["tail_human"] S["feature_human_ears"] >> features["ears"] + S["human_name"] >> custom_names["human"] S["clown_name"] >> custom_names["clown"] S["mime_name"] >> custom_names["mime"] S["ai_name"] >> custom_names["ai"] @@ -406,6 +407,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car WRITE_FILE(S["feature_lizard_spines"] , features["spines"]) WRITE_FILE(S["feature_lizard_body_markings"] , features["body_markings"]) WRITE_FILE(S["feature_lizard_legs"] , features["legs"]) + WRITE_FILE(S["human_name"] , custom_names["human"]) WRITE_FILE(S["clown_name"] , custom_names["clown"]) WRITE_FILE(S["mime_name"] , custom_names["mime"]) WRITE_FILE(S["ai_name"] , custom_names["ai"]) diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index e403541bc2b..a5367459884 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -72,12 +72,15 @@ H.dna.species.after_equip_job(src, H, visualsOnly) + if(CONFIG_GET(flag/enforce_human_authority) && (title in GLOB.command_positions)) + if(H.dna.species.id != "human") + H.set_species(/datum/species/human) + H.rename_self("human", H.client) + H.remove_catshit() + if(!visualsOnly && announce) announce(H) - if(CONFIG_GET(flag/enforce_human_authority) && (title in GLOB.command_positions)) - H.remove_catshit() - /datum/job/proc/get_access() if(!config) //Needed for robots. return src.minimal_access.Copy() diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm index feadd932c5b..a01e862cd4b 100644 --- a/code/modules/mob/dead/new_player/new_player.dm +++ b/code/modules/mob/dead/new_player/new_player.dm @@ -317,8 +317,6 @@ return 0 if(job.required_playtime_remaining(client)) return 0 - if(CONFIG_GET(flag/enforce_human_authority) && !client.prefs.pref_species.qualifies_for_rank(rank, client.prefs.features)) - return 0 return 1 diff --git a/config/game_options.txt b/config/game_options.txt index 2fed53c3980..f610495632e 100644 --- a/config/game_options.txt +++ b/config/game_options.txt @@ -383,10 +383,6 @@ LAW_WEIGHT buildawall,0 ## Attempting to upload laws past this point will fail unless the AI is reset SILICON_MAX_LAW_AMOUNT 12 -## Uncomment to give players the choice of their species before they join the game -JOIN_WITH_MUTANT_RACE - - ## Roundstart Races ##------------------------------------------------------------------------------------------- ## Uncommenting races will allow them to be choosen at roundstart while join_with_muntant_race is on. You'll need at least one.