Resomi Scrubbin' (#14755)

This commit is contained in:
Wowzewow (Wezzy)
2022-09-09 19:57:01 +02:00
committed by GitHub
parent d1741e3b66
commit 928af1968b
3 changed files with 41 additions and 74 deletions
-74
View File
@@ -256,80 +256,6 @@ var/list/holder_mob_icon_cache = list()
var/obj/item/holder/H = usr.loc
H.report_onmob_location(0, H.get_equip_slot(), src)
/obj/item/holder/human
icon = null
contained_sprite = FALSE
var/holder_icon = 'icons/mob/holder_complex.dmi'
var/list/generate_for_slots = list(slot_l_hand_str, slot_r_hand_str, slot_back_str)
slot_flags = SLOT_BACK
/obj/item/holder/human/sync(var/mob/living/M)
cut_overlays()
// Generate appropriate on-mob icons.
var/mob/living/carbon/human/owner = M
if(!icon && istype(owner) && owner.species)
var/icon/I = new /icon()
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())
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(holder_icon, "[species_name]_holder_[cache_entry]_base")
mob_icon.Blend(skin_colour, ICON_ADD)
var/icon/hair_icon = icon(holder_icon, "[species_name]_holder_[cache_entry]_hair")
hair_icon.Blend(hair_colour, ICON_ADD)
var/icon/eyes_icon = icon(holder_icon, "[species_name]_holder_[cache_entry]_eyes")
eyes_icon.Blend(eye_colour, ICON_ADD)
// 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
var/newstate
switch (cache_entry)
if (slot_l_hand_str)
newstate = "[species_name]_lh"
if (slot_r_hand_str)
newstate = "[species_name]_rh"
if (slot_back_str)
newstate = "[species_name]_ba"
I.Insert(holder_mob_icon_cache[cache_key], newstate)
dir = 2
var/icon/mob_icon = icon(owner.icon, owner.icon_state)
I.Insert(mob_icon, species_name)
icon = I
icon_state = species_name
item_state = species_name
contained_sprite = TRUE
color = M.color
name = M.name
desc = M.desc
copy_overlays(M)
var/mob/living/carbon/human/H = loc
if(istype(H))
if(H.l_hand == src)
H.update_inv_l_hand()
else if(H.r_hand == src)
H.update_inv_r_hand()
else
H.regenerate_icons()
..()
/obj/item/holder/verb/change_animal_name()
set name = "Name Animal"
set category = "IC"