diff --git a/code/__DEFINES/external_organs.dm b/code/__DEFINES/external_organs.dm index 5d84a3aecdd9..d6ec21f2f775 100644 --- a/code/__DEFINES/external_organs.dm +++ b/code/__DEFINES/external_organs.dm @@ -5,6 +5,11 @@ ///Uses the parent's haircolor #define ORGAN_COLOR_HAIR (1<<2) +// BEGIN NON-MODULE CHANGE +// in a chain, inherit the mob's mutant color, a forced mutant color, before the true draw color +#define ORGAN_COLOR_MUTANT_OVERRIDE (1<<3) +// END NON-MODULE CHANGE + ///Tail wagging #define WAG_ABLE (1<<0) #define WAG_WAGGING (1<<1) diff --git a/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm b/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm index 35440ebab830..6132f583b1e9 100644 --- a/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm @@ -131,6 +131,10 @@ if(isnull(draw_color) && ishuman(bodypart_owner.owner)) var/mob/living/carbon/human/human_owner = bodypart_owner.owner draw_color = human_owner.hair_color + // BEGIN NON-MODULE CHANGE + if(ORGAN_COLOR_MUTANT_OVERRIDE) + draw_color = mutant_override_color(bodypart_owner) + // END NON-MODULE CHANGE return TRUE diff --git a/code/modules/surgery/organs/external/_visual_organs.dm b/code/modules/surgery/organs/external/_visual_organs.dm index 9decb58b79e0..c0db98cb49ab 100644 --- a/code/modules/surgery/organs/external/_visual_organs.dm +++ b/code/modules/surgery/organs/external/_visual_organs.dm @@ -152,7 +152,7 @@ Unlike normal organs, we're actually inside a persons limbs at all times /datum/bodypart_overlay/mutant/frills layers = EXTERNAL_ADJACENT feature_key = "frills" - color_source = ORGAN_COLOR_OVERRIDE + color_source = ORGAN_COLOR_MUTANT_OVERRIDE // NON-MODULE CHANGE /datum/bodypart_overlay/mutant/frills/can_draw_on_bodypart(obj/item/bodypart/bodypart_owner) return !(bodypart_owner.owner?.obscured_slots & HIDEEARS) @@ -160,18 +160,11 @@ Unlike normal organs, we're actually inside a persons limbs at all times /datum/bodypart_overlay/mutant/frills/get_global_feature_list() return SSaccessories.frills_list -/datum/bodypart_overlay/mutant/frills/override_color(obj/item/bodypart/bodypart_owner) +// BEGIN NON-MODULE CHANGE +/datum/bodypart_overlay/mutant/frills/mutant_override_color(obj/item/bodypart/bodypart_owner) // NOTE: this was originally in the slot of "override_color" but was changed to this. // prioritize a specific color they have set - if(bodypart_owner?.owner?.dna?.features["lizard_frill_color"]) - return bodypart_owner.owner.dna.features["lizard_frill_color"] - // then use body color if we should be mutant colored - if(isnull(bodypart_owner.owner) || HAS_TRAIT(bodypart_owner.owner, TRAIT_MUTANT_COLORS) || HAS_TRAIT(bodypart_owner, TRAIT_MUTANT_COLORS)) - return bodypart_owner.draw_color - // then use forced color - for non-mutant-colored species, like piscinids - if(bodypart_owner?.owner?.dna?.features["forced_fish_color"]) - return bodypart_owner.owner.dna.features["forced_fish_color"] - // then default to body color - though this will probably be skin color, some forced color, or pure white - return bodypart_owner.draw_color + return bodypart_owner?.owner?.dna?.features["lizard_frill_color"] || ..() +// END NON-MODULE CHANGE /datum/bodypart_overlay/mutant/frills/generate_icon_cache(obj/item/bodypart/limb) . = ..() diff --git a/code/modules/surgery/organs/external/spines.dm b/code/modules/surgery/organs/external/spines.dm index 65aa0b9a2586..b269b9416660 100644 --- a/code/modules/surgery/organs/external/spines.dm +++ b/code/modules/surgery/organs/external/spines.dm @@ -34,6 +34,7 @@ layers = EXTERNAL_ADJACENT|EXTERNAL_BEHIND feature_key = "spines" dyable = TRUE + color_source = ORGAN_COLOR_MUTANT_OVERRIDE // NON-MODULE CHANGE /datum/bodypart_overlay/mutant/spines/get_global_feature_list() return SSaccessories.spines_list diff --git a/code/modules/surgery/organs/external/tails.dm b/code/modules/surgery/organs/external/tails.dm index 7fe537165caf..426e0c87e351 100644 --- a/code/modules/surgery/organs/external/tails.dm +++ b/code/modules/surgery/organs/external/tails.dm @@ -211,6 +211,7 @@ /datum/bodypart_overlay/mutant/tail/lizard feature_key = "tail_lizard" mesh_in_suits = TRUE + color_source = ORGAN_COLOR_MUTANT_OVERRIDE // NON-MODULE CHANGE /datum/bodypart_overlay/mutant/tail/lizard/get_global_feature_list() return SSaccessories.tails_list_lizard @@ -227,6 +228,7 @@ var/wagging = FALSE /// Key for tail spine states, depends on the shape of the tail. Defined in the tail sprite datum. var/tail_spine_key = NONE + color_source = ORGAN_COLOR_MUTANT_OVERRIDE // NON-MODULE CHANGE /datum/bodypart_overlay/mutant/tail_spines/get_global_feature_list() return SSaccessories.tail_spines_list diff --git a/code/modules/surgery/organs/external/wings/functional_wings.dm b/code/modules/surgery/organs/external/wings/functional_wings.dm index f03af571b7c2..e1c86284ee79 100644 --- a/code/modules/surgery/organs/external/wings/functional_wings.dm +++ b/code/modules/surgery/organs/external/wings/functional_wings.dm @@ -179,6 +179,7 @@ name = "dragon wings" desc = "Hey, HEY- NOT lizard wings. Dragon wings. Mighty dragon wings." sprite_accessory_override = /datum/sprite_accessory/wings/dragon + bodypart_overlay = /datum/bodypart_overlay/mutant/wings/functional/mutant_color // NON_MODULE CHANGE ///robotic wings, which relate to androids. /obj/item/organ/wings/functional/robotic diff --git a/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_human_animid_Lizard.png b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_human_animid_Lizard.png new file mode 100644 index 000000000000..48b61a49d6c4 Binary files /dev/null and b/code/modules/unit_tests/screenshots/screenshot_humanoids__datum_species_human_animid_Lizard.png differ diff --git a/maplestation.dme b/maplestation.dme index 4fe727a5440f..5d0fc3d1094b 100644 --- a/maplestation.dme +++ b/maplestation.dme @@ -6308,6 +6308,7 @@ #include "maplestation_modules\code\controllers\subsystem\pain_subsystem.dm" #include "maplestation_modules\code\datums\dna.dm" #include "maplestation_modules\code\datums\shuttles.dm" +#include "maplestation_modules\code\datums\bodypart_overlays\mutant_bodypart_overlay.dm" #include "maplestation_modules\code\datums\brain_damage\split_personality.dm" #include "maplestation_modules\code\datums\components\easy_ignite.dm" #include "maplestation_modules\code\datums\components\knockoff_move.dm" @@ -6715,6 +6716,7 @@ #include "maplestation_modules\code\modules\mob\living\carbon\human\species_types\animid\animid_dog.dm" #include "maplestation_modules\code\modules\mob\living\carbon\human\species_types\animid\animid_fish.dm" #include "maplestation_modules\code\modules\mob\living\carbon\human\species_types\animid\animid_fox.dm" +#include "maplestation_modules\code\modules\mob\living\carbon\human\species_types\animid\animid_lizard.dm" #include "maplestation_modules\code\modules\mob\living\carbon\human\species_types\animid\animid_prefs.dm" #include "maplestation_modules\code\modules\mob\living\carbon\human\species_types\animid\animid_rat.dm" #include "maplestation_modules\code\modules\mob\living\carbon\human\species_types\synth\android.dm" diff --git a/maplestation_modules/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm b/maplestation_modules/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm new file mode 100644 index 000000000000..19f1526b714a --- /dev/null +++ b/maplestation_modules/code/datums/bodypart_overlays/mutant_bodypart_overlay.dm @@ -0,0 +1,14 @@ +// used for additional stuff on mutant bodypart overlays + +// used by "ORGAN_COLOR_MUTANT_OVERRIDE" but can also be used by other organs' color overrides +/datum/bodypart_overlay/mutant/proc/mutant_override_color(obj/item/bodypart/bodypart_owner) + // use body color if we should be mutant colored + if(isnull(bodypart_owner.owner) || HAS_TRAIT(bodypart_owner.owner, TRAIT_MUTANT_COLORS) || HAS_TRAIT(bodypart_owner, TRAIT_MUTANT_COLORS)) + return bodypart_owner.draw_color + // first try to use forced color - for non-mutant-colored species, like piscinids + // then default to body color - though this will probably be skin color, some other forced color, or pure white + return bodypart_owner.owner.dna.features["forced_mut_color"] || bodypart_owner.draw_color + +// todo: figure out how on god's green earth functional wings even get their color, also refactor that part of the code and push it to TG +/datum/bodypart_overlay/mutant/wings/functional/mutant_color + color_source = ORGAN_COLOR_MUTANT_OVERRIDE diff --git a/maplestation_modules/code/modules/client/preferences/species/lizard.dm b/maplestation_modules/code/modules/client/preferences/species/lizard.dm index 0e142b8815f5..a806fbaea35e 100644 --- a/maplestation_modules/code/modules/client/preferences/species/lizard.dm +++ b/maplestation_modules/code/modules/client/preferences/species/lizard.dm @@ -61,7 +61,10 @@ return 3 /datum/preference/numeric/hiss_length/is_accessible(datum/preferences/preferences) - return ..() && ispath(preferences.read_preference(/datum/preference/choiced/species), /datum/species/lizard) + var/datum/species/target_species = preferences.read_preference(/datum/preference/choiced/species) + // lizard animids, are, for many reasons, a bit funky so i'll add an exception for them + var/species_check = (ispath(target_species, /datum/species/human/animid)) && (preferences.read_preference(/datum/preference/choiced/animid_type) == /datum/animid_type/lizard::id) + return ..() && (ispath(target_species::mutanttongue, /obj/item/organ/tongue/lizard) || species_check) /datum/preference/numeric/hiss_length/apply_to_human(mob/living/carbon/human/target, value) var/obj/item/organ/tongue/lizard/tongue = target.get_organ_slot(ORGAN_SLOT_TONGUE) diff --git a/maplestation_modules/code/modules/mob/living/carbon/human/species_types/animid/animid_fish.dm b/maplestation_modules/code/modules/mob/living/carbon/human/species_types/animid/animid_fish.dm index b87d77a135d4..4180f651b1cf 100644 --- a/maplestation_modules/code/modules/mob/living/carbon/human/species_types/animid/animid_fish.dm +++ b/maplestation_modules/code/modules/mob/living/carbon/human/species_types/animid/animid_fish.dm @@ -20,7 +20,7 @@ /datum/animid_type/fish/pre_species_gain(datum/species/human/animid/species, mob/living/carbon/human/new_animid) // ensures we get mutant color rather than a random forced color - new_animid.dna?.features["forced_fish_color"] = new_animid.dna?.features["mcolor"] + new_animid.dna?.features["forced_mut_color"] = new_animid.dna?.features["mcolor"] /datum/animid_type/fish/extra_feature_keys() return list(/datum/preference/color/mutant_color::savefile_key) @@ -95,7 +95,7 @@ . = ..() RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(check_location)) check_location(owner, null) - owner.dna.features["forced_fish_color"] ||= pick("#B4B8DD", "#85C7D0", "#67BBEE", "#2F4450", "#55CCBB", "#999FD0", "#345066", "#585B69", "#7381A0", "#B6DDE5", "#4E4E50") + owner.dna.features["forced_mut_color"] ||= pick("#B4B8DD", "#85C7D0", "#67BBEE", "#2F4450", "#55CCBB", "#999FD0", "#345066", "#585B69", "#7381A0", "#B6DDE5", "#4E4E50") /obj/item/organ/tail/fish/on_mob_remove(mob/living/carbon/owner) . = ..() @@ -129,16 +129,9 @@ /datum/bodypart_overlay/mutant/tail/fish feature_key = "fish_tail" - color_source = ORGAN_COLOR_OVERRIDE + color_source = ORGAN_COLOR_MUTANT_OVERRIDE mesh_in_suits = TRUE -/datum/bodypart_overlay/mutant/tail/fish/override_color(obj/item/bodypart/bodypart_owner) - //If the owner uses mutant colors, inherit the color of the bodypart - if(!bodypart_owner.owner || HAS_TRAIT(bodypart_owner.owner, TRAIT_MUTANT_COLORS)) - return bodypart_owner.draw_color - - return bodypart_owner.owner.dna?.features["forced_fish_color"] || bodypart_owner.draw_color - /datum/bodypart_overlay/mutant/tail/fish/get_global_feature_list() return SSaccessories.tails_list_fish @@ -213,6 +206,7 @@ texture_bodypart_overlay = /datum/bodypart_overlay/texture/fishscale brute_modifier = 0.9 burn_modifier = 0.9 + wing_types = list(/obj/item/organ/wings/functional/angel, /obj/item/organ/wings/functional/dragon) /obj/item/bodypart/head/scaled texture_bodypart_overlay = /datum/bodypart_overlay/texture/fishscale diff --git a/maplestation_modules/code/modules/mob/living/carbon/human/species_types/animid/animid_lizard.dm b/maplestation_modules/code/modules/mob/living/carbon/human/species_types/animid/animid_lizard.dm new file mode 100644 index 000000000000..d0dc71363eba --- /dev/null +++ b/maplestation_modules/code/modules/mob/living/carbon/human/species_types/animid/animid_lizard.dm @@ -0,0 +1,65 @@ +/datum/animid_type/lizard + id = "Lizard" + components = list( + BODY_ZONE_CHEST = /obj/item/bodypart/chest/scaled, + BODY_ZONE_HEAD = /obj/item/bodypart/head/scaled, + BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left/scaled, + BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left/scaled, + BODY_ZONE_R_ARM = /obj/item/bodypart/arm/right/scaled, + BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right/scaled, + MUTANT_ORGANS = list( + /obj/item/organ/horns = SPRITE_ACCESSORY_NONE, + /obj/item/organ/frills = SPRITE_ACCESSORY_NONE, + /obj/item/organ/spines = SPRITE_ACCESSORY_NONE, + /obj/item/organ/tail/lizard = /datum/sprite_accessory/tails/lizard/smooth::name, + ), + ) + + name = "Reptilid" + icon = FA_ICON_DRAGON + +/datum/animid_type/lizard/pre_species_gain(datum/species/human/animid/species, mob/living/carbon/human/new_animid) + // ensures we get mutant color rather than a random forced color + new_animid.dna?.features["forced_mut_color"] = new_animid.dna?.features["mcolor"] + species.mutanttongue = new_animid.dna?.features["hissing"] ? /obj/item/organ/tongue/lizard : /obj/item/organ/tongue/lizard/no_hiss + +/datum/animid_type/lizard/extra_feature_keys() + return list(/datum/preference/color/mutant_color::savefile_key) + +/datum/animid_type/lizard/get_readable_features() + return ..() + "Scales" + +/datum/animid_type/lizard/get_extra_perks() + var/list/to_add = list() + + to_add += list( + list( + SPECIES_PERK_TYPE = SPECIES_NEUTRAL_PERK, + SPECIES_PERK_ICON = FA_ICON_HAND_FIST, + SPECIES_PERK_NAME = "Scaled Defense", + SPECIES_PERK_DESC = "[name] scales provide a minor amount of resistance to bruises and burns. \ + However, good luck disguising your scaled skin.", + ), + ) + + return to_add + +/datum/preference/toggle/liz_tongue_hissing + savefile_key = "liz_tongue_hissing" + savefile_identifier = PREFERENCE_CHARACTER + category = PREFERENCE_CATEGORY_SECONDARY_FEATURES + can_randomize = FALSE + default_value = FALSE + +/datum/preference/toggle/liz_tongue_hissing/apply_to_human(mob/living/carbon/human/target, value) + // behavior is only applied on animids by default + target.dna.features["hissing"] = value + +/datum/preference/toggle/liz_tongue_hissing/is_accessible(datum/preferences/preferences) + return ..() && ((ispath(preferences.read_preference(/datum/preference/choiced/species), /datum/species/human/animid)) && (preferences.read_preference(/datum/preference/choiced/animid_type) == /datum/animid_type/lizard::id)) + +/obj/item/organ/tongue/lizard/no_hiss // because modifies_speech only affects things on init + name = "mutated forked tongue" + desc = "A thin and long muscle typically found in reptilian races, apparently moonlights as a nose. The ends on this one appear more rigid than normal, reducing the amount of hissing." + modifies_speech = FALSE // no hiss for you + draw_length = 0 diff --git a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx index 5bedcab6da25..649fa2725deb 100644 --- a/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx +++ b/tgui/packages/tgui/interfaces/PreferencesMenu/preferences/features/_modular_species_features.tsx @@ -167,6 +167,12 @@ export const feature_fox_tail: FeatureChoiced = { component: FeatureDropdownInput, }; +export const liz_tongue_hissing: FeatureToggle = { + name: 'Lizard Speech', + description: 'If checked, you will sssspeak like a lizardperson.', + component: CheckboxInput, +}; + export const feature_android_species: FeatureChoiced = { name: 'Android Species', description: 'Determines what species you are modeled after.',