/tg/ Station 13 - Modules - Types — Var Details - Proc Details

liquid_turf

Vars

blood_colorColour of the blood in reagent_list, blended by blood volume as blood comes in. Null when no blood is tracked.
fire_flamesThe flames while this tile burns, in vis_contents.
fire_glowThe flames' emissive copy, in vis_contents. It always shows the flames' icon_state.
fire_light_xHow far east of this tile the light it holds for its fire light block sits, in tiles.
fire_light_yHow far north of this tile the light it holds for its fire light block sits, in tiles.
fire_loop_tableThe fire loop (1 to 5) per world tile, read as [(y % 8) + 1][(x % 8) + 1], so neighbours burn out of step.
fire_smokeSmoke over the flames, in vis_contents from the end of the ignite.
liquid_state_messagesState-specific message chunks for examine_turf()
reagent_opacityVolume-weighted liquid_opacity of reagent_list, from 0 (clear) to 1 (opaque).
surface_classThe LIQUID_SURFACE_* look this pool draws, from get_liquid_surface().
surface_detailThe marks this pool draws over its surface ("grit", "chunks" or "bumps"), or null.

Procs

InitializeHooks the liquid to its turf, draws it and queues its smoothing.
blend_blood_colorBlends blood coming into this liquid into blood_color, weighted by blood volume.
calculate_heightSets the liquid's height from its volume, and its depth from that height.
check_fireUpdates fire_state from this liquid's mix.
clear_fire_visualsTakes this tile's fire holders off it and gives them back to SSliquids' pools.
examine_turfHandles COMSIG_ATOM_EXAMINE for the turf.
get_alpha_filterReturns an alpha filter by one icon state's mask from get_alpha_mask(), made once and shared.
get_alpha_maskReturns the /icon of one icon state for an alpha mask filter, made once and shared.
get_clip_filterReturns get_alpha_filter() for a mask, or null when the mask is fully opaque and so clips nothing.
get_fire_loopReturns this tile's fire loop, 1 to 5, from fire_loop_table.
get_fire_stateReturns the fire state this liquid's mix supports.
get_fire_temperatureReturns the temperature this liquid's fire exposes its tile and everything on it to.
get_fire_tierReturns the fire art's tier for fire_state: "small", "medium" or "big", or null while the liquid isn't burning.
get_liquid_state_for_heightReturns the LIQUID_STATE_* depth for a liquid height, fractions included, from a puddle up to a full tile.
get_mask_alphaReturns the one alpha every pixel of a mask has, or null when its pixels differ. Each mask is read once.
ignite_fire_visualsLights 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_overlayMakes and returns the liquid effect overlay.
make_state_layerReturns a list of over and underlays for different liquid states.
make_surface_overlaysReturns this tile's surface overlays for its surface_class, in drawing order: the edge piece and the texture slices.
make_surface_pieceReturns a liquid_surfaces.dmi state as an overlay in its own colour and alpha.
make_surface_textureReturns this tile's slice of a world-anchored surface texture, clipped to the pool by an alpha filter.
process_fireRuns one fire run on this tile: spreads the fire, burns its fuel and heats the tile.
reagents_to_textCreates a string of the reagents that make up this liquid.
set_fire_lightSets the light this liquid holds for its fire light block, and refreshes it only when something changed.
set_fire_masksClips this tile's flames and their copy by its junction's "flame-[junction]" mask, and its smoke by "smoke-[junction]".
set_fire_stateSets the fire state and its flames, and queues the tile's fire light block, which SSliquids lights.
set_new_liquid_stateSets the pool's LIQUID_STATE_* depth.
set_reagent_color_for_liquidTints the liquid to its reagent mix, sets its alpha from depth and opacity, and picks its surface.
set_smoke_maskClips this tile's smoke by its junction's "smoke-[junction]" mask.
set_surfaceSets the pool's surface class and detail.
start_fire_smokeAdds the smoke over this tile's flames when their ignite ends, so no puff floats over flames still growing.
update_fire_visualsShows this tile's fire as fire_state asks: lights it, swaps its tier, or puts it out.
update_from_reagentsWorks 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:

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:

calculate_height

Sets the liquid's height from its volume, and its depth from that height.

Arguments:

Returns:

check_fire

Updates fire_state from this liquid's mix.

Arguments:

Returns:

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:

get_alpha_filter

Returns an alpha filter by one icon state's mask from get_alpha_mask(), made once and shared.

Arguments:

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:

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:

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:

Returns:

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:

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:

make_liquid_overlay

Makes and returns the liquid effect overlay.

Arguments:

make_state_layer

Returns a list of over and underlays for different liquid states.

Arguments:

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:

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:

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:

set_reagent_color_for_liquid

Tints the liquid to its reagent mix, sets its alpha from depth and opacity, and picks its surface.

Arguments:

Returns:

set_smoke_mask

Clips this tile's smoke by its junction's "smoke-[junction]" mask.

Arguments:

set_surface

Sets the pool's surface class and detail.

Arguments:

Returns:

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: