Garden — the growing floor, on screen.
The referee decides that a round has closed. This component is what you
SEE happen next: every plant animating into its next stage, a root-knot
heaving its flagstone up a step, a lightwood rising until the lane behind
it is gone, and the Blight taking the tiles it took.
It owns the bodies under the `Garden` anchor and the height of the tile
plates under `Board`. It owns no unit and no rule: what the garden does to
whoever is standing in it is reported to the referee, not applied.
Nothing here runs on a clock. `update` moves cosmetic tweens — a stalk
easing into its new size, a vine swaying — and never changes game state.
local G = entity.find("Garden").component.get("Garden")
G:layoutMission("propagation_hall")
G:runRound() -- the garden's turn, then the Blight's
G:sow(4, 5, "lightwood")
G:describeTile(4, 5)
easeOutCubic(t: number) → number
| arg | type | description |
|---|
| t | number | |
easeOutBack(t: number) → number
| arg | type | description |
|---|
| t | number | |
spawnBody(x: number, y: number, kind: string, stage: number, t: any) → any
Spawn the body for one growing thing. `kind` is a plant id or "blight".
| arg | type | description |
|---|
| x | number | |
| y | number | |
| kind | string | |
| stage | number | |
| t | any | |
purgeAnims(id: string?) → void
Drop every tween that still points at an entity that is going away. A
tween left holding a despawned id re-resolves it every frame, and the
engine reports each of those lookups, so one stale entry becomes a flood.
| arg | type | description |
|---|
| id | string? | |
despawnBody(key: string) → void
| arg | type | description |
|---|
| key | string | |
spawnMark(x: number, y: number, kind: string, t: any) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
| kind | string | |
| t | any | |
clearMark(x: number, y: number) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
tweensRun( ) → boolean
While the simulation is frozen no tick arrives, so a tween started now
would leave a half-grown plant standing on the board for as long as the
freeze lasts. Growth still happens; it simply arrives at its full size.
animate(body: any, fromScale: number, dur: number, mode: string) → void
| arg | type | description |
|---|
| body | any | |
| fromScale | number | |
| dur | number | |
| mode | string | |
animateOut(body: any, dur: number) → void
| arg | type | description |
|---|
| body | any | |
| dur | number | |
lift(ent: any, toY: number, dur: number) → void
Raise or drop a tile plate and everything standing on it.
| arg | type | description |
|---|
| ent | any | |
| toY | number | |
| dur | number | |
raiseTile(x: number, y: number, elev: number, dur: number) → void
| arg | type | description |
|---|
| x | number | |
| y | number | |
| elev | number | |
| dur | number | |
syncTile(x: number, y: number, animated: boolean) → void
One pass over the board: whatever the state says is growing gets a body of
the right form, whatever is gone loses its body. `animated` decides whether
the differences ease in or simply appear (a fresh layout should not play
eighty growth animations at once).
| arg | type | description |
|---|
| x | number | |
| y | number | |
| animated | boolean | |
clearBodies( ) → void
Throw every body away. The next sync builds them again from the board, so
this is how a change to the geometry itself reaches what is standing there.
syncAll(animated: boolean) → void
| arg | type | description |
|---|
| animated | boolean | |
settlePlates( ) → void
Put every tile plate at the height its tile says, with no animation.
hasReferee( ) → boolean
Whether a referee is present. Without one the garden keeps its own round
count so the growth turn can be exercised on its own.
reportEffects(effects: { any }) → void
Hand what the garden did to whoever is standing in it to the referee. The
garden never writes a unit.
| arg | type | description |
|---|
| effects | { any } | |
runGardenPhase(round: number) → void
| arg | type | description |
|---|
| round | number | |
runBlightPhase(round: number) → void
| arg | type | description |
|---|
| round | number | |
tick(dt: number) → void
| arg | type | description |
|---|
| dt | number | |
update(dt: number) → void
| arg | type | description |
|---|
| dt | number | |
editorUpdate(dt: number) → void
| arg | type | description |
|---|
| dt | number | |
gardenTurn(round: number?) → void
--!desc Resolve the garden's turn: every plant grows one stage and the
--! spreaders spread. Returns the list of changes it animated.
--!arg round The round that just closed. Defaults to the board's round.
--!return An array of change records.
--!example entity.find("Garden").component.get("Garden"):gardenTurn()
| arg | type | description |
|---|
| round | number? | |
blightTurn(round: number?) → void
--!desc Resolve the Blight's turn: the crystal hardens, creeps, and raises
--! the floor where it takes root.
--!arg round The round that just closed. Defaults to the board's round.
--!return An array of change records.
--!example entity.find("Garden").component.get("Garden"):blightTurn()
| arg | type | description |
|---|
| round | number? | |
runRound( ) → any
--!desc Close a round: the garden takes its turn, then the Blight takes
--! its own. With no referee on the scene the garden advances its own
--! round count so it can be exercised alone.
--!return A table of { round, garden, blight, blightShare }.
--!example entity.find("Garden").component.get("Garden"):runRound()
sow(x: number, y: number, kind: string?) → any
--!desc Sow a seed on a tile — cover, laid ahead of the advance.
--!arg x Tile column.
--!arg y Tile row.
--!arg kind A plant id; creepvine when omitted.
--!return A table of { ok, reason }.
--!example entity.find("Garden").component.get("Garden"):sow(4, 5, "lightwood")
| arg | type | description |
|---|
| x | number | |
| y | number | |
| kind | string? | |
burn(x: number, y: number) → any
--!desc Burn a tile back to bare stone, opening the lane through it.
--!arg x Tile column.
--!arg y Tile row.
--!return A table of { ok, reason }.
--!example entity.find("Garden").component.get("Garden"):burn(4, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
flood(x: number, y: number, rounds: number?) → any
--!desc Open the brass line onto a tile: growth is held off there, and any
--! fire goes out.
--!arg x Tile column.
--!arg y Tile row.
--!arg rounds How long the water stands. Two rounds when omitted.
--!return A table of { ok, reason }.
--!example entity.find("Garden").component.get("Garden"):flood(4, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
| rounds | number? | |
cut(x: number, y: number) → any
--!desc Strip a tile back with the billhook — no fire, no water.
--!arg x Tile column.
--!arg y Tile row.
--!return A table of { ok, reason }.
--!example entity.find("Garden").component.get("Garden"):cut(4, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
floodRow(y: number) → number
--!desc Flood a whole row from the brass pipes — Cassian's Open the Line.
--!arg y Tile row.
--!return How many tiles took the water.
--!example entity.find("Garden").component.get("Garden"):floodRow(6)
| arg | type | description |
|---|
| y | number | |
describeTile(x: number, y: number) → any
--!desc What the tile inspector says about a tile: what is growing there,
--! what it becomes next round, its cover and its elevation.
--!arg x Tile column.
--!arg y Tile row.
--!return A description table, or nil off the board.
--!example entity.find("Garden").component.get("Garden"):describeTile(4, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
coverAt(x: number, y: number) → number
--!desc The cover a tile gives right now: 0 none, 1 half, 2 full.
--!arg x Tile column.
--!arg y Tile row.
--!return The cover value.
--!example entity.find("Garden").component.get("Garden"):coverAt(4, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
blocksSight(x: number, y: number) → boolean
--!desc Whether a line of sight dies on this tile.
--!arg x Tile column.
--!arg y Tile row.
--!return true when nothing can be seen through it.
--!example entity.find("Garden").component.get("Garden"):blocksSight(4, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
hazardAt(x: number, y: number) → number
--!desc The damage a unit takes for ending its turn on a tile.
--!arg x Tile column.
--!arg y Tile row.
--!return The damage, zero when the tile is harmless.
--!example entity.find("Garden").component.get("Garden"):hazardAt(4, 5)
| arg | type | description |
|---|
| x | number | |
| y | number | |
snapshot( ) → any
--!desc Everything growing on the board in one table, plus the Blight's
--! share and the share that loses the mission.
--!return The garden snapshot.
--!example entity.find("Garden").component.get("Garden"):snapshot()
layoutMission(mission: string?) → any
--!desc Lay a room's opening garden out and rebuild every body.
--!arg mission A mission id from the garden module's layouts.
--!return The layout that was used.
--!example entity.find("Garden").component.get("Garden"):layoutMission("heart_chamber")
| arg | type | description |
|---|
| mission | string? | |
rebuild( ) → number
--!desc Rebuild every body from the board's current state, without
--! animating. Use after another slice has changed the tiles directly.
--!return How many bodies stand on the board.
--!example entity.find("Garden").component.get("Garden"):rebuild()
seedBlight(x: number, y: number, stage: number?) → boolean
--!desc Seed the Blight onto a tile — the mission setup's hand, and any
--! script that wants to make the board worse on purpose.
--!arg x Tile column.
--!arg y Tile row.
--!arg stage 1..3; a fresh bloom when omitted.
--!return true when the tile took it.
--!example entity.find("Garden").component.get("Garden"):seedBlight(4, 9, 2)
| arg | type | description |
|---|
| x | number | |
| y | number | |
| stage | number? | |
blightState( ) → any
--!desc The share of the greenhouse the Blight holds, 0..1, and the share
--! at which the room is lost.
--!return A table of { share, tiles, threshold }.
--!example entity.find("Garden").component.get("Garden"):blightState()