From 9efdad1d6b980d4b6e237c360835649c1aebfff8 Mon Sep 17 00:00:00 2001 From: deathride58 Date: Tue, 3 Mar 2020 13:55:33 -0500 Subject: [PATCH] Initial commit - lays out the foundation for a more robust limb icon override system. You're welcome. --- code/__DEFINES/mobs.dm | 2 + code/game/machinery/limbgrower.dm | 3 +- .../mob/living/carbon/human/species.dm | 2 +- .../carbon/human/species_types/bugmen.dm | 2 +- .../carbon/human/species_types/furrypeople.dm | 4 +- .../living/carbon/human/species_types/ipc.dm | 2 +- code/modules/surgery/bodyparts/bodyparts.dm | 54 ++++++++----------- 7 files changed, 30 insertions(+), 39 deletions(-) diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index dc67de3150..c1686560d6 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -58,8 +58,10 @@ #define BODYPART_DISABLED_DAMAGE 1 #define BODYPART_DISABLED_PARALYSIS 2 +#define DEFAULT_BODYPART_ICON 'icons/mob/human_parts.dmi' #define DEFAULT_BODYPART_ICON_ORGANIC 'icons/mob/human_parts_greyscale.dmi' #define DEFAULT_BODYPART_ICON_ROBOTIC 'icons/mob/augmentation/augments.dmi' +#define DEFAULT_BODYPART_ICON_CITADEL 'modular_citadel/icons/mob/mutant_bodyparts.dmi' #define MONKEY_BODYPART "monkey" #define ALIEN_BODYPART "alien" diff --git a/code/game/machinery/limbgrower.dm b/code/game/machinery/limbgrower.dm index 28afea817b..f77cf3adfb 100644 --- a/code/game/machinery/limbgrower.dm +++ b/code/game/machinery/limbgrower.dm @@ -138,7 +138,8 @@ limb = new buildpath(loc) if(selected_category=="human" || selected_category=="lizard") //Species with greyscale parts should be included here limb.icon = 'icons/mob/human_parts_greyscale.dmi' - limb.should_draw_greyscale = TRUE + limb.base_bp_icon = DEFAULT_BODYPART_ICON_ORGANIC + limb.color_src = MUTCOLORS else limb.icon = 'icons/mob/human_parts.dmi' // Set this limb up using the specias name and body zone diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index b1bc47ea4a..917317262c 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -104,7 +104,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names) var/fixed_mut_color3 = "" var/whitelisted = 0 //Is this species restricted to certain players? var/whitelist = list() //List the ckeys that can use this species, if it's whitelisted.: list("John Doe", "poopface666", "SeeALiggerPullTheTrigger") Spaces & capitalization can be included or ignored entirely for each key as it checks for both. - var/should_draw_citadel = FALSE + var/icon_limbs //Overrides the icon used for the limbs of this species. Mainly for downstream, and also because hardcoded icons disgust me. Implemented and maintained as a favor in return for a downstream's implementation of synths. /////////// // PROCS // diff --git a/code/modules/mob/living/carbon/human/species_types/bugmen.dm b/code/modules/mob/living/carbon/human/species_types/bugmen.dm index e2e41330fb..6bd8a44e0a 100644 --- a/code/modules/mob/living/carbon/human/species_types/bugmen.dm +++ b/code/modules/mob/living/carbon/human/species_types/bugmen.dm @@ -13,7 +13,7 @@ meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/insect liked_food = MEAT | FRUIT disliked_food = TOXIC - should_draw_citadel = TRUE + icon_limbs = DEFAULT_BODYPART_ICON_CITADEL /datum/species/insect/spec_death(gibbed, mob/living/carbon/human/H) if(H) diff --git a/code/modules/mob/living/carbon/human/species_types/furrypeople.dm b/code/modules/mob/living/carbon/human/species_types/furrypeople.dm index ab86b2cc5d..608d71e2c5 100644 --- a/code/modules/mob/living/carbon/human/species_types/furrypeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/furrypeople.dm @@ -2,7 +2,7 @@ name = "Anthromorph" id = "mammal" default_color = "4B4B4B" - should_draw_citadel = TRUE + icon_limbs = DEFAULT_BODYPART_ICON_CITADEL species_traits = list(MUTCOLORS,EYECOLOR,LIPS,HAIR,HORNCOLOR,WINGCOLOR) inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID|MOB_BEAST mutant_bodyparts = list("mam_tail", "mam_ears", "mam_body_markings", "mam_snouts", "deco_wings", "taur", "horns", "legs") @@ -55,7 +55,7 @@ id = "xeno" say_mod = "hisses" default_color = "00FF00" - should_draw_citadel = TRUE + icon_limbs = DEFAULT_BODYPART_ICON_CITADEL species_traits = list(MUTCOLORS,EYECOLOR,LIPS) mutant_bodyparts = list("xenotail", "xenohead", "xenodorsal", "mam_body_markings", "taur", "legs") default_features = list("xenotail"="Xenomorph Tail","xenohead"="Standard","xenodorsal"="Standard", "mam_body_markings" = "Xeno","mcolor" = "0F0","mcolor2" = "0F0","mcolor3" = "0F0","taur" = "None", "legs" = "Digitigrade") diff --git a/code/modules/mob/living/carbon/human/species_types/ipc.dm b/code/modules/mob/living/carbon/human/species_types/ipc.dm index add0e17c43..b7305a9228 100644 --- a/code/modules/mob/living/carbon/human/species_types/ipc.dm +++ b/code/modules/mob/living/carbon/human/species_types/ipc.dm @@ -3,7 +3,7 @@ id = "ipc" say_mod = "beeps" default_color = "00FF00" - should_draw_citadel = TRUE + icon_limbs = DEFAULT_BODYPART_ICON_CITADEL blacklisted = 0 sexes = 0 species_traits = list(MUTCOLORS,NOEYES,NOTRANSSTING) diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm index c9affe92f9..b3d55f9af4 100644 --- a/code/modules/surgery/bodyparts/bodyparts.dm +++ b/code/modules/surgery/bodyparts/bodyparts.dm @@ -41,9 +41,9 @@ var/skin_tone = "" var/body_gender = "" var/species_id = "" - var/should_draw_citadel = FALSE + var/color_src + var/base_bp_icon //Overrides the icon being used for this limb. This is mainly for downstreams, implemented and maintained as a favor in return for implementing synths. And also because should_draw_* for icon overrides was pretty messy. You're welcome. var/should_draw_gender = FALSE - var/should_draw_greyscale = FALSE var/species_color = "" var/mutation_color = "" var/no_update = 0 @@ -283,9 +283,9 @@ if(change_icon_to_default) if(status == BODYPART_ORGANIC) - icon = DEFAULT_BODYPART_ICON_ORGANIC + icon = base_bp_icon ? base_bp_icon : DEFAULT_BODYPART_ICON_ORGANIC else if(status == BODYPART_ROBOTIC) - icon = DEFAULT_BODYPART_ICON_ROBOTIC + icon = base_bp_icon ? base_bp_icon : DEFAULT_BODYPART_ICON_ROBOTIC if(owner) owner.updatehealth() @@ -313,7 +313,8 @@ species_id = "husk" //overrides species_id dmg_overlay_type = "" //no damage overlay shown when husked should_draw_gender = FALSE - should_draw_greyscale = FALSE + color_src = FALSE + base_bp_icon = DEFAULT_BODYPART_ICON no_update = TRUE body_markings = "husk" // reeee aux_marking = "husk" @@ -323,11 +324,11 @@ if(!animal_origin) var/mob/living/carbon/human/H = C - should_draw_greyscale = FALSE + color_src = FALSE var/datum/species/S = H.dna.species + base_bp_icon = S.icon_limbs ? S.icon_limbs : DEFAULT_BODYPART_ICON species_id = S.limbs_id - should_draw_citadel = S.should_draw_citadel // Citadel Addition species_flags_list = H.dna.species.species_traits //body marking memes @@ -342,7 +343,7 @@ if(S.use_skintones) skin_tone = H.skin_tone - should_draw_greyscale = TRUE + base_bp_icon = (base_bp_icon == DEFAULT_BODYPART_ICON) ? DEFAULT_BODYPART_ICON_ORGANIC : base_bp_icon else skin_tone = "" @@ -354,9 +355,12 @@ species_color = S.fixed_mut_color else species_color = H.dna.features["mcolor"] - should_draw_greyscale = TRUE + base_bp_icon = (base_bp_icon == DEFAULT_BODYPART_ICON) ? DEFAULT_BODYPART_ICON_ORGANIC : base_bp_icon else species_color = "" + + if(base_bp_icon != DEFAULT_BODYPART_ICON) + color_src = MUTCOLORS //TODO - Add color matrix support to base limbs if("legs" in S.default_features) if(body_zone == BODY_ZONE_L_LEG || body_zone == BODY_ZONE_R_LEG) @@ -462,32 +466,16 @@ should_draw_gender = FALSE if(is_organic_limb()) - if(should_draw_greyscale) - limb.icon = 'icons/mob/human_parts_greyscale.dmi' - if(should_draw_gender) - limb.icon_state = "[species_id]_[body_zone]_[icon_gender]" - else if(use_digitigrade) + limb.icon = base_bp_icon ? base_bp_icon : 'icons/mob/human_parts.dmi' + if(should_draw_gender) + limb.icon_state = "[species_id]_[body_zone]_[icon_gender]" + else if (use_digitigrade) + if(base_bp_icon == DEFAULT_BODYPART_ICON_ORGANIC) //Compatibility hack for the current iconset. limb.icon_state = "[digitigrade_type]_[use_digitigrade]_[body_zone]" else - limb.icon_state = "[species_id]_[body_zone]" + limb.icon_state = "[species_id]_[digitigrade_type]_[use_digitigrade]_[body_zone]" else - limb.icon = 'icons/mob/human_parts.dmi' - if(should_draw_gender) - limb.icon_state = "[species_id]_[body_zone]_[icon_gender]" - else if(use_digitigrade) - limb.icon_state = "[species_id]_[digitigrade_type]_[use_digitigrade]_[body_zone]" - else - limb.icon_state = "[species_id]_[body_zone]" - - // Citadel Start - if(should_draw_citadel) - limb.icon = 'modular_citadel/icons/mob/mutant_bodyparts.dmi' - if(should_draw_gender) - limb.icon_state = "[species_id]_[body_zone]_[icon_gender]" - else if(use_digitigrade) - limb.icon_state = "[species_id]_[digitigrade_type]_[use_digitigrade]_[body_zone]" - else - limb.icon_state = "[species_id]_[body_zone]" + limb.icon_state = "[species_id]_[body_zone]" // Body markings if(!isnull(body_markings)) @@ -555,7 +543,7 @@ . += marking return - if(should_draw_greyscale) + if(color_src) //TODO - add color matrix support for base species limbs var/draw_color = mutation_color || species_color || (skin_tone && skintone2hex(skin_tone)) if(draw_color) limb.color = "#[draw_color]"