games/kaintuck: persistent trading house carries money & reputation across runs

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) — a Ledger folds 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). Carryover is what a new run inherits; Carryover::fresh() is the clean-slate scenario stake.
  • engine/mod.rsbegin_with(trader, carry) seeds the new run's starting cash & reputation. Default scenario behavior is unchanged, so golden_trace_is_stable and existing engine tests stay green.
  • storage/mod.rs — new kaintuck.ledger key (v1), separate from the mid-run kaintuck.save.
  • app.rs — on game over the run is folded into the ledger alongside the high-score record.
  • UInew_game starts from the house and shows it; splash gets a "YOUR TRADING HOUSE" panel + a "disband the house" reset; game_over shows 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