From 5957f031546ed181336c3975a6730de569f63945 Mon Sep 17 00:00:00 2001 From: Repede Date: Thu, 25 Jan 2024 04:12:17 -0500 Subject: [PATCH] Teshfix (#1410) * Fix teshari sprite when scooped up * comment add * remove duplicate code --- code/modules/mob/holder.dm | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/holder.dm b/code/modules/mob/holder.dm index e245849ff80..0607862b449 100644 --- a/code/modules/mob/holder.dm +++ b/code/modules/mob/holder.dm @@ -345,6 +345,38 @@ var/list/holder_mob_icon_cache = list() return H /obj/item/weapon/holder/human - icon = 'icons/mob/holder_complex.dmi' + icon = 'icons/mob/holder_complex_yw.dmi' //YW Edit - yw complex var/list/generate_for_slots = list(slot_l_hand_str, slot_r_hand_str, slot_back_str) + item_icons = list(slot_l_hand_str = 'icons/mob/holder_complex_yw.dmi', slot_r_hand_str = 'icons/mob/holder_complex_yw.dmi') //YW Add - holder slot_flags = SLOT_BACK + +//YW Addition Start - Holder code for tesh +/obj/item/weapon/holder/human/Initialize(mapload, mob/held) + . = ..() + // Generate appropriate on-mob icons. + var/mob/living/carbon/human/owner = held + if(istype(owner) && owner.species) + var/skin_colour = rgb(owner.r_skin, owner.g_skin, owner.b_skin) + var/hair_colour = rgb(owner.r_hair, owner.g_hair, owner.b_hair) + var/eye_colour = rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes) + var/species_name = lowertext(owner.species.get_bodytype(owner)) + + for(var/cache_entry in generate_for_slots) + var/cache_key = "[owner.species]-[cache_entry]-[skin_colour]-[hair_colour]" + if(!holder_mob_icon_cache[cache_key]) + // Generate individual icons. + var/icon/mob_icon = icon(icon, "[species_name]_holder_[cache_entry]_base") + mob_icon.Blend(skin_colour, ICON_MULTIPLY) + var/icon/hair_icon = icon(icon, "[species_name]_holder_[cache_entry]_hair") + hair_icon.Blend(hair_colour, ICON_MULTIPLY) + var/icon/eyes_icon = icon(icon, "[species_name]_holder_[cache_entry]_eyes") + eyes_icon.Blend(eye_colour, ICON_MULTIPLY) + + // Blend them together. + mob_icon.Blend(eyes_icon, ICON_OVERLAY) + mob_icon.Blend(hair_icon, ICON_OVERLAY) + + // Add to the cache. + holder_mob_icon_cache[cache_key] = mob_icon + item_icons[cache_entry] = holder_mob_icon_cache[cache_key] +//YW Addition End