Light fixture
The standard light tube fixture
Vars | |
brightness_color | Light colour when on |
---|---|
brightness_power | Light intensity |
brightness_range | Light range (Also used in power calculation) |
bulb_emergency_colour | The colour of the light while it's in emergency mode |
deconstruct_type | What light construct type to turn into when we are deconstructed |
extinguished | Was this light extinguished with an antag ability? Used to ovveride flicker events |
fitting | Type of light bulb that goes into the fixture |
flickering | Is the light currently flickering? |
light_type | Item type of the light bulb |
lightmaterials | Materials the light is made of |
nightshift_allowed | Allowed to be switched to night shift mode? |
nightshift_enabled | Currently in night shift mode? |
nightshift_light_color | The colour of the light while it's in night shift mode |
nightshift_light_power | Light intensity when in night shift mode |
nightshift_light_range | Light range when in night shift mode |
on | Is the light on or off? |
rigged | Is the light rigged to explode? |
status | Light fixture status (LIGHT_OK | LIGHT_EMPTY | LIGHT_BURNED | LIGHT_BROKEN) |
switchcount | How many times has the light been switched on/off? (This is used to calc the probability the light burns out) |
turning_on | Is the light currently turning on? |
Procs | |
_turn_on | The actual proc to turn on the lightbulb. |
flicker_event | Flicker routine for the light. Called by invoke_async so the parent proc can return immediately. |
update | Updates the light's 'on' state and power consumption based on /obj/machinery/light/var/on. |
Var Details
brightness_color
Light colour when on
brightness_power
Light intensity
brightness_range
Light range (Also used in power calculation)
bulb_emergency_colour
The colour of the light while it's in emergency mode
deconstruct_type
What light construct type to turn into when we are deconstructed
extinguished
Was this light extinguished with an antag ability? Used to ovveride flicker events
fitting
Type of light bulb that goes into the fixture
flickering
Is the light currently flickering?
light_type
Item type of the light bulb
lightmaterials
Materials the light is made of
nightshift_allowed
Allowed to be switched to night shift mode?
nightshift_enabled
Currently in night shift mode?
nightshift_light_color
The colour of the light while it's in night shift mode
nightshift_light_power
Light intensity when in night shift mode
nightshift_light_range
Light range when in night shift mode
on
Is the light on or off?
rigged
Is the light rigged to explode?
status
Light fixture status (LIGHT_OK | LIGHT_EMPTY | LIGHT_BURNED | LIGHT_BROKEN)
switchcount
How many times has the light been switched on/off? (This is used to calc the probability the light burns out)
turning_on
Is the light currently turning on?
Proc Details
_turn_on
The actual proc to turn on the lightbulb.
Private proc, do not call directly. Use /obj/machinery/light/proc/update instead.
Sets the light power, range, and colour based on environmental conditions such as night shift and fire alarms.
Also handles light bulbs burning out and exploding if trigger
is TRUE
.
flicker_event
Flicker routine for the light. Called by invoke_async so the parent proc can return immediately.
update
Updates the light's 'on' state and power consumption based on /obj/machinery/light/var/on.
Arguments:
- trigger - Should this update check if the light will explode/burn out.
- instant - Will the lightbulb turn on instantly, or after a short delay.
- play_sound - Will the lightbulb play a sound when it's turned on.