Files
GS13NG/code/modules/surgery/organs/eyes.dm
2017-05-12 15:57:11 -05:00

135 lines
3.9 KiB
Plaintext

/obj/item/organ/eyes
name = "eyes"
icon_state = "eyeballs"
desc = "I see you!"
zone = "eyes"
slot = "eye_sight"
gender = PLURAL
var/sight_flags = 0
var/see_in_dark = 2
var/tint = 0
var/eye_color = "" //set to a hex code to override a mob's eye color
var/old_eye_color = "fff"
var/flash_protect = 0
var/see_invisible = SEE_INVISIBLE_LIVING
var/lighting_alpha
/obj/item/organ/eyes/Insert(mob/living/carbon/M, special = 0)
..()
if(ishuman(owner))
var/mob/living/carbon/human/HMN = owner
old_eye_color = HMN.eye_color
if(eye_color)
HMN.eye_color = eye_color
HMN.regenerate_icons()
else
eye_color = HMN.eye_color
M.update_tint()
owner.update_sight()
/obj/item/organ/eyes/Remove(mob/living/carbon/M, special = 0)
..()
if(ishuman(M) && eye_color)
var/mob/living/carbon/human/HMN = M
HMN.eye_color = old_eye_color
HMN.regenerate_icons()
M.update_tint()
M.update_sight()
/obj/item/organ/eyes/night_vision
name = "shadow eyes"
desc = "A spooky set of eyes that can see in the dark."
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
actions_types = list(/datum/action/item_action/organ_action/use)
var/night_vision = TRUE
/obj/item/organ/eyes/night_vision/ui_action_click()
switch(lighting_alpha)
if (LIGHTING_PLANE_ALPHA_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE
if (LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE)
lighting_alpha = LIGHTING_PLANE_ALPHA_INVISIBLE
else
lighting_alpha = LIGHTING_PLANE_ALPHA_VISIBLE
owner.update_sight()
/obj/item/organ/eyes/night_vision/alien
name = "alien eyes"
desc = "It turned out they had them after all!"
see_in_dark = 8
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
sight_flags = SEE_MOBS
/obj/item/organ/eyes/night_vision/zombie
name = "undead eyes"
desc = "Somewhat counterintuitively, these half rotten eyes actually have superior vision to those of a living human."
///Robotic
/obj/item/organ/eyes/robotic
name = "robotic eyes"
icon_state = "cybernetic_eyeballs"
desc = "Your vision is augmented."
status = ORGAN_ROBOTIC
/obj/item/organ/eyes/robotic/emp_act(severity)
if(!owner)
return
if(severity > 1)
if(prob(10 * severity))
return
to_chat(owner, "<span class='warning'>Static obfuscates your vision!</span>")
owner.flash_act(visual = 1)
/obj/item/organ/eyes/robotic/xray
name = "X-ray eyes"
desc = "These cybernetic eyes will give you X-ray vision. Blinking is futile."
eye_color = "000"
see_in_dark = 8
sight_flags = SEE_MOBS | SEE_OBJS | SEE_TURFS
/obj/item/organ/eyes/robotic/thermals
name = "Thermals eyes"
desc = "These cybernetic eye implants will give you Thermal vision. Vertical slit pupil included."
eye_color = "FC0"
origin_tech = "materials=5;programming=4;biotech=4;magnets=4;syndicate=1"
sight_flags = SEE_MOBS
lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_VISIBLE
flash_protect = -1
see_in_dark = 8
/obj/item/organ/eyes/robotic/flashlight
name = "flashlight eyes"
desc = "It's two flashlights rigged together with some wire. Why would you put these in someones head?"
eye_color ="fee5a3"
icon = 'icons/obj/lighting.dmi'
icon_state = "flashlight_eyes"
flash_protect = 2
tint = INFINITY
/obj/item/organ/eyes/robotic/flashlight/emp_act(severity)
return
/obj/item/organ/eyes/robotic/flashlight/Insert(var/mob/living/carbon/M, var/special = 0)
..()
M.set_light(M.light_range + 15, M.light_power + 1)
/obj/item/organ/eyes/robotic/flashlight/Remove(var/mob/living/carbon/M, var/special = 0)
M.set_light(M.light_range -15, M.light_power - 1)
..()
// Welding shield implant
/obj/item/organ/eyes/robotic/shield
name = "shielded robotic eyes"
desc = "These reactive micro-shields will protect you from welders and flashes without obscuring your vision."
origin_tech = "materials=4;biotech=3;engineering=4;plasmatech=3"
flash_protect = 2
/obj/item/organ/eyes/robotic/shield/emp_act(severity)
return