From b4c7a90b08f3a481700a5518a544fe8571d6c87d Mon Sep 17 00:00:00 2001 From: Iajret Creature <122297233+Steals-The-PRs@users.noreply.github.com> Date: Mon, 11 Dec 2023 01:45:50 +0300 Subject: [PATCH] Fixes random species features not being applied when spawning randomized mobs (#1063) * Fixes random species features not being applied when spawning randomized mobs * Does this without creating duped list entries * Update dna.dm * Update dna.dm * No more monkey abominations * Update monkey.dm * Update monkey.dm * Update global_lists.dm * Update dna.dm Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> --- code/__HELPERS/global_lists.dm | 1 + code/_globalvars/lists/flavor_misc.dm | 1 + code/datums/dna.dm | 8 ++++---- code/modules/surgery/organs/external/tails.dm | 2 +- .../modules/mob/living/carbon/human/species/monkey.dm | 5 +++++ 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm index c6fa9d09ac8..ba342c20d5e 100644 --- a/code/__HELPERS/global_lists.dm +++ b/code/__HELPERS/global_lists.dm @@ -38,6 +38,7 @@ init_sprite_accessory_subtypes(/datum/sprite_accessory/bra, GLOB.bra_list, GLOB.bra_m, GLOB.bra_f) // SKYRAT EDIT ADDITION init_sprite_accessory_subtypes(/datum/sprite_accessory/wings/moth, GLOB.moth_wings_list) // SKYRAT EDIT ADDITION - Customization + init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, GLOB.tails_list_monkey, add_blank = TRUE) // SKYRAT EDIT ADDITION - We don't want monkeys getting randomized non-monkey tails init_sprite_accessory_subtypes(/datum/sprite_accessory/pod_hair, GLOB.pod_hair_list, add_blank = TRUE) // SKYRAT EDIT - Customization - ORIGINAL: init_sprite_accessory_subtypes(/datum/sprite_accessory/pod_hair, GLOB.pod_hair_list) //SKYRAT EDIT ADDITION BEGIN diff --git a/code/_globalvars/lists/flavor_misc.dm b/code/_globalvars/lists/flavor_misc.dm index afb15912694..5123ffaec00 100644 --- a/code/_globalvars/lists/flavor_misc.dm +++ b/code/_globalvars/lists/flavor_misc.dm @@ -43,6 +43,7 @@ GLOBAL_LIST_EMPTY(caps_list) */ //SKYRAT EDIT REMOVAL END GLOBAL_LIST_EMPTY(moth_wings_list) // SKYRAT EDIT ADDITION - Customization +GLOBAL_LIST_EMPTY(tails_list_monkey) // SKYRAT EDIT ADDITION - Customization GLOBAL_LIST_EMPTY(pod_hair_list) GLOBAL_LIST_INIT(color_list_ethereal, list( diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 9f16047fad6..6b53310261a 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -495,9 +495,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) blood_type = newblood_type if(create_mutation_blocks) //I hate this generate_dna_blocks() - mutant_bodyparts = species.get_mutant_bodyparts(features, existing_mutant_bodyparts = randomize_features ? list() : mutant_bodyparts) // SKYRAT EDIT ADDITION if(randomize_features) - /* SKYRAT EDIT REMOVAL - We don't really want this, do we? We get the same effect from get_mutant_bodyparts() on our end, but without mixing up weird species features. + /* SKYRAT EDIT REMOVAL - We don't really want this. We instead let get_mutant_bodyparts() handle the bodypart randomization on our end, to prevent getting any crazy cross-species features. var/static/list/all_species_protoypes if(isnull(all_species_protoypes)) all_species_protoypes = list() @@ -507,10 +506,11 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) for(var/datum/species/random_species as anything in all_species_protoypes) features |= random_species.randomize_features() SKYRAT EDIT REMOVAL END */ - body_markings = species.get_random_body_markings(features) // SKYRAT EDIT ADDITION - features["mcolor"] = "#[random_color()]" + features = species.randomize_features() | features // SKYRAT EDIT CHANGE - Where applicable, replace features with the features generated by species/randomize_features() - Original: features["mcolor"] = "#[random_color()]" + body_markings = species.get_random_body_markings(features) // SKYRAT EDIT ADDITION + mutant_bodyparts = species.get_mutant_bodyparts(features, existing_mutant_bodyparts = randomize_features ? list() : mutant_bodyparts) // SKYRAT EDIT ADDITION update_dna_identity() /datum/dna/stored //subtype used by brain mob's stored_dna diff --git a/code/modules/surgery/organs/external/tails.dm b/code/modules/surgery/organs/external/tails.dm index bfeb128eb7a..3235ddf7dbc 100644 --- a/code/modules/surgery/organs/external/tails.dm +++ b/code/modules/surgery/organs/external/tails.dm @@ -128,7 +128,7 @@ feature_key = "tail" // SKYRAT EDIT - Customization - ORIGINAL: feature_key = "tail_monkey" /datum/bodypart_overlay/mutant/tail/monkey/get_global_feature_list() - return GLOB.sprite_accessories["tail"] // SKYRAT EDIT CHANGE - ORIGINAL: return GLOB.tails_list_monkey + return GLOB.tails_list_monkey /obj/item/organ/external/tail/lizard name = "lizard tail" diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/monkey.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/monkey.dm index 76126e02192..7054f8aedde 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/monkey.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/monkey.dm @@ -3,6 +3,11 @@ "tail" = list("Monkey", FALSE), ) +/datum/species/monkey/randomize_features() + var/list/features = ..() + features["tail"] = pick(GLOB.tails_list_monkey - list("None")) // No tail-less monkeys. + return features + /datum/species/monkey/prepare_human_for_preview(mob/living/carbon/human/monke) regenerate_organs(monke, src, visual_only = TRUE) monke.update_body(is_creating = TRUE)