final stuff, i think?
This commit is contained in:
@@ -87,28 +87,35 @@
|
||||
|
||||
/obj/item/organ/eyes/applyOrganDamage(d, maximum = maxHealth)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
var/old_damaged = eye_damaged
|
||||
switch(damage)
|
||||
if(INFINITY to maxHealth)
|
||||
eye_damaged = BLIND_VISION_THREE
|
||||
if(maxHealth to high_threshold)
|
||||
eye_damaged = BLURRY_VISION_TWO
|
||||
if(high_threshold to low_threshold)
|
||||
eye_damaged = BLURRY_VISION_ONE
|
||||
else
|
||||
if(!owner)
|
||||
return FALSE
|
||||
apply_damaged_eye_effects()
|
||||
|
||||
/// Applies effects to our owner based on how damaged our eyes are
|
||||
/obj/item/organ/eyes/proc/apply_damaged_eye_effects()
|
||||
// we're in healthy threshold, either try to heal (if damaged) or do nothing
|
||||
if(damage <= low_threshold)
|
||||
if(eye_damaged)
|
||||
eye_damaged = FALSE
|
||||
if(eye_damaged == old_damaged || !owner)
|
||||
// clear nearsightedness from damage
|
||||
owner.clear_fullscreen(EYE_DAMAGE)
|
||||
// and cure blindness from damage
|
||||
owner.cure_blind(EYE_DAMAGE)
|
||||
return
|
||||
if(old_damaged == BLIND_VISION_THREE)
|
||||
owner.cure_blind(EYE_DAMAGE)
|
||||
else if(eye_damaged == BLIND_VISION_THREE)
|
||||
|
||||
//various degrees of "oh fuck my eyes", from "point a laser at your eye" to "staring at the Sun" intensities
|
||||
// 50 - blind
|
||||
// 49-31 - nearsighted (2 severity)
|
||||
// 30-20 - nearsighted (1 severity)
|
||||
if(organ_flags & ORGAN_FAILING)
|
||||
// become blind from damage
|
||||
owner.become_blind(EYE_DAMAGE)
|
||||
if(eye_damaged && eye_damaged != BLIND_VISION_THREE)
|
||||
owner.overlay_fullscreen("eye_damage", /atom/movable/screen/fullscreen/scaled/impaired, eye_damaged)
|
||||
|
||||
else
|
||||
owner.clear_fullscreen("eye_damage")
|
||||
// become nearsighted from damage
|
||||
owner.overlay_fullscreen(EYE_DAMAGE, /atom/movable/screen/fullscreen/scaled/impaired, damage > high_threshold ? 2 : 1)
|
||||
|
||||
eye_damaged = TRUE
|
||||
|
||||
/obj/item/organ/eyes/night_vision
|
||||
name = "shadow eyes"
|
||||
|
||||
Reference in New Issue
Block a user