Skip to content

Commit

Permalink
Teshfix (#1410)
Browse files Browse the repository at this point in the history
* Fix teshari sprite when scooped up

* comment add

* remove duplicate code
  • Loading branch information
Repede committed Jan 25, 2024
1 parent fbc17a7 commit 5957f03
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion code/modules/mob/holder.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5957f03

Please sign in to comment.