Log inGet started
World

Verdigris Cloister

Branchmain
Branchesmain
Commit65770846aa

README.md

Director — the referee, standing in the scene

The rules live in game.rules. This component is the one place in the world that holds them: it lays the mission out, mirrors the headline board state onto fields anything can read, paces the Blight's own turn so a human can watch it, and publishes the entire rules surface as methods.

That last part matters more than it looks. A module required from an execute call and a module required from a component are the same instance here, but the component is the copy the game is actually running — so every other slice reaches the board through this component, and nothing has to know how the rules are put together.

Getting hold of it

local D = entity.find("rules_referee").component.get("Director")

It is hosted on rules_referee, a child of the Director anchor. If it is not there — a fresh engine, a scene reload — put it back with one line:

local ref = entity.find("rules_referee")
    or entity.spawn("rules_referee", { parent = entity.find("Director") })
if not ref.component.get("Director") then
    ref.component.add("Director", { mission = "propagation_hall" })
end

Fields

FieldMeaning
missionwhich mission to lay out (default propagation_hall)
autoStartlay it out as soon as the referee wakes
autoBlightlet the referee play the Blight's turn by itself
aiPaceseconds between two actions of the Blight's turn
phase round activeUnit outcome blightShare missionNameread-only mirrors of the board

aiPace is the only number in this game measured in seconds, and it only ever paces the enemy. Nothing anywhere puts a clock on the player's own turn.

Reading

snapshot(opts?) · brief() · queue(count?) · tileInfo(x, y) · reachable(unitId) · pathTo(unitId, x, y) · hitChance(a, b) · targets(unitId) · abilities(unitId) · overwatchCone(unitId) · missions() · carried()

hitChance returns the percentage and mods, an ordered list of { id, label, value } — base aim, range, cover, flank, elevation, wounds, reaction — which is exactly the stack the HUD prints.

reachable and pathTo report cover (what the tile buys against the enemies that can actually see it — the honest number for a cover indicator) alongside bestCover (the best it holds in any direction).

Asking permission

canMove · canAttack · canOverwatch · canGarden · canUndo — each returns { ok, reason }, and the reason is a sentence a screen can print: "It is Brother Anselm's turn, not Sister Vespera's."

Doing

select · move · undo · attack · overwatch · garden · hold · endTurn · phaseDone · aiStep · startMission · setSeed · gardenEffect · setTile

gardenEffect({ unitId, amount, heal?, source?, cause? }) is how the garden slice reports what its growth did to whoever was standing in it — the garden decides what grew and who it touched, the referee owns health and death.

setTile(x, y, patch) is the one door through which growth reaches the board the referee owns; it recomputes cover and the Blight's share for you.

What it does per frame

Nothing, unless it is the Blight's turn and autoBlight is on — then one enemy action every aiPace seconds until that turn is over. update is play mode only; every method above works in edit mode too, which is how the board can be inspected without running the game.