Files
Bubberstation/code/game/objects/effects/lighting.dm
ChungusGamer666 b9b19bd6e1 Lighting object oddities (#76009)
## About The Pull Request

Fire stacks status effect no longer uses a weakref for the mob light, I
am pretty sure there was no real reason to use a weakref there.
Deleted weird luminescent glow dummy, now it just uses the standard
moblight obj.
Put all /obj/effect/dummy/lighting_obj together in a single file and
added a comment explaining why they exist.

(I severely dislike the /obj/effect/dummy typepath, but I am very much
unsure if just replacing all of them with /obj/effect/abstract would
break shit)

## Why It's Good For The Game

Code organization good
2023-06-20 06:08:29 +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 = MOVABLE_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"