From 52977003405546251bb33403eabb1e46e10c3406 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 5 Aug 2020 14:11:40 +0100 Subject: [PATCH 01/11] snowflake coders are bad --- code/_globalvars/lists/flavor_misc.dm | 8 +- code/modules/client/preferences.dm | 322 ++------------------------ 2 files changed, 23 insertions(+), 307 deletions(-) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index a25381f266..6afa8ef0ce 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -231,4 +231,10 @@ GLOBAL_LIST_INIT(speech_verbs, list("default","says","gibbers", "states", "chitt GLOBAL_LIST_INIT(roundstart_tongues, list("default","human tongue" = /obj/item/organ/tongue, "lizard tongue" = /obj/item/organ/tongue/lizard, "skeleton tongue" = /obj/item/organ/tongue/bone, "fly tongue" = /obj/item/organ/tongue/fly, "ipc tongue" = /obj/item/organ/tongue/robot/ipc)) - +//locked parts are those that your picked species requires to have +//unlocked parts are those that anyone can choose on customisation regardless +//parts not in unlocked, but in all, are thus locked +GLOBAL_LIST_INIT(all_mutant_parts, list("tail_lizard" = "Tail", "mam_tail" = "Tail", "tail_human" = "Tail", "snout" = "Snout", "frills" = "Frills", "spines" = "Spines", "body_markings" = "Body Markings", "mam_body_markings" = "Species Markings" , "mam_ears" = "Ears", "ears" = "Ears", "mam_snouts" = "Snout", "legs" = "Legs", "deco_wings" = "Decorative Wings", "insect_wings" = "Insect Wings", "insect_fluff" = "Insect Fluff", "taur" = "Tauric Body", "insect_markings" = "Insect Markings", "wings" = "Wings", "xenohead" = "Caste Head", "xenotail" = "Tail", "xenodorsal" = "Dorsal Spines", "ipc_screen" = "Screen", "ipc_antenna" = "Antenna", "meat_type" = "Meat Type")) +GLOBAL_LIST_INIT(unlocked_mutant_parts, list("meat_type", "horns")) +//parts in either of the above two lists that require a second option that allows them to be coloured +GLOBAL_LIST_INIT(colored_mutant_parts, list("insect_wings" = "wings_color", "deco_wings" = "wings_color", "horns" = "horns_color")) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 9355f83827..291e4eac0e 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -507,310 +507,20 @@ GLOBAL_LIST_EMPTY(preferences_datums) dat += "" mutant_category = 0 - if(pref_species.mutant_bodyparts["tail_lizard"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Tail

" - - dat += "[features["tail_lizard"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - - if(pref_species.mutant_bodyparts["mam_tail"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Tail

" - - dat += "[features["mam_tail"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["tail_human"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Tail

" - - dat += "[features["tail_human"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - - if(pref_species.mutant_bodyparts["meat_type"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Meat Type

" - - dat += "[features["meat_type"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["snout"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Snout

" - - dat += "[features["snout"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["horns"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Horns

" - - dat += "[features["horns"]]" - dat += "    Change
" - - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - if(pref_species.mutant_bodyparts["frills"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Frills

" - - dat += "[features["frills"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - - if(pref_species.mutant_bodyparts["spines"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Spines

" - - dat += "[features["spines"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - - if(pref_species.mutant_bodyparts["body_markings"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Body Markings

" - - dat += "[features["body_markings"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["mam_body_markings"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Species Markings

" - - dat += "[features["mam_body_markings"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - - if(pref_species.mutant_bodyparts["mam_ears"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Ears

" - - dat += "[features["mam_ears"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - - if(pref_species.mutant_bodyparts["ears"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Ears

" - - dat += "[features["ears"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - - if(pref_species.mutant_bodyparts["mam_snouts"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Snout

" - - dat += "[features["mam_snouts"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["legs"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Legs

" - - dat += "[features["legs"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["deco_wings"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Decorative wings

" - - dat += "[features["deco_wings"]]" - dat += "    Change
" - - if(pref_species.mutant_bodyparts["insect_wings"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Insect wings

" - - dat += "[features["insect_wings"]]" - dat += "    Change
" - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["insect_fluff"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Insect Fluff

" - - dat += "[features["insect_fluff"]]" - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["taur"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Tauric Body

" - - dat += "[features["taur"]]" - - if(pref_species.mutant_bodyparts["insect_markings"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Insect markings

" - - dat += "[features["insect_markings"]]
" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["wings"] && GLOB.r_wings_list.len >1) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Wings

" - - dat += "[features["wings"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["xenohead"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Caste Head

" - - dat += "[features["xenohead"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["xenotail"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Tail

" - - dat += "[features["xenotail"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["xenodorsal"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Dorsal Spines

" - - dat += "[features["xenodorsal"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["ipc_screen"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Screen

" - - dat += "[features["ipc_screen"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 - if(pref_species.mutant_bodyparts["ipc_antenna"]) - if(!mutant_category) - dat += APPEARANCE_CATEGORY_COLUMN - - dat += "

Antenna

" - - dat += "[features["ipc_antenna"]]" - - mutant_category++ - if(mutant_category >= MAX_MUTANT_ROWS) - dat += "" - mutant_category = 0 + for(var/mutant_part in GLOB.all_mutant_parts) + var/part_name = pref_species.mutant_bodyparts[mutant_part] + if(part_name || GLOB.unlocked_mutant_parts[mutant_part]) //either its in the species, or it's unlocked and it doesn't matter (unlocked meaning any species can have it) + if(!mutant_category) + dat += APPEARANCE_CATEGORY_COLUMN + dat += "

[part_name]

" + dat += "[features[mutant_part]]" + var/color_type = GLOB.colored_mutant_parts[mutant_part] //if it can be coloured, show the appropriate button + if(color_type) + dat += "    Change
" + mutant_category++ + if(mutant_category >= MAX_MUTANT_ROWS) + dat += "" + mutant_category = 0 if(mutant_category) dat += "" @@ -1919,7 +1629,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["tail_human"] = "None" features["tail_lizard"] = "None" - if("meats") + if("_type") var/new_meat new_meat = input(user, "Choose your character's meat type:", "Character Preference") as null|anything in GLOB.meat_types if(new_meat) @@ -2024,7 +1734,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if(new_deco_wings) features["deco_wings"] = new_deco_wings - if("insect_fluffs") + if("insect_fluff") var/new_insect_fluff new_insect_fluff = input(user, "Choose your character's wings:", "Character Preference") as null|anything in GLOB.insect_fluffs_list if(new_insect_fluff) From 8effb219e1b4f107f3b7deaec2c0268ffa4ced39 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 5 Aug 2020 15:27:48 +0100 Subject: [PATCH 02/11] fix a bug and reduce it by 1 more line --- code/modules/client/preferences.dm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 291e4eac0e..25cae1a9e9 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -508,11 +508,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) mutant_category = 0 for(var/mutant_part in GLOB.all_mutant_parts) - var/part_name = pref_species.mutant_bodyparts[mutant_part] - if(part_name || GLOB.unlocked_mutant_parts[mutant_part]) //either its in the species, or it's unlocked and it doesn't matter (unlocked meaning any species can have it) + if(pref_species.mutant_bodyparts[mutant_part] || GLOB.unlocked_mutant_parts[mutant_part]) //either its in the species, or it's unlocked and it doesn't matter (unlocked meaning any species can have it) if(!mutant_category) dat += APPEARANCE_CATEGORY_COLUMN - dat += "

[part_name]

" + dat += "

[GLOB.all_mutant_parts[mutant_part]]

" dat += "[features[mutant_part]]" var/color_type = GLOB.colored_mutant_parts[mutant_part] //if it can be coloured, show the appropriate button if(color_type) From 1f62a4bbf91f6796c2a0c88ddf75944b907f47fd Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 5 Aug 2020 15:29:07 +0100 Subject: [PATCH 03/11] typo --- code/modules/client/preferences.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 25cae1a9e9..a42c4b89ac 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -1628,7 +1628,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) features["tail_human"] = "None" features["tail_lizard"] = "None" - if("_type") + if("meat_type") var/new_meat new_meat = input(user, "Choose your character's meat type:", "Character Preference") as null|anything in GLOB.meat_types if(new_meat) From f2c1b251194ce56b9364a2caa3046c2458c084f7 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 5 Aug 2020 15:50:25 +0100 Subject: [PATCH 04/11] yes --- code/_globalvars/lists/flavor_misc.dm | 2 +- code/modules/client/preferences.dm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index 6afa8ef0ce..9b7589345f 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -234,7 +234,7 @@ GLOBAL_LIST_INIT(roundstart_tongues, list("default","human tongue" = /obj/item/o //locked parts are those that your picked species requires to have //unlocked parts are those that anyone can choose on customisation regardless //parts not in unlocked, but in all, are thus locked -GLOBAL_LIST_INIT(all_mutant_parts, list("tail_lizard" = "Tail", "mam_tail" = "Tail", "tail_human" = "Tail", "snout" = "Snout", "frills" = "Frills", "spines" = "Spines", "body_markings" = "Body Markings", "mam_body_markings" = "Species Markings" , "mam_ears" = "Ears", "ears" = "Ears", "mam_snouts" = "Snout", "legs" = "Legs", "deco_wings" = "Decorative Wings", "insect_wings" = "Insect Wings", "insect_fluff" = "Insect Fluff", "taur" = "Tauric Body", "insect_markings" = "Insect Markings", "wings" = "Wings", "xenohead" = "Caste Head", "xenotail" = "Tail", "xenodorsal" = "Dorsal Spines", "ipc_screen" = "Screen", "ipc_antenna" = "Antenna", "meat_type" = "Meat Type")) +GLOBAL_LIST_INIT(all_mutant_parts, list("tail_lizard" = "Tail", "mam_tail" = "Tail", "tail_human" = "Tail", "snout" = "Snout", "frills" = "Frills", "spines" = "Spines", "body_markings" = "Body Markings", "mam_body_markings" = "Species Markings" , "mam_ears" = "Ears", "ears" = "Ears", "mam_snouts" = "Snout", "legs" = "Legs", "deco_wings" = "Decorative Wings", "insect_wings" = "Insect Wings", "insect_fluff" = "Insect Fluff", "taur" = "Tauric Body", "insect_markings" = "Insect Markings", "wings" = "Wings", "xenohead" = "Caste Head", "xenotail" = "Tail", "xenodorsal" = "Dorsal Spines", "ipc_screen" = "Screen", "ipc_antenna" = "Antenna", "meat_type" = "Meat Type", "horns" = "Horns")) GLOBAL_LIST_INIT(unlocked_mutant_parts, list("meat_type", "horns")) //parts in either of the above two lists that require a second option that allows them to be coloured GLOBAL_LIST_INIT(colored_mutant_parts, list("insect_wings" = "wings_color", "deco_wings" = "wings_color", "horns" = "horns_color")) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index a42c4b89ac..294e6713a5 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -508,7 +508,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) mutant_category = 0 for(var/mutant_part in GLOB.all_mutant_parts) - if(pref_species.mutant_bodyparts[mutant_part] || GLOB.unlocked_mutant_parts[mutant_part]) //either its in the species, or it's unlocked and it doesn't matter (unlocked meaning any species can have it) + if(pref_species.mutant_bodyparts[mutant_part] || mutant_part in GLOB.unlocked_mutant_parts) //either its in the species, or it's unlocked and it doesn't matter (unlocked meaning any species can have it) if(!mutant_category) dat += APPEARANCE_CATEGORY_COLUMN dat += "

[GLOB.all_mutant_parts[mutant_part]]

" From 14bc60955ffe828b29d9aa832be6231d5a72b3b0 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 5 Aug 2020 16:31:27 +0100 Subject: [PATCH 05/11] unlocked --- code/modules/client/client_procs.dm | 3 +++ code/modules/client/preferences.dm | 18 +++++++++--------- .../modules/mob/living/carbon/human/species.dm | 3 +++ 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 5c9b1eec2e..62a997c938 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -988,3 +988,6 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) screen -= S qdel(S) char_render_holders = null + +/client/proc/can_have_part(part_name) + return prefs.pref_species.mutant_bodyparts[part_name] || part_name in GLOB.unlocked_mutant_parts //either they have it, or its unlocked diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index 294e6713a5..bac373235c 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -508,7 +508,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) mutant_category = 0 for(var/mutant_part in GLOB.all_mutant_parts) - if(pref_species.mutant_bodyparts[mutant_part] || mutant_part in GLOB.unlocked_mutant_parts) //either its in the species, or it's unlocked and it doesn't matter (unlocked meaning any species can have it) + if(parent.can_have_part(mutant_part)) if(!mutant_category) dat += APPEARANCE_CATEGORY_COLUMN dat += "

[GLOB.all_mutant_parts[mutant_part]]

" @@ -565,7 +565,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) var/tauric_shape = FALSE if(features["cock_taur"]) var/datum/sprite_accessory/penis/P = GLOB.cock_shapes_list[features["cock_shape"]] - if(P.taur_icon && pref_species.mutant_bodyparts["taur"]) + if(P.taur_icon && parent.can_have_part("taur")) var/datum/sprite_accessory/taur/T = GLOB.taur_list[features["taur"]] if(T.taur_mode & P.accepted_taurs) tauric_shape = TRUE @@ -1493,14 +1493,14 @@ GLOBAL_LIST_EMPTY(preferences_datums) pref_species = new newtype() //let's ensure that no weird shit happens on species swapping. custom_species = null - if(!pref_species.mutant_bodyparts["body_markings"]) + if(!parent.can_have_part("body_markings")) features["body_markings"] = "None" - if(!pref_species.mutant_bodyparts["mam_body_markings"]) + if(!parent.can_have_part("mam_body_markings")) features["mam_body_markings"] = "None" - if(pref_species.mutant_bodyparts["mam_body_markings"]) + if(parent.can_have_part("mam_body_markings")) if(features["mam_body_markings"] == "None") features["mam_body_markings"] = "Plain" - if(pref_species.mutant_bodyparts["tail_lizard"]) + if(parent.can_have_part("tail_lizard")) features["tail_lizard"] = "Smooth" if(pref_species.id == "felinid") features["mam_tail"] = "Cat" @@ -1881,7 +1881,7 @@ GLOBAL_LIST_EMPTY(preferences_datums) if("cock_shape") var/new_shape var/list/hockeys = list() - if(pref_species.mutant_bodyparts["taur"]) + if(parent.can_have_part("taur")) var/datum/sprite_accessory/taur/T = GLOB.taur_list[features["taur"]] for(var/A in GLOB.cock_shapes_list) var/datum/sprite_accessory/penis/P = GLOB.cock_shapes_list[A] @@ -2488,10 +2488,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.dna.nameless = character.nameless character.dna.custom_species = character.custom_species - if(pref_species.mutant_bodyparts["meat_type"]) + if(parent.can_have_part("meat_type")) character.type_of_meat = GLOB.meat_types[features["meat_type"]] - if(character.dna.species.mutant_bodyparts["legs"] && (character.dna.features["legs"] == "Digitigrade" || character.dna.features["legs"] == "Avian")) + if(parent.can_have_part("legs") && (character.dna.features["legs"] == "Digitigrade" || character.dna.features["legs"] == "Avian")) pref_species.species_traits |= DIGITIGRADE else pref_species.species_traits -= DIGITIGRADE diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index dc7fe86aca..c1fb704a6d 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -123,6 +123,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) limbs_id = id ..() + //update our mutant bodyparts to include unlocked ones + mutant_bodyparts += GLOB.unlocked_mutant_parts + /proc/generate_selectable_species(clear = FALSE) if(clear) GLOB.roundstart_races = list() From 6ba359e0a1769af16e094263d18fc9fdec95baf6 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 5 Aug 2020 17:43:54 +0100 Subject: [PATCH 06/11] fix --- code/modules/client/client_procs.dm | 2 +- code/modules/client/preferences.dm | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 62a997c938..cfca66a2a6 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -990,4 +990,4 @@ GLOBAL_LIST_EMPTY(external_rsc_urls) char_render_holders = null /client/proc/can_have_part(part_name) - return prefs.pref_species.mutant_bodyparts[part_name] || part_name in GLOB.unlocked_mutant_parts //either they have it, or its unlocked + return prefs.pref_species.mutant_bodyparts[part_name] || (part_name in GLOB.unlocked_mutant_parts) diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm index bac373235c..c950c186e4 100644 --- a/code/modules/client/preferences.dm +++ b/code/modules/client/preferences.dm @@ -2488,10 +2488,10 @@ GLOBAL_LIST_EMPTY(preferences_datums) character.dna.nameless = character.nameless character.dna.custom_species = character.custom_species - if(parent.can_have_part("meat_type")) + if((parent && parent.can_have_part("meat_type")) || pref_species.mutant_bodyparts["meat_type"]) character.type_of_meat = GLOB.meat_types[features["meat_type"]] - if(parent.can_have_part("legs") && (character.dna.features["legs"] == "Digitigrade" || character.dna.features["legs"] == "Avian")) + if(((parent && parent.can_have_part("legs")) || pref_species.mutant_bodyparts["legs"]) && (character.dna.features["legs"] == "Digitigrade" || character.dna.features["legs"] == "Avian")) pref_species.species_traits |= DIGITIGRADE else pref_species.species_traits -= DIGITIGRADE From ce0a5b701606c8c7676efe6eadc9ef9a3623766b Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Sat, 8 Aug 2020 15:26:25 +0100 Subject: [PATCH 07/11] only horns is unlocked now --- code/_globalvars/lists/flavor_misc.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index 9b7589345f..b7d3d71574 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -235,6 +235,6 @@ GLOBAL_LIST_INIT(roundstart_tongues, list("default","human tongue" = /obj/item/o //unlocked parts are those that anyone can choose on customisation regardless //parts not in unlocked, but in all, are thus locked GLOBAL_LIST_INIT(all_mutant_parts, list("tail_lizard" = "Tail", "mam_tail" = "Tail", "tail_human" = "Tail", "snout" = "Snout", "frills" = "Frills", "spines" = "Spines", "body_markings" = "Body Markings", "mam_body_markings" = "Species Markings" , "mam_ears" = "Ears", "ears" = "Ears", "mam_snouts" = "Snout", "legs" = "Legs", "deco_wings" = "Decorative Wings", "insect_wings" = "Insect Wings", "insect_fluff" = "Insect Fluff", "taur" = "Tauric Body", "insect_markings" = "Insect Markings", "wings" = "Wings", "xenohead" = "Caste Head", "xenotail" = "Tail", "xenodorsal" = "Dorsal Spines", "ipc_screen" = "Screen", "ipc_antenna" = "Antenna", "meat_type" = "Meat Type", "horns" = "Horns")) -GLOBAL_LIST_INIT(unlocked_mutant_parts, list("meat_type", "horns")) +GLOBAL_LIST_INIT(unlocked_mutant_parts, list("horns")) //parts in either of the above two lists that require a second option that allows them to be coloured GLOBAL_LIST_INIT(colored_mutant_parts, list("insect_wings" = "wings_color", "deco_wings" = "wings_color", "horns" = "horns_color")) From 82298fd56c796534d95566bb7e0a6c85b037906a Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 12 Aug 2020 17:03:23 +0100 Subject: [PATCH 08/11] yes --- code/modules/client/preferences_savefile.dm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 59d99674eb..07670b3ea5 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -5,7 +5,7 @@ // You do not need to raise this if you are adding new values that have sane defaults. // Only raise this value when changing the meaning/format/name/layout of an existing value // where you would want the updater procs below to run -#define SAVEFILE_VERSION_MAX 33 +#define SAVEFILE_VERSION_MAX 34 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -200,6 +200,13 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car features["silicon_flavor_text"] = html_encode(features["silicon_flavor_text"]) features["ooc_notes"] = html_encode(features["ooc_notes"]) + if(current_version < 34) + if(features["horns"] && S["species"]) //check for saved horn data + var/datum/species/loaded_species = GLOB.species_list[S["species"]] + if(loaded_species && !initial(loaded_species.mutant_bodyparts["horns"])) //if saved horn data plus previously no initial horns were allowed on their race, wipe the horns + features["horns"] = null + + /datum/preferences/proc/load_path(ckey,filename="preferences.sav") if(!ckey) return @@ -224,7 +231,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car var/needs_update = savefile_needs_update(S) if(needs_update == -2) //fatal, can't load any data return 0 - + . = TRUE //general preferences @@ -443,7 +450,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car return 0 . = TRUE - + //Species var/species_id S["species"] >> species_id From e5d48e307a3ba33f3af08f68b4917acf54954936 Mon Sep 17 00:00:00 2001 From: Timothy Teakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Wed, 12 Aug 2020 17:04:37 +0100 Subject: [PATCH 09/11] woops --- code/modules/client/preferences_savefile.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index 07670b3ea5..dc66008027 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -203,7 +203,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car if(current_version < 34) if(features["horns"] && S["species"]) //check for saved horn data var/datum/species/loaded_species = GLOB.species_list[S["species"]] - if(loaded_species && !initial(loaded_species.mutant_bodyparts["horns"])) //if saved horn data plus previously no initial horns were allowed on their race, wipe the horns + if(loaded_species && !initial(loaded_species.mutant_bodyparts)["horns"]) //if saved horn data plus previously no initial horns were allowed on their race, wipe the horns features["horns"] = null From a9caceb001d9225911f39047260ae44e8bf22c17 Mon Sep 17 00:00:00 2001 From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Fri, 14 Aug 2020 02:27:54 +0100 Subject: [PATCH 10/11] insect fluff! --- code/_globalvars/lists/flavor_misc.dm | 2 +- code/modules/client/preferences_savefile.dm | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index b7d3d71574..7c2ebc5f0c 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -235,6 +235,6 @@ GLOBAL_LIST_INIT(roundstart_tongues, list("default","human tongue" = /obj/item/o //unlocked parts are those that anyone can choose on customisation regardless //parts not in unlocked, but in all, are thus locked GLOBAL_LIST_INIT(all_mutant_parts, list("tail_lizard" = "Tail", "mam_tail" = "Tail", "tail_human" = "Tail", "snout" = "Snout", "frills" = "Frills", "spines" = "Spines", "body_markings" = "Body Markings", "mam_body_markings" = "Species Markings" , "mam_ears" = "Ears", "ears" = "Ears", "mam_snouts" = "Snout", "legs" = "Legs", "deco_wings" = "Decorative Wings", "insect_wings" = "Insect Wings", "insect_fluff" = "Insect Fluff", "taur" = "Tauric Body", "insect_markings" = "Insect Markings", "wings" = "Wings", "xenohead" = "Caste Head", "xenotail" = "Tail", "xenodorsal" = "Dorsal Spines", "ipc_screen" = "Screen", "ipc_antenna" = "Antenna", "meat_type" = "Meat Type", "horns" = "Horns")) -GLOBAL_LIST_INIT(unlocked_mutant_parts, list("horns")) +GLOBAL_LIST_INIT(unlocked_mutant_parts, list("horns", "insect_fluff")) //parts in either of the above two lists that require a second option that allows them to be coloured GLOBAL_LIST_INIT(colored_mutant_parts, list("insect_wings" = "wings_color", "deco_wings" = "wings_color", "horns" = "horns_color")) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index dc66008027..a5d7b3f8ca 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -5,7 +5,7 @@ // You do not need to raise this if you are adding new values that have sane defaults. // Only raise this value when changing the meaning/format/name/layout of an existing value // where you would want the updater procs below to run -#define SAVEFILE_VERSION_MAX 34 +#define SAVEFILE_VERSION_MAX 35 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -200,11 +200,14 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car features["silicon_flavor_text"] = html_encode(features["silicon_flavor_text"]) features["ooc_notes"] = html_encode(features["ooc_notes"]) - if(current_version < 34) - if(features["horns"] && S["species"]) //check for saved horn data + if(current_version < 35) + if(S["species"]) var/datum/species/loaded_species = GLOB.species_list[S["species"]] - if(loaded_species && !initial(loaded_species.mutant_bodyparts)["horns"]) //if saved horn data plus previously no initial horns were allowed on their race, wipe the horns - features["horns"] = null + if(loaded_species) + for(var/unlocked_part in GLOB.unlocked_mutant_parts) + if(features[unlocked_part]) //check for saved data on an unlocked part + if(!initial(loaded_species.mutant_bodyparts)[unlocked_part]) //if saved horn data plus previously no initial horns were allowed on their race, wipe the horns + features[unlocked_part] = null /datum/preferences/proc/load_path(ckey,filename="preferences.sav") From 8b4fb136b224b05e672994418c5d04ee2a154b2b Mon Sep 17 00:00:00 2001 From: timothyteakettle <59849408+timothyteakettle@users.noreply.github.com> Date: Fri, 14 Aug 2020 02:37:08 +0100 Subject: [PATCH 11/11] ok fuck it --- code/modules/client/preferences_savefile.dm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm index a5d7b3f8ca..64c5e775b0 100644 --- a/code/modules/client/preferences_savefile.dm +++ b/code/modules/client/preferences_savefile.dm @@ -5,7 +5,7 @@ // You do not need to raise this if you are adding new values that have sane defaults. // Only raise this value when changing the meaning/format/name/layout of an existing value // where you would want the updater procs below to run -#define SAVEFILE_VERSION_MAX 35 +#define SAVEFILE_VERSION_MAX 34 /* SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Carn @@ -200,16 +200,6 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car features["silicon_flavor_text"] = html_encode(features["silicon_flavor_text"]) features["ooc_notes"] = html_encode(features["ooc_notes"]) - if(current_version < 35) - if(S["species"]) - var/datum/species/loaded_species = GLOB.species_list[S["species"]] - if(loaded_species) - for(var/unlocked_part in GLOB.unlocked_mutant_parts) - if(features[unlocked_part]) //check for saved data on an unlocked part - if(!initial(loaded_species.mutant_bodyparts)[unlocked_part]) //if saved horn data plus previously no initial horns were allowed on their race, wipe the horns - features[unlocked_part] = null - - /datum/preferences/proc/load_path(ckey,filename="preferences.sav") if(!ckey) return