Files
Bubberstation/code/game/objects/effects/lighting.dm
SkyratBot 4f53ec2660 [MIRROR] Fixes complex lights not handling moving well, renames lighting defines (#26484)
* Fixes complex lights not handling moving well, renames lighting defines (#81423)

## About The Pull Request

[Fixes static lights not
moving](ffef43c05a)

Worked fine when the owner moved, but if the owner was inside something
else, it would try and trigger an update on the PARENT's lights, which
are obviously not us.

[Renames MOVABLE_LIGHT and STATIC_LIGHT to better describe what they
do](de73a63bd4)

People keep trying to change the lighting system of lamps and it makes
me mad.
I choose OVERLAY_LIGHT and COMPLEX_LIGHT here, I couldn't figure out a
better name for turf matrix lighting. Suggestions welcome

## Why It's Good For The Game

Closes #80005
Hopefully improves understanding of lighting at a glance
## Changelog
🆑
fix: Fixes fancy lights not updating their source location when picked
up and moved
/🆑

* Oh well

---------

Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
2024-02-12 22:25:22 +00:00

43 lines
1.2 KiB
Plaintext

/**
* Basically, a fake object that emits light.
*
* Why is this used sometimes instead of giving atoms light values directly?
* Because using these, you can have multiple light sources in a single object.
*/
/obj/effect/dummy/lighting_obj
name = "lighting"
desc = "Tell a coder if you're seeing this."
icon_state = "nothing"
light_system = OVERLAY_LIGHT
light_range = MINIMUM_USEFUL_LIGHT_RANGE
light_color = COLOR_WHITE
blocks_emissive = EMISSIVE_BLOCK_NONE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/effect/dummy/lighting_obj/Initialize(mapload, range, power, color, duration)
. = ..()
if(!isnull(range))
set_light_range(range)
if(!isnull(power))
set_light_power(power)
if(!isnull(color))
set_light_color(color)
if(duration)
QDEL_IN(src, duration)
/obj/effect/dummy/lighting_obj/moblight
name = "mob lighting"
/obj/effect/dummy/lighting_obj/moblight/Initialize(mapload, range, power, color, duration)
. = ..()
if(!ismob(loc))
return INITIALIZE_HINT_QDEL
/obj/effect/dummy/lighting_obj/moblight/fire
name = "mob fire lighting"
light_color = LIGHT_COLOR_FIRE
light_range = LIGHT_RANGE_FIRE
/obj/effect/dummy/lighting_obj/moblight/species
name = "species lighting"