Closing Eyes (#22957)

* You can now close your eyes. This blinds you, but gives you protection
against flash effects.
* Welding while blind takes three times as long and has an 80% chance to
fail, with a risk of burning yourself.

<img width="825" height="571" alt="image"
src="https://github.com/user-attachments/assets/14871444-e1c6-4d0f-8f56-d07e56055db0"
/>
<img width="875" height="633" alt="image"
src="https://github.com/user-attachments/assets/134379bb-474c-4c5d-b069-2559d9390305"
/>


AI usage disclosure: The code for this was created in-part using GPT 5.6
Sol.
This commit is contained in:
Geeves
2026-08-13 16:57:18 +00:00
committed by GitHub
parent 3ad4c47ca2
commit 5a410180b5
10 changed files with 119 additions and 8 deletions
@@ -209,6 +209,10 @@
if(wrists && !skipwrists)
msg += "[get_pronoun("He")] [get_pronoun("is")] wearing [icon2html(wrists, user)] <a href='byond://?src=[REF(src)];lookitem_desc_only=[REF(wrists)]'>\a [wrists]</a> [wrists.get_wrist_examine_text(src)].\n"
//closed eyes
if(!skipeyes && eyes_are_closed())
msg += "[get_pronoun("His")] eyes are closed.\n"
//Jitters
if(is_jittery)
if(jitteriness >= 300)
@@ -925,6 +925,9 @@
return base_flash_protection
/mob/living/carbon/human/flash_act(intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, ignore_inherent = FALSE, type = /atom/movable/screen/fullscreen/flash, length = 2.5 SECONDS)
if(eyes_are_closed())
return FALSE
if(..())
var/obj/item/organ/E = get_eyes(no_synthetic = !affect_silicon)
if(istype(E))
@@ -205,6 +205,14 @@
return eyes
/// Returns TRUE when this mob's vision organ has been voluntarily closed.
/mob/living/carbon/human/proc/eyes_are_closed()
var/obj/item/organ/internal/eyes/eyes = get_eyes()
return eyes?.eyes_closed
/mob/living/carbon/human/is_blind()
return ..() || eyes_are_closed()
/mob/living/carbon/human/proc/awaken_psi_basic(var/source)
var/static/list/psi_operancy_messages = list(
"There's something in your skull!",
@@ -771,7 +771,7 @@
if(!H.client)//no client, no screen to update
return 1
H.set_fullscreen(H.eye_blind, "blind", /atom/movable/screen/fullscreen/blind)
H.set_fullscreen(H.eye_blind || H.eyes_are_closed(), "blind", /atom/movable/screen/fullscreen/blind)
H.set_fullscreen(H.stat == UNCONSCIOUS, "blackout", /atom/movable/screen/fullscreen/blackout)
if(GLOB.config.welder_vision)
@@ -315,7 +315,7 @@ There are several things that need to be remembered:
var/icon_key = "[species.race_key][g][s_tone][r_skin][g_skin][b_skin][lipstick_color || "nolips"][!!husk][!!fat][!!skeleton][is_frenzied]"
var/obj/item/organ/internal/eyes/eyes = get_eyes()
if(eyes)
icon_key += "[rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])]"
icon_key += "[rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])][eyes.eyes_closed ? "closed" : "open"]"
else
icon_key += "#000000"
+20
View File
@@ -12,6 +12,26 @@
toxin_type = CE_OCULOTOXIC
var/list/eye_colour = list(0,0,0)
var/singular_name = "eye"
/// Whether the owner has voluntarily closed this organ.
var/eyes_closed = FALSE
/obj/item/organ/internal/eyes/verb/toggle_eyes()
set name = "Open/Close Eyes"
set desc = "Close your eyes to block your vision and protect them from bright flashes."
set category = "IC"
set src in usr
if(!owner || usr != owner || owner.incapacitated())
return
eyes_closed = !eyes_closed
if(eyes_closed)
owner.custom_emote(VISIBLE_MESSAGE, "closes their eyes.")
else
owner.custom_emote(VISIBLE_MESSAGE, "opens their eyes.")
owner.update_body()
owner.handle_vision()
/obj/item/organ/internal/eyes/proc/update_colour()
if(!owner)
+12 -4
View File
@@ -60,17 +60,22 @@
is_frenzied = TRUE
if(owner.species.has_organ[owner.species.vision_organ])
var/obj/item/organ/internal/eyes/eyes = owner.get_eyes()
if(eyes && species.eyes && !is_frenzied)
if(eyes && species.eyes && (!is_frenzied || eyes.eyes_closed))
var/eyecolor
if (eyes.eye_colour)
if(eyes.eye_colour && !eyes.eyes_closed)
eyecolor = rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])
var/cache_key = "[species.eyes]_[eyecolor || "nocolor"]"
var/cache_key = "[species.eyes]_[eyes.eyes_closed ? "closed" : (eyecolor || "nocolor")]"
var/icon/eyes_icon = SSicon_cache.human_eye_cache[cache_key]
if (!eyes_icon)
eyes_icon = new/icon(species.eyes_icons, species.eyes)
if(eyecolor)
if(eyes.eyes_closed)
// A translucent black eye mask darkens the skin beneath it, creating eyelids
// which follow both colour-based skin and tone-shaded human complexions.
eyes_icon.Blend(rgb(0, 0, 0), ICON_MULTIPLY)
eyes_icon.ChangeOpacity(0.2)
else if(eyecolor)
eyes_icon.Blend(eyecolor, species.eyes_icon_blend)
else
eyes_icon.Blend(rgb(128,0,0), species.eyes_icon_blend)
@@ -109,6 +114,9 @@
var/list/bonus_overlays = list()
var/obj/item/organ/internal/eyes/eyes = H.get_eyes()
if(eyes?.eyes_closed)
return mob_overlays
if(eyes && BP_IS_ROBOTIC(eyes))
var/datum/robolimb/robolimb_data = GLOB.all_robolimbs[eyes.model]
if(robolimb_data.emissive)