From edd5bd61a4892d0c27d6f0e74bc467d6ed920e9f Mon Sep 17 00:00:00 2001 From: Lexanx <61974560+Lexanx@users.noreply.github.com> Date: Sun, 27 Oct 2024 16:19:46 +0300 Subject: [PATCH] adherents --- mods/adherent_discharge/code/adherent.dm | 39 ++++++++++++++++++++++++ mods/ipc_mods/code/machine_functions.dm | 9 +++--- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/mods/adherent_discharge/code/adherent.dm b/mods/adherent_discharge/code/adherent.dm index 681dec209ae83..b1c1fd4c8f783 100644 --- a/mods/adherent_discharge/code/adherent.dm +++ b/mods/adherent_discharge/code/adherent.dm @@ -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 diff --git a/mods/ipc_mods/code/machine_functions.dm b/mods/ipc_mods/code/machine_functions.dm index 03a119c6ac8f5..7cd990706615d 100644 --- a/mods/ipc_mods/code/machine_functions.dm +++ b/mods/ipc_mods/code/machine_functions.dm @@ -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) @@ -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) @@ -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")