From 781a15c81e0c13277e5ae0d9aa985d831a7a941b Mon Sep 17 00:00:00 2001 From: deathride58 Date: Thu, 21 Feb 2019 06:19:43 -0500 Subject: [PATCH] adds the ability to mark your character as nameless --- code/datums/dna.dm | 5 ++++- code/modules/client/preferences.dm | 10 ++++++++-- code/modules/client/preferences_savefile.dm | 3 +++ code/modules/jobs/job_types/job.dm | 6 ++++++ code/modules/mob/living/carbon/human/human_defines.dm | 2 ++ code/modules/mob/living/carbon/human/human_helpers.dm | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) diff --git a/code/datums/dna.dm b/code/datums/dna.dm index ed18b3cade..b3f3f7efa1 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -8,6 +8,7 @@ var/datum/species/species = new /datum/species/human //The type of mutant race the player is if applicable (i.e. potato-man) var/list/features = list("FFF") //first value is mutant color var/real_name //Stores the real name of the person who originally got this dna datum. Used primarely for changelings, + var/nameless = FALSE var/list/mutations = list() //All mutations are from now on here var/list/temporary_mutations = list() //Timers for temporary mutations var/list/previous = list() //For temporary name/ui/ue/blood_type modifications @@ -43,6 +44,7 @@ destination.set_species(species.type, icon_update=0) destination.dna.features = features.Copy() destination.dna.real_name = real_name + destination.dna.nameless = nameless destination.dna.temporary_mutations = temporary_mutations.Copy() if(ishuman(destination)) var/mob/living/carbon/human/H = destination @@ -59,6 +61,7 @@ new_dna.features = features.Copy() new_dna.species = new species.type new_dna.real_name = real_name + new_dna.nameless = nameless new_dna.mutations = mutations.Copy() /datum/dna/proc/add_mutation(mutation_name) @@ -199,7 +202,7 @@ /datum/dna/proc/is_same_as(datum/dna/D) - if(uni_identity == D.uni_identity && struc_enzymes == D.struc_enzymes && real_name == D.real_name) + if(uni_identity == D.uni_identity && struc_enzymes == D.struc_enzymes && real_name == D.real_name && nameless == D.nameless) if(species.type == D.species.type && features == D.features && blood_type == D.blood_type) return 1 return 0 diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 53a8d84af2..a11c1497c2 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -58,6 +58,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) //character preferences var/real_name //our character's name + var/nameless = FALSE //whether or not our character is nameless var/be_random_name = 0 //whether we'll have a random name every round var/be_random_body = 0 //whether we'll have a random body every round var/gender = MALE //gender of character (well duh) @@ -213,8 +214,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "Random Name " dat += "Always Random Name: [be_random_name ? "Yes" : "No"]
" - dat += "Name: " + dat += "[nameless ? "Default designation" : "Name"]: " dat += "[real_name]
" + dat += "Be nameless: [nameless ? "Yes" : "No"]
" dat += "Gender: [gender == MALE ? "Male" : (gender == FEMALE ? "Female" : (gender == PLURAL ? "Non-binary" : "Object"))]
" dat += "Age: [age]
" @@ -1841,6 +1843,8 @@ GLOBAL_LIST_EMPTY(preferences_datums) damagescreenshake = 0 else damagescreenshake = 1 + if("nameless") + nameless = !nameless //END CITADEL EDIT if("publicity") if(unlock_content) @@ -2021,8 +2025,9 @@ GLOBAL_LIST_EMPTY(preferences_datums) else if(firstspace == name_length) real_name += "[pick(GLOB.last_names)]" - character.real_name = real_name + character.real_name = nameless ? "[real_name] #[rand(10000, 99999)]" : real_name character.name = character.real_name + character.nameless = nameless character.gender = gender character.age = age @@ -2056,6 +2061,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.set_species(chosen_species, icon_update = FALSE, pref_load = TRUE) character.dna.features = features.Copy() character.dna.real_name = character.real_name + character.dna.nameless = character.nameless if("tail_lizard" in pref_species.default_features) character.dna.species.mutant_bodyparts |= "tail_lizard" diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index dbf782c5fe..fdcc01f7c8 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -235,6 +235,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //Character S["real_name"] >> real_name + S["nameless"] >> nameless S["name_is_always_random"] >> be_random_name S["body_is_always_random"] >> be_random_body S["gender"] >> gender @@ -362,6 +363,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(!features["mcolor"] || features["mcolor"] == "#000") features["mcolor"] = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F") + nameless = sanitize_integer(nameless, 0, 1, initial(nameless)) be_random_name = sanitize_integer(be_random_name, 0, 1, initial(be_random_name)) be_random_body = sanitize_integer(be_random_body, 0, 1, initial(be_random_body)) @@ -427,6 +429,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //Character WRITE_FILE(S["real_name"] , real_name) + WRITE_FILE(S["nameless"] , nameless) WRITE_FILE(S["name_is_always_random"] , be_random_name) WRITE_FILE(S["body_is_always_random"] , be_random_body) WRITE_FILE(S["gender"] , gender) diff --git a/code/modules/jobs/job_types/job.dm b/code/modules/jobs/job_types/job.dm index 0e1daff5e0..e441b3e889 100644 --- a/code/modules/jobs/job_types/job.dm +++ b/code/modules/jobs/job_types/job.dm @@ -193,6 +193,12 @@ if(!J) J = SSjob.GetJob(H.job) + if(H.nameless && J.dresscodecompliant) + if(J.title in GLOB.command_positions) + H.real_name = J.title + else + H.real_name = "[J.title] #[rand(10000, 99999)]" + var/obj/item/card/id/C = H.wear_id if(istype(C)) C.access = J.get_access() diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index 99615e9543..4f168d97fc 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -45,6 +45,8 @@ var/name_override //For temporary visible name changes + var/nameless = FALSE //For drones of both the insectoid and robotic kind. And other types of nameless critters. + var/datum/personal_crafting/handcrafting var/datum/physiology/physiology diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 6050c3e278..dd37563f8f 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -56,7 +56,7 @@ if( head && (head.flags_inv&HIDEFACE) ) return if_no_face //Likewise for hats var/obj/item/bodypart/O = get_bodypart(BODY_ZONE_HEAD) - if( !O || (has_trait(TRAIT_DISFIGURED)) || (O.brutestate+O.burnstate)>2 || cloneloss>50 || !real_name ) //disfigured. use id-name if possible + if( !O || (has_trait(TRAIT_DISFIGURED)) || (O.brutestate+O.burnstate)>2 || cloneloss>50 || !real_name || nameless) //disfigured. use id-name if possible return if_no_face return real_name