From 3d9aa41247ea7eaa7d5c4c0272f637934fe5812f Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Wed, 24 Jan 2018 02:01:45 -0500 Subject: [PATCH] POLARIS: Glowing eyes species var --- .../living/carbon/human/species/species.dm | 1 + .../species/station/traits_vr/neutral.dm | 6 ++ .../mob/living/carbon/human/update_icons.dm | 71 +++++++++++++++---- 3 files changed, 64 insertions(+), 14 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 5a3ff2175c..bd0c6e1870 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -161,6 +161,7 @@ var/obj/effect/decal/cleanable/blood/tracks/move_trail = /obj/effect/decal/cleanable/blood/tracks/footprints // What marks are left when walking var/list/skin_overlays = list() var/has_floating_eyes = 0 // Whether the eyes can be shown above other icons + var/has_glowing_eyes = 0 // Whether the eyes are shown above all lighting var/water_movement = 0 // How much faster or slower the species is in water var/snow_movement = 0 // How much faster or slower the species is on snow diff --git a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm index 8f45717ac8..ee849fb721 100644 --- a/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm +++ b/code/modules/mob/living/carbon/human/species/station/traits_vr/neutral.dm @@ -95,6 +95,12 @@ cost = 0 var_changes = list("trashcan" = 1) +/datum/trait/glowing_eyes + name = "Glowing Eyes" + desc = "Your eyes show up above darkness. SPOOKY! And kinda edgey too." + cost = 0 + var_changes = list("has_glowing_eyes" = 1) + /datum/trait/glowing_body name = "Glowing Body" desc = "Your body glows about as much as a PDA light! Settable color and toggle in Abilities tab ingame." diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index 26c4020057..8dc1a6a447 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -125,19 +125,20 @@ Please contact me on #coderbus IRC. ~Carn x #define BACK_LAYER 17 #define HAIR_LAYER 18 //TODO: make part of head layer? #define EARS_LAYER 19 -#define FACEMASK_LAYER 20 -#define HEAD_LAYER 21 -#define COLLAR_LAYER 22 -#define HANDCUFF_LAYER 23 -#define LEGCUFF_LAYER 24 -#define L_HAND_LAYER 25 -#define R_HAND_LAYER 26 -#define MODIFIER_EFFECTS_LAYER 27 -#define FIRE_LAYER 28 //If you're on fire -#define WATER_LAYER 29 //If you're submerged in water. -#define TARGETED_LAYER 30 //BS12: Layer for the target overlay from weapon targeting system -#define WING_LAYER 31 //VOREStation edit. Simply move this up a number if things are added. -#define TOTAL_LAYERS 31 //VOREStation edit. +#define EYES_LAYER 20 +#define FACEMASK_LAYER 21 +#define HEAD_LAYER 22 +#define COLLAR_LAYER 23 +#define HANDCUFF_LAYER 24 +#define LEGCUFF_LAYER 25 +#define L_HAND_LAYER 26 +#define R_HAND_LAYER 27 +#define MODIFIER_EFFECTS_LAYER 28 +#define FIRE_LAYER 29 //If you're on fire +#define WATER_LAYER 30 //If you're submerged in water. +#define TARGETED_LAYER 31 //BS12: Layer for the target overlay from weapon targeting system +#define WING_LAYER 32 //VOREStation edit. Simply move this up a number if things are added. +#define TOTAL_LAYERS 32 //VOREStation edit. ////////////////////////////////// /mob/living/carbon/human @@ -483,6 +484,7 @@ var/global/list/damage_icon_parts = list() //Reset our hair overlays_standing[HAIR_LAYER] = null + update_eyes(0) //Pirated out of here, for glowing eyes. var/obj/item/organ/external/head/head_organ = get_organ(BP_HEAD) if(!head_organ || head_organ.is_stump() ) @@ -527,9 +529,50 @@ var/global/list/damage_icon_parts = list() face_standing += rgb(,,,120) overlays_standing[HAIR_LAYER] = image(face_standing) - if(update_icons) update_icons_layers() +/mob/living/carbon/human/update_eyes(var/update_icons=1) + if(QDESTROYING(src)) + return + + //Reset our eyes + overlays_standing[EYES_LAYER] = null + + //This is ONLY for glowing eyes for now. Boring flat eyes are done by the head's own proc. + if(!species.has_glowing_eyes) + if(update_icons) update_icons_layers() + return + + //Our glowy eyes should be hidden if some equipment hides them. + if(!should_have_organ(O_EYES) || (head && (head.flags_inv & BLOCKHAIR)) || (wear_mask && (wear_mask.flags_inv & BLOCKHAIR))) + if(update_icons) update_icons_layers() + return + + //Get the head, we'll need it later. + var/obj/item/organ/external/head/head_organ = get_organ(BP_HEAD) + if(!head_organ || head_organ.is_stump() ) + if(update_icons) update_icons_layers() + return + + //The eyes store the color themselves, funny enough. + var/obj/item/organ/internal/eyes/eyes = internal_organs_by_name[O_EYES] + if(!head_organ.eye_icon) + if(update_icons) update_icons_layers() + return + + var/icon/eyes_icon = new/icon(head_organ.eye_icon_location, head_organ.eye_icon) + if(eyes) + 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) + + var/image/eyes_image = image(eyes_icon) + eyes_image.plane = PLANE_LIGHTING_ABOVE + + overlays_standing[EYES_LAYER] = eyes_image + + if(update_icons) update_icons_layers() + /mob/living/carbon/human/update_mutations(var/update_icons=1) if(QDESTROYING(src)) return