Eye fix
This commit is contained in:
@@ -32,6 +32,8 @@
|
||||
|
||||
/obj/item/organ/eyes/Insert(mob/living/carbon/M, special = FALSE, drop_if_replaced = FALSE)
|
||||
..()
|
||||
if(damage == initial(damage))
|
||||
clear_eye_trauma()
|
||||
if(ishuman(owner))
|
||||
var/mob/living/carbon/human/HMN = owner
|
||||
old_eye_color = HMN.eye_color
|
||||
@@ -46,7 +48,9 @@
|
||||
M.update_tint()
|
||||
owner.update_sight()
|
||||
|
||||
|
||||
/obj/item/organ/eyes/Remove(mob/living/carbon/M, special = 0)
|
||||
clear_eye_trauma()
|
||||
..()
|
||||
if(ishuman(M) && eye_color)
|
||||
var/mob/living/carbon/human/HMN = M
|
||||
@@ -65,7 +69,7 @@
|
||||
//various degrees of "oh fuck my eyes", from "point a laser at your eye" to "staring at the Sun" intensities
|
||||
if(damage > 20)
|
||||
damaged = TRUE
|
||||
if((organ_flags & ORGAN_FAILING))
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
C.become_blind(EYE_DAMAGE)
|
||||
else if(damage > 30)
|
||||
C.overlay_fullscreen("eye_damage", /obj/screen/fullscreen/impaired, 2)
|
||||
@@ -77,6 +81,11 @@
|
||||
C.clear_fullscreen("eye_damage")
|
||||
return
|
||||
|
||||
/obj/item/organ/eyes/proc/clear_eye_trauma()
|
||||
var/mob/living/carbon/C = owner
|
||||
C.clear_fullscreen("eye_damage")
|
||||
C.cure_blind(EYE_DAMAGE)
|
||||
damaged = FALSE
|
||||
|
||||
/obj/item/organ/eyes/night_vision
|
||||
name = "shadow eyes"
|
||||
|
||||
@@ -77,17 +77,17 @@
|
||||
applyOrganDamage(maxHealth * decay_factor)
|
||||
|
||||
/obj/item/organ/proc/on_life() //repair organ damage if the organ is not failing
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
return
|
||||
///Damage decrements by a percent of its maxhealth
|
||||
var/healing_amount = -(maxHealth * healing_factor)
|
||||
///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health
|
||||
healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0
|
||||
applyOrganDamage(healing_amount) //to FERMI_TWEAK
|
||||
if(!(organ_flags & ORGAN_FAILING))
|
||||
///Damage decrements by a percent of its maxhealth
|
||||
var/healing_amount = -(maxHealth * healing_factor)
|
||||
///Damage decrements again by a percent of its maxhealth, up to a total of 4 extra times depending on the owner's health
|
||||
healing_amount -= owner.satiety > 0 ? 4 * healing_factor * owner.satiety / MAX_SATIETY : 0
|
||||
applyOrganDamage(healing_amount) //to FERMI_TWEAK
|
||||
//Make it so each threshold is stuck.
|
||||
|
||||
/obj/item/organ/examine(mob/user)
|
||||
. = ..()
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
if(!organ_flags & ORGAN_FAILING)
|
||||
if(status == ORGAN_ROBOTIC)
|
||||
. += "<span class='warning'>[src] seems to be broken!</span>"
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user