rules
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
rules
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->TODO: describe this module.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
newLane(id: string, foe: string) → void
state — the live match One record per lane, keyed "ember" / "ash". `owner` is the peer id of the player commanding that lane, or nil when the AI commander runs it.
| arg | type | description |
|---|---|---|
| id | string | |
| foe | string |
reset( ) → void
Reset the match back to its opening position. Any slice may call it; the entrypoint calls it when the scene enters play.
on(event: string, fn: (any) → void
The events the slices agree on. Emitting an event not on this list is allowed; documenting it here is how the next slice discovers it. matchStarted {} waveTick { wave, spawned = { {lane, creep} } } creepSpawned { lane, creep, entity } -- lane = the lane it marches down creepKilled { lane, creep, bounty, by } -- `by` = "ember" | "ash" creepLeaked { lane, creep, leak } livesChanged { lane, lives, delta } goldChanged { lane, gold, delta } incomeChanged { lane, income } sendQueued { lane, creep, cost } heroDamaged { lane, health, max, amount } heroDied { lane } heroRespawned { lane } abilityUsed { lane, ability } matchOver { winner }
| arg | type | description |
|---|---|---|
| event | string | |
| fn | (any |
off(event: string, fn: (any) → void
| arg | type | description |
|---|---|---|
| event | string | |
| fn | (any |
emit(event: string, payload: any) → void
| arg | type | description |
|---|---|---|
| event | string | |
| payload | any |
creep(id: string) → void
helpers — the shared arithmetic, so five slices agree on one answer
| arg | type | description |
|---|---|---|
| id | string |
lane(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
foe(id: string) → string
| arg | type | description |
|---|---|---|
| id | string |
gateOf(laneId: string) → void
Where a lane's creeps enter, and what they march toward.
| arg | type | description |
|---|---|---|
| laneId | string |
nexusOf(laneId: string) → void
| arg | type | description |
|---|---|---|
| laneId | string |
marchDir(laneId: string) → number
March direction along X for a lane's creeps: +1 for ember, -1 for ash.
| arg | type | description |
|---|---|---|
| laneId | string |
progress(laneId: string, x: number) → number
Progress 0..1 of a world x along a lane's march (0 = gate, 1 = nexus).
| arg | type | description |
|---|---|---|
| laneId | string | |
| x | number |
clampToLane(laneId: string, x: number, z: number) → void
Keep a world position inside its lane's playable band.
| arg | type | description |
|---|---|---|
| laneId | string | |
| x | number | |
| z | number |
spend(laneId: string, amount: number) → boolean
Spend gold. Returns false and changes nothing if the lane can't afford it.
| arg | type | description |
|---|---|---|
| laneId | string | |
| amount | number |
grant(laneId: string, amount: number) → void
| arg | type | description |
|---|---|---|
| laneId | string | |
| amount | number |
leak(laneId: string, amount: number) → void
A creep reached a nexus. Drains lives and ends the match at zero.
| arg | type | description |
|---|---|---|
| laneId | string | |
| amount | number |
send(laneId: string, creepId: string) → boolean
Buy one creep into the foe's lane. The single entry point for sending — the economy slice calls it, the HUD calls it, the AI commander calls it.
| arg | type | description |
|---|---|---|
| laneId | string | |
| creepId | string |
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ quality × 0.35
+ performance × 0.25
± compat factor
Usability ratings
Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".
Scoped to this part · feeds back into the world's score.