Light bloom

This commit is contained in:
quotefox
2022-05-05 00:05:46 +01:00
parent 9ee122d256
commit 77d18eecb9
7 changed files with 47 additions and 0 deletions
+16
View File
@@ -104,6 +104,8 @@
var/icon_update_needed = FALSE
var/obj/machinery/computer/apc_control/remote_control = null
var/obj/effect/light/lighteffect //light effect
/obj/machinery/power/apc/unlocked
locked = FALSE
@@ -185,6 +187,8 @@
addtimer(CALLBACK(src, .proc/update), 5)
/obj/machinery/power/apc/Destroy()
if(lighteffect)
lighteffect.Del()
GLOB.apcs_list -= src
if(malfai && operating)
@@ -320,6 +324,13 @@
// And now, separately for cleanness, the lighting changing
if(update_state & UPSTATE_ALLGOOD)
if(!lighteffect)//make the light
lighteffect = new/obj/effect/light
lighteffect.loc = src.loc
lighteffect.alpha = 50
lighteffect.pixel_x = pixel_x
lighteffect.pixel_y = pixel_y
switch(charging)
if(APC_NOT_CHARGING)
light_color = LIGHT_COLOR_RED
@@ -328,6 +339,7 @@
if(APC_FULLY_CHARGED)
light_color = LIGHT_COLOR_GREEN
set_light(lon_range)
lighteffect.color = light_color
else if(update_state & UPSTATE_BLUESCREEN)
light_color = LIGHT_COLOR_BLUE
set_light(lon_range)
@@ -336,6 +348,10 @@
icon_update_needed = FALSE
/obj/machinery/power/apc/Move()
if(lighteffect)
lighteffect.loc = src.loc //move the light overlay
/obj/machinery/power/apc/proc/check_updates()
var/last_update_state = update_state
var/last_update_overlay = update_overlay