Ports some Bay hair code

This commit is contained in:
Atermonera
2018-06-12 00:43:43 -07:00
committed by VirgoBot
parent d669d8a97f
commit 7cd1442e8f
5 changed files with 161 additions and 17 deletions

View File

@@ -51,10 +51,10 @@ var/global/list/limb_icon_cache = list()
/obj/item/organ/external/head/get_icon()
..()
//The overlays are not drawn on the mob, they are used for if the head is removed and becomes an item
cut_overlays()
//Every 'addon' below requires information from species
if(!owner || !owner.species)
return
@@ -78,7 +78,7 @@ var/global/list/limb_icon_cache = list()
eyes_icon.Blend(rgb(owner.r_eyes, owner.g_eyes, owner.b_eyes), ICON_ADD)
add_overlay(eyes_icon)
mob_icon.Blend(eyes_icon, ICON_OVERLAY)
//Lip color/icon
if(owner.lip_style && (species && (species.appearance_flags & HAS_LIPS)))
var/icon/lip_icon = new/icon('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s")
@@ -94,27 +94,42 @@ var/global/list/limb_icon_cache = list()
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"
overlays |= get_hair_icon()
return mob_icon
/obj/item/organ/external/head/proc/get_hair_icon()
var/image/res = image('icons/mob/human_face.dmi',"bald_s")
//Facial hair
if(owner.f_style)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[owner.f_style]
if(facial_hair_style && facial_hair_style.species_allowed && (species.get_bodytype(owner) in facial_hair_style.species_allowed))
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
if(facial_hair_style.do_colouration)
<<<<<<< HEAD
facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_MULTIPLY) // VOREStation edit
add_overlay(facial_s)
=======
facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD)
res.overlays |= facial_s
>>>>>>> e8020de... Merge pull request #5335 from Anewbe/hair_stealing
//Head hair
if(owner.h_style && !(owner.head && (owner.head.flags_inv & BLOCKHEADHAIR)))
var/datum/sprite_accessory/hair/hair_style = hair_styles_list[owner.h_style]
var/style = owner.h_style
var/datum/sprite_accessory/hair/hair_style = hair_styles_list[style]
if(owner.head && (owner.head.flags_inv & BLOCKHEADHAIR))
if(!(hair_style.flags & HAIR_VERY_SHORT))
hair_style = hair_styles_list["Short Hair"]
if(hair_style && (species.get_bodytype(owner) in hair_style.species_allowed))
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
var/icon/hair_s_add = new/icon("icon" = hair_style.icon_add, "icon_state" = "[hair_style.icon_state]_s")
if(hair_style.do_colouration && islist(h_col) && h_col.len >= 3)
hair_s.Blend(rgb(h_col[1], h_col[2], h_col[3]), ICON_MULTIPLY)
hair_s.Blend(hair_s_add, ICON_ADD)
add_overlay(hair_s)
res.overlays |= hair_s
return mob_icon
return res
/obj/item/organ/external/proc/get_icon(var/skeletal)