diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index b768039ac29..e1c05cc7210 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -106,30 +106,33 @@ Please contact me on #coderbus IRC. ~Carn x //Human Overlays Indexes///////// #define MUTANTRACE_LAYER 1 -#define MUTATIONS_LAYER 2 -#define DAMAGE_LAYER 3 -#define UNIFORM_LAYER 4 -#define ID_LAYER 5 -#define SHOES_LAYER 6 -#define GLOVES_LAYER 7 -#define EARS_LAYER 8 -#define SUIT_LAYER 9 -#define GLASSES_LAYER 10 -#define BELT_LAYER 11 //Possible make this an overlay of somethign required to wear a belt? -#define TAIL_LAYER 12 //bs12 specific. this hack is probably gonna come back to haunt me -#define SUIT_STORE_LAYER 13 -#define BACK_LAYER 14 -#define HAIR_LAYER 15 //TODO: make part of head layer? -#define FACEMASK_LAYER 16 -#define HEAD_LAYER 17 -#define COLLAR_LAYER 18 -#define HANDCUFF_LAYER 19 -#define LEGCUFF_LAYER 20 -#define L_HAND_LAYER 21 -#define R_HAND_LAYER 22 -#define TARGETED_LAYER 23 //BS12: Layer for the target overlay from weapon targeting system -#define FIRE_LAYER 24 //If you're on fire -#define TOTAL_LAYERS 24 +#define MARKINGS_LAYER 2 +#define MUTATIONS_LAYER 3 +#define DAMAGE_LAYER 4 +#define UNIFORM_LAYER 5 +#define ID_LAYER 6 +#define SHOES_LAYER 7 +#define GLOVES_LAYER 8 +#define EARS_LAYER 9 +#define SUIT_LAYER 10 +#define GLASSES_LAYER 11 +#define BELT_LAYER 12 //Possible make this an overlay of somethign required to wear a belt? +#define TAIL_LAYER 13 //bs12 specific. this hack is probably gonna come back to haunt me +#define SUIT_STORE_LAYER 14 +#define BACK_LAYER 15 +#define HAIR_LAYER 16 //TODO: make part of head layer? +#define HEAD_ACCESSORY_LAYER 17 +#define FHAIR_LAYER 18 +#define FACEMASK_LAYER 19 +#define HEAD_LAYER 20 +#define COLLAR_LAYER 21 +#define HANDCUFF_LAYER 22 +#define LEGCUFF_LAYER 23 +#define L_HAND_LAYER 24 +#define R_HAND_LAYER 25 +#define TARGETED_LAYER 26 //BS12: Layer for the target overlay from weapon targeting system +#define FIRE_LAYER 27 //If you're on fire +#define TOTAL_LAYERS 27 @@ -245,7 +248,7 @@ var/global/list/damage_icon_parts = list() qdel(stand_icon) stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank") var/icon_key = "" - var/obj/item/organ/internal/eyes/eyes = get_int_organ(/obj/item/organ/internal/eyes) + var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"] if(eyes) icon_key += "[rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])]" @@ -350,6 +353,75 @@ var/global/list/damage_icon_parts = list() //tail update_tail_layer(0) + //head accessory + update_head_accessory(0) + //markings + update_markings(0) + //hair + update_hair(0) + update_fhair(0) + + +//MARKINGS OVERLAY +/mob/living/carbon/human/proc/update_markings(var/update_icons=1) + //Reset our markings + overlays_standing[MARKINGS_LAYER] = null + + var/obj/item/organ/external/chest/chest_organ = get_organ("chest") + if(!chest_organ || chest_organ.is_stump() || (chest_organ.status & ORGAN_DESTROYED) ) + if(update_icons) update_icons() + return + + //base icons + var/icon/markings_standing = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s") + + if(m_style && (src.species.bodyflags & HAS_MARKINGS)) + var/datum/sprite_accessory/marking_style = marking_styles_list[m_style] + if(marking_style && marking_style.species_allowed) + if(src.species.name in marking_style.species_allowed) + var/icon/markings_s = new/icon("icon" = marking_style.icon, "icon_state" = "[marking_style.icon_state]_s") + if(marking_style.do_colouration) + markings_s.Blend(rgb(r_markings, g_markings, b_markings), ICON_ADD) + markings_standing.Blend(markings_s, ICON_OVERLAY) + else + //warning("Invalid m_style for [species.name]: [m_style]") + + overlays_standing[MARKINGS_LAYER] = image(markings_standing) + + if(update_icons) update_icons() + +//HEAD ACCESSORY OVERLAY +/mob/living/carbon/human/proc/update_head_accessory(var/update_icons=1) + //Reset our head accessory + overlays_standing[HEAD_ACCESSORY_LAYER] = null + + var/obj/item/organ/external/head/head_organ = get_organ("head") + if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED) ) + if(update_icons) update_icons() + return + + //masks and helmets can obscure our head accessory + if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR))) + if(update_icons) update_icons() + return + + //base icons + var/icon/head_accessory_standing = new /icon('icons/mob/body_accessory.dmi',"accessory_none_s") + + if(ha_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic()) && (src.species.bodyflags & HAS_HEAD_ACCESSORY))) + var/datum/sprite_accessory/head_accessory_style = head_accessory_styles_list[ha_style] + if(head_accessory_style && head_accessory_style.species_allowed) + if(src.species.name in head_accessory_style.species_allowed) + var/icon/head_accessory_s = new/icon("icon" = head_accessory_style.icon, "icon_state" = "[head_accessory_style.icon_state]_s") + if(head_accessory_style.do_colouration) + head_accessory_s.Blend(rgb(r_headacc, g_headacc, b_headacc), ICON_ADD) + head_accessory_standing.Blend(head_accessory_s, ICON_OVERLAY) + else + //warning("Invalid ha_style for [species.name]: [ha_style]") + + overlays_standing[HEAD_ACCESSORY_LAYER] = image(head_accessory_standing) + + if(update_icons) update_icons() //HAIR OVERLAY @@ -367,6 +439,41 @@ var/global/list/damage_icon_parts = list() if(update_icons) update_icons() return + //base icons + var/icon/hair_standing = new /icon('icons/mob/human_face.dmi',"bald_s") + + if(h_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic()))) + var/datum/sprite_accessory/hair_style = hair_styles_list[h_style] + if(hair_style && hair_style.species_allowed) + if(src.species.name in hair_style.species_allowed) + var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") + if(hair_style.do_colouration) + hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD) + + hair_standing.Blend(hair_s, ICON_OVERLAY) + else + //warning("Invalid h_style for [species.name]: [h_style]") + + overlays_standing[HAIR_LAYER] = image(hair_standing) + + if(update_icons) update_icons() + + +//FACIAL HAIR OVERLAY +/mob/living/carbon/human/proc/update_fhair(var/update_icons=1) + //Reset our facial hair + overlays_standing[FHAIR_LAYER] = null + + var/obj/item/organ/external/head/head_organ = get_organ("head") + if(!head_organ || head_organ.is_stump() || (head_organ.status & ORGAN_DESTROYED) ) + if(update_icons) update_icons() + return + + //masks and helmets can obscure our facial hair, unless we're a synthetic + if( (head && (head.flags & BLOCKHAIR)) || (wear_mask && (wear_mask.flags & BLOCKHAIR))) + if(update_icons) update_icons() + return + //base icons var/icon/face_standing = new /icon('icons/mob/human_face.dmi',"bald_s") @@ -381,22 +488,7 @@ var/global/list/damage_icon_parts = list() else //warning("Invalid f_style for [species.name]: [f_style]") - if(!get_int_organ(/obj/item/organ/internal/brain)) - face_standing += icon("icon"='icons/mob/human_face.dmi', "icon_state" = "debrained_s") - - if(h_style && !(head && (head.flags & BLOCKHEADHAIR) && !(isSynthetic()))) - var/datum/sprite_accessory/hair_style = hair_styles_list[h_style] - if(hair_style && hair_style.species_allowed) - if(src.species.name in hair_style.species_allowed) - var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s") - if(hair_style.do_colouration) - hair_s.Blend(rgb(r_hair, g_hair, b_hair), ICON_ADD) - - face_standing.Blend(hair_s, ICON_OVERLAY) - else - //warning("Invalid h_style for [species.name]: [h_style]") - - overlays_standing[HAIR_LAYER] = image(face_standing) + overlays_standing[FHAIR_LAYER] = image(face_standing) if(update_icons) update_icons() @@ -460,6 +552,7 @@ var/global/list/damage_icon_parts = list() skeleton = null update_hair(0) + update_fhair(0) if(update_icons) update_icons() //Call when target overlay should be added/removed @@ -488,6 +581,8 @@ var/global/list/damage_icon_parts = list() update_mutations(0) update_body(0) update_hair(0) + update_head_accessory(0) + update_fhair(0) update_mutantrace(0) update_inv_w_uniform(0,0) update_inv_wear_id(0) @@ -1019,6 +1114,7 @@ var/global/list/damage_icon_parts = list() //Human Overlays Indexes///////// #undef MUTANTRACE_LAYER +#undef MARKINGS_LAYER #undef MUTATIONS_LAYER #undef DAMAGE_LAYER #undef UNIFORM_LAYER @@ -1035,6 +1131,8 @@ var/global/list/damage_icon_parts = list() #undef BACK_LAYER #undef HAIR_LAYER #undef HEAD_LAYER +#undef HEAD_ACCESSORY_LAYER +#undef FHAIR_LAYER #undef COLLAR_LAYER #undef HANDCUFF_LAYER #undef LEGCUFF_LAYER diff --git a/icons/mob/human_face.dmi b/icons/mob/human_face.dmi index 1fa0f5c3a22..ffecceda82e 100644 Binary files a/icons/mob/human_face.dmi and b/icons/mob/human_face.dmi differ