state
A module script.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2strict
new(generation: number, traits: Sim.Traits?, name: string?) → Dragon
| arg | type | description |
|---|---|---|
| generation | number | |
| traits | Sim.Traits? | |
| name | string? |
reserveCapacity(mass: number) → number
The circulating + stored energy reserve, kcal. This is fat, not a day of basal expenditure -- which is why a fed animal can fly for a long time and a lean one cannot.
| arg | type | description |
|---|---|---|
| mass | number |
stomachCapacity(mass: number) → number
| arg | type | description |
|---|---|---|
| mass | number |
refreshCapacity(d: Dragon) → void
Reserve capacity scales with body size, like any other organ.
| arg | type | description |
|---|---|---|
| d | Dragon |
flightPower(d: Dragon, flapping: boolean, rho: number) → number
The metabolic cost of staying in the air right now, in watts. Powered flight pays the full power curve at the current airspeed; a glide pays nothing but trim, because gravity is doing the work (you buy the altitude back later, or a thermal buys it for you). That gap is the whole reason a big flier soars.
| arg | type | description |
|---|---|---|
| d | Dragon | |
| flapping | boolean | |
| rho | number |
canFlap(d: Dragon) → void
Can the flight muscle answer right now? Heat and exhaustion both gate it, and that is what keeps the animal alive: flapping is what cooks a big dragon, and a cooked dragon cannot flap. The muscle quits before the animal does. So overheating reads as your wings going dead and the ground coming up -- not as a silent death.
| arg | type | description |
|---|---|---|
| d | Dragon |
checkDeath(d: Dragon) → void
| arg | type | description |
|---|---|---|
| d | Dragon |
eat(d: Dragon, offeredKg: number, isCarrion: boolean) → Meal
Eat. `offeredKg` is how much meat is there; what you get is bounded by the stomach you carry. Fresh meat feeds you; carrion additionally feeds the methanogens that make your fire -- which is the trade the roster is built on, since the stinking carcass that draws rivals is the only thing that fills your sac.
| arg | type | description |
|---|---|---|
| d | Dragon | |
| offeredKg | number | |
| isCarrion | boolean |
digest(d: Dragon, dt: number) → void
Move food from the stomach into the reserve over time, and spill the overflow into growth. You cannot bank a whole aurochs at once: you digest it, and what your fat stores cannot hold is what builds new body.
| arg | type | description |
|---|---|---|
| d | Dragon | |
| dt | number |
growthEfficiency(mass: number) → number
| arg | type | description |
|---|---|---|
| mass | number |
spendGrowth(d: Dragon, channel: GrowthChannel, kcal: number) → boolean
| arg | type | description |
|---|---|---|
| d | Dragon | |
| channel | GrowthChannel | |
| kcal | number |
effectiveCatalyst(d: Dragon) → number
Breathe fire. Returns the sim's own result so the caller can drive VFX, audio and damage from the same numbers the Codex prints. The catalyst actually available to this exhale. The gland's Pt-group loading is the ceiling you grow toward; the charge is how much of it is currently primed. A big gland that just fired is as useless as a small one.
| arg | type | description |
|---|---|---|
| d | Dragon |
breathe(d: Dragon, exhaleFraction: number) → Sim
| arg | type | description |
|---|---|---|
| d | Dragon | |
| exhaleFraction | number |
hatchling(parent: Dragon, rng: () → void
Death, then the next generation. The lineage is the save file: you respawn as your own hatchling, carrying drifted traits, one generation on.
| arg | type | description |
|---|---|---|
| parent | Dragon | |
| rng | ( |
serialize(d: Dragon) → void
| arg | type | description |
|---|---|---|
| d | Dragon |
deserialize(t: { [string]: any }) → Dragon
| arg | type | description |
|---|---|---|
| t | { [string]: any } |
Dragon = {Environment = {TickOutput = {Meal = {GrowthChannel = "mass" | "wings" | "muscle" | "sac" | "catalyst" | "armor"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.