From 26d5e7e0b64371cfde98aada32652c2e8de208d8 Mon Sep 17 00:00:00 2001 From: Arokha Sieyes Date: Fri, 16 Mar 2018 19:53:26 -0400 Subject: [PATCH] POLARIS: Add eye color to shapeshifters --- .../human/species/species_shapeshift.dm | 37 ++++++++++++++++++- .../human/species/station/prometheans.dm | 1 + .../mob/living/carbon/human/update_icons.dm | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/species/species_shapeshift.dm b/code/modules/mob/living/carbon/human/species/species_shapeshift.dm index 55d2dc1e8d4..bb53aca8ee8 100644 --- a/code/modules/mob/living/carbon/human/species/species_shapeshift.dm +++ b/code/modules/mob/living/carbon/human/species/species_shapeshift.dm @@ -183,6 +183,9 @@ var/list/wrapped_species_by_ref = list() r_skin = hex2num(copytext(new_skin, 2, 4)) g_skin = hex2num(copytext(new_skin, 4, 6)) b_skin = hex2num(copytext(new_skin, 6, 8)) + r_synth = r_skin + g_synth = g_skin + b_synth = b_skin var/datum/species/shapeshifter/S = species if(S.monochromatic) @@ -287,4 +290,36 @@ var/list/wrapped_species_by_ref = list() if(species && mind) apply_traits() */ - return \ No newline at end of file + return + +/mob/living/carbon/human/proc/shapeshifter_select_eye_colour() + + set name = "Select Eye Color" + set category = "Abilities" + + if(stat || world.time < last_special) + return + + last_special = world.time + 50 + + var/current_color = rgb(r_eyes,g_eyes,b_eyes) + var/new_eyes = input("Pick a new color for your eyes.","Eye Color", current_color) as null|color + if(!new_eyes) + return + + shapeshifter_set_eye_color(new_eyes) + +/mob/living/carbon/human/proc/shapeshifter_set_eye_color(var/new_eyes) + + var/list/new_color_rgb_list = hex2rgb(new_eyes) + // First, update mob vars. + r_eyes = new_color_rgb_list[1] + g_eyes = new_color_rgb_list[2] + b_eyes = new_color_rgb_list[3] + // Now sync the organ's eye_colour list, if possible + var/obj/item/organ/internal/eyes/eyes = internal_organs_by_name[O_EYES] + if(istype(eyes)) + eyes.update_colour() + + update_icons_body() + update_eyes() diff --git a/code/modules/mob/living/carbon/human/species/station/prometheans.dm b/code/modules/mob/living/carbon/human/species/station/prometheans.dm index e01fe608d3f..1329e6dbd49 100644 --- a/code/modules/mob/living/carbon/human/species/station/prometheans.dm +++ b/code/modules/mob/living/carbon/human/species/station/prometheans.dm @@ -83,6 +83,7 @@ var/datum/species/shapeshifter/promethean/prometheans /mob/living/carbon/human/proc/shapeshifter_select_shape, /mob/living/carbon/human/proc/shapeshifter_select_colour, /mob/living/carbon/human/proc/shapeshifter_select_hair, + /mob/living/carbon/human/proc/shapeshifter_select_eye_colour, /mob/living/carbon/human/proc/shapeshifter_select_hair_colors, /mob/living/carbon/human/proc/shapeshifter_select_gender, /mob/living/carbon/human/proc/regenerate diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm index a742723dbf1..b63239c0dd5 100644 --- a/code/modules/mob/living/carbon/human/update_icons.dm +++ b/code/modules/mob/living/carbon/human/update_icons.dm @@ -354,7 +354,7 @@ var/global/list/damage_icon_parts = list() if(eyes) icon_key += "[rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])]" else - icon_key += "#000000" + icon_key += "[r_eyes], [g_eyes], [b_eyes]" for(var/organ_tag in species.has_limbs) var/obj/item/organ/external/part = organs_by_name[organ_tag]