mirror of
https://github.com/quotefox/Hyper-Station-13.git
synced 2026-08-22 20:26:15 +01:00
Light bloom
This commit is contained in:
@@ -223,6 +223,9 @@
|
||||
var/bulb_emergency_pow_mul = 0.75 // the multiplier for determining the light's power in emergency mode
|
||||
var/bulb_emergency_pow_min = 0.5 // the minimum value for the light's power in emergency mode
|
||||
|
||||
var/obj/effect/light/lighteffect //light effect
|
||||
|
||||
|
||||
/obj/machinery/light/broken
|
||||
status = LIGHT_BROKEN
|
||||
icon_state = "tube-broken"
|
||||
@@ -242,6 +245,8 @@
|
||||
icon_state = "bulb-broken"
|
||||
|
||||
/obj/machinery/light/Move()
|
||||
if(lighteffect)
|
||||
lighteffect.loc = src.loc
|
||||
if(status != LIGHT_BROKEN)
|
||||
break_light_tube(1)
|
||||
return ..()
|
||||
@@ -285,6 +290,8 @@
|
||||
|
||||
/obj/machinery/light/Destroy()
|
||||
var/area/A = get_area(src)
|
||||
if(lighteffect)
|
||||
lighteffect.Del()
|
||||
if(A)
|
||||
on = FALSE
|
||||
// A.update_lights()
|
||||
@@ -292,6 +299,8 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/light/update_icon()
|
||||
if(lighteffect)
|
||||
lighteffect.Del()
|
||||
cut_overlays()
|
||||
switch(status) // set icon_states
|
||||
if(LIGHT_OK)
|
||||
@@ -301,6 +310,10 @@
|
||||
else
|
||||
icon_state = "[base_state]"
|
||||
if(on)
|
||||
lighteffect = new/obj/effect/light/large
|
||||
lighteffect.loc = src.loc
|
||||
lighteffect.alpha = CLAMP(light_power*33, 5, 100)
|
||||
lighteffect.color = light_color
|
||||
var/mutable_appearance/glowybit = mutable_appearance(overlayicon, base_state, ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE)
|
||||
glowybit.alpha = CLAMP(light_power*250, 30, 200)
|
||||
add_overlay(glowybit)
|
||||
|
||||
Reference in New Issue
Block a user