/datum/light_source
Vars | |
applied | Whether we have applied our light yet or not. |
---|---|
effect_str | List used to store how much we're affecting corners. |
light_angle | How many degrees of a circle should our light show. 360 is all of it, 180 is half, etc |
light_color | The colour of the light, string, decomposed by parse_light_color() |
light_dir | What direction our angled light is pointed |
light_height | The height of the light. The larger this is, the dimmer we'll start |
light_power | Intensity of the emitter light. |
light_range | The range of the emitted light. |
needs_update | whether we are to be added to SSlighting's sources_queue list for an update |
offset_x | How much to x shift our light by when displaying it |
offset_y | How much to y shift our light by when displaying it |
source_atom | The atom that we belong to. |
source_turf | The turf under the source atom. |
top_atom | The atom we're emitting light from (for example a mob if we're from a flashlight that's being held). |
visual_offset | How much larger our light sheet should be, based off offset_x and y We clamp to at least 1, so if offset_x is 0.1, then this'll be 1 |
Procs | |
add_to_light_sources | add this light source to new_atom_host's light_sources list. updating movement registrations as needed |
falloff_at_coord | Takes x y and z offsets from the source as input, alongside our source's range Returns a value between 0 and 1, 0 being dark on that tile, 1 being fully lit |
generate_sheet | Returns a list of lists that encodes the light falloff of our source Takes anything that impacts our generation as input This function should be "pure", no side effects or reads from the source object |
generate_sheet_multiz | Returns a THREE dimensional list of lists that encodes the lighting falloff of our source Takes anything that impacts our generation as input This function should be "pure", no side effects or reads from the passed object |
get_sheet | Returns a list of lists, indexed with ints, that can be read to get the lighting multiplier at any one point If the requested sheet is multiz, this will be 3 lists deep, first handling z level then x and y otherwise it's just two, x then y |
impacted_corners | Returns a list of lighting corners this source impacts |
print_sheet | Dumps the content of a lighting sheet to chat, for debugging |
refresh_values | Refreshes our lighting source to match its parent atom Returns TRUE if an update is needed, FALSE otherwise |
remove_from_light_sources | remove this light source from old_atom_host's light_sources list, unsetting movement registrations |
remove_lum | This is the define used to calculate falloff. |
update | This proc will cause the light source to update the top atom, and add itself to the update queue. |
update_host_lights | signal handler for when our host atom moves and we need to update our effects |
Var Details
applied
Whether we have applied our light yet or not.
effect_str
List used to store how much we're affecting corners.
light_angle
How many degrees of a circle should our light show. 360 is all of it, 180 is half, etc
light_color
The colour of the light, string, decomposed by parse_light_color()
light_dir
What direction our angled light is pointed
light_height
The height of the light. The larger this is, the dimmer we'll start
light_power
Intensity of the emitter light.
light_range
The range of the emitted light.
needs_update
whether we are to be added to SSlighting's sources_queue list for an update
offset_x
How much to x shift our light by when displaying it
offset_y
How much to y shift our light by when displaying it
source_atom
The atom that we belong to.
source_turf
The turf under the source atom.
top_atom
The atom we're emitting light from (for example a mob if we're from a flashlight that's being held).
visual_offset
How much larger our light sheet should be, based off offset_x and y We clamp to at least 1, so if offset_x is 0.1, then this'll be 1
Proc Details
add_to_light_sources
add this light source to new_atom_host's light_sources list. updating movement registrations as needed
falloff_at_coord
Takes x y and z offsets from the source as input, alongside our source's range Returns a value between 0 and 1, 0 being dark on that tile, 1 being fully lit
generate_sheet
Returns a list of lists that encodes the light falloff of our source Takes anything that impacts our generation as input This function should be "pure", no side effects or reads from the source object
generate_sheet_multiz
Returns a THREE dimensional list of lists that encodes the lighting falloff of our source Takes anything that impacts our generation as input This function should be "pure", no side effects or reads from the passed object
get_sheet
Returns a list of lists, indexed with ints, that can be read to get the lighting multiplier at any one point If the requested sheet is multiz, this will be 3 lists deep, first handling z level then x and y otherwise it's just two, x then y
impacted_corners
Returns a list of lighting corners this source impacts
print_sheet
Dumps the content of a lighting sheet to chat, for debugging
refresh_values
Refreshes our lighting source to match its parent atom Returns TRUE if an update is needed, FALSE otherwise
remove_from_light_sources
remove this light source from old_atom_host's light_sources list, unsetting movement registrations
remove_lum
This is the define used to calculate falloff.
update
This proc will cause the light source to update the top atom, and add itself to the update queue.
update_host_lights
signal handler for when our host atom moves and we need to update our effects