Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synth glitch screens #2764

Merged
merged 5 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions mods/ipc_mods/code/machine_functions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,83 @@

visible_message("<span class='notice'>\The [src] attaches \the [O] to \his body!</span>",
"<span class='notice'>You attach \the [O] to your body!</span>")



/obj/screen/fullscreen/no_power
icon = 'mods/ipc_mods/icons/glitch.dmi'
icon_state = "no_power"
layer = BLIND_LAYER
scale_to_view = TRUE

/obj/screen/fullscreen/glitch_monitor
icon = 'mods/ipc_mods/icons/glitch.dmi'
icon_state = "glitch_monitor"
layer = BLIND_LAYER
scale_to_view = TRUE
alpha = 60

/obj/screen/fullscreen/glitchs
icon = 'mods/ipc_mods/icons/glitch.dmi'
icon_state = "glitch_eye"
layer = BLIND_LAYER
scale_to_view = TRUE

/obj/screen/fullscreen/glitch_bw
icon = 'mods/ipc_mods/icons/glitch.dmi'
icon_state = "glitch_bw"
layer = BLIND_LAYER
scale_to_view = TRUE
alpha = 60

/obj/screen/fullscreen/glitch_bw/alpha
alpha = 160


/datum/species/handle_vision(mob/living/carbon/human/H)
if(H.isSynthetic())
var/list/vision = H.get_accumulated_vision_handlers()
H.update_sight()
H.set_sight(H.sight|get_vision_flags(H)|H.equipment_vision_flags|vision[1])
H.change_light_colour(H.getDarkvisionTint())

if(H.stat == DEAD)
return 1

if(!H.druggy)
H.set_see_in_dark((H.sight == (SEE_TURFS|SEE_MOBS|SEE_OBJS)) ? 8 : min(H.getDarkvisionRange() + H.equipment_darkness_modifier, 8))
if(H.equipment_see_invis)
H.set_see_invisible(max(min(H.see_invisible, H.equipment_see_invis), vision[2]))

if(H.equipment_tint_total >= TINT_BLIND)
H.eye_blind = max(H.eye_blind, 1)

if(!H.client)//no client, no screen to update
return 1

if(H.stat == !UNCONSCIOUS)
H.set_fullscreen(H.eye_blind && !H.equipment_prescription, "glitch_monitor", /obj/screen/fullscreen/glitch_bw/alpha)
H.set_fullscreen(H.stat == UNCONSCIOUS, "no_power", /obj/screen/fullscreen/no_power)

if(config.welder_vision)
H.set_fullscreen(H.equipment_tint_total, "welder", /obj/screen/fullscreen/impaired, H.equipment_tint_total)
var/how_nearsighted = get_how_nearsighted(H)
H.set_fullscreen(how_nearsighted, "nearsighted", /obj/screen/fullscreen/oxy, how_nearsighted)
H.set_fullscreen(H.eye_blurry, "blurry", /obj/screen/fullscreen/glitch_bw)
H.set_fullscreen(H.druggy, "high", /obj/screen/fullscreen/high)

for(var/overlay in H.equipment_overlays)
H.client.screen |= overlay

return 1
else
.=..()

/mob/living/carbon/human/emp_act(severity)
. = ..()
if(isSynthetic())
overlay_fullscreen("sensoremp", /obj/screen/fullscreen/glitchs)
addtimer(new Callback(src, PROC_REF(clear_emp_act)), 1.5 SECONDS)

/mob/living/carbon/human/proc/clear_emp_act()
clear_fullscreen("sensoremp")
Binary file added mods/ipc_mods/icons/glitch.dmi
Binary file not shown.