cf_state
One-paragraph description of what this module provides and who consumes it.
[name]
One-paragraph description of what this module provides and who consumes it.
Exports
M.exampleFn(arg) -> result— what it does and when to call it.M.exampleValue: type— what value it carries.
Usage
local M = require("@<youridentity>::modules.[name]")
M.exampleFn("foo")
Notes
- Anything callers need to know about THIS module: required runtime ordering, state ownership, side effects.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2COINFALL's run state, as pure data and rules. No entities, no rendering, no UI -- the director owns the world and calls in here to decide what the run does next, and the HUD reads the same table. Keeping it separate is what makes the numbers testable: a whole run can be stepped from a script with no machine on screen.
quotaTarget(m: number, q: number) → number
The bank target for machine `m` (0-based) at quota `q` (0-based). Targets climb steeply enough that a late machine cannot be cleared on coin volume alone -- the player has to let corruption run to raise the payout.
| arg | type | description |
|---|---|---|
| m | number | |
| q | number |
newRun(seed: number, residue: number) → void
A fresh run. `residue` is the persisted meta-progression; it widens the relic pool rather than making the player stronger.
| arg | type | description |
|---|---|---|
| seed | number | |
| residue | number |
recomputeModifiers(run: ?) → void
Re-derive the cached relic modifiers. Called whenever the held set moves.
| arg | type | description |
|---|---|---|
| run | ? |
target(run: ?) → number
The target the current quota is chasing.
| arg | type | description |
|---|---|---|
| run | ? |
clockFor(run: ?) → number
The clock a fresh quota starts on, including DEBT RELIEF.
| arg | type | description |
|---|---|---|
| run | ? |
rot(run: ?, amount: number) → boolean
Add corruption and report whether it just ended the run.
| arg | type | description |
|---|---|---|
| run | ? | |
| amount | number |
burn(run: ?, amount: number) → number
Spend corruption (the shrine, and nothing else). Returns what was burned.
| arg | type | description |
|---|---|---|
| run | ? | |
| amount | number |
wound(run: ?) → boolean
Take a vitality point. Returns true when that was the last one.
| arg | type | description |
|---|---|---|
| run | ? |
bank(run: ?, amount: number) → string
Bank an amount toward the current quota. Returns "met" when the quota was just cleared, "machine" when that was the machine's last quota, and "won" when it was the last machine.
| arg | type | description |
|---|---|---|
| run | ? | |
| amount | number |
tick(run: ?, dt: number) → string
Advance the clock and the coin trickle. Returns "expired" when the debt clock just ran out -- the caller takes the vitality, not this function, so the loss sequence stays in one place.
| arg | type | description |
|---|---|---|
| run | ? | |
| dt | number |
resetClock(run: ?) → void
Restart the current quota's clock after the machine has taken its payment.
| arg | type | description |
|---|---|---|
| run | ? |
canFire(run: ?, id: string) → void
Whether a relic's active can fire right now, and why not when it cannot.
| arg | type | description |
|---|---|---|
| run | ? | |
| id | string |
fire(run: ?, id: string) → void
Fire an active: charge its corruption and start its cooldown. Returns the relic definition so the caller can carry out the effect.
| arg | type | description |
|---|---|---|
| run | ? | |
| id | string |
take(run: ?, id: string) → void
Take a relic from a draft.
| arg | type | description |
|---|---|---|
| run | ? | |
| id | string |
offerDraft(run: ?) → void
Roll the next draft offer. Returns the offered ids.
| arg | type | description |
|---|---|---|
| run | ? |
residueEarned(run: ?) → number
The residue a finished run banks. Clearing machines is what pays; winning pays a bonus on top.
| arg | type | description |
|---|---|---|
| run | ? |
snapshot(run: ?) → void
A flat snapshot for the HUD and for data queries during validation.
| arg | type | description |
|---|---|---|
| run | ? |
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.