diff --git a/code/__DEFINES/bodyparts.dm b/code/__DEFINES/bodyparts.dm index c36eeda76dee..e5d7181fd3cd 100644 --- a/code/__DEFINES/bodyparts.dm +++ b/code/__DEFINES/bodyparts.dm @@ -50,10 +50,11 @@ // #define LIMB_COLOR_VOIDWALKER_CURSE 50 // // Overlay priorities -// #define BODYPART_OVERLAY_FISH_INFUSION 1 -// #define BODYPART_OVERLAY_CARP_INFUSION 2 -// #define BODYPART_OVERLAY_CSS_SUICIDE 3 -// #define BODYPART_OVERLAY_VOIDWALKER_CURSE 4 +#define BODYPART_OVERLAY_FISH_INFUSION 1 +#define BODYPART_OVERLAY_CARP_INFUSION 2 +#define BODYPART_OVERLAY_CSS_SUICIDE 3 +#define BODYPART_OVERLAY_VOIDWALKER_CURSE 4 +#define BODYPART_OVERLAY_MESH 5 // Bodypart surgery state /// An incision has been made into the skin diff --git a/code/datums/bodypart_overlays/bodypart_overlay.dm b/code/datums/bodypart_overlays/bodypart_overlay.dm index 65559f2924b1..1d6020103603 100644 --- a/code/datums/bodypart_overlays/bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/bodypart_overlay.dm @@ -81,5 +81,5 @@ return list() /// Additionally color or texture the limb -/datum/bodypart_overlay/proc/modify_bodypart_appearance(datum/appearance) +/datum/bodypart_overlay/proc/modify_bodypart_appearance(image/appearance) return diff --git a/code/datums/bodypart_overlays/markings_bodypart_overlay.dm b/code/datums/bodypart_overlays/markings_bodypart_overlay.dm index ecc7e13c2f90..39dcd6185f18 100644 --- a/code/datums/bodypart_overlays/markings_bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/markings_bodypart_overlay.dm @@ -35,7 +35,7 @@ . += use_gender . += draw_color -/datum/bodypart_overlay/simple/body_marking/can_draw_on_bodypart(mob/living/carbon/human/human) +/datum/bodypart_overlay/simple/body_marking/can_draw_on_bodypart(obj/item/bodypart/bodypart_owner) return icon_state != SPRITE_ACCESSORY_NONE /datum/bodypart_overlay/simple/body_marking/get_image(layer, obj/item/bodypart/limb) diff --git a/code/datums/bodypart_overlays/texture_bodypart_overlay.dm b/code/datums/bodypart_overlays/texture_bodypart_overlay.dm index 9b66acfbcf0f..22920ea8b983 100644 --- a/code/datums/bodypart_overlays/texture_bodypart_overlay.dm +++ b/code/datums/bodypart_overlays/texture_bodypart_overlay.dm @@ -5,15 +5,16 @@ /// icon state for the texture var/texture_icon_state /// Cache the icon so we dont have to make a new one each time - var/cached_texture_icon - /// Priority of this texture - all textures with a lower priority will not be rendered + VAR_FINAL/icon/cached_texture_icon + + /// Priority of this texture - all textures with a lower priority will outright not be rendered var/overlay_priority = 0 /datum/bodypart_overlay/texture/New() . = ..() cached_texture_icon = icon(texture_icon, texture_icon_state) -/datum/bodypart_overlay/texture/modify_bodypart_appearance(datum/appearance) +/datum/bodypart_overlay/texture/modify_bodypart_appearance(image/appearance) appearance.add_filter("bodypart_texture_[texture_icon_state]", 1, layering_filter(icon = cached_texture_icon, blend_mode = BLEND_INSET_OVERLAY)) /datum/bodypart_overlay/texture/generate_icon_cache() @@ -29,19 +30,114 @@ blocks_emissive = EMISSIVE_BLOCK_NONE texture_icon_state = "spacey" texture_icon = 'icons/mob/human/textures.dmi' - // overlay_priority = BODYPART_OVERLAY_VOIDWALKER_CURSE + overlay_priority = BODYPART_OVERLAY_VOIDWALKER_CURSE /datum/bodypart_overlay/texture/carpskin texture_icon_state = "carpskin" texture_icon = 'icons/mob/human/textures.dmi' - // overlay_priority = BODYPART_OVERLAY_CARP_INFUSION + overlay_priority = BODYPART_OVERLAY_CARP_INFUSION /datum/bodypart_overlay/texture/checkered texture_icon_state = "checkered" texture_icon = 'icons/mob/human/textures.dmi' - // overlay_priority = BODYPART_OVERLAY_CSS_SUICIDE + overlay_priority = BODYPART_OVERLAY_CSS_SUICIDE /datum/bodypart_overlay/texture/fishscale texture_icon_state = "fishscale" texture_icon = 'icons/mob/human/textures.dmi' - // overlay_priority = BODYPART_OVERLAY_FISH_INFUSION + overlay_priority = BODYPART_OVERLAY_FISH_INFUSION + +/datum/bodypart_overlay/texture/mesh + texture_icon_state = "mesh_mask" + texture_icon = 'maplestation_modules/icons/mob/clothing/tail_suit_mask.dmi' + overlay_priority = BODYPART_OVERLAY_MESH + /// Icon state for displacement map that comes with the texture + var/displacement_icon_state = "mesh_mask_displacement" + /// Icon file for the displacement map that comes with the texture. + var/displacement_icon = 'maplestation_modules/icons/mob/clothing/tail_suit_mask.dmi' + /// Cache the displacement icon so we dont have to make a new one each time + VAR_FINAL/icon/cached_displacement_icon + + /// Icon state for the lighting map that comes with the texture. + var/lighting_icon_state = "mesh_mask_lighting" + /// Icon file for the lighting map that comes with the texture. + var/lighting_icon = 'maplestation_modules/icons/mob/clothing/tail_suit_mask.dmi' + /// Cache the lighting icon so we dont have to make a new one each time + VAR_FINAL/icon/cached_lighting_icon + + /// Color used for the outline filter + var/outline_color = "#080808" + +/datum/bodypart_overlay/texture/mesh/New() + . = ..() + cached_displacement_icon = icon(displacement_icon, displacement_icon_state) + cached_lighting_icon = icon(lighting_icon, lighting_icon_state) + +/datum/bodypart_overlay/texture/mesh/modify_bodypart_appearance(image/appearance) + if(!should_modify(appearance)) + return + + . = ..() + // adds a displacement map so the outline lines up with the bottom of the sprite + appearance.add_filter("displacement", 2, displacement_map_filter(cached_displacement_icon, size = 1)) + // adds an outline so the texture doesn't end abruptly + appearance.add_filter("outline", 3, outline_filter(1, outline_color, OUTLINE_SHARP)) + // adds a bit of lighting to make the texture look less flat + appearance.add_filter("lighting", 4, layering_filter(cached_lighting_icon, blend_mode = BLEND_MULTIPLY)) + // forces white (blends better with the texture) + appearance.color = COLOR_WHITE + +/datum/bodypart_overlay/texture/mesh/proc/should_modify(image/appearance) + // only apply to "real planes", ie not emissive or lighting or whatever + var/appearance_plane = PLANE_TO_TRUE(appearance.plane) + if(appearance_plane != FLOAT_PLANE && appearance_plane != GAME_PLANE) + return FALSE + // only apply to other mutant bodyparts. we filter by layer which is absolutely not ideal + var/appearance_layer = abs(appearance.layer) + if(appearance_layer != BODY_ADJ_LAYER && appearance_layer != BODY_FRONT_LAYER && appearance_layer != BODY_BEHIND_LAYER) + return FALSE + return TRUE + +/datum/bodypart_overlay/texture/mesh/black + texture_icon_state = "mesh_mask" + outline_color = "#080808" + +/datum/bodypart_overlay/texture/mesh/white + texture_icon_state = "mesh_mask_white" + outline_color = "#B2B2B2" + +/datum/bodypart_overlay/texture/mesh/biosuit + texture_icon_state = "mesh_mask_biosuit" + outline_color = "#747182" + +/datum/bodypart_overlay/texture/mesh/biosuit_dark + texture_icon_state = "mesh_mask_biosuit_dark" + outline_color = "#514F5B" + +/datum/bodypart_overlay/texture/mesh/bombsuit + texture_icon_state = "mesh_mask_bombsuit" + outline_color = "#897B51" + +/datum/bodypart_overlay/texture/mesh/bombsuit_white + texture_icon_state = "mesh_mask_bombsuit_white" + outline_color = "#A58975" + +/datum/bodypart_overlay/texture/mesh/bombsuit_red + texture_icon_state = "mesh_mask_bombsuit_red" + outline_color = "#511D19" + +/datum/bodypart_overlay/texture/mesh/firesuit + texture_icon_state = "mesh_mask_firesuit" + outline_color = "#262A33" + +/datum/bodypart_overlay/texture/mesh/drake + texture_icon_state = "mesh_mask_drake" + outline_color = "#615C5A" + +/datum/bodypart_overlay/texture/mesh/heretic + texture_icon_state = "mesh_mask_heretic" + outline_color = "#270B08" + +/datum/bodypart_overlay/texture/mesh/space + texture_icon_state = "mesh_mask_space" + outline_color = "#1F1F1F" diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm index 0c604478bf11..5f0f7807bafa 100644 --- a/code/modules/antagonists/cult/cult_items.dm +++ b/code/modules/antagonists/cult/cult_items.dm @@ -242,6 +242,10 @@ Striking a noncultist, however, will tear their flesh."} icon_state = "cult_hoodalt" inhand_icon_state = null +/obj/item/clothing/head/hooded/cult_hoodie/alt/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/drake) + /obj/item/clothing/suit/hooded/cultrobes/alt name = "cultist robes" desc = "An armored set of robes worn by the followers of Nar'Sie." @@ -249,6 +253,10 @@ Striking a noncultist, however, will tear their flesh."} inhand_icon_state = null hoodtype = /obj/item/clothing/head/hooded/cult_hoodie/alt +/obj/item/clothing/suit/hooded/cultrobes/alt/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/drake) + /obj/item/clothing/suit/hooded/cultrobes/alt/ghost item_flags = DROPDEL @@ -312,6 +320,10 @@ Striking a noncultist, however, will tear their flesh."} max_heat_protection_temperature = SPACE_SUIT_MAX_TEMP_PROTECT resistance_flags = NONE +/obj/item/clothing/suit/hooded/cultrobes/hardened/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/drake) + /datum/armor/cultrobes_hardened melee = 50 bullet = 40 @@ -336,6 +348,10 @@ Striking a noncultist, however, will tear their flesh."} flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF resistance_flags = NONE +/obj/item/clothing/head/hooded/cult_hoodie/hardened/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/drake) + /datum/armor/cult_hoodie_hardened melee = 50 bullet = 40 diff --git a/code/modules/antagonists/heretic/items/heretic_armor.dm b/code/modules/antagonists/heretic/items/heretic_armor.dm index f2ea36dd18e1..7f2bc39a60c9 100644 --- a/code/modules/antagonists/heretic/items/heretic_armor.dm +++ b/code/modules/antagonists/heretic/items/heretic_armor.dm @@ -12,6 +12,7 @@ /obj/item/clothing/head/hooded/cult_hoodie/eldritch/Initialize(mapload) . = ..() AddElement(/datum/element/heretic_focus) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/heretic) /obj/item/clothing/suit/hooded/cultrobes/eldritch name = "ominous armor" @@ -25,6 +26,10 @@ // Slightly better than normal cult robes armor_type = /datum/armor/cultrobes_eldritch +/obj/item/clothing/suit/hooded/cultrobes/eldritch/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/heretic) + /datum/armor/cultrobes_eldritch melee = 50 bullet = 50 diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm index e13e04dce61e..29ad204b353f 100644 --- a/code/modules/clothing/head/hardhat.dm +++ b/code/modules/clothing/head/hardhat.dm @@ -196,6 +196,10 @@ visor_flags_inv = NONE visor_state = "weldvisor_atmos" +/obj/item/clothing/head/utility/hardhat/welding/atmos/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/firesuit) + /obj/item/clothing/head/utility/hardhat/welding/atmos/worn_overlays(mutable_appearance/standing, isinhands, icon_file) . = ..() if(!isinhands) diff --git a/code/modules/clothing/spacesuits/_spacesuits.dm b/code/modules/clothing/spacesuits/_spacesuits.dm index c6a07d3eb139..f7189490997e 100644 --- a/code/modules/clothing/spacesuits/_spacesuits.dm +++ b/code/modules/clothing/spacesuits/_spacesuits.dm @@ -38,6 +38,7 @@ if(fishing_modifier) AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) add_stabilizer() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/space) /obj/item/clothing/head/helmet/space/proc/add_stabilizer(loose_hat = TRUE) AddComponent(/datum/component/hat_stabilizer, loose_hat = loose_hat) @@ -99,6 +100,7 @@ if(fishing_modifier) AddComponent(/datum/component/adjust_fishing_difficulty, fishing_modifier) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/space) /// Start Processing on the space suit when it is worn to heat the wearer /obj/item/clothing/suit/space/equipped(mob/living/user, slot) diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm index 7a17a9b2f1fe..663319cb72fc 100644 --- a/code/modules/clothing/suits/armor.dm +++ b/code/modules/clothing/suits/armor.dm @@ -293,10 +293,14 @@ . = ..() AddComponent(/datum/component/adjust_fishing_difficulty, 5) init_rustle_component() + init_equipment_overlay() /obj/item/clothing/suit/armor/riot/proc/init_rustle_component() AddComponent(/datum/component/item_equipped_movement_rustle) +/obj/item/clothing/suit/armor/riot/proc/init_equipment_overlay() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/black) + /datum/armor/armor_riot melee = 50 bullet = 10 @@ -515,7 +519,11 @@ /obj/item/nullrod, /obj/item/tank/internals/emergency_oxygen, /obj/item/tank/internals/plasmaman, - ) + ) + +/obj/item/clothing/suit/armor/riot/knight/init_equipment_overlay() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/biosuit_dark) + /obj/item/clothing/suit/armor/riot/knight/init_rustle_component() AddComponent(/datum/component/item_equipped_movement_rustle, SFX_PLATE_ARMOR_RUSTLE, 8) diff --git a/code/modules/clothing/suits/bio.dm b/code/modules/clothing/suits/bio.dm index a14b3fcd77bd..b037024db0b2 100644 --- a/code/modules/clothing/suits/bio.dm +++ b/code/modules/clothing/suits/bio.dm @@ -11,6 +11,7 @@ flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEHAIR|HIDEFACIALHAIR|HIDEFACE|HIDESNOUT resistance_flags = ACID_PROOF flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF + var/texture_type = /datum/bodypart_overlay/texture/mesh/biosuit // Icon_state passed into clothing dirt component var/dirt_state = "bio_dirt" @@ -20,6 +21,7 @@ AddComponent(/datum/component/clothing_dirt, dirt_state) AddComponent(/datum/component/adjust_fishing_difficulty, 6) AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, texture_type) /datum/armor/head_bio_hood bio = 100 @@ -43,10 +45,12 @@ strip_delay = 70 equip_delay_other = 70 resistance_flags = ACID_PROOF + var/texture_type = /datum/bodypart_overlay/texture/mesh/biosuit /obj/item/clothing/suit/bio_suit/Initialize(mapload) . = ..() AddComponent(/datum/component/adjust_fishing_difficulty, 6) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, texture_type) //Standard biosuit, orange stripe /datum/armor/suit_bio_suit @@ -103,9 +107,11 @@ //Janitor's biosuit, grey with purple arms /obj/item/clothing/head/bio_hood/janitor icon_state = "bio_janitor" + texture_type = /datum/bodypart_overlay/texture/mesh/biosuit_dark /obj/item/clothing/suit/bio_suit/janitor icon_state = "bio_janitor" + texture_type = /datum/bodypart_overlay/texture/mesh/biosuit_dark /obj/item/clothing/suit/bio_suit/janitor/Initialize(mapload) . = ..() @@ -137,6 +143,7 @@ inhand_icon_state = "bio_suit" strip_delay = 40 equip_delay_other = 20 + texture_type = /datum/bodypart_overlay/texture/mesh/black /obj/item/clothing/suit/bio_suit/plaguedoctorsuit/Initialize(mapload) . = ..() diff --git a/code/modules/clothing/suits/utility.dm b/code/modules/clothing/suits/utility.dm index ad094edcace2..352848c67e17 100644 --- a/code/modules/clothing/suits/utility.dm +++ b/code/modules/clothing/suits/utility.dm @@ -40,6 +40,7 @@ /obj/item/clothing/suit/utility/fire/Initialize(mapload) . = ..() AddComponent(/datum/component/adjust_fishing_difficulty, 7) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/firesuit) /datum/armor/utility_fire melee = 15 @@ -98,11 +99,14 @@ flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF resistance_flags = NONE + var/texture_type = /datum/bodypart_overlay/texture/mesh/bombsuit + /obj/item/clothing/head/utility/bomb_hood/Initialize(mapload) . = ..() AddComponent(/datum/component/clothing_dirt, "bomb_dirt") AddComponent(/datum/component/adjust_fishing_difficulty, 8) AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, texture_type) /datum/armor/utility_bomb_hood melee = 20 @@ -130,9 +134,12 @@ equip_delay_other = 70 resistance_flags = NONE + var/texture_type = /datum/bodypart_overlay/texture/mesh/bombsuit + /obj/item/clothing/suit/utility/bomb_suit/Initialize(mapload) . = ..() AddComponent(/datum/component/adjust_fishing_difficulty, 8) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, texture_type) /datum/armor/utility_bomb_suit melee = 20 @@ -146,19 +153,23 @@ /obj/item/clothing/head/utility/bomb_hood/security icon_state = "bombsuit_sec" inhand_icon_state = null + texture_type = /datum/bodypart_overlay/texture/mesh/bombsuit_red /obj/item/clothing/suit/utility/bomb_suit/security icon_state = "bombsuit_sec" inhand_icon_state = null allowed = list(/obj/item/gun/energy, /obj/item/melee/baton, /obj/item/restraints/handcuffs) + texture_type = /datum/bodypart_overlay/texture/mesh/bombsuit_red /obj/item/clothing/head/utility/bomb_hood/white icon_state = "bombsuit_white" inhand_icon_state = null + texture_type = /datum/bodypart_overlay/texture/mesh/bombsuit_white /obj/item/clothing/suit/utility/bomb_suit/white icon_state = "bombsuit_white" inhand_icon_state = null + texture_type = /datum/bodypart_overlay/texture/mesh/bombsuit_white /* * Radiation protection @@ -184,6 +195,7 @@ AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) AddElement(/datum/element/radiation_protected_clothing) AddComponent(/datum/component/clothing_dirt, "rad_dirt") + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/black) /datum/armor/utility_radiation bio = 60 @@ -214,3 +226,4 @@ . = ..() AddElement(/datum/element/radiation_protected_clothing) AddComponent(/datum/component/adjust_fishing_difficulty, 7) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/black) diff --git a/code/modules/hydroponics/beekeeping/beekeeper_suit.dm b/code/modules/hydroponics/beekeeping/beekeeper_suit.dm index ef42445b40b4..185f89410ae8 100644 --- a/code/modules/hydroponics/beekeeping/beekeeper_suit.dm +++ b/code/modules/hydroponics/beekeeping/beekeeper_suit.dm @@ -8,6 +8,10 @@ drop_sound = 'maplestation_modules/sound/items/pickup/hat.ogg' pickup_sound = 'maplestation_modules/sound/items/pickup/hat.ogg' +/obj/item/clothing/head/utility/beekeeper_head/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/white) + /obj/item/clothing/suit/utility/beekeeper_suit name = "beekeeper suit" desc = "Keeps the lil buzzing buggers away from your squishy bits." @@ -16,3 +20,7 @@ body_parts_covered = CHEST|GROIN|LEGS|ARMS clothing_flags = THICKMATERIAL allowed = list(/obj/item/melee/flyswatter, /obj/item/reagent_containers/spray/plantbgone, /obj/item/plant_analyzer, /obj/item/seeds, /obj/item/reagent_containers/cup/bottle, /obj/item/reagent_containers/cup/beaker, /obj/item/cultivator, /obj/item/reagent_containers/spray/pestspray, /obj/item/hatchet, /obj/item/storage/bag/plants) + +/obj/item/clothing/suit/utility/beekeeper_suit/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/white) diff --git a/code/modules/mining/equipment/explorer_gear.dm b/code/modules/mining/equipment/explorer_gear.dm index e48aec13c27b..b8cdc8c14656 100644 --- a/code/modules/mining/equipment/explorer_gear.dm +++ b/code/modules/mining/equipment/explorer_gear.dm @@ -182,6 +182,7 @@ /obj/item/clothing/suit/armor/bone/Initialize(mapload) . = ..() AddComponent(/datum/component/armor_plate, upgrade_item = /obj/item/clothing/accessory/talisman) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/drake) allowed = GLOB.mining_suit_allowed /obj/item/clothing/head/helmet/skull @@ -227,6 +228,7 @@ /obj/item/clothing/suit/hooded/cloak/drake/Initialize(mapload) . = ..() allowed = GLOB.mining_suit_allowed + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/drake) /obj/item/clothing/head/hooded/cloakhood/drake name = "drake helm" @@ -240,6 +242,10 @@ max_heat_protection_temperature = FIRE_IMMUNITY_MAX_TEMP_PROTECT resistance_flags = FIRE_PROOF | ACID_PROOF +/obj/item/clothing/head/hooded/cloakhood/drake/Initialize(mapload) + . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/drake) + /obj/item/clothing/suit/hooded/cloak/godslayer name = "godslayer armour" icon_state = "godslayer" diff --git a/code/modules/mod/mod_clothes.dm b/code/modules/mod/mod_clothes.dm index a62aed8f0de5..965d08af117c 100644 --- a/code/modules/mod/mod_clothes.dm +++ b/code/modules/mod/mod_clothes.dm @@ -11,10 +11,7 @@ /obj/item/clothing/head/mod/Initialize(mapload) . = ..() ADD_TRAIT(src, TRAIT_NO_SPEED_POTION, INNATE_TRAIT) - -// Even without a hat stabilizer, hats can be worn - however, they'll fall off very easily -/obj/item/clothing/head/mod/Initialize(mapload) - . = ..() + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_HEAD, /datum/bodypart_overlay/texture/mesh/space) AddComponent(/datum/component/hat_stabilizer, loose_hat = TRUE) /obj/item/clothing/suit/mod @@ -38,6 +35,7 @@ /obj/item/clothing/suit/mod/Initialize(mapload) . = ..() ADD_TRAIT(src, TRAIT_NO_SPEED_POTION, INNATE_TRAIT) + AddElement(/datum/element/equipment_bodypart_overlay, BODY_ZONE_CHEST, /datum/bodypart_overlay/texture/mesh/space) /obj/item/clothing/gloves/mod name = "MOD gauntlets" diff --git a/code/modules/surgery/bodyparts/_bodyparts.dm b/code/modules/surgery/bodyparts/_bodyparts.dm index 49c4f7cceff8..ee5c579902f1 100644 --- a/code/modules/surgery/bodyparts/_bodyparts.dm +++ b/code/modules/surgery/bodyparts/_bodyparts.dm @@ -1252,7 +1252,7 @@ for(var/external_layer in overlay.all_layers) if(overlay.layers & external_layer) . += overlay.get_overlay(external_layer, src) - for(var/datum/layer in .) + for(var/image/layer in .) overlay.modify_bodypart_appearance(layer) return . diff --git a/code/modules/surgery/organs/external/tails.dm b/code/modules/surgery/organs/external/tails.dm index 8aec8d47329e..7fe537165caf 100644 --- a/code/modules/surgery/organs/external/tails.dm +++ b/code/modules/surgery/organs/external/tails.dm @@ -144,14 +144,23 @@ ///Tail parent type, with wagging functionality /datum/bodypart_overlay/mutant/tail layers = EXTERNAL_FRONT|EXTERNAL_BEHIND - var/wagging = FALSE dyable = TRUE + /// Tracks if it's currently wagging or not + var/wagging = FALSE + /// If TRUE the tail is shown when over supported suits like space suits + var/mesh_in_suits = FALSE /datum/bodypart_overlay/mutant/tail/get_base_icon_state() return "[wagging ? "wagging_" : ""][sprite_datum.icon_state]" //add the wagging tag if we be wagging /datum/bodypart_overlay/mutant/tail/can_draw_on_bodypart(obj/item/bodypart/bodypart_owner) - return !(bodypart_owner.owner?.obscured_slots & HIDEJUMPSUIT) + if(!(bodypart_owner.owner?.obscured_slots & HIDEJUMPSUIT)) + return TRUE + if(!mesh_in_suits) + return FALSE + if(locate(/datum/bodypart_overlay/texture/mesh) in bodypart_owner.bodypart_overlays) + return TRUE + return FALSE /obj/item/organ/tail/cat name = "cat tail" @@ -201,6 +210,7 @@ ///Lizard tail bodypart overlay datum /datum/bodypart_overlay/mutant/tail/lizard feature_key = "tail_lizard" + mesh_in_suits = TRUE /datum/bodypart_overlay/mutant/tail/lizard/get_global_feature_list() return SSaccessories.tails_list_lizard diff --git a/code/modules/unit_tests/screenshots/screenshot_digi_leg_test.png b/code/modules/unit_tests/screenshots/screenshot_digi_leg_test.png index 8fb16d008feb..4836591351e7 100644 Binary files a/code/modules/unit_tests/screenshots/screenshot_digi_leg_test.png and b/code/modules/unit_tests/screenshots/screenshot_digi_leg_test.png differ diff --git a/maplestation.dme b/maplestation.dme index a96b99fc2964..b65a0cdddaa1 100644 --- a/maplestation.dme +++ b/maplestation.dme @@ -6304,6 +6304,7 @@ #include "maplestation_modules\code\datums\diseases\disease_resistance.dm" #include "maplestation_modules\code\datums\elements\bodypart_sprint_buff.dm" #include "maplestation_modules\code\datums\elements\digitigrade_limb.dm" +#include "maplestation_modules\code\datums\elements\equipment_bodypart_overlay.dm" #include "maplestation_modules\code\datums\elements\fire_patting_item.dm" #include "maplestation_modules\code\datums\elements\glove_slapper.dm" #include "maplestation_modules\code\datums\elements\rip_off_able.dm" diff --git a/maplestation_modules/code/datums/elements/equipment_bodypart_overlay.dm b/maplestation_modules/code/datums/elements/equipment_bodypart_overlay.dm new file mode 100644 index 000000000000..e07f1093f0d5 --- /dev/null +++ b/maplestation_modules/code/datums/elements/equipment_bodypart_overlay.dm @@ -0,0 +1,71 @@ +/datum/element/equipment_bodypart_overlay + element_flags = ELEMENT_BESPOKE + argument_hash_start_idx = 2 + + var/body_zone + var/bodypart_overlay_type + +/datum/element/equipment_bodypart_overlay/Attach(datum/target, body_zone, bodypart_overlay_type) + . = ..() + if(!isitem(target)) + return ELEMENT_INCOMPATIBLE + + src.body_zone = body_zone + src.bodypart_overlay_type = bodypart_overlay_type + + var/obj/item/target_item = target + RegisterSignal(target_item, COMSIG_ITEM_EQUIPPED, PROC_REF(item_equipped)) + RegisterSignal(target_item, COMSIG_ITEM_DROPPED, PROC_REF(item_dropped)) + if(isliving(target_item.loc)) + var/mob/living/wearer = target_item.loc + item_equipped(target_item, wearer, wearer.get_slot_by_item(target_item)) + +/datum/element/equipment_bodypart_overlay/Detach(datum/source, ...) + . = ..() + var/obj/item/target_item = source + UnregisterSignal(target_item, COMSIG_ITEM_EQUIPPED) + UnregisterSignal(target_item, COMSIG_ITEM_DROPPED) + if(isliving(target_item.loc)) + var/mob/living/wearer = target_item.loc + item_dropped(target_item, wearer) + +/datum/element/equipment_bodypart_overlay/proc/item_equipped(obj/item/equipped_item, mob/living/carbon/equipper, slot) + SIGNAL_HANDLER + + if(!(slot & equipped_item.slot_flags)) + return + + var/obj/item/bodypart/affected_bodypart = equipper.get_bodypart(body_zone) + if(isnull(affected_bodypart)) + return + if(locate(bodypart_overlay_type) in affected_bodypart.bodypart_overlays) + return + + affected_bodypart.add_bodypart_overlay(new bodypart_overlay_type) + RegisterSignal(equipper, COMSIG_CARBON_POST_REMOVE_LIMB, PROC_REF(limb_removed)) + RegisterSignal(equipper, COMSIG_CARBON_POST_ATTACH_LIMB, PROC_REF(limb_added)) + +/datum/element/equipment_bodypart_overlay/proc/item_dropped(obj/item/dropped_item, mob/living/carbon/dropper) + SIGNAL_HANDLER + + var/obj/item/bodypart/affected_bodypart = dropper.get_bodypart(body_zone) + if(isnull(affected_bodypart)) + return + + var/datum/bodypart_overlay/overlay_to_remove = locate(bodypart_overlay_type) in affected_bodypart.bodypart_overlays + if(!isnull(overlay_to_remove)) + affected_bodypart.remove_bodypart_overlay(overlay_to_remove) + UnregisterSignal(dropper, COMSIG_CARBON_POST_REMOVE_LIMB) + UnregisterSignal(dropper, COMSIG_CARBON_POST_ATTACH_LIMB) + +/datum/element/equipment_bodypart_overlay/proc/limb_removed(mob/living/carbon/limb_owner, obj/item/bodypart/removed_limb) + SIGNAL_HANDLER + + var/datum/bodypart_overlay/overlay_to_remove = locate(bodypart_overlay_type) in removed_limb.bodypart_overlays + if(!isnull(overlay_to_remove)) + removed_limb.remove_bodypart_overlay(overlay_to_remove) + +/datum/element/equipment_bodypart_overlay/proc/limb_added(mob/living/carbon/limb_owner, obj/item/bodypart/added_limb) + SIGNAL_HANDLER + + added_limb.add_bodypart_overlay(new bodypart_overlay_type) diff --git a/maplestation_modules/code/modules/mob/living/carbon/human/ornithid_features/avian_tails.dm b/maplestation_modules/code/modules/mob/living/carbon/human/ornithid_features/avian_tails.dm index d9f4b7bde097..632be7e06685 100644 --- a/maplestation_modules/code/modules/mob/living/carbon/human/ornithid_features/avian_tails.dm +++ b/maplestation_modules/code/modules/mob/living/carbon/human/ornithid_features/avian_tails.dm @@ -13,6 +13,7 @@ feature_key = "tail_avian" layers = EXTERNAL_BEHIND | EXTERNAL_FRONT color_source = ORGAN_COLOR_OVERRIDE + mesh_in_suits = TRUE /datum/bodypart_overlay/mutant/tail/avian/get_global_feature_list() return SSaccessories.tails_list_avian @@ -21,7 +22,6 @@ draw_color = ownerlimb?.owner?.dna?.features["feathers"] || "#FFFFFF" return TRUE - /datum/sprite_accessory/tails/avian icon = 'maplestation_modules/icons/mob/ornithidfeatures.dmi' 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 b6aac951227b..b87d77a135d4 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 @@ -130,6 +130,7 @@ /datum/bodypart_overlay/mutant/tail/fish feature_key = "fish_tail" color_source = ORGAN_COLOR_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 diff --git a/maplestation_modules/icons/mob/clothing/tail_suit_mask.dmi b/maplestation_modules/icons/mob/clothing/tail_suit_mask.dmi new file mode 100644 index 000000000000..e86540b223ea Binary files /dev/null and b/maplestation_modules/icons/mob/clothing/tail_suit_mask.dmi differ