Skip to content

Commit

Permalink
adherents
Browse files Browse the repository at this point in the history
  • Loading branch information
Lexanx committed Oct 27, 2024
1 parent ebf297a commit edd5bd6
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
39 changes: 39 additions & 0 deletions mods/adherent_discharge/code/adherent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,42 @@

adherent_core.ready_to_charge = FALSE
to_chat(src, SPAN_WARNING("You have relieved the tension of your tentacles."))


/datum/species/adherent/handle_vision(mob/living/carbon/human/H)
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

////obj/screen/fullscreen/glitch описан в mods\ipc_mods\code\machine_functions.dm
9 changes: 5 additions & 4 deletions mods/ipc_mods/code/machine_functions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
alpha = 80

/obj/screen/fullscreen/glitch_bw/alpha
alpha = 200
alpha = 180


/datum/species/machine/handle_vision(mob/living/carbon/human/H)
Expand All @@ -141,7 +141,8 @@
if(!H.client)//no client, no screen to update
return 1

H.set_fullscreen(H.eye_blind && !H.equipment_prescription, "glitch_monitor", /obj/screen/fullscreen/glitch_bw/alpha)
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)
Expand All @@ -158,9 +159,9 @@

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

/mob/living/carbon/human/proc/clear_emp_act()
clear_fullscreen("sensoremp")

0 comments on commit edd5bd6

Please sign in to comment.