liquid_turf 
Vars | |
| blood_color | Colour of the blood in reagent_list, blended by blood volume as blood comes in. Null when no blood is tracked. |
|---|---|
| fire_flames | The flames while this tile burns, in vis_contents. |
| fire_glow | The flames' emissive copy, in vis_contents. It always shows the flames' icon_state. |
| fire_light_x | How far east of this tile the light it holds for its fire light block sits, in tiles. |
| fire_light_y | How far north of this tile the light it holds for its fire light block sits, in tiles. |
| fire_loop_table | The fire loop (1 to 5) per world tile, read as [(y % 8) + 1][(x % 8) + 1], so neighbours burn out of step. |
| fire_smoke | Smoke over the flames, in vis_contents from the end of the ignite. |
| liquid_state_messages | State-specific message chunks for examine_turf() |
| reagent_opacity | Volume-weighted liquid_opacity of reagent_list, from 0 (clear) to 1 (opaque). |
| surface_class | The LIQUID_SURFACE_* look this pool draws, from get_liquid_surface(). |
| surface_detail | The marks this pool draws over its surface ("grit", "chunks" or "bumps"), or null. |
Procs | |
| Initialize | Hooks the liquid to its turf, draws it and queues its smoothing. |
| blend_blood_color | Blends blood coming into this liquid into blood_color, weighted by blood volume. |
| calculate_height | Sets the liquid's height from its volume, and its depth from that height. |
| check_fire | Updates fire_state from this liquid's mix. |
| clear_fire_visuals | Takes this tile's fire holders off it and gives them back to SSliquids' pools. |
| examine_turf | Handles COMSIG_ATOM_EXAMINE for the turf. |
| get_alpha_filter | Returns an alpha filter by one icon state's mask from get_alpha_mask(), made once and shared. |
| get_alpha_mask | Returns the /icon of one icon state for an alpha mask filter, made once and shared. |
| get_clip_filter | Returns get_alpha_filter() for a mask, or null when the mask is fully opaque and so clips nothing. |
| get_fire_loop | Returns this tile's fire loop, 1 to 5, from fire_loop_table. |
| get_fire_state | Returns the fire state this liquid's mix supports. |
| get_fire_temperature | Returns the temperature this liquid's fire exposes its tile and everything on it to. |
| get_fire_tier | Returns the fire art's tier for fire_state: "small", "medium" or "big", or null while the liquid isn't burning. |
| get_liquid_state_for_height | Returns the LIQUID_STATE_* depth for a liquid height, fractions included, from a puddle up to a full tile. |
| get_mask_alpha | Returns the one alpha every pixel of a mask has, or null when its pixels differ. Each mask is read once. |
| ignite_fire_visuals | Lights this tile's fire: makes the flames and their emissive copy, plays the ignite once on both, and starts the smoke when the ignite ends. |
| make_liquid_overlay | Makes and returns the liquid effect overlay. |
| make_state_layer | Returns a list of over and underlays for different liquid states. |
| make_surface_overlays | Returns this tile's surface overlays for its surface_class, in drawing order: the edge piece and the texture slices. |
| make_surface_piece | Returns a liquid_surfaces.dmi state as an overlay in its own colour and alpha. |
| make_surface_texture | Returns this tile's slice of a world-anchored surface texture, clipped to the pool by an alpha filter. |
| process_fire | Runs one fire run on this tile: spreads the fire, burns its fuel and heats the tile. |
| reagents_to_text | Creates a string of the reagents that make up this liquid. |
| set_fire_light | Sets the light this liquid holds for its fire light block, and refreshes it only when something changed. |
| set_fire_masks | Clips this tile's flames and their copy by its junction's "flame-[junction]" mask, and its smoke by "smoke-[junction]". |
| set_fire_state | Sets the fire state and its flames, and queues the tile's fire light block, which SSliquids lights. |
| set_new_liquid_state | Sets the pool's LIQUID_STATE_* depth. |
| set_reagent_color_for_liquid | Tints the liquid to its reagent mix, sets its alpha from depth and opacity, and picks its surface. |
| set_smoke_mask | Clips this tile's smoke by its junction's "smoke-[junction]" mask. |
| set_surface | Sets the pool's surface class and detail. |
| start_fire_smoke | Adds the smoke over this tile's flames when their ignite ends, so no puff floats over flames still growing. |
| update_fire_visuals | Shows this tile's fire as fire_state asks: lights it, swaps its tier, or puts it out. |
| update_from_reagents | Works out this liquid's depth, colour, alpha and surface from reagent_list, and redraws its overlays once if its depth or surface changed. |
Var Details
blood_color 
Colour of the blood in reagent_list, blended by blood volume as blood comes in. Null when no blood is tracked.
fire_flames 
The flames while this tile burns, in vis_contents.
fire_glow 
The flames' emissive copy, in vis_contents. It always shows the flames' icon_state.
fire_light_x 
How far east of this tile the light it holds for its fire light block sits, in tiles.
fire_light_y 
How far north of this tile the light it holds for its fire light block sits, in tiles.
fire_loop_table 
The fire loop (1 to 5) per world tile, read as [(y % 8) + 1][(x % 8) + 1], so neighbours burn out of step.
fire_smoke 
Smoke over the flames, in vis_contents from the end of the ignite.
liquid_state_messages 
State-specific message chunks for examine_turf()
reagent_opacity 
Volume-weighted liquid_opacity of reagent_list, from 0 (clear) to 1 (opaque).
surface_class 
The LIQUID_SURFACE_* look this pool draws, from get_liquid_surface().
surface_detail 
The marks this pool draws over its surface ("grit", "chunks" or "bumps"), or null.
Proc Details
Initialize
Hooks the liquid to its turf, draws it and queues its smoothing.
Arguments:
- draw_later: TRUE when the caller fills the new liquid and draws it once at the end; FALSE draws it now, empty.
blend_blood_color
Blends blood coming into this liquid into blood_color, weighted by blood volume.
Call it before the blood joins reagent_list, which must still hold the old blood volume.
Arguments:
- added_color: Colour of the blood coming in. Null counts as the blood reagent's own colour.
- added_blood: Units of blood coming in.
calculate_height
Sets the liquid's height from its volume, and its depth from that height.
Arguments:
- redraw: FALSE leaves a changed depth for the caller to redraw.
Returns:
- TRUE: The depth changed.
check_fire
Updates fire_state from this liquid's mix.
Arguments:
- hotspotted: TRUE when something is igniting us, so a liquid that isn't burning yet can catch.
Returns:
- TRUE: The liquid is burning.
- FALSE: It isn't, and any fire it had is out.
clear_fire_visuals
Takes this tile's fire holders off it and gives them back to SSliquids' pools.
examine_turf
Handles COMSIG_ATOM_EXAMINE for the turf.
Adds reagent info to examine text. Arguments:
- source - the turf we're peekin at
- examiner - the user
- examine_text - the examine list
get_alpha_filter
Returns an alpha filter by one icon state's mask from get_alpha_mask(), made once and shared.
Arguments:
- icon_file: The DMI holding the mask.
- mask_state: The mask's icon state.
get_alpha_mask
Returns the /icon of one icon state for an alpha mask filter, made once and shared.
Every tile with the same junction then filters by the same icon, so their filters dedupe.
Arguments:
- icon_file: The DMI holding the mask.
- mask_state: The mask's icon state.
get_clip_filter
Returns get_alpha_filter() for a mask, or null when the mask is fully opaque and so clips nothing.
Only for art under the exact-art RULE in the art contract: the mask's size, and partly clear pixels, if any, at 0 or 255 per channel. A filter passes those and opaque or clear pixels exactly, but draws other partly clear colours a level off, so leaving it out would change them.
Arguments:
- icon_file: The DMI holding the mask.
- mask_state: The mask's icon state.
get_fire_loop
Returns this tile's fire loop, 1 to 5, from fire_loop_table.
get_fire_state
Returns the fire state this liquid's mix supports.
A mix burns only while more than REQUIRED_FIRE_FLAMMABLE_SHARE of it is flammable and its power per unit beats REQUIRED_FIRE_POWER_PER_UNIT. Each state above small then needs both its LIQUID_FIRE_POWER_* power per unit and its LIQUID_FIRE_UNITS_* flammable units. Power per unit caps how fierce the mix burns, and the flammable units left shrink the fire as it burns out.
Arguments:
- hotspotted: TRUE when something is igniting us. Without it, a liquid that isn't burning stays out.
Returns:
- A LIQUID_FIRE_STATE_* define, LIQUID_FIRE_STATE_NONE when the liquid won't burn.
get_fire_temperature
Returns the temperature this liquid's fire exposes its tile and everything on it to.
get_fire_tier
Returns the fire art's tier for fire_state: "small", "medium" or "big", or null while the liquid isn't burning.
get_liquid_state_for_height
Returns the LIQUID_STATE_* depth for a liquid height, fractions included, from a puddle up to a full tile.
get_mask_alpha
Returns the one alpha every pixel of a mask has, or null when its pixels differ. Each mask is read once.
Arguments:
- icon_file: The DMI holding the mask.
- mask_state: The mask's icon state.
ignite_fire_visuals
Lights this tile's fire: makes the flames and their emissive copy, plays the ignite once on both, and starts the smoke when the ignite ends.
The ignite is a flick, which the server times, so a client that first sees the tile mid-ignite sees the rest of it and then the loop. NEVER show the ignite through icon_state: each client would start it over at first sight.
Arguments:
- tier: The fire art's tier, from get_fire_tier().
- loop: This tile's fire loop, from get_fire_loop().
make_liquid_overlay
Makes and returns the liquid effect overlay.
Arguments:
- overlay_state - the icon state of the new overlay
- overlay_layer - the layer
- overlay_plane - the plane
make_state_layer
Returns a list of over and underlays for different liquid states.
Arguments:
- state - the stage number.
- has_top - if this stage has a top.
make_surface_overlays
Returns this tile's surface overlays for its surface_class, in drawing order: the edge piece and the texture slices.
make_surface_piece
Returns a liquid_surfaces.dmi state as an overlay in its own colour and alpha.
make_surface_texture
Returns this tile's slice of a world-anchored surface texture, clipped to the pool by an alpha filter.
A fully opaque mask leaves tone, grit and chunks slices unfiltered (get_clip_filter()), and a weight mask of one alpha becomes the slice's own alpha.
Arguments:
- texture: The slices' state prefix in liquid_surfaces.dmi.
- junction: This tile's smoothing junction. A lone puddle (0) takes the texture's fixed slice, when it has one.
- mask_state: A liquid_surfaces.dmi weight state to clip by. Null clips by this tile's base state.
process_fire
Runs one fire run on this tile: spreads the fire, burns its fuel and heats the tile.
Each flammable reagent uses up its liquid_fire_burnrate, then the fire state follows what's left. So the fire steps down as it burns out, and leaves processing once it's out.
reagents_to_text
Creates a string of the reagents that make up this liquid.
Puts the reagent(s) that make up the liquid into string form e.g. "plasma" or "plasma and water", or 'plasma, milk, and water' depending on how many reagents there are.
Returns the reagents list string or a generic "liquid" if there are no reagents somehow
set_fire_light
Sets the light this liquid holds for its fire light block, and refreshes it only when something changed.
Arguments:
- range: The light's range.
- power: The light's power.
- light_x: Where the light sits, in tiles east of this tile.
- light_y: Where the light sits, in tiles north of this tile.
set_fire_masks
Clips this tile's flames and their copy by its junction's "flame-[junction]" mask, and its smoke by "smoke-[junction]".
A fully opaque mask leaves them unfiltered (get_clip_filter()), so the fire art must keep the exact-art RULE in the art contract above update_overlays().
set_fire_state
Sets the fire state and its flames, and queues the tile's fire light block, which SSliquids lights.
set_new_liquid_state
Sets the pool's LIQUID_STATE_* depth.
Arguments:
- new_state: The new depth.
- redraw: FALSE leaves the overlays for the caller to redraw.
set_reagent_color_for_liquid
Tints the liquid to its reagent mix, sets its alpha from depth and opacity, and picks its surface.
Arguments:
- redraw: FALSE leaves a changed surface for the caller to redraw.
Returns:
- TRUE: The surface changed.
set_smoke_mask
Clips this tile's smoke by its junction's "smoke-[junction]" mask.
Arguments:
- junction: This tile's smoothing junction, NONE for a lone puddle.
set_surface
Sets the pool's surface class and detail.
Arguments:
- new_class: A LIQUID_SURFACE_* define.
- new_detail: The class's detail, or null.
- redraw: FALSE leaves a change for the caller to redraw.
Returns:
- TRUE: Either changed.
start_fire_smoke
Adds the smoke over this tile's flames when their ignite ends, so no puff floats over flames still growing.
update_fire_visuals
Shows this tile's fire as fire_state asks: lights it, swaps its tier, or puts it out.
The flames, their emissive copy and the smoke are holders in vis_contents, so a tier change only swaps their icon_states and never rebuilds the liquid's overlays. Every looping state runs on one clock per client, so a swapped loop keeps time.
update_from_reagents
Works out this liquid's depth, colour, alpha and surface from reagent_list, and redraws its overlays once if its depth or surface changed.
Arguments:
- force_redraw: TRUE redraws even when neither changed, for a liquid that isn't drawn yet.