Fixes Global and Fixes Eyes (#7976)

* Fixes Custom Species Global lists

Basically changing it to a GLOB just had it add all the species into one global variable instead of a proper list.

* Update global_lists.dm

* Fixes Eyes Stuff

* Removes extraneous Vorestation Edits

* Fixes compile issue
This commit is contained in:
Novacat
2021-03-17 23:50:37 -09:00
committed by GitHub
parent 81ae48ba93
commit e4962d9f9f
6 changed files with 46 additions and 91 deletions
-50
View File
@@ -51,56 +51,6 @@ var/global/list/limb_icon_cache = list()
var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[O_EYES]
if(eyes) eyes.update_colour()
/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(!iscarbon(owner) || !owner.species)
return
//Eye color/icon
var/should_have_eyes = owner.should_have_organ(O_EYES)
var/has_eye_color = owner.species.appearance_flags & HAS_EYE_COLOR
if((should_have_eyes || has_eye_color) && eye_icon)
var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[O_EYES]
var/icon/eyes_icon = new/icon(eye_icon_location, eye_icon)
//Should have eyes
if(should_have_eyes)
//And we have them
if(eyes)
if(has_eye_color)
eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD)
//They're gone!
else
eyes_icon.Blend(rgb(128,0,0), ICON_ADD)
//We have weird other-sorts of eyes (as we're not supposed to have eye organ, but we have HAS_EYE_COLOR species)
else
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")
add_overlay(lip_icon)
mob_icon.Blend(lip_icon, ICON_OVERLAY)
//Head markings
for(var/M in markings)
var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"]
var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]")
mark_s.Blend(markings[M]["color"], ICON_ADD)
add_overlay(mark_s) //So when it's not on your body, it has icons
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"
add_overlay(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
+42 -37
View File
@@ -266,14 +266,12 @@
encased = "skull"
base_miss_chance = 40
var/can_intake_reagents = 1
var/eye_icons = 'icons/mob/human_face_alt.dmi'
var/head_offset = 0
var/eye_icon = "eyes_s"
var/eye_icon_location = 'icons/mob/human_face.dmi'
force = 3
throwforce = 7
var/eye_icon_location = 'icons/mob/human_face.dmi'
/obj/item/organ/external/head/Initialize()
if(config.allow_headgibs)
cannot_gib = FALSE
@@ -327,50 +325,57 @@
/obj/item/organ/external/head/get_icon()
..()
overlays.Cut()
if(!owner || !owner.species)
//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(!iscarbon(owner) || !owner.species)
return
var/icon/eyecon
//Eye color/icon
var/should_have_eyes = owner.should_have_organ(O_EYES)
var/has_eye_color = owner.species.appearance_flags & HAS_EYE_COLOR
if((should_have_eyes || has_eye_color) && eye_icon)
var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[O_EYES]
var/icon/eyes_icon = new/icon(eye_icon_location, eye_icon)
//Should have eyes
if(should_have_eyes)
//And we have them
if(eyes)
if(has_eye_color)
eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD)
//They're gone!
else
eyes_icon.Blend(rgb(128,0,0), ICON_ADD)
//We have weird other-sorts of eyes (as we're not supposed to have eye organ, but we have HAS_EYE_COLOR species)
else
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)
icon_cache_key += "[eye_icon]"
//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")
add_overlay(lip_icon)
mob_icon.Blend(lip_icon, ICON_OVERLAY)
//Head markings
for(var/M in markings)
var/datum/sprite_accessory/marking/mark_style = markings[M]["datum"]
var/icon/mark_s = new/icon("icon" = mark_style.icon, "icon_state" = "[mark_style.icon_state]-[organ_tag]")
mark_s.Blend(markings[M]["color"], mark_style.color_blend_mode)
overlays |= mark_s //So when it's not on your body, it has icons
add_overlay(mark_s) //So when it's not on your body, it has icons
mob_icon.Blend(mark_s, ICON_OVERLAY) //So when it's on your body, it has icons
icon_cache_key += "[M][markings[M]["color"]]"
if(owner.should_have_organ(O_EYES))//Moved on top of markings.
var/obj/item/organ/internal/eyes/eyes = owner.internal_organs_by_name[O_EYES]
if(eye_icon)
var/icon/eyes_icon = new/icon(eye_icons, eye_icon)
if(eyes)
if(owner.species.appearance_flags & HAS_EYE_COLOR)
eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD)
else
eyes_icon.Blend(rgb(128,0,0), ICON_ADD)
mob_icon.Blend(eyes_icon, ICON_OVERLAY)
overlays |= eyes_icon
add_overlay(get_hair_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")
overlays |= lip_icon
mob_icon.Blend(lip_icon, ICON_OVERLAY)
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)
facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD)
overlays |= image(facial_s, "pixel_y" = head_offset)
if(owner.h_style && !(owner.head && (owner.head.flags_inv & BLOCKHEADHAIR)))
var/datum/sprite_accessory/hair_style = hair_styles_list[owner.h_style]
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")
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)
overlays |= image(hair_s, "pixel_y" = head_offset)
return mob_icon
/obj/item/organ/external/head/skrell