# Wagon Trail 1848

An original Oregon-Trail-style trail management game (clean-room design, not a
port). Lead a party of five from Independence, Missouri to the Willamette
Valley: buy supplies, manage pace and rations, hunt, rest, cross rivers, and
survive disease, broken bones, thieves, and bad water. Three occupations
(Banker/Carpenter/Farmer) with score multipliers.

A single self-contained HTML file (`wagon-trail-1848.html`) — open in any
modern browser to play, no build step, no server.

- **Play:** open the HTML file in a browser. In the Muse app it runs as an
  interactive widget with persistent state (via `window.hatchWidget`); outside
  the app it falls back to in-memory state for a single session.
- **Changelog:** `CHANGELOG.md` — what changed in each version.
- **Dev log & run history:** `wagon-trail-1848.md` — balance changes, bug
  lists, and records of completed runs.
- **Regression tests:** `tests/wagon-harness.js` — headless Node harness that
  plays full games by simulating button taps with seeded RNG, checking
  invariants (no negative supplies, HP in range, games complete) and
  feature-specific behavior. Run: `cd tests && node wagon-harness.js 24 1848`
- **Sharing:** the file is free to share; the reuse notes at the top of the
  `<script>` block explain how to embed it.

## License

Wagon Trail 1848 is © 2026 Aaron and Nova, released under [CC BY-NC-SA
4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) (Creative Commons
Attribution-NonCommercial-ShareAlike 4.0 International — full text in
`LICENSE`). In short: free to play, copy, and modify for non-commercial
purposes — just credit Aaron and Nova, and share your modified version
under the same license. Don't sell it.

### Undo buttons

Two kinds, deliberately different:

- **Store undo (cream button, free):** every buy/sell in a store visit stacks
  up; each tap peels back one transaction, in reverse order, until the store
  is back to how you found it. No score cost — fat fingers in the shop are
  forgiven. Each visit (General Store, each fort) keeps its own history;
  leaving starts a fresh slate.
- **Trail undo (amber button, costs 150 score points each):** rewinds the last
  consequential trail action — traveling a day, resting, hunting, river
  crossings, trail choices, resting at a fort. The amber color is the
  tell: this one isn't free. The 150-pt hit (deducted from the final score and
  itemized on the game-over screen) is big enough to deter rewinding bad
  decisions, but small enough that a genuine whoopsie won't wreck a run.
  Note: re-doing a travel day rolls fresh dice — it rewinds the mistake, not
  the luck. It's also two-tap: the first tap arms it (the button turns red
  and says "Tap again to undo"), the second consecutive tap executes, and
  tapping anything else disarms it — so a stray thumb can't burn 150 points
  by accident.
- **Stepping back into a shop (cream button, free):** undoing "Left the
  store" or "Left the fort" just walks you back through the shop door — no
  dice were rolled, so there's no penalty. Still two-tap, still single-level,
  rendered cream like the store undo since it's free.

### Fort work (mercy for the unlucky)

The game keeps count of genuine disasters — oxen lost on the trail or
drowned at river crossings, wagons wrecked by currents. One bad roll counts
once, no matter how much damage cascades from it: injuries, damage ticks, and
starvation never add to the count, and sick travelers never count at all
(the game shows the ailment and says rest would help — that's gameplay, not
luck). After three disasters, word of your misfortunes travels ahead: forts
offer paid work, $20 a day, up to 5 days per fort. A work day costs a day like any trail day (food eaten,
health ticks, winter creeps closer), so it's a cup of water for a dying run —
enough to replace a drowned ox or buy food to survive — not a money printer.
The 5-day-per-fort cap keeps it a lifeline rather than a grind. Work days are
undoable like any trail action (-150 pts).
