Log inGet started
World

Rogue Ice

Branchmain
Branchesmain
Commit9e9ef62cbb

README.md

Engine

The ROGUE ICE rules engine (spec: /zero/source/design/spec.md, "Rules"). Engine.new({ state, emit, touch, persist }) returns one game instance bound to a state table and an emitter; game.rules.Director binds the live one to Core.state() / Core.emit / Core.touch with persistence on, and balance simulations bind private instances with no-op emitters.

An instance answers every Core.COMMANDS name through g.command(name, payload) (returns ok, reason), and implements: the run (starter deck, seeded 3-act map from game.rules.Season, reachability, act progression, win/lose by 3 losses or bankruptcy); the card match (intro/faceoff, shifts with energy, hype and forecheck, SKATE draws, line of 3 skaters, equipment, buffs, puck zone and possession, shots vs goalie composure, block, opponent intents from Core.TEAMS with hits reducing them, periods, intermissions, sudden-death overtime and a shootout, goal/intermission/final pause steps advanced by continue); post-match economy (salaries, gate, sponsors, ads, win bonus, purse); off-ice sponsor / fans / broadcast events scored by pitch / fanScore / media / cha with an on-theme streak bonus and tiered rewards; the trade desk (cards, goalies, card removal); rewards (1 of 3, rarity weighted); achievements, Prestige and unlocks via game.rules.Meta. It emits every Core.EVENTS event with the spec's payloads and calls touch before each one.

Extra state fields beyond the spec, for presentation: run.payroll, run.deckSize, run.stats, match.payout = {salaries, gate, sponsors, ads, bonus, net} at the final whistle, match.won, match.shots, match.shootout, event.tiers (score thresholds), event.done/tier/rewards (result panel; leave or continue closes it), event.plays, reward.money, result.reason/stats/money/fans, meta.hasSave and meta.bonuses (start money/hype bought by Prestige).

g.decide() returns the next (command, payload) a sensible GM would send (the autoplay policy); g.boot() loads meta and shows the title. Engine.TUNING holds the balance numbers the spec leaves to the rules.