diff --git a/code/__DEFINES/traits/declarations.dm b/code/__DEFINES/traits/declarations.dm index 2e9725266f3..8d2b54ab72f 100644 --- a/code/__DEFINES/traits/declarations.dm +++ b/code/__DEFINES/traits/declarations.dm @@ -138,8 +138,6 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai #define TRAIT_AGENDER "agender" /// Species with this trait have a blood clan mechanic #define TRAIT_BLOOD_CLANS "blood_clans" -/// Species with this trait have markings (this SUCKS, remove this later in favor of bodypart overlays) -#define TRAIT_HAS_MARKINGS "has_markings" /// Species with this trait use skin tones for coloration #define TRAIT_USES_SKINTONES "uses_skintones" /// Species with this trait use mutant colors for coloration diff --git a/code/_globalvars/traits/_traits.dm b/code/_globalvars/traits/_traits.dm index 45455b3f564..3e5c2d9b4d5 100644 --- a/code/_globalvars/traits/_traits.dm +++ b/code/_globalvars/traits/_traits.dm @@ -259,7 +259,6 @@ GLOBAL_LIST_INIT(traits_by_type, list( "TRAIT_HARDLY_WOUNDED" = TRAIT_HARDLY_WOUNDED, "TRAIT_HAS_BEEN_KIDNAPPED" = TRAIT_HAS_BEEN_KIDNAPPED, "TRAIT_HAS_CRANIAL_FISSURE" = TRAIT_HAS_CRANIAL_FISSURE, - "TRAIT_HAS_MARKINGS" = TRAIT_HAS_MARKINGS, "TRAIT_HATED_BY_DOGS" = TRAIT_HATED_BY_DOGS, "TRAIT_HEAD_INJURY_BLOCKED" = TRAIT_HEAD_INJURY_BLOCKED, "TRAIT_HEALS_FROM_CARP_RIFTS" = TRAIT_HEALS_FROM_CARP_RIFTS, diff --git a/code/_globalvars/traits/admin_tooling.dm b/code/_globalvars/traits/admin_tooling.dm index fa4ae71def9..0d14fe28db2 100644 --- a/code/_globalvars/traits/admin_tooling.dm +++ b/code/_globalvars/traits/admin_tooling.dm @@ -96,7 +96,6 @@ GLOBAL_LIST_INIT(admin_visible_traits, list( "TRAIT_GUNFLIP" = TRAIT_GUNFLIP, "TRAIT_HANDS_BLOCKED" = TRAIT_HANDS_BLOCKED, "TRAIT_HARDLY_WOUNDED" = TRAIT_HARDLY_WOUNDED, - "TRAIT_HAS_MARKINGS" = TRAIT_HAS_MARKINGS, "TRAIT_HEAVY_SLEEPER" = TRAIT_HEAVY_SLEEPER, "TRAIT_HIDE_EXTERNAL_ORGANS" = TRAIT_HIDE_EXTERNAL_ORGANS, "TRAIT_HOLY" = TRAIT_HOLY, diff --git a/code/controllers/subsystem/sprite_accessories.dm b/code/controllers/subsystem/sprite_accessories.dm index 2b0bb20e414..5499ab68d4a 100644 --- a/code/controllers/subsystem/sprite_accessories.dm +++ b/code/controllers/subsystem/sprite_accessories.dm @@ -37,7 +37,7 @@ SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity //SKYRAT EDIT REMOVAL - CUSTOMIZATION /* //Lizard Bits (all datum lists indexed by name) - var/list/body_markings_list + var/list/lizard_markings_list var/list/snouts_list var/list/horns_list var/list/frills_list @@ -57,9 +57,10 @@ SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity var/list/moth_markings_list var/list/caps_list */ + var/list/moth_markings_list var/list/pod_hair_list - // SKYRAT EDIT BEGIN + // SKYRAT EDIT ADDITION START - Customization var/list/sprite_accessories /// Stores all /datum/sprite_accessory/bra indexed by name. @@ -75,6 +76,8 @@ SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity var/list/moth_wings_list /// Monkey tail list var/list/tails_list_monkey + /// Lizard Marking list + var/list/lizard_markings_list /// All the different scream types var/list/scream_types //SKYRAT EDIT END @@ -111,7 +114,7 @@ SUBSYSTEM_DEF(accessories) // just 'accessories' for brevity socks_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/socks)[DEFAULT_SPRITE_LIST] /* //SKYRAT EDIT REMOVAL - CUSTOMIZATION - body_markings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/body_markings)[DEFAULT_SPRITE_LIST] + lizard_markings_list = init_sprite_accessory_subtypes(/datum/sprite_accessory/lizard_markings)[DEFAULT_SPRITE_LIST] tails_list_human = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/human, add_blank = TRUE)[DEFAULT_SPRITE_LIST] tails_list_lizard = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/lizard, add_blank = TRUE)[DEFAULT_SPRITE_LIST] tails_list_monkey = init_sprite_accessory_subtypes(/datum/sprite_accessory/tails/monkey, add_blank = TRUE)[DEFAULT_SPRITE_LIST] diff --git a/code/datums/bodypart_overlays/markings_bodypart_overlay.dm b/code/datums/bodypart_overlays/markings_bodypart_overlay.dm new file mode 100644 index 00000000000..c2c6f54d861 --- /dev/null +++ b/code/datums/bodypart_overlays/markings_bodypart_overlay.dm @@ -0,0 +1,31 @@ +/// For body markings applied on the species, which need some extra code +/datum/bodypart_overlay/simple/body_marking + layers = EXTERNAL_ADJACENT + /// Listen to the gendercode, if the limb is bimorphic + var/use_gender = FALSE + /// Which dna feature key to draw from + var/dna_feature_key + /// Which bodyparts do we apply ourselves to? + var/list/applies_to = list(/obj/item/bodypart/head, /obj/item/bodypart/chest, /obj/item/bodypart/arm/left, /obj/item/bodypart/arm/right, \ + /obj/item/bodypart/leg/left, /obj/item/bodypart/leg/right) + +/// Get the accessory list from SSaccessories. Used in species.dm to get the right sprite +/datum/bodypart_overlay/simple/body_marking/proc/get_accessory(name) + CRASH("get_accessories() not overriden on [type] !") + +/datum/bodypart_overlay/simple/body_marking/get_image(layer, obj/item/bodypart/limb) + var/gender_string = (use_gender && limb.is_dimorphic) ? (limb.gender == MALE ? MALE : FEMALE + "_") : "" //we only got male and female sprites + return image(icon, gender_string + icon_state + "_" + limb.body_zone, layer = layer) + +/datum/bodypart_overlay/simple/body_marking/moth + dna_feature_key = "moth_markings" + +/datum/bodypart_overlay/simple/body_marking/moth/get_accessory(name) + return SSaccessories.moth_markings_list[name] + +/datum/bodypart_overlay/simple/body_marking/lizard + dna_feature_key = "lizard_markings" + applies_to = list(/obj/item/bodypart/chest) + +/datum/bodypart_overlay/simple/body_marking/lizard/get_accessory(name) + return SSaccessories.lizard_markings_list[name] diff --git a/code/datums/dna.dm b/code/datums/dna.dm index 2c44a06d5a5..92c8a2dc45a 100644 --- a/code/datums/dna.dm +++ b/code/datums/dna.dm @@ -248,8 +248,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) L[DNA_MUTANT_COLOR_BLOCK] = sanitize_hexcolor(features["mcolor"], include_crunch = FALSE) if(features["ethcolor"]) L[DNA_ETHEREAL_COLOR_BLOCK] = sanitize_hexcolor(features["ethcolor"], include_crunch = FALSE) - if(features["body_markings"]) - L[DNA_LIZARD_MARKINGS_BLOCK] = construct_block(SSaccessories.body_markings_list.Find(features["body_markings"]), length(SSaccessories.body_markings_list)) + if(features["lizard_markings"]) + L[DNA_LIZARD_MARKINGS_BLOCK] = construct_block(SSaccessories.lizard_markings_list.Find(features["lizard_markings"]), length(SSaccessories.lizard_markings_list)) if(features["tail_cat"]) L[DNA_TAIL_BLOCK] = construct_block(SSaccessories.tails_list_human.Find(features["tail_cat"]), length(SSaccessories.tails_list_human)) if(features["tail_lizard"]) @@ -401,7 +401,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) if(DNA_ETHEREAL_COLOR_BLOCK) set_uni_feature_block(blocknumber, sanitize_hexcolor(features["ethcolor"], include_crunch = FALSE)) if(DNA_LIZARD_MARKINGS_BLOCK) - set_uni_feature_block(blocknumber, construct_block(SSaccessories.body_markings_list.Find(features["body_markings"]), length(SSaccessories.body_markings_list))) + set_uni_feature_block(blocknumber, construct_block(SSaccessories.lizard_markings_list.Find(features["lizard_markings"]), length(SSaccessories.lizard_markings_list))) if(DNA_TAIL_BLOCK) set_uni_feature_block(blocknumber, construct_block(SSaccessories.tails_list_human.Find(features["tail_cat"]), length(SSaccessories.tails_list_human))) if(DNA_LIZARD_TAIL_BLOCK) @@ -733,8 +733,8 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) dna.features["mcolor"] = sanitize_hexcolor(get_uni_feature_block(features, DNA_MUTANT_COLOR_BLOCK)) if(dna.features["ethcolor"]) dna.features["ethcolor"] = sanitize_hexcolor(get_uni_feature_block(features, DNA_ETHEREAL_COLOR_BLOCK)) - if(dna.features["body_markings"]) - dna.features["body_markings"] = SSaccessories.body_markings_list[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_MARKINGS_BLOCK), length(SSaccessories.body_markings_list))] + if(dna.features["lizard_markings"]) + dna.features["lizard_markings"] = SSaccessories.lizard_markings_list[deconstruct_block(get_uni_feature_block(features, DNA_LIZARD_MARKINGS_BLOCK), length(SSaccessories.lizard_markings_list))] if(dna.features["snout"]) dna.features["snout"] = SSaccessories.snouts_list[deconstruct_block(get_uni_feature_block(features, DNA_SNOUT_BLOCK), length(SSaccessories.snouts_list))] if(dna.features["horns"]) @@ -773,12 +773,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block()) external_organ.mutate_feature(features, src) if(icon_update) - if(mutcolor_update) - update_body(is_creating = TRUE) - else - update_body() - if(mutations_overlay_update) - update_mutations_overlay() + update_body(is_creating = mutcolor_update) */ //SKYRAT EDIT REMOVAL END diff --git a/code/datums/sprite_accessories.dm b/code/datums/sprite_accessories.dm index ddd3fe62a8f..9c704ea1321 100644 --- a/code/datums/sprite_accessories.dm +++ b/code/datums/sprite_accessories.dm @@ -1703,24 +1703,24 @@ // MutantParts Definitions // ///////////////////////////// -/datum/sprite_accessory/body_markings - icon = 'icons/mob/human/species/lizard/lizard_misc.dmi' +/datum/sprite_accessory/lizard_markings + icon = 'icons/mob/human/species/lizard/lizard_markings.dmi' -/datum/sprite_accessory/body_markings/none +/datum/sprite_accessory/lizard_markings/none name = "None" icon_state = "none" -/datum/sprite_accessory/body_markings/dtiger +/datum/sprite_accessory/lizard_markings/dtiger name = "Dark Tiger Body" icon_state = "dtiger" gender_specific = TRUE -/datum/sprite_accessory/body_markings/ltiger +/datum/sprite_accessory/lizard_markings/ltiger name = "Light Tiger Body" icon_state = "ltiger" gender_specific = TRUE -/datum/sprite_accessory/body_markings/lbelly +/datum/sprite_accessory/lizard_markings/lbelly name = "Light Belly" icon_state = "lbelly" gender_specific = TRUE diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm index 8166671b6e8..0af1dcded4e 100644 --- a/code/game/objects/structures/mirror.dm +++ b/code/game/objects/structures/mirror.dm @@ -354,7 +354,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/structure/mirror/broken, 28) user.set_facial_haircolor(sanitize_hexcolor(new_face_color), update = FALSE) user.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK) user.update_body_parts() - user.update_mutant_bodyparts(force_update = TRUE) /// SKYRAT EDIT ADDITION - Mirrors are no longer scared of colored ears + user.update_mutant_bodyparts() /// SKYRAT EDIT ADDITION - Mirrors are no longer scared of colored ears /obj/structure/mirror/magic/attack_hand(mob/living/carbon/human/user) . = ..() diff --git a/code/modules/client/preferences/_preference.dm b/code/modules/client/preferences/_preference.dm index 401b4a20bea..05dfe539612 100644 --- a/code/modules/client/preferences/_preference.dm +++ b/code/modules/client/preferences/_preference.dm @@ -112,6 +112,10 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key()) /// will show the feature as selectable. var/relevant_mutant_bodypart = null + /// If the selected species has this in its /datum/species/body_markings, + /// will show the feature as selectable. + var/relevant_body_markings = null + /// If the selected species has this in its /datum/species/inherent_traits, /// will show the feature as selectable. var/relevant_inherent_trait = null @@ -330,6 +334,7 @@ GLOBAL_LIST_INIT(preference_entries_by_key, init_preference_entries_by_key()) || !isnull(relevant_inherent_trait) \ || !isnull(relevant_external_organ) \ || !isnull(relevant_head_flag) \ + || !isnull(relevant_body_markings) \ ) var/species_type = preferences.read_preference(/datum/preference/choiced/species) diff --git a/code/modules/client/preferences/species_features/lizard.dm b/code/modules/client/preferences/species_features/lizard.dm index 4f459d8085f..ace8779ed15 100644 --- a/code/modules/client/preferences/species_features/lizard.dm +++ b/code/modules/client/preferences/species_features/lizard.dm @@ -30,20 +30,20 @@ category = PREFERENCE_CATEGORY_FEATURES main_feature_name = "Body markings" should_generate_icons = TRUE - relevant_mutant_bodypart = "body_markings" + relevant_body_markings = /datum/bodypart_overlay/simple/body_marking/lizard /datum/preference/choiced/lizard_body_markings/init_possible_values() - return assoc_to_keys_features(SSaccessories.body_markings_list) + return assoc_to_keys_features(SSaccessories.lizard_markings_list) /datum/preference/choiced/lizard_body_markings/icon_for(value) - var/datum/sprite_accessory/sprite_accessory = SSaccessories.body_markings_list[value] + var/datum/sprite_accessory/sprite_accessory = SSaccessories.lizard_markings_list[value] var/icon/final_icon = icon('icons/mob/human/species/lizard/bodyparts.dmi', "lizard_chest_m") if (sprite_accessory.icon_state != "none") var/icon/body_markings_icon = icon( 'icons/mob/human/species/lizard/lizard_misc.dmi', - "m_body_markings_[sprite_accessory.icon_state]_ADJ", + "male_[sprite_accessory.icon_state]_chest", ) final_icon.Blend(body_markings_icon, ICON_OVERLAY) @@ -56,7 +56,7 @@ return final_icon /datum/preference/choiced/lizard_body_markings/apply_to_human(mob/living/carbon/human/target, value) - target.dna.features["body_markings"] = value + target.dna.features["lizard_markings"] = value /datum/preference/choiced/lizard_frills savefile_key = "feature_lizard_frills" diff --git a/code/modules/client/preferences/species_features/moth.dm b/code/modules/client/preferences/species_features/moth.dm index d377414b0bf..b306c052d71 100644 --- a/code/modules/client/preferences/species_features/moth.dm +++ b/code/modules/client/preferences/species_features/moth.dm @@ -35,7 +35,7 @@ category = PREFERENCE_CATEGORY_FEATURES main_feature_name = "Body markings" should_generate_icons = TRUE - relevant_mutant_bodypart = "moth_markings" + relevant_body_markings = /datum/bodypart_overlay/simple/body_marking/moth /datum/preference/choiced/moth_markings/init_possible_values() return assoc_to_keys_features(SSaccessories.moth_markings_list) diff --git a/code/modules/mining/lavaland/megafauna_loot.dm b/code/modules/mining/lavaland/megafauna_loot.dm index 79ee234bfcc..9a8186c6423 100644 --- a/code/modules/mining/lavaland/megafauna_loot.dm +++ b/code/modules/mining/lavaland/megafauna_loot.dm @@ -757,7 +757,7 @@ "wings" = "None", "frills" = "None", "spines" = "Long", - "body_markings" = "Dark Tiger Body", + "lizard_markings" = "Dark Tiger Body", "legs" = DIGITIGRADE_LEGS, ) consumer.eye_color_left = "#FEE5A3" diff --git a/code/modules/mob/living/carbon/carbon_update_icons.dm b/code/modules/mob/living/carbon/carbon_update_icons.dm index e241b012035..a96979abb62 100644 --- a/code/modules/mob/living/carbon/carbon_update_icons.dm +++ b/code/modules/mob/living/carbon/carbon_update_icons.dm @@ -54,8 +54,8 @@ SEND_SIGNAL(src, COMSIG_CARBON_REMOVE_OVERLAY, cache_index, I) //used when putting/removing clothes that hide certain mutant body parts to just update those and not update the whole body. -/mob/living/carbon/human/proc/update_mutant_bodyparts(force_update = FALSE) // SKYRAT EDIT CHANGE - dna?.species.handle_mutant_bodyparts(src, force_update = force_update) // SKYRAT EDIT CHANGE +/mob/living/carbon/human/proc/update_mutant_bodyparts() + dna?.species.handle_mutant_bodyparts(src) update_body_parts() /mob/living/carbon/update_body(is_creating = FALSE) diff --git a/code/modules/mob/living/carbon/human/_species.dm b/code/modules/mob/living/carbon/human/_species.dm index b3839d41fe4..ce54e6cd60f 100644 --- a/code/modules/mob/living/carbon/human/_species.dm +++ b/code/modules/mob/living/carbon/human/_species.dm @@ -107,6 +107,9 @@ GLOBAL_LIST_EMPTY(features_by_species) ///Replaces default appendix with a different organ. var/obj/item/organ/internal/appendix/mutantappendix = /obj/item/organ/internal/appendix + /// Store body marking defines. See mobs.dm for bitflags + //var/list/body_markings = list() // SKYRAT EDIT REMOVAL - We already have this defined as an assoc list + /// Flat modifier on all damage taken via [apply_damage][/mob/living/proc/apply_damage] (so being punched, shot, etc.) /// IE: 10 = 10% less damage taken. var/damage_modifier = 0 @@ -471,7 +474,7 @@ GLOBAL_LIST_EMPTY(features_by_species) var/obj/item/organ/external/new_organ = SSwardrobe.provide_type(organ_path) new_organ.Insert(human, special=TRUE, movement_flags = DELETE_IF_REPLACED) - + //add_body_markings(human_who_gained_species) // SKYRAT EDIT REMOVAL - We do this differently if(length(inherent_traits)) human_who_gained_species.add_traits(inherent_traits, SPECIES_TRAIT) @@ -531,6 +534,8 @@ GLOBAL_LIST_EMPTY(features_by_species) clear_tail_moodlets(C) + remove_body_markings(C) + // Removes all languages previously associated with [LANGUAGE_SPECIES], gaining our new species will add new ones back var/datum/language_holder/losing_holder = GLOB.prototype_language_holders[species_language_holder] for(var/language in losing_holder.understood_languages) @@ -599,42 +604,6 @@ GLOBAL_LIST_EMPTY(features_by_species) eye_organ.refresh(call_update = FALSE) standing += eye_organ.generate_body_overlay(species_human) - // organic body markings (oh my god this is terrible please rework this to be done on the limbs themselves i beg you) - if(HAS_TRAIT(species_human, TRAIT_HAS_MARKINGS)) - var/obj/item/bodypart/chest/chest = species_human.get_bodypart(BODY_ZONE_CHEST) - var/obj/item/bodypart/arm/right/right_arm = species_human.get_bodypart(BODY_ZONE_R_ARM) - var/obj/item/bodypart/arm/left/left_arm = species_human.get_bodypart(BODY_ZONE_L_ARM) - var/obj/item/bodypart/leg/right/right_leg = species_human.get_bodypart(BODY_ZONE_R_LEG) - var/obj/item/bodypart/leg/left/left_leg = species_human.get_bodypart(BODY_ZONE_L_LEG) - var/datum/sprite_accessory/markings = SSaccessories.moth_markings_list[species_human.dna.features["moth_markings"]] - var/mutable_appearance/marking = mutable_appearance(layer = -BODY_LAYER, appearance_flags = KEEP_TOGETHER) - - if(noggin && (IS_ORGANIC_LIMB(noggin))) - var/mutable_appearance/markings_head_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_head") - marking.overlays += markings_head_overlay - - if(chest && (IS_ORGANIC_LIMB(chest))) - var/mutable_appearance/markings_chest_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_chest") - marking.overlays += markings_chest_overlay - - if(right_arm && (IS_ORGANIC_LIMB(right_arm))) - var/mutable_appearance/markings_r_arm_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_r_arm") - marking.overlays += markings_r_arm_overlay - - if(left_arm && (IS_ORGANIC_LIMB(left_arm))) - var/mutable_appearance/markings_l_arm_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_l_arm") - marking.overlays += markings_l_arm_overlay - - if(right_leg && (IS_ORGANIC_LIMB(right_leg))) - var/mutable_appearance/markings_r_leg_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_r_leg") - marking.overlays += markings_r_leg_overlay - - if(left_leg && (IS_ORGANIC_LIMB(left_leg))) - var/mutable_appearance/markings_l_leg_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_l_leg") - marking.overlays += markings_l_leg_overlay - - standing += marking - //Underwear, Undershirts & Socks if(!HAS_TRAIT(species_human, TRAIT_NO_UNDERWEAR)) if(species_human.underwear) @@ -716,8 +685,6 @@ GLOBAL_LIST_EMPTY(features_by_species) switch(bodypart) if("ears") accessory = SSaccessories.ears_list[source.dna.features["ears"]] - if("body_markings") - accessory = SSaccessories.body_markings_list[source.dna.features["body_markings"]] if("legs") accessory = SSaccessories.legs_list[source.dna.features["legs"]] @@ -770,10 +737,11 @@ GLOBAL_LIST_EMPTY(features_by_species) source.apply_overlay(BODY_BEHIND_LAYER) source.apply_overlay(BODY_ADJ_LAYER) source.apply_overlay(BODY_FRONT_LAYER) + + update_body_markings(source) */ //SKYRAT EDIT REMOVAL END - //This exists so sprite accessories can still be per-layer without having to include that layer's //number in their sprite name, which causes issues when those numbers change. /datum/species/proc/mutant_bodyparts_layertext(layer) @@ -1587,6 +1555,7 @@ GLOBAL_LIST_EMPTY(features_by_species) || (preference.relevant_inherent_trait in inherent_traits) \ || (preference.relevant_external_organ in external_organs) \ || (preference.relevant_head_flag && check_head_flags(preference.relevant_head_flag)) \ + || (preference.relevant_body_markings in body_markings) \ ) features += preference.savefile_key @@ -2205,3 +2174,48 @@ GLOBAL_LIST_EMPTY(features_by_species) return fixed_mut_color return null + +/// Add species appropriate body markings +/datum/species/proc/add_body_markings(mob/living/carbon/human/hooman) + for(var/markings_type in body_markings) //loop through possible species markings + var/datum/bodypart_overlay/simple/body_marking/markings = new markings_type() // made to die... mostly because we cant use initial on lists but its convenient and organized + var/accessory_name = hooman.dna.features[markings.dna_feature_key] //get the accessory name from dna + var/datum/sprite_accessory/moth_markings/accessory = markings.get_accessory(accessory_name) //get the actual datum + + if(isnull(accessory)) + CRASH("Value: [accessory_name] did not have a corresponding sprite accessory!") + + for(var/obj/item/bodypart/part as anything in markings.applies_to) //check through our limbs + var/obj/item/bodypart/people_part = hooman.get_bodypart(initial(part.body_zone)) // and see if we have a compatible marking for that limb + + if(!people_part) + continue + + var/datum/bodypart_overlay/simple/body_marking/overlay = new markings_type () + + // Tell the overlay what it should look like + overlay.icon = accessory.icon + overlay.icon_state = accessory.icon_state + overlay.use_gender = accessory.gender_specific + overlay.draw_color = accessory.color_src ? hooman.dna.features["mcolor"] : null + + people_part.add_bodypart_overlay(overlay) + +/// Remove body markings +/datum/species/proc/remove_body_markings(mob/living/carbon/human/hooman) + for(var/obj/item/bodypart/part as anything in hooman.bodyparts) + for(var/datum/bodypart_overlay/simple/body_marking/marking in part.bodypart_overlays) + part.remove_bodypart_overlay(marking) + +/// Update the overlays if necessary +/datum/species/proc/update_body_markings(mob/living/carbon/human/hooman) + var/needs_update = FALSE + for(var/datum/bodypart_overlay/simple/body_marking/marking as anything in body_markings) + if(initial(marking.dna_feature_key) == body_markings[marking]) // dna is same as our species (sort of mini-cache), so no update needed + continue + needs_update = TRUE + break + + if(needs_update) + remove_body_markings(hooman) + add_body_markings(hooman) diff --git a/code/modules/mob/living/carbon/human/dummy.dm b/code/modules/mob/living/carbon/human/dummy.dm index d07edbed57f..01867694ab6 100644 --- a/code/modules/mob/living/carbon/human/dummy.dm +++ b/code/modules/mob/living/carbon/human/dummy.dm @@ -104,7 +104,7 @@ INITIALIZE_IMMEDIATE(/mob/living/carbon/human/dummy) /* SKYRAT EDIT START - Customization - ORIGINAL: target.dna.features["mcolor"] = COLOR_VIBRANT_LIME target.dna.features["ethcolor"] = COLOR_WHITE - target.dna.features["body_markings"] = get_consistent_feature_entry(SSaccessories.body_markings_list) + target.dna.features["lizard_markings"] = get_consistent_feature_entry(SSaccessories.lizard_markings_list) target.dna.features["ears"] = get_consistent_feature_entry(SSaccessories.ears_list) target.dna.features["frills"] = get_consistent_feature_entry(SSaccessories.frills_list) target.dna.features["horns"] = get_consistent_feature_entry(SSaccessories.horns_list) diff --git a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm index 2a13653bf6b..b8ee1344bfc 100644 --- a/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/lizardpeople.dm @@ -8,7 +8,8 @@ TRAIT_TACKLING_TAILED_DEFENDER, ) inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID|MOB_REPTILE - mutant_bodyparts = list("body_markings" = "None", "legs" = "Normal Legs") + mutant_bodyparts = list("body_markings" = "None", "legs" = "Normal Legs") // SKYRAT EDIT CHANGE - ORIGINAL: mutant_bodyparts = list("legs" = "Normal Legs") + //body_markings = list(/datum/bodypart_overlay/simple/body_marking/lizard = "None") // SKYRAT EDIT REMOVAL - We do this our own way external_organs = list( /obj/item/organ/external/horns = "None", /obj/item/organ/external/frills = "None", @@ -51,7 +52,7 @@ /* /datum/species/lizard/randomize_features() var/list/features = ..() - features["body_markings"] = pick(SSaccessories.body_markings_list) + features["lizard_markings"] = pick(SSaccessories.lizard_markings_list) return features */ //SKYRAT EDIT REMOVAL END diff --git a/code/modules/mob/living/carbon/human/species_types/mothmen.dm b/code/modules/mob/living/carbon/human/species_types/mothmen.dm index 8d67cf9c16a..36355ea080a 100644 --- a/code/modules/mob/living/carbon/human/species_types/mothmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/mothmen.dm @@ -3,12 +3,11 @@ plural_form = "Mothmen" id = SPECIES_MOTH inherent_traits = list( - TRAIT_HAS_MARKINGS, TRAIT_TACKLING_WINGED_ATTACKER, TRAIT_ANTENNAE, ) inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID|MOB_BUG - mutant_bodyparts = list("moth_markings" = "None") + mutant_bodyparts = list("moth_markings" = "None") // SKYRAT EDIT CHANGE - ORIGINAL: body_markings = list(/datum/bodypart_overlay/simple/body_marking/moth = "None") // external_organs = list(/obj/item/organ/external/wings/moth = "Plain", /obj/item/organ/external/antennae = "Plain") // SKYRAT EDIT REMOVAL - Fixing moths meat = /obj/item/food/meat/slab/human/mutant/moth mutanttongue = /obj/item/organ/internal/tongue/moth diff --git a/code/modules/unit_tests/changeling.dm b/code/modules/unit_tests/changeling.dm index 360cd34dd17..bdcc9b2d281 100644 --- a/code/modules/unit_tests/changeling.dm +++ b/code/modules/unit_tests/changeling.dm @@ -80,7 +80,7 @@ ling.dna.mutant_bodyparts["horns"] = list(MUTANT_INDEX_NAME = "Curled", MUTANT_INDEX_COLOR_LIST = list("#292826", "#292826", "#8292826")) // SKYRAT EDIT CHANGE - ORIGINAL: ling.dna.features["horns"] = "Curved" ling.dna.mutant_bodyparts["frills"] = list(MUTANT_INDEX_NAME = "Short", MUTANT_INDEX_COLOR_LIST = list("#886600", "#886600", "#886600")) // SKYRAT EDIT CHANGE - ORIGINAL: ling.dna.features["frills"] = "Sort" ling.dna.mutant_bodyparts["spines"] = list(MUTANT_INDEX_NAME = "Long + Membrane", MUTANT_INDEX_COLOR_LIST = list("#886600", "#886600", "#886600")) // SKYRAT EDIT CHANGE - ORIGINAL: ling.dna.features["spines"] = "Long + Membrane" - ling.dna.body_markings["chest"] = list("Light Belly" = list("#886600", 0)) // SKYRAT EDIT CHANGE - ORIGINAL : ling.dna.features[body_markings] = list("Light Belly") + ling.dna.body_markings["chest"] = list("Light Belly" = list("#886600", 0)) // SKYRAT EDIT CHANGE - ORIGINAL : ling.dna.features[lizard_markings] = list("Light Belly") ling.dna.features["legs"] = DIGITIGRADE_LEGS ling.eye_color_left = COLOR_WHITE ling.eye_color_right = COLOR_WHITE diff --git a/icons/mob/human/species/lizard/lizard_markings.dmi b/icons/mob/human/species/lizard/lizard_markings.dmi new file mode 100644 index 00000000000..7cc8f2fa1b8 Binary files /dev/null and b/icons/mob/human/species/lizard/lizard_markings.dmi differ diff --git a/icons/mob/human/species/lizard/lizard_misc.dmi b/icons/mob/human/species/lizard/lizard_misc.dmi index ab228f29076..346581978e4 100644 Binary files a/icons/mob/human/species/lizard/lizard_misc.dmi and b/icons/mob/human/species/lizard/lizard_misc.dmi differ diff --git a/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm b/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm index 906a27fe61a..71d8702fe97 100644 --- a/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm +++ b/modular_skyrat/master_files/code/modules/client/preferences/mutant_parts.dm @@ -100,7 +100,7 @@ savefile_key = "feature_body_markings" relevant_mutant_bodypart = "body_markings" type_to_check = /datum/preference/toggle/mutant_toggle/body_markings - default_accessory_type = /datum/sprite_accessory/body_markings/none + default_accessory_type = /datum/sprite_accessory/lizard_markings/none /datum/preference/choiced/mutant_choice/body_markings/is_accessible(datum/preferences/preferences) . = ..() // Got to do this because of linters. diff --git a/modular_skyrat/master_files/code/modules/reagents/medicine_reagents/medicine_reagents.dm b/modular_skyrat/master_files/code/modules/reagents/medicine_reagents/medicine_reagents.dm index 8a2a81fd4cb..faba0cdb892 100644 --- a/modular_skyrat/master_files/code/modules/reagents/medicine_reagents/medicine_reagents.dm +++ b/modular_skyrat/master_files/code/modules/reagents/medicine_reagents/medicine_reagents.dm @@ -17,4 +17,4 @@ if(!istype(exposed_mob) || (reac_volume < 0.5)) return - exposed_mob.update_mutant_bodyparts(force_update=TRUE) + exposed_mob.update_mutant_bodyparts() diff --git a/modular_skyrat/modules/customization/datums/dna.dm b/modular_skyrat/modules/customization/datums/dna.dm index c10b8abf27d..180ddf33cf1 100644 --- a/modular_skyrat/modules/customization/datums/dna.dm +++ b/modular_skyrat/modules/customization/datums/dna.dm @@ -232,9 +232,6 @@ GLOBAL_LIST_EMPTY(total_uf_len_by_block) dna.features["skin_color"] = sanitize_hexcolor(get_uni_feature_block(features, DNA_SKIN_COLOR_BLOCK)) if(icon_update) - if(mutcolor_update) - update_body(is_creating = TRUE) - else - update_body() + update_body(is_creating = mutcolor_update) if(mutations_overlay_update) update_mutations_overlay() diff --git a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm index 2efc9ab9f3f..6550c9ae755 100644 --- a/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm +++ b/modular_skyrat/modules/customization/modules/mob/dead/new_player/sprite_accessories.dm @@ -159,7 +159,7 @@ GLOBAL_LIST_EMPTY(cached_mutant_icon_files) name = "Round" icon_state = "round" -/datum/sprite_accessory/body_markings +/datum/sprite_accessory/lizard_markings key = "body_markings" generic = "Body Markings" default_color = DEFAULT_TERTIARY diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm index e89ee0b0a1c..b18187e9fd6 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species.dm @@ -36,7 +36,7 @@ GLOBAL_LIST_EMPTY(customizable_races) /datum/species/proc/get_default_mutant_bodyparts() return list() -/datum/species/proc/handle_mutant_bodyparts(mob/living/carbon/human/owner, forced_colour, force_update = FALSE) +/datum/species/proc/handle_mutant_bodyparts(mob/living/carbon/human/source, forced_colour) return /datum/species/dullahan diff --git a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/moth.dm b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/moth.dm index 562ba54398d..9fa8d667c74 100644 --- a/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/moth.dm +++ b/modular_skyrat/modules/customization/modules/mob/living/carbon/human/species/moth.dm @@ -1,7 +1,6 @@ /datum/species/moth mutant_bodyparts = list() inherent_traits = list( - TRAIT_HAS_MARKINGS, TRAIT_TACKLING_WINGED_ATTACKER, TRAIT_ANTENNAE, TRAIT_MUTANT_COLORS, diff --git a/modular_skyrat/modules/primitive_catgirls/code/species.dm b/modular_skyrat/modules/primitive_catgirls/code/species.dm index ea04f051006..d0b0f5cbaac 100644 --- a/modular_skyrat/modules/primitive_catgirls/code/species.dm +++ b/modular_skyrat/modules/primitive_catgirls/code/species.dm @@ -70,8 +70,8 @@ human_for_preview.dna.species.mutant_bodyparts["tail"] = list(MUTANT_INDEX_NAME = "Cat", MUTANT_INDEX_COLOR_LIST = list(human_for_preview.hair_color)) human_for_preview.dna.species.mutant_bodyparts["ears"] = list(MUTANT_INDEX_NAME = "Cat", MUTANT_INDEX_COLOR_LIST = list(human_for_preview.hair_color)) - human_for_preview.update_mutant_bodyparts(TRUE) - human_for_preview.update_body(TRUE) + human_for_preview.update_mutant_bodyparts() + human_for_preview.update_body(is_creating = TRUE) /datum/species/human/felinid/primitive/get_species_description() return list( diff --git a/modular_skyrat/modules/teshari/code/_teshari.dm b/modular_skyrat/modules/teshari/code/_teshari.dm index 39dd33443bf..0cb21f0e32a 100644 --- a/modular_skyrat/modules/teshari/code/_teshari.dm +++ b/modular_skyrat/modules/teshari/code/_teshari.dm @@ -13,7 +13,6 @@ TRAIT_LITERATE, TRAIT_MUTANT_COLORS, TRAIT_NO_UNDERWEAR, - TRAIT_HAS_MARKINGS, ) digitigrade_customization = DIGITIGRADE_NEVER changesource_flags = MIRROR_BADMIN | WABBAJACK | MIRROR_MAGIC | MIRROR_PRIDE | ERT_SPAWN | RACE_SWAP | SLIME_EXTRACT diff --git a/tgstation.dme b/tgstation.dme index b2e79ec76a4..a6607fb33a1 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -1086,6 +1086,7 @@ #include "code\datums\atmosphere\planetary.dm" #include "code\datums\bodypart_overlays\bodypart_overlay.dm" #include "code\datums\bodypart_overlays\emote_bodypart_overlay.dm" +#include "code\datums\bodypart_overlays\markings_bodypart_overlay.dm" #include "code\datums\bodypart_overlays\mutant_bodypart_overlay.dm" #include "code\datums\bodypart_overlays\simple_bodypart_overlay.dm" #include "code\datums\brain_damage\brain_trauma.dm"