games/kaintuck: persistent trading house carries money & reputation across runs
#40 in Riparion/riparion-retro — merged 2026-06-13
Why
Every Kaintuck run started identically ($50 cash, reputation 0) and ended by clearing the save and recording only a per-run high score. Nothing the player earned survived, so there was no incentive to play a second run beyond chasing the scoreboard.
What
A persistent trading house: money and reputation now carry from one run to the next, win or lose.
- New
engine/ledger.rs(pure, host-tested) — aLedgerfolds each finished run into the house: net wealth (cash − debt, debt forgiven, floored at $0), reputation, plus lifetime tallies (journeys, arrivals home, best score, miles).Carryoveris what a new run inherits;Carryover::fresh()is the clean-slate scenario stake. engine/mod.rs—begin_with(trader, carry)seeds the new run's starting cash & reputation. Default scenario behavior is unchanged, sogolden_trace_is_stableand existing engine tests stay green.storage/mod.rs— newkaintuck.ledgerkey (v1), separate from the mid-runkaintuck.save.app.rs— on game over the run is folded into the ledger alongside the high-score record.- UI —
new_gamestarts from the house and shows it;splashgets a "YOUR TRADING HOUSE" panel + a "disband the house" reset;game_overshows the amount carried forward.
Crate bumped to 0.1.14.
Note
Run score still uses leftover = cash − debt, so inherited money now counts toward per-run scores — scores drift upward over a dynasty. Left as-is (reads fine as a growing house); switching the score's wealth term to net gain this run is an easy follow-up if undesirable.
Test
cargo test -p kaintuck— 46 pass (3 new ledger tests; golden trace unchanged).- Clean
cargo check(no warnings).
🤖 Generated with Claude Code
Last updated 2026-06-13
Links to this note
Merged pull requests, newest first.