-
Notifications
You must be signed in to change notification settings - Fork 1
Tutorial Six Stats
Split Special into Special Attack and Special Defense — crystal's own model, as a declared vocabulary. One line in your ruleset chooses it; the engine's stat math, battle selection, EV economy, and the wire all follow.
Two things, both in data/ruleset.json:
{
"base": "gen1",
"mon_wire": 3,
"stats": ["hp", "atk", "def", "spd", "sat", "sdf"]
}stats is the ordered stat vocabulary. The engine knows two: the gen-1 five (the absent default) and this six — spd is Speed, sat/sdf the special halves, in the cartridge's own stat order. Anything else refuses at --validate and boot. The six needs mon_wire: 3 — the wire whose ivs/evs bags carry the new columns.
Declare it at the root (the whole project runs six) or inside a named ruleset entry (a save chooses it in-story — see Per-Save Rulesets).
sat/sdf are additive in species stats (and ev_yield). Declare them where you have real numbers; leave them off and both halves derive from spc — partial data degrades honestly, the same shape as per-move category:
"stats": {"hp": 90, "atk": 85, "def": 100, "spd": 55, "spc": 80, "sat": 60, "sdf": 100}bst sums the declared set — a spc-100 species with no declared halves counts 100 per half. If your stat_base_scale kernel bands by bst, six-wide numbers are what it sees.
-
Stat math:
satandsdfcompute from the single spc DV and the spc stat-exp pool — crystal'sCalcMonStatC, faithfully. DVs never widen; genetics stay five. -
Battle: special moves attack with
satand defend withsdf. Gen-1's one "SPECIAL" — stage moves, X SPECIAL, the AI — resolves tosat. CALCIUM awards the attacking half through yourev_gainkernel. -
Kernels:
stat_calc2runs once per declared stat;ev_gainseesev_sat/yield_sat/base_satrows. Your caps live in your kernel, as ever. -
Natures:
up/downacceptsat/sdf; existing four-stat tables keep validating. -
The wire and saves:
mon/3records stay minimal (deviations only); existing wire-2 saves widen at load by copying the spc column onto both halves.friendshipandpokerusride along inert — carried for the Johto era, never read today. - Linking: the declared vocabulary joins the handshake — a five-wide and a six-wide copy refuse to link instead of desyncing.
The four-row stat screens show sat on the SPECIAL row for now; the six-row screen arrives with the Johto era's UI work.
Pairs with Per-Save Rulesets and Modern Individuals. Gate: --sixstattest.
Monworks: MIT code · CC0 samples · everything pictured is original content. The faithful Pokémon Red build derives from your own local pokered clone and is never distributed. Pokémon is © Nintendo/Creatures/GAME FREAK; this is an unaffiliated fan engineering project.
Play
Create
Tutorials
- Writing Text
- Battle Backdrops
- Colors and Palettes
- Display Filters and Shaders
- Widescreen and Scaling
- Quality-of-Life Knobs
- Overlays (Recipes)
- Abilities & Battle Hooks
- Modern Individuals
- Per-Individual Fields
- Item Field Scripts
- Field Effects
- The Modern Ruleset
- Per-Save Rulesets
- Six Stats
- The Clock
- Conditioned Bindings
- Day and Night
- Sprite Variants
- Overworld Spawns
- Language Packs
- Set-Piece Battles & Narration
- Run a Server
- Join a Server
Elsewhere