madcaps
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
madcaps
<!-- 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/v2madcaps — the shared rules, constants, state and signal bus of FIRST LIGHT: SABAEAN MADCAPS. local MC = require("game.madcaps") One module, required by every slice. The tables it exports are shared state: a field a component sets is the field another component reads, and a save of this file folds into the same loaded instance, so bus subscriptions survive a hot reload. The plan phase owns this file; a slice that needs a new constant or signal adds it HERE in a small, additive edit and says so in the spec.
tierTopY(i: number) → number
| arg | type | description |
|---|---|---|
| i | number |
tierHalf(i: number) → number
| arg | type | description |
|---|---|---|
| i | number |
stairFace(i: number) → string
The face whose flight leads from tier i up to tier i + 1.
| arg | type | description |
|---|---|---|
| i | number |
faceDir(face: string) → void
Unit outward direction of a face, as {x, z}.
| arg | type | description |
|---|---|---|
| face | string |
faceTangent(face: string) → void
Unit direction ALONG a face, 90 degrees from its outward normal, pointing at the corner the NEXT face begins on. A flight climbs this way, so it lets the runner out where the following flight starts.
| arg | type | description |
|---|---|---|
| face | string |
stairFootHead(i: number) → void
World position of the foot and head of the flight from tier i to i+1. The walkable ring of a terrace is only MC.TEMPLE.inset wide, so a flight that ran straight at the wall would have to be a ladder or hang in the air off the terrace. It runs ALONG the wall instead: the flight fills the ring radially and takes its whole rise over MC.TEMPLE.stairRun of travel sideways across the face of tier i+1, which is how a stepped temple is climbed. Foot and head therefore differ by the tangent, not the normal. foot: on the terrace of tier i, at the low end of the flight. head: on the terrace of tier i+1, where the flight lets the runner out.
| arg | type | description |
|---|---|---|
| i | number |
altar( ) → void
The summit altar, where the flame must arrive.
startPosition( ) → void
Where a runner starts: on the ground terrace, at the foot of the first flight, facing the temple.
rival(id: string) → void
| arg | type | description |
|---|---|---|
| id | string |
resetState( ) → void
on(name: string, fn: (...any) → void
| arg | type | description |
|---|---|---|
| name | string | |
| fn | (...any |
off(handle: ?) → void
| arg | type | description |
|---|---|---|
| handle | ? |
emit(name: string, ...: ?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| ... | ? |
sfx(name: string) → void
Convenience: a one-shot by name, for any slice.
| arg | type | description |
|---|---|---|
| name | string |
say(who: string, text: string, seconds: number?, extra: { [string]: any }?) → void
Convenience: a spoken line. `who` is a rival id, "narrator", or "runner". `extra` carries the optional fields the signal table already documents on a `say` payload: `clip` (the .soundClip the line was generated as) and `playedBy` (the slice that is already sounding it, so the sound slice ducks the bed instead of playing the line a second time). Added by the rivals slice; every existing three-argument call is unchanged.
| arg | type | description |
|---|---|---|
| who | string | |
| text | string | |
| seconds | number? | |
| extra | { [string]: any }? |
setPhase(phase: string) → void
The one phase writer. Anybody may CALL it, but by convention only Game.component does, in answer to a uiRequest or a rule.
| arg | type | description |
|---|---|---|
| phase | 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.