From 595bb0c8e4ef3ee5aec68ef892357420631b0db6 Mon Sep 17 00:00:00 2001 From: Incoming Date: Fri, 12 Jun 2015 00:43:35 -0400 Subject: [PATCH] Generalizes lizard parts to "features" for future non-lizard fields, at the same time merging mutant color into this list Random lizard bodies will finally have color! Pushes features almost all the way to the DNA side of thing, the mob side is only needed during character creation. Note that changes to the save file will invoke a one time per character runtime for legacy characters as the save file purges mutant_color, this is as far as I can tell harmless, has no effect on the player, and is self correcting. --- code/__HELPERS/mobs.dm | 4 +- code/datums/datacore.dm | 5 +-- code/game/dna.dm | 28 ++++-------- code/game/gamemodes/abduction/gland.dm | 2 +- .../abduction/machinery/experiment.dm | 2 +- .../gamemodes/changeling/powers/absorb.dm | 2 +- .../gamemodes/changeling/powers/tiny_prick.dm | 2 +- .../gamemodes/changeling/powers/transform.dm | 4 +- code/game/machinery/cloning.dm | 4 +- code/game/machinery/computer/cloning.dm | 7 ++- code/game/objects/structures/mirror.dm | 2 +- code/modules/admin/verbs/randomverbs.dm | 2 +- code/modules/client/preferences.dm | 44 +++++++++---------- code/modules/client/preferences_savefile.dm | 28 ++++++------ code/modules/hydroponics/hydroponics.dm | 6 +-- code/modules/hydroponics/seeds.dm | 4 +- .../mob/living/carbon/carbon_defines.dm | 3 ++ code/modules/mob/living/carbon/human/blood.dm | 4 +- .../mob/living/carbon/human/human_defines.dm | 3 -- .../mob/living/carbon/human/species.dm | 28 ++++++------ .../mob/new_player/preferences_setup.dm | 18 ++++---- 21 files changed, 91 insertions(+), 111 deletions(-) diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm index 4adc380f245..01f8d00be82 100644 --- a/code/__HELPERS/mobs.dm +++ b/code/__HELPERS/mobs.dm @@ -36,7 +36,7 @@ if(FEMALE) return pick(socks_f) else return pick(socks_list) -/proc/random_lizard_features() +/proc/random_features() if(!tails_list.len) init_sprite_accessory_subtypes(/datum/sprite_accessory/tails, tails_list) if(!snouts_list.len) @@ -50,7 +50,7 @@ if(!body_markings_list.len) init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings, body_markings_list) - return(list("tail" = pick(tails_list), "snout" = pick(snouts_list), "horns" = pick(horns_list), "frills" = pick(frills_list), "spines" = pick(spines_list), "body_markings" = pick(body_markings_list))) + return(list("mcolor" = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F"), "tail" = pick(tails_list), "snout" = pick(snouts_list), "horns" = pick(horns_list), "frills" = pick(frills_list), "spines" = pick(spines_list), "body_markings" = pick(body_markings_list))) /proc/random_hair_style(gender) switch(gender) diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm index 556bafff59c..ae0df9ac76d 100644 --- a/code/datums/datacore.dm +++ b/code/datums/datacore.dm @@ -260,8 +260,7 @@ var/record_id_num = 1001 L.fields["enzymes"] = H.dna.struc_enzymes L.fields["identity"] = H.dna.uni_identity L.fields["species"] = H.dna.species.type - L.fields["mcolor"] = H.dna.mutant_color - L.fields["lizard_parts"]= H.dna.lizard_parts + L.fields["features"] = H.dna.features L.fields["image"] = image locked += L return @@ -273,7 +272,7 @@ var/record_id_num = 1001 photo = icon("icon" = 'icons/mob/human.dmi', "icon_state" = "[H.skin_tone]_[g]_s") else photo = icon("icon" = 'icons/mob/human.dmi', "icon_state" = "[H.dna.species.id]_[g]_s") - photo.Blend("#[H.dna.mutant_color]", ICON_MULTIPLY) + photo.Blend("#[H.dna.features["mcolor"]]", ICON_MULTIPLY) var/icon/eyes_s if(EYECOLOR in H.dna.species.specflags) diff --git a/code/game/dna.dm b/code/game/dna.dm index 707fcb2f264..bcc55e48d35 100644 --- a/code/game/dna.dm +++ b/code/game/dna.dm @@ -21,8 +21,7 @@ var/uni_identity var/blood_type var/datum/species/species = new /datum/species/human() //The type of mutant race the player is if applicable (i.e. potato-man) - var/mutant_color = "FFF" // What color you are if you have certain speciess - var/list/lizard_parts = list() + 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/list/mutations = list() //All mutations are from now on here var/mob/living/carbon/holder @@ -37,8 +36,7 @@ destination.dna.uni_identity = uni_identity destination.dna.blood_type = blood_type hardset_dna(destination, null, null, null, null, species) - destination.dna.mutant_color = mutant_color - destination.dna.lizard_parts = lizard_parts + destination.dna.features = features destination.dna.real_name = real_name destination.dna.mutations = mutations @@ -48,8 +46,7 @@ new_dna.uni_identity = uni_identity new_dna.blood_type = blood_type new_dna.species = new species.type - new_dna.mutant_color = mutant_color - new_dna.lizard_parts = lizard_parts + new_dna.features = features new_dna.real_name = real_name new_dna.mutations = mutations @@ -134,7 +131,7 @@ spans |= M.get_spans() return spans -/proc/hardset_dna(mob/living/carbon/owner, ui, se, real_name, blood_type, datum/species/mrace, mcolor, lizard_parts) +/proc/hardset_dna(mob/living/carbon/owner, ui, se, real_name, blood_type, datum/species/mrace, features) if(!ismonkey(owner) && !ishuman(owner)) return if(!owner.dna) @@ -146,15 +143,8 @@ owner.reagents.del_reagent(exotic_blood.id) owner.dna.species = new mrace() - if(mcolor) - owner.dna.mutant_color = mcolor - - if(lizard_parts) - owner.dna.lizard_parts = lizard_parts - if(ishuman(owner)) - var/mob/living/carbon/human/H = owner - H.lizard_parts = lizard_parts - + if(features) + owner.dna.features = features if(real_name) owner.real_name = real_name @@ -203,9 +193,7 @@ character.dna.uni_identity = character.dna.generate_uni_identity(character) character.dna.struc_enzymes = character.dna.generate_struc_enzymes(character) character.dna.unique_enzymes = character.dna.generate_unique_enzymes(character) - if(istype(character, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = character - H.dna.lizard_parts = H.lizard_parts + character.dna.features = character.features return character.dna /proc/create_dna(mob/living/carbon/C, datum/species/S) //don't use this unless you're about to use hardset_dna or ready_dna @@ -985,7 +973,7 @@ /datum/dna/proc/is_same_as(var/datum/dna/D) if(uni_identity == D.uni_identity && struc_enzymes == D.struc_enzymes && real_name == D.real_name) - if(species == D.species && mutant_color == D.mutant_color && blood_type == D.blood_type && D.lizard_parts == lizard_parts) + if(species == D.species && features == D.features && blood_type == D.blood_type) return 1 return 0 diff --git a/code/game/gamemodes/abduction/gland.dm b/code/game/gamemodes/abduction/gland.dm index ccb60820159..264d0d3a445 100644 --- a/code/game/gamemodes/abduction/gland.dm +++ b/code/game/gamemodes/abduction/gland.dm @@ -213,7 +213,7 @@ /obj/effect/cocoon/abductor/proc/Copy(var/mob/living/carbon/human/H) var/mob/living/carbon/human/interactive/greytide/clone = new(src) - hardset_dna(clone,H.dna.uni_identity,H.dna.struc_enzymes,H.real_name, H.dna.blood_type, H.dna.species.type, H.dna.mutant_color) + hardset_dna(clone,H.dna.uni_identity,H.dna.struc_enzymes,H.real_name, H.dna.blood_type, H.dna.species.type, H.dna.features) //There's no define for this / get all items ? var/list/slots = list(slot_back,slot_w_uniform,slot_wear_suit,\ diff --git a/code/game/gamemodes/abduction/machinery/experiment.dm b/code/game/gamemodes/abduction/machinery/experiment.dm index 3d79a64b56b..bfa6d9b2a53 100644 --- a/code/game/gamemodes/abduction/machinery/experiment.dm +++ b/code/game/gamemodes/abduction/machinery/experiment.dm @@ -43,7 +43,7 @@ photo = icon("icon" = 'icons/mob/human.dmi', "icon_state" = "[H.skin_tone]_[g]_s") else photo = icon("icon" = 'icons/mob/human.dmi', "icon_state" = "[H.dna.species.id]_[g]_s") - photo.Blend("#[H.dna.mutant_color]", ICON_MULTIPLY) + photo.Blend("#[H.dna.features["mcolor"]]", ICON_MULTIPLY) var/icon/eyes_s if(EYECOLOR in H.dna.species.specflags) diff --git a/code/game/gamemodes/changeling/powers/absorb.dm b/code/game/gamemodes/changeling/powers/absorb.dm index 913b6dd295d..516a407cbef 100644 --- a/code/game/gamemodes/changeling/powers/absorb.dm +++ b/code/game/gamemodes/changeling/powers/absorb.dm @@ -92,7 +92,7 @@ new_dna.struc_enzymes = T.dna.struc_enzymes new_dna.real_name = T.dna.real_name new_dna.species = T.dna.species - new_dna.mutant_color = T.dna.mutant_color + new_dna.features = T.dna.features new_dna.blood_type = T.dna.blood_type absorbedcount++ store_dna(new_dna, user) diff --git a/code/game/gamemodes/changeling/powers/tiny_prick.dm b/code/game/gamemodes/changeling/powers/tiny_prick.dm index 280a6e468f2..bbadbcd6cac 100644 --- a/code/game/gamemodes/changeling/powers/tiny_prick.dm +++ b/code/game/gamemodes/changeling/powers/tiny_prick.dm @@ -91,7 +91,7 @@ var/datum/dna/NewDNA = selected_dna if(ismonkey(target)) user << "We stealthily sting [target.name]." - hardset_dna(target, NewDNA.uni_identity, NewDNA.struc_enzymes, NewDNA.real_name, NewDNA.blood_type, NewDNA.species.type, NewDNA.mutant_color, NewDNA.lizard_parts) + hardset_dna(target, NewDNA.uni_identity, NewDNA.struc_enzymes, NewDNA.real_name, NewDNA.blood_type, NewDNA.species.type, NewDNA.features) updateappearance(target) feedback_add_details("changeling_powers","TS") return 1 diff --git a/code/game/gamemodes/changeling/powers/transform.dm b/code/game/gamemodes/changeling/powers/transform.dm index 9c6dad4d2d8..2f57a81ebb7 100644 --- a/code/game/gamemodes/changeling/powers/transform.dm +++ b/code/game/gamemodes/changeling/powers/transform.dm @@ -17,9 +17,7 @@ user.dna = chosen_dna user.real_name = chosen_dna.real_name - hardset_dna(user, null, null, null, null, chosen_dna.species.type) - user.dna.mutant_color = chosen_dna.mutant_color - user.dna.lizard_parts = chosen_dna.lizard_parts + hardset_dna(user, null, null, null, null, chosen_dna.species.type, chosen_dna.features) updateappearance(user) domutcheck(user) diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm index 69f0b6d36e5..4c94c276c2d 100644 --- a/code/game/machinery/cloning.dm +++ b/code/game/machinery/cloning.dm @@ -122,7 +122,7 @@ //Clonepod //Start growing a human clone in the pod! -/obj/machinery/clonepod/proc/growclone(var/ckey, var/clonename, var/ui, var/se, var/mindref, var/datum/species/mrace, var/mcolor, var/lizard_parts, var/factions) +/obj/machinery/clonepod/proc/growclone(var/ckey, var/clonename, var/ui, var/se, var/mindref, var/datum/species/mrace, var/list/features, var/factions) if(panel_open) return 0 if(mess || attempting) @@ -183,7 +183,7 @@ H.ckey = ckey H << "Consciousness slowly creeps over you as your body regenerates.
So this is what cloning feels like?
" - hardset_dna(H, ui, se, null, null, mrace, mcolor, lizard_parts) + hardset_dna(H, ui, se, null, null, mrace, features) H.faction |= factions H.set_cloned_appearance() diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm index 5c30286ba75..1a45351b770 100644 --- a/code/game/machinery/computer/cloning.dm +++ b/code/game/machinery/computer/cloning.dm @@ -35,7 +35,7 @@ if(!(pod1.occupant || pod1.mess) && (pod1.efficiency > 5)) for(var/datum/data/record/R in records) if(!(pod1.occupant || pod1.mess)) - if(pod1.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["mcolor"], R.fields["lizard_parts"], R.fields["factions"])) + if(pod1.growclone(R.fields["ckey"], R.fields["name"], R.fields["UI"], R.fields["SE"], R.fields["mind"], R.fields["mrace"], R.fields["features"], R.fields["factions"])) records -= R /obj/machinery/computer/cloning/proc/updatemodules() @@ -329,7 +329,7 @@ temp = "Clonepod malfunction." else if(!config.revival_cloning) temp = "Unable to initiate cloning cycle." - else if(pod1.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["mcolor"], C.fields["lizard_parts"], C.fields["factions"])) + else if(pod1.growclone(C.fields["ckey"], C.fields["name"], C.fields["UI"], C.fields["SE"], C.fields["mind"], C.fields["mrace"], C.fields["features"], C.fields["factions"])) temp = "[C.fields["name"]] => Cloning cycle in progress..." records.Remove(C) if(active_record == C) @@ -380,8 +380,7 @@ R.fields["UI"] = subject.dna.uni_identity R.fields["SE"] = subject.dna.struc_enzymes R.fields["blood_type"] = subject.dna.blood_type - R.fields["mcolor"] = subject.dna.mutant_color - R.fields["lizard_parts"] = subject.dna.lizard_parts + R.fields["features"] = subject.dna.features R.fields["factions"] = subject.faction //Add an implant if needed var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject) diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 6eb5f7b9317..90949e773ef 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -150,7 +150,7 @@ var/temp_hsv = RGBtoHSV(new_mutantcolor) if(ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright - H.dna.mutant_color = sanitize_hexcolor(new_mutantcolor) + H.dna.features["mcolor"] = sanitize_hexcolor(new_mutantcolor) else H << "Invalid color. Your color is not bright enough." diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm index 9159d969197..8a455d9e69c 100644 --- a/code/modules/admin/verbs/randomverbs.dm +++ b/code/modules/admin/verbs/randomverbs.dm @@ -298,7 +298,7 @@ Traitors and the like can also be revived with the previous role mostly intact. //DNA if(record_found)//Pull up their name from database records if they did have a mind. - hardset_dna(new_character, record_found.fields["identity"], record_found.fields["enzymes"], record_found.fields["name"], record_found.fields["blood_type"], record_found.fields["species"], record_found.fields["mcolor"], record_found.fields["lizard_parts"]) + hardset_dna(new_character, record_found.fields["identity"], record_found.fields["enzymes"], record_found.fields["name"], record_found.fields["blood_type"], record_found.fields["species"], record_found.fields["features"]) else//If they have no records, we just do a random DNA for them, based on their random appearance/savefile. ready_dna(new_character) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 6a5421efc2b..4728a49daf9 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -61,8 +61,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set var/skin_tone = "caucasian1" //Skin color var/eye_color = "000" //Eye color var/datum/species/pref_species = new /datum/species/human() //Mutant race - var/mutant_color = "FFF" //Mutant race skin color - var/list/lizard_parts = list("tail" = "Smooth", "snout" = "Round", "horns" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None") + var/list/features = list("mcolor" = "FFF", "tail" = "Smooth", "snout" = "Round", "horns" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None") var/list/custom_names = list("clown", "mime", "ai", "cyborg", "religion", "deity") @@ -245,7 +244,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "

Alien Color

" - dat += "    Change
" + dat += "    Change
" dat += "" @@ -254,7 +253,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "

Tail

" - dat += "[lizard_parts["tail"]]
" + dat += "[features["tail"]]
" dat += "" @@ -263,7 +262,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "

Snout

" - dat += "[lizard_parts["snout"]]
" + dat += "[features["snout"]]
" dat += "" @@ -272,7 +271,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "

Horns

" - dat += "[lizard_parts["horns"]]
" + dat += "[features["horns"]]
" dat += "" @@ -281,7 +280,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "

Frills

" - dat += "[lizard_parts["frills"]]
" + dat += "[features["frills"]]
" dat += "" @@ -290,7 +289,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "

Spines

" - dat += "[lizard_parts["spines"]]
" + dat += "[features["spines"]]
" dat += "" @@ -299,7 +298,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set dat += "

Body Markings

" - dat += "[lizard_parts["body_markings"]]
" + dat += "[features["body_markings"]]
" dat += "" @@ -792,54 +791,54 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set if(result) var/newtype = roundstart_species[result] pref_species = new newtype() - if(mutant_color == "#000") - mutant_color = pref_species.default_color + if(features["mcolor"] == "#000") + features["mcolor"] = pref_species.default_color if("mutant_color") var/new_mutantcolor = input(user, "Choose your character's alien skin color:", "Character Preference") as color|null if(new_mutantcolor) var/temp_hsv = RGBtoHSV(new_mutantcolor) if(new_mutantcolor == "#000000") - mutant_color = pref_species.default_color + features["mcolor"] = pref_species.default_color else if(ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright - mutant_color = sanitize_hexcolor(new_mutantcolor) + features["mcolor"] = sanitize_hexcolor(new_mutantcolor) else user << "Invalid color. Your color is not bright enough." if("tail") var/new_tail new_tail = input(user, "Choose your character's tail:", "Character Preference") as null|anything in tails_list if(new_tail) - lizard_parts["tail"] = new_tail + features["tail"] = new_tail if("snout") var/new_snout new_snout = input(user, "Choose your character's snout:", "Character Preference") as null|anything in snouts_list if(new_snout) - lizard_parts["snout"] = new_snout + features["snout"] = new_snout if("horns") var/new_horns new_horns = input(user, "Choose your character's horns:", "Character Preference") as null|anything in horns_list if(new_horns) - lizard_parts["horns"] = new_horns + features["horns"] = new_horns if("frills") var/new_frills new_frills = input(user, "Choose your character's frills:", "Character Preference") as null|anything in frills_list if(new_frills) - lizard_parts["frills"] = new_frills + features["frills"] = new_frills if("spines") var/new_spines new_spines = input(user, "Choose your character's spines:", "Character Preference") as null|anything in spines_list if(new_spines) - lizard_parts["spines"] = new_spines + features["spines"] = new_spines if("body_markings") var/new_body_markings new_body_markings = input(user, "Choose your character's body markings:", "Character Preference") as null|anything in body_markings_list if(new_body_markings) - lizard_parts["body_markings"] = new_body_markings + features["body_markings"] = new_body_markings if("s_tone") var/new_s_tone = input(user, "Choose your character's skin-tone:", "Character Preference") as null|anything in skin_tones @@ -1010,10 +1009,9 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set if(character.dna) character.dna.real_name = character.real_name if(pref_species != /datum/species/human && config.mutant_races) - hardset_dna(character, null, null, null, null, pref_species.type) + hardset_dna(character, null, null, null, null, pref_species.type, features) else - hardset_dna(character, null, null, null, null, /datum/species/human) - character.dna.mutant_color = mutant_color + hardset_dna(character, null, null, null, null, /datum/species/human, features) character.update_mutcolor() character.gender = gender @@ -1031,7 +1029,7 @@ var/global/list/special_roles = list( //keep synced with the defines BE_* in set character.undershirt = undershirt character.socks = socks - character.lizard_parts = lizard_parts + character.features = features if(backbag > 3 || backbag < 1) backbag = 1 //Same as above diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 2c675713c3e..e4b0d1c0781 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -166,8 +166,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car else pref_species = new /datum/species/human() - if(!S["mutant_color"] || S["mutant_color"] == "#000") - S["mutant_color"] << "#FFF" + if(!S["features["mcolor"]"] || S["features["mcolor"]"] == "#000") + S["features["mcolor"]"] << "#FFF" //Character S["OOC_Notes"] >> metadata @@ -186,8 +186,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["undershirt"] >> undershirt S["socks"] >> socks S["backbag"] >> backbag - S["mutant_color"] >> mutant_color - S["lizard_parts"] >> lizard_parts + S["features"] >> features S["clown_name"] >> custom_names["clown"] S["mime_name"] >> custom_names["mime"] S["ai_name"] >> custom_names["ai"] @@ -214,8 +213,8 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car //Sanitize metadata = sanitize_text(metadata, initial(metadata)) real_name = reject_bad_name(real_name) - if(!mutant_color || mutant_color == "#000") - mutant_color = "#FFF" + if(!features["mcolor"] || features["mcolor"] == "#000") + features["mcolor"] = "#FFF" if(!real_name) real_name = random_name(gender) 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)) @@ -239,13 +238,13 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car eye_color = sanitize_hexcolor(eye_color, 3, 0) skin_tone = sanitize_inlist(skin_tone, skin_tones) backbag = sanitize_integer(backbag, 1, backbaglist.len, initial(backbag)) - mutant_color = sanitize_hexcolor(mutant_color, 3, 0) - lizard_parts["tail"] = sanitize_inlist(lizard_parts["tail"], tails_list) - lizard_parts["snout"] = sanitize_inlist(lizard_parts["snout"], snouts_list) - lizard_parts["horns"] = sanitize_inlist(lizard_parts["horns"], horns_list) - lizard_parts["frills"] = sanitize_inlist(lizard_parts["frills"], frills_list) - lizard_parts["spines"] = sanitize_inlist(lizard_parts["spines"], spines_list) - lizard_parts["body_markings"] = sanitize_inlist(lizard_parts["body_markings"], body_markings_list) + features["mcolor"] = sanitize_hexcolor(features["mcolor"], 3, 0) + features["tail"] = sanitize_inlist(features["tail"], tails_list) + features["snout"] = sanitize_inlist(features["snout"], snouts_list) + features["horns"] = sanitize_inlist(features["horns"], horns_list) + features["frills"] = sanitize_inlist(features["frills"], frills_list) + features["spines"] = sanitize_inlist(features["spines"], spines_list) + features["body_markings"] = sanitize_inlist(features["body_markings"], body_markings_list) userandomjob = sanitize_integer(userandomjob, 0, 1, initial(userandomjob)) job_civilian_high = sanitize_integer(job_civilian_high, 0, 65535, initial(job_civilian_high)) @@ -286,8 +285,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car S["socks"] << socks S["backbag"] << backbag S["species"] << pref_species.name - S["mutant_color"] << mutant_color - S["lizard_parts"] << lizard_parts + S["features"] << features S["clown_name"] << custom_names["clown"] S["mime_name"] << custom_names["mime"] S["ai_name"] << custom_names["ai"] diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 78a92dc1481..a0eb0bb53a9 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -848,9 +848,9 @@ podman.ckey = ckey_holder podman.gender = blood_gender podman.faction |= factions - if(!mutant_color) - mutant_color = "#59CE00" - hardset_dna(podman,null,null,podman.real_name,blood_type,/datum/species/plant/pod,mutant_color)//Discard SE's and UI's, podman cloning is inaccurate, and always make them a podman + if(!features["mcolor"]) + features["mcolor"] = "#59CE00" + hardset_dna(podman,null,null,podman.real_name,blood_type,/datum/species/plant/pod,features)//Discard SE's and UI's, podman cloning is inaccurate, and always make them a podman podman.set_cloned_appearance() else //else, one packet of seeds. maybe two diff --git a/code/modules/hydroponics/seeds.dm b/code/modules/hydroponics/seeds.dm index 05369322619..17f0e3a7eff 100644 --- a/code/modules/hydroponics/seeds.dm +++ b/code/modules/hydroponics/seeds.dm @@ -90,7 +90,7 @@ var/datum/mind/mind = null var/blood_gender = null var/blood_type = null - var/mutant_color = null + var/list/features = null var/factions = null var/contains_sample = 0 @@ -104,7 +104,7 @@ realName = bloodSample.data["real_name"] blood_gender = bloodSample.data["gender"] blood_type = bloodSample.data["blood_type"] - mutant_color = bloodSample.data["mutant_color"] + features = bloodSample.data["features"] factions = bloodSample.data["factions"] W.reagents.clear_reagents() user << "You inject the contents of the syringe into the seeds." diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm index 41a04d1273f..37dc0b19792 100644 --- a/code/modules/mob/living/carbon/carbon_defines.dm +++ b/code/modules/mob/living/carbon/carbon_defines.dm @@ -9,6 +9,9 @@ var/obj/item/handcuffed = null //Whether or not the mob is handcuffed var/obj/item/legcuffed = null //Same as handcuffs but for legs. Bear traps use this. + var/list/features = list("mcolor" = "FFF", "tail" = "Smooth", "snout" = "Round", "horns" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None") + + //inventory slots var/obj/item/back = null var/obj/item/clothing/mask/wear_mask = null diff --git a/code/modules/mob/living/carbon/human/blood.dm b/code/modules/mob/living/carbon/human/blood.dm index e8b46b5ca51..289fb8e5ee8 100644 --- a/code/modules/mob/living/carbon/human/blood.dm +++ b/code/modules/mob/living/carbon/human/blood.dm @@ -30,7 +30,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 /mob/living/carbon/human/proc/fixblood() for(var/datum/reagent/blood/B in vessel.reagent_list) if(B.id == "blood") - B.data = list("donor"=src,"viruses"=null,"blood_DNA"=dna.unique_enzymes,"blood_type"=dna.blood_type,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"mutant_color"=null, "factions"=null) + B.data = list("donor"=src,"viruses"=null,"blood_DNA"=dna.unique_enzymes,"blood_type"=dna.blood_type,"resistances"=null,"trace_chem"=null,"mind"=null,"ckey"=null,"gender"=null,"real_name"=null,"cloneable"=null,"features"=null, "factions"=null) /mob/living/carbon/human/proc/suppress_bloodloss(var/amount) if(bleedsuppress) @@ -172,7 +172,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122 B.data["blood_type"] = copytext(src.dna.blood_type,1,0) B.data["gender"] = src.gender B.data["real_name"] = src.real_name - B.data["mutant_color"] = src.dna.mutant_color + B.data["features"] = src.dna.features B.data["factions"] = src.faction return B diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm index e63c0832a7c..9b373ba72f4 100644 --- a/code/modules/mob/living/carbon/human/human_defines.dm +++ b/code/modules/mob/living/carbon/human/human_defines.dm @@ -25,9 +25,6 @@ var/socks = "Nude" //Which socks the player wants var/backbag = 2 //Which backpack type the player has chosen. Nothing, Satchel or Backpack. - //Mutant Parts - var/list/lizard_parts = list("tail" = "Smooth", "snout" = "Round", "horns" = "None", "frills" = "None", "spines" = "None", "body_markings" = "None") - //Equipment slots var/obj/item/wear_suit = null var/obj/item/w_uniform = null diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index bf239e68541..e6722b607f2 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -113,7 +113,7 @@ spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = icon_state_string, "layer" = -SPECIES_LAYER) - spec_base.color = "#[H.dna.mutant_color]" + spec_base.color = "#[H.dna.features["mcolor"]]" standing = spec_base if(standing) @@ -136,7 +136,7 @@ if(hair_color) if(hair_color == "mutcolor") - img_facial_s.color = "#" + H.dna.mutant_color + img_facial_s.color = "#" + H.dna.features["mcolor"] else img_facial_s.color = "#" + hair_color else @@ -164,7 +164,7 @@ if(hair_color) if(hair_color == "mutcolor") - img_hair_s.color = "#" + H.dna.mutant_color + img_hair_s.color = "#" + H.dna.features["mcolor"] else img_hair_s.color = "#" + hair_color else @@ -241,7 +241,7 @@ bodyparts_to_add -= "tail" if("spines" in mutant_bodyparts) - if(!H.lizard_parts["spines"] || H.lizard_parts["spines"] == "None" || H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT)) + if(!H.dna.features["spines"] || H.dna.features["spines"] == "None" || H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT)) bodyparts_to_add -= "spines" if("snout" in mutant_bodyparts) //Take a closer look at that snout! @@ -249,11 +249,11 @@ bodyparts_to_add -= "snout" if("frills" in mutant_bodyparts) - if(!H.lizard_parts["frills"] || H.lizard_parts["frills"] == "None" || H.head && (H.head.flags_inv & HIDEEARS)) + if(!H.dna.features["frills"] || H.dna.features["frills"] == "None" || H.head && (H.head.flags_inv & HIDEEARS)) bodyparts_to_add -= "frills" if("horns" in mutant_bodyparts) - if(!H.lizard_parts["horns"] || H.lizard_parts["horns"] == "None" || H.head && (H.head.flags & BLOCKHAIR) || (H.wear_mask && (H.wear_mask.flags & BLOCKHAIR))) + if(!H.dna.features["horns"] || H.dna.features["horns"] == "None" || H.head && (H.head.flags & BLOCKHAIR) || (H.wear_mask && (H.wear_mask.flags & BLOCKHAIR))) bodyparts_to_add -= "horns" if(!bodyparts_to_add) @@ -268,19 +268,19 @@ var/datum/sprite_accessory/S switch(bodypart) if("tail") - S = tails_list[H.lizard_parts["tail"]] + S = tails_list[H.dna.features["tail"]] if("spines") - S = spines_list[H.lizard_parts["spines"]] + S = spines_list[H.dna.features["spines"]] if("snout") - S = snouts_list[H.lizard_parts["snout"]] + S = snouts_list[H.dna.features["snout"]] if("frills") - S = frills_list[H.lizard_parts["frills"]] + S = frills_list[H.dna.features["frills"]] if("horns") - S = horns_list[H.lizard_parts["horns"]] + S = horns_list[H.dna.features["horns"]] if("body_markings") - S = body_markings_list[H.lizard_parts["body_markings"]] + S = body_markings_list[H.dna.features["body_markings"]] - if(S.icon_state == "none") + if(!S || S.icon_state == "none") continue var/icon_string if(S.gender_specific) @@ -291,7 +291,7 @@ I = image("icon" = 'icons/mob/mutant_bodyparts.dmi', "icon_state" = icon_string, "layer" =- layer) if(!(H.disabilities & HUSK)) - I.color = "#[H.dna.mutant_color]" + I.color = "#[H.dna.features["mcolor"]]" standing += I H.overlays_standing[layer] = standing.Copy() standing = list() diff --git a/code/modules/mob/new_player/preferences_setup.dm b/code/modules/mob/new_player/preferences_setup.dm index 35ae61dc9ff..68d6f57c709 100644 --- a/code/modules/mob/new_player/preferences_setup.dm +++ b/code/modules/mob/new_player/preferences_setup.dm @@ -17,7 +17,7 @@ if(!pref_species) pref_species = new /datum/species/human() backbag = 2 - lizard_parts = random_lizard_features() + features = random_features() age = rand(AGE_MIN,AGE_MAX) /datum/preferences/proc/update_preview_icon() //seriously. This is horrendous. @@ -47,7 +47,7 @@ preview_icon = new /icon('icons/mob/human.dmi', "[skin_tone]_[g]_s") else preview_icon = new /icon('icons/mob/human.dmi', "[pref_species.id]_[g]_s") - preview_icon.Blend("#[mutant_color]", ICON_MULTIPLY) + preview_icon.Blend("#[features["mcolor"]]", ICON_MULTIPLY) var/datum/sprite_accessory/S var/icon/eyes_s = new/icon() @@ -79,17 +79,17 @@ for(var/bodypart in pref_species.mutant_bodyparts) switch(bodypart) if("tail") - S = tails_list[lizard_parts["tail"]] + S = tails_list[features["tail"]] if("spines") - S = spines_list[lizard_parts["spines"]] + S = spines_list[features["spines"]] if("snout") - S = snouts_list[lizard_parts["snout"]] + S = snouts_list[features["snout"]] if("frills") - S = frills_list[lizard_parts["frills"]] + S = frills_list[features["frills"]] if("horns") - S = horns_list[lizard_parts["horns"]] + S = horns_list[features["horns"]] if("body_markings") - S = body_markings_list[lizard_parts["body_markings"]] + S = body_markings_list[features["body_markings"]] if(S.icon_state == "none") continue @@ -100,7 +100,7 @@ icon_string = "[pref_species.id]_m_[bodypart]_[S.icon_state]_[layer]" var/icon/part = new/icon("icon" = 'icons/mob/mutant_bodyparts.dmi', "icon_state" = icon_string) - part.Blend("#[mutant_color]", ICON_MULTIPLY) + part.Blend("#[features["mcolor"]]", ICON_MULTIPLY) preview_icon.Blend(part, ICON_OVERLAY) if(underwear)