Files
Zergspower 27551e1caf Tweaks blindness to be more player friendly (#94323)
## About The Pull Request

So something i missed from when i played Goonstation a long while ago
was my blind characters, i tried recreating them in TGCode but found
that the blind quirk here is far more harsh to play visually. So i got
some help from Melbert and got a plan goin and here's the results.


![blinds](https://github.com/user-attachments/assets/d12bd5c1-e0cb-4997-835f-279076c6a665)

Players can see colors! But muted, this change is strictly for visual
enjoyment as the constant monochrome is just - i cant really describe
how much i hate seeing it for more than 15 minutes.

Secondly the flicker is gone from the quirk but remains for all the
temporary blindness, this is 100% Melberts code as they're a helluva lot
smarter than I am and I just nod and smile before pasting it. This did
entail creating a new fulscreen in the dmi, but i just copy/pasted the
existing one and took out the animated frames and named it as 'static'
so it wouldnt interfere with anything else using it.

## Why It's Good For The Game

Playing a blind character is great, however it causes some serious
eyestrain after prolonged playstyle

## Changelog
🆑 MrMelbert, Zergspower
qol: The world is now heavily desaturated while blind, rather than pure
monochrome, to give players some visual stimulus
qol: When blind, the brief flicker of the entire screen now only appears
for mobs temporarily blinded - ie, mobs blinded from quirk / trauma /
genetic mutation no longer experience it
/🆑
2025-12-10 20:42:56 +00:00

263 lines
7.4 KiB
Plaintext

/mob/proc/overlay_fullscreen(category, type, severity)
var/atom/movable/screen/fullscreen/screen = screens[category]
if (!screen || screen.type != type)
// needs to be recreated
clear_fullscreen(category, FALSE)
screens[category] = screen = new type()
else if ((!severity || severity == screen.severity) && (!client || screen.screen_loc != "CENTER-7,CENTER-7" || screen.view == client.view))
// doesn't need to be updated
return screen
screen.icon_state = "[initial(screen.icon_state)][severity]"
screen.severity = severity
if (client && screen.should_show_to(src))
screen.update_for_view(client.view)
client.screen += screen
if(screen.needs_offsetting)
SET_PLANE_EXPLICIT(screen, PLANE_TO_TRUE(screen.plane), src)
return screen
/mob/proc/clear_fullscreen(category, animated = 10)
var/atom/movable/screen/fullscreen/screen = screens[category]
if(!screen)
return
screens -= category
if(!QDELETED(src) && animated)
animate(screen, alpha = 0, time = animated)
addtimer(CALLBACK(src, PROC_REF(clear_fullscreen_after_animate), screen), animated, TIMER_CLIENT_TIME)
else
if(client)
client.screen -= screen
qdel(screen)
/mob/proc/clear_fullscreen_after_animate(atom/movable/screen/fullscreen/screen)
if(client)
client.screen -= screen
qdel(screen)
/mob/proc/clear_fullscreens()
for(var/category in screens)
clear_fullscreen(category)
/mob/proc/hide_fullscreens()
if(client)
for(var/category in screens)
client.screen -= screens[category]
/mob/proc/reload_fullscreen()
if(client)
var/atom/movable/screen/fullscreen/screen
for(var/category in screens)
screen = screens[category]
if(screen.should_show_to(src))
screen.update_for_view(client.view)
client.screen |= screen
else
client.screen -= screen
/mob/on_changed_z_level(turf/old_turf, turf/new_turf, same_z_layer, notify_contents)
. = ..()
if(!same_z_layer)
relayer_fullscreens()
/mob/proc/relayer_fullscreens()
var/turf/our_lad = get_turf(src)
var/offset = GET_TURF_PLANE_OFFSET(our_lad)
for(var/category in screens)
var/atom/movable/screen/fullscreen/screen = screens[category]
if(screen.needs_offsetting)
screen.plane = GET_NEW_PLANE(initial(screen.plane), offset)
/atom/movable/screen/fullscreen
icon = 'icons/hud/screen_full.dmi'
icon_state = "default"
screen_loc = "CENTER-7,CENTER-7"
layer = FULLSCREEN_LAYER
plane = FULLSCREEN_PLANE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
var/view = 7
var/severity = 0
var/show_when_dead = FALSE
var/needs_offsetting = TRUE
/atom/movable/screen/fullscreen/proc/update_for_view(client_view)
if (screen_loc == "CENTER-7,CENTER-7" && view != client_view)
var/list/actualview = getviewsize(client_view)
view = client_view
transform = matrix(actualview[1]/FULLSCREEN_OVERLAY_RESOLUTION_X, 0, 0, 0, actualview[2]/FULLSCREEN_OVERLAY_RESOLUTION_Y, 0)
/atom/movable/screen/fullscreen/proc/should_show_to(mob/mymob)
if(!show_when_dead && mymob.stat == DEAD)
return FALSE
return TRUE
/atom/movable/screen/fullscreen/Destroy()
severity = 0
. = ..()
/atom/movable/screen/fullscreen/brute
icon_state = "brutedamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/oxy
icon_state = "oxydamageoverlay"
layer = UI_DAMAGE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/crit
icon_state = "passage"
layer = CRIT_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/crit/vision
icon_state = "oxydamageoverlay"
layer = BLIND_LAYER
/atom/movable/screen/fullscreen/crit/projectile_parry
layer = PARRY_LAYER
/atom/movable/screen/fullscreen/blind
icon_state = "blackimageoverlay"
layer = BLIND_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/blind/cyborg
show_when_dead = TRUE
/atom/movable/screen/fullscreen/blind/noflicker
icon_state = "blackimageoverlaystatic"
layer = BLIND_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/curse
icon_state = "curse"
layer = CURSE_LAYER
plane = FULLSCREEN_PLANE
/atom/movable/screen/fullscreen/ivanov_display
icon_state = "ivanov"
alpha = 180
/atom/movable/screen/fullscreen/impaired
icon_state = "impairedoverlay"
/atom/movable/screen/fullscreen/flash
icon = 'icons/hud/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
/atom/movable/screen/fullscreen/flash/black
icon = 'icons/hud/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "black"
/atom/movable/screen/fullscreen/flash/static
icon = 'icons/hud/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "noise"
/atom/movable/screen/fullscreen/high
icon_state = "druggy"
alpha = 255
plane = LIGHTING_PLANE
layer = LIGHTING_ABOVE_ALL + 1 //Infinity plus one (not actually)
blend_mode = BLEND_MULTIPLY
/atom/movable/screen/fullscreen/high/update_for_view(client_view)
animate(src, flags = ANIMATION_END_NOW) //Stop all animations.
. = ..()
color = COLOR_MATRIX_IDENTITY //We convert it early to avoid a sudden weird jitter.
alpha = 0
animate(src, alpha = 255, time = 5 SECONDS) //Fade in.
addtimer(CALLBACK(src, PROC_REF(start_hue_rotation)), 5 SECONDS)
/atom/movable/screen/fullscreen/high/proc/start_hue_rotation()
animate(src, color = color_matrix_rotate_hue(1), loop = -1, time = 2 SECONDS) //Start the loop.
var/step_precision = 18 //Larger is more precise rotations.
for(var/current_step in 1 to step_precision - 1) //We do the -1 here because 360 == 0 when it comes to angles.
animate(
color = color_matrix_rotate_hue(current_step * 360/step_precision),
time = 2 SECONDS,
)
/atom/movable/screen/fullscreen/color_vision
icon = 'icons/hud/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
alpha = 80
/atom/movable/screen/fullscreen/bluespace_sparkle
icon = 'icons/effects/effects.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "shieldsparkles"
layer = FLASH_LAYER
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
show_when_dead = TRUE
/atom/movable/screen/fullscreen/color_vision/green
color = "#00ff00"
/atom/movable/screen/fullscreen/color_vision/red
color = "#ff0000"
/atom/movable/screen/fullscreen/color_vision/blue
color = "#0000ff"
/atom/movable/screen/fullscreen/cinematic_backdrop
icon = 'icons/hud/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "flash"
plane = SPLASHSCREEN_PLANE
layer = CINEMATIC_LAYER
color = COLOR_BLACK
show_when_dead = TRUE
/atom/movable/screen/fullscreen/lighting_backdrop
icon = 'icons/hud/screen_gen.dmi'
icon_state = "flash"
screen_loc = "WEST,SOUTH to EAST,NORTH"
plane = LIGHTING_PLANE
layer = LIGHTING_ABOVE_ALL
blend_mode = BLEND_OVERLAY
show_when_dead = TRUE
needs_offsetting = FALSE
//Provides darkness to the back of the lighting plane
/atom/movable/screen/fullscreen/lighting_backdrop/lit
invisibility = INVISIBILITY_LIGHTING
layer = BACKGROUND_LAYER+21
color = "#000"
//Provides whiteness in case you don't see lights so everything is still visible
/atom/movable/screen/fullscreen/lighting_backdrop/unlit
layer = BACKGROUND_LAYER+20
/atom/movable/screen/fullscreen/see_through_darkness
icon_state = "nightvision"
plane = LIGHTING_PLANE
layer = LIGHTING_ABOVE_ALL
blend_mode = BLEND_ADD
show_when_dead = TRUE
/atom/movable/screen/fullscreen/static_vision
icon = 'icons/hud/screen_gen.dmi'
screen_loc = "WEST,SOUTH to EAST,NORTH"
icon_state = "noise"
color = "#04a8d1"
alpha = 80
/atom/movable/screen/fullscreen/static_vision/cyborg
show_when_dead = TRUE
color = "#c90000"
alpha = 0