Space Station 13 - Modules - TypesVar Details - Proc Details

light

Vars

base_stateBase description and icon_state.
construct_typeType path for the machine to create when dismantled. Should be /obj/machinery/light_construct or a subtype.
current_modeThe light's current lighting mode. One of LIGHTMODE_*.
flickeringWhether or not the light is currently flickering.
light_typeType path of the light bulb item. Used for initialization and to determine what bulbs fit.
lightbulbThe installed light bolb.
onWhether or not the light is turned on.
sspark_spread effect datum.

Procs

brokenBreak the light and make sparks if it was on.
fixFixes a broken light.
flickerCauses the light to start flickering.
get_color_from_areaFetches the light's color based on area flags. Used for Init and for smartly installing new bulbs during runtime (See light replacers).
get_fitting_nameFetches the name of light_type.
get_mode_colorReturn's the current mode's l_color value or, if there is no current_mode, the lightbulb's color.
get_statusReturns lightbulb.status.
insert_bulbAttempts to insert a given light bulb. Called by use_tool().
remove_bulbAttempts to remove an installed light bulb. Called by attack_hand().
set_emergency_lightingToggles the light's emergency lighting mode (LIGHTMODE_EMERGENCY).
set_modeSet's the lights current_mode. new_mode should be one of LIGHTMODE_*.
setonSets the light's on state, if there's a functional light bulb installed.
switch_checkCalls lightbulb.switch_on() and updates the lighting and icon accordingly.

Var Details

base_state

Base description and icon_state.

construct_type

Type path for the machine to create when dismantled. Should be /obj/machinery/light_construct or a subtype.

current_mode

The light's current lighting mode. One of LIGHTMODE_*.

flickering

Whether or not the light is currently flickering.

light_type

Type path of the light bulb item. Used for initialization and to determine what bulbs fit.

lightbulb

The installed light bolb.

on

Whether or not the light is turned on.

s

spark_spread effect datum.

Proc Details

broken

Break the light and make sparks if it was on.

fix

Fixes a broken light.

flicker

Causes the light to start flickering.

get_color_from_area

Fetches the light's color based on area flags. Used for Init and for smartly installing new bulbs during runtime (See light replacers).

get_fitting_name

Fetches the name of light_type.

get_mode_color

Return's the current mode's l_color value or, if there is no current_mode, the lightbulb's color.

get_status

Returns lightbulb.status.

insert_bulb

Attempts to insert a given light bulb. Called by use_tool().

remove_bulb

Attempts to remove an installed light bulb. Called by attack_hand().

set_emergency_lighting

Toggles the light's emergency lighting mode (LIGHTMODE_EMERGENCY).

set_mode

Set's the lights current_mode. new_mode should be one of LIGHTMODE_*.

seton

Sets the light's on state, if there's a functional light bulb installed.

switch_check

Calls lightbulb.switch_on() and updates the lighting and icon accordingly.