From 19a3f768c855a9fa1093fbb007ab6c19be78218e Mon Sep 17 00:00:00 2001 From: GDN <96800819+GDNgit@users.noreply.github.com> Date: Thu, 7 Mar 2024 05:04:57 -0600 Subject: [PATCH] into the bin (#24289) --- code/game/machinery/ai_display.dm | 15 +++++++++------ code/game/machinery/status_display.dm | 1 - code/game/machinery/vendors/vending.dm | 2 -- code/modules/events/prison_break.dm | 2 +- .../living/simple_animal/hostile/angel_statue.dm | 3 +-- .../living/simple_animal/hostile/floorcluwne.dm | 2 +- code/modules/power/apc/apc_overlay.dm | 7 ------- code/modules/power/lights.dm | 5 ++++- code/modules/power/powernets/local_powernet.dm | 10 ---------- 9 files changed, 16 insertions(+), 31 deletions(-) diff --git a/code/game/machinery/ai_display.dm b/code/game/machinery/ai_display.dm index e094df65bb4..fda00c73582 100644 --- a/code/game/machinery/ai_display.dm +++ b/code/game/machinery/ai_display.dm @@ -8,13 +8,9 @@ GLOBAL_LIST_EMPTY(ai_displays) anchored = TRUE density = FALSE - var/spookymode = FALSE - /// Current mode var/mode = AI_DISPLAY_MODE_BLANK - /// Target icon state - var/picture_state /// Current emotion, used to calculate an icon state var/emotion = "Neutral" @@ -50,10 +46,17 @@ GLOBAL_LIST_EMPTY(ai_displays) if(stat & (NOPOWER | BROKEN)) return FALSE - spookymode = TRUE - update_icon() + addtimer(CALLBACK(src, PROC_REF(un_spookify), mode), 2 SECONDS) + mode = null + update_icon(UPDATE_OVERLAYS) return TRUE +/obj/machinery/ai_status_display/proc/un_spookify(our_real_state) + mode = our_real_state + if(stat & (NOPOWER | BROKEN)) + return FALSE + update_icon(UPDATE_OVERLAYS) + /obj/machinery/ai_status_display/update_overlays() . = ..() diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm index 4da41171a6b..3574689fd5d 100644 --- a/code/game/machinery/status_display.dm +++ b/code/game/machinery/status_display.dm @@ -197,7 +197,6 @@ GLOBAL_LIST_EMPTY(status_displays) picture_state = null update_icon(UPDATE_OVERLAYS) - /proc/post_status(mode, data1, data2) if(usr && mode == STATUS_DISPLAY_MESSAGE) log_and_message_admins("set status screen message: [data1] [data2]") diff --git a/code/game/machinery/vendors/vending.dm b/code/game/machinery/vendors/vending.dm index 1faeb0eff3e..7ad77c102cb 100644 --- a/code/game/machinery/vendors/vending.dm +++ b/code/game/machinery/vendors/vending.dm @@ -238,12 +238,10 @@ for(var/i in 1 to amount) force_no_power_icon_state = TRUE - set_light(0) update_icon(UPDATE_OVERLAYS) sleep(rand(1, 3)) force_no_power_icon_state = FALSE - set_light(light_range_on, light_power_on) update_icon(UPDATE_OVERLAYS) sleep(rand(1, 10)) update_icon(UPDATE_OVERLAYS) diff --git a/code/modules/events/prison_break.dm b/code/modules/events/prison_break.dm index 957d98dd1b5..a31683fe1f8 100644 --- a/code/modules/events/prison_break.dm +++ b/code/modules/events/prison_break.dm @@ -61,7 +61,7 @@ if(areas && areas.len > 0) for(var/area/A in areas) for(var/obj/machinery/light/L in A) - L.flicker(10) + L.forced_flicker(10) /datum/event/prison_break/end() for(var/area/A in shuffle(areas)) diff --git a/code/modules/mob/living/simple_animal/hostile/angel_statue.dm b/code/modules/mob/living/simple_animal/hostile/angel_statue.dm index 4dc7121db08..9ad6a092150 100644 --- a/code/modules/mob/living/simple_animal/hostile/angel_statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/angel_statue.dm @@ -176,8 +176,7 @@ /obj/effect/proc_holder/spell/aoe/flicker_lights/cast(list/targets, mob/user = usr) for(var/turf/T in targets) for(var/obj/machinery/light/L in T) - L.flicker() - return + L.forced_flicker() //Blind AOE /obj/effect/proc_holder/spell/aoe/blindness diff --git a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm index 1da49658b65..45e18dfd550 100644 --- a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm +++ b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm @@ -300,7 +300,7 @@ manifested = FALSE addtimer(CALLBACK(src, TYPE_PROC_REF(/mob/living/simple_animal/hostile/floor_cluwne, Manifest)), 2) for(var/obj/machinery/light/L in range(H, 8)) - L.flicker() + L.forced_flicker() if(STAGE_ATTACK) diff --git a/code/modules/power/apc/apc_overlay.dm b/code/modules/power/apc/apc_overlay.dm index 2143d619094..cb169c0e76f 100644 --- a/code/modules/power/apc/apc_overlay.dm +++ b/code/modules/power/apc/apc_overlay.dm @@ -218,13 +218,6 @@ addtimer(CALLBACK(src, PROC_REF(flicker), TRUE), 1) cut_overlays() managed_overlays = null - // APC power distruptions have a chance to propogate to other machines on its network - for(var/obj/machinery/M in apc_area) - // Please don't cascade, thanks - if(M == src) - continue - if(prob(10)) - M.flicker() else flick("apcemag", src) //Second time we cause the APC to update its icon, then add a timer to update icon later addtimer(CALLBACK(src, TYPE_PROC_REF(/atom, update_icon), TRUE), 10) diff --git a/code/modules/power/lights.dm b/code/modules/power/lights.dm index 21cdd3dd022..1b391b25088 100644 --- a/code/modules/power/lights.dm +++ b/code/modules/power/lights.dm @@ -650,7 +650,10 @@ if(current_apc) RegisterSignal(machine_powernet, COMSIG_POWERNET_POWER_CHANGE, PROC_REF(update), override = TRUE) -/obj/machinery/light/flicker(amount = rand(20, 30)) +/obj/machinery/light/get_spooked() + return forced_flicker() + +/obj/machinery/light/proc/forced_flicker(amount = rand(20, 30)) if(flickering) return FALSE diff --git a/code/modules/power/powernets/local_powernet.dm b/code/modules/power/powernets/local_powernet.dm index 76c633bcdf6..cad1158a1aa 100644 --- a/code/modules/power/powernets/local_powernet.dm +++ b/code/modules/power/powernets/local_powernet.dm @@ -176,13 +176,3 @@ if(prob(MACHINE_FLICKER_CHANCE)) powernet_apc?.flicker() - // lights don't have their own processing loop, so local powernets will be the father they never had. 3x as likely to cause a light flicker in a particular area, pick a light to flicker at random - if(prob(MACHINE_FLICKER_CHANCE * 3)) - var/list/lights = list() - for(var/obj/machinery/light/L in powernet_area) - lights += L - - if(length(lights)) - var/obj/machinery/light/picked_light = pick(lights) - ASSERT(istype(picked_light)) - picked_light.flicker()