xonecas.ioDon't click! Sean Caetano Martin Sign in

tiny-adventure / commits / 4d35276

Add the expedition layer and the painted-minis art pass

Wounds now carry between fights. Walking up to an uncleared place stops
the party and shows a threat card with simulated odds and expected
wounds, so the player chooses to fight or back off. Camps and cleared
villages let the party rest, buy gear and potions, and sell loot. A
defeat sends the party to the nearest camp and costs a quarter of its
gold. Enemies that out-level the party give catch-up XP.

The AI textures and icons are gone. The board is painted with vertex
colours from one palette, unexplored ground shows as grey primer, and
figures stand on painted bases. Every UI surface uses the theme tokens:
warm greys and one amber accent. Combat gets sound, camera shake and
hit flashes.

Verified with scripts/verify.sh at six resolutions, seed 7: 0 failures,
plus go vet and go test.

Co-Authored-By: Claude Opus 5.5

sacenox2 days ago4d352765bfede24c0cc0eb0c352d1992862dd75bparent 127599d67 files changed

This diff is too big to show in full. The first 1000 lines are below, and every file is listed with its counts.

README.md+7-8
@@ -1,6 +1,6 @@
11 # Tiny Adventure
22
3-A procedurally generated, tiny Dungeons and Dragons style campaign in the browser. A Go server generates the world from a seed. A Three.js client renders it. Combat plays out automatically from unit stats, abilities and gear.
3+A procedurally generated, tiny Dungeons and Dragons style campaign in the browser, played with painted miniatures on a tabletop board. A Go server generates the world from a seed. A Three.js client renders it. Fights play out automatically from unit stats, abilities and gear. Your decisions are when to fight, when to rest, and what to buy, sell and equip.
44
55 ## Run
66
@@ -16,13 +16,9 @@ Open http://localhost:8080. Flags:
1616
1717 The New Game button on the end screen asks the server for a fresh random seed.
1818
19-## Assets
19+## Art
2020
21-Generated textures and icons are committed in `web/assets`. To regenerate them, put `OPENROUTER_API_KEY=...` in `.env` (never committed) and run:
22-
23-```
24-scripts/gen-assets.sh
25-```
21+Everything is drawn at runtime, with no image assets. The board and miniatures take flat colours from one palette in `web/js/paint.js`. Tiles you have not explored stay unpainted grey primer. The UI uses the role tokens in `web/js/theme.js`: warm greys, one amber accent for the objective, selection and primary action, and red for danger. Sound effects are synthesized with Web Audio in `web/js/sound.js`.
2622
2723 ## How a campaign is built
2824
@@ -42,8 +38,11 @@ Beating the boss ends the campaign with a stats screen.
4238
4339 - Click a tile to walk there. Right-drag or Q/E rotates, the wheel zooms.
4440 - The next main objective is always marked with a light beam and labelled with its level (`Lv N`), even in the fog. J opens the journal, which marks the next step.
41+- Walking toward a place that is still held stops you next to it and shows its defenders, your chance to win, and how much health the fight should cost. Fight (Enter) or back off (Esc).
42+- Wounds carry from fight to fight. Camps are the two spawns plus every cleared camp or village. At a camp (C), rest to heal the party, buy potions and gear, and sell loot. P drinks a potion on the selected hero.
4543 - Walking over loot picks it up. In the inventory (I), `Equip best` gears every hero with the best items in the pack.
46-- A lost fight returns the party to the nearest spawn or cleared POI. Level up on lower level POIs and try again.
44+- A lost fight carries the party back to the nearest camp, patched up, and costs a quarter of its gold. Heroes still earn half XP, more when they fought above their level.
45+- M toggles sound.
4746
4847 ## Check
4948
docs/api.md+52-4
@@ -6,6 +6,8 @@ Errors return a non-2xx status and `{"error": "message"}` (`ErrorResponse`).
66
77 Every endpoint except `/api/seed` and `/api/combat/log` returns a full `GameState`. `phase` is one of `explore`, `combat`, `victory`, `defeat`.
88
9+`stats.hp` is a unit's current health. It carries from fight to fight and is capped by `maxHp` plus gear `maxHp` bonuses. Every item has a `value` in gold. `party.potions` counts potions.
10+
911 ## GameState example
1012
1113 ```json
@@ -55,9 +57,11 @@ Every endpoint except `/api/seed` and `/api/combat/log` returns a full `GameStat
5557 }
5658 ```
5759
58-Combat resolves instantly on the server, so `phase` is never left at `combat`. After a fight `encounter` (`Encounter`) and `log` describe it until the next move or interact. A lost fight sets `phase: "defeat"`, grants a quarter of the XP, and returns the party to the nearest spawn or cleared POI; the next action resumes `explore`. `summary.seconds` is the elapsed play time, frozen at victory. The boss POI only starts its fight once all other main steps are done. A `retrieve` step completes once …
60+Combat resolves instantly on the server, so `phase` is never left at `combat`. After a fight `encounter` (`Encounter`) and `log` describe it until the next move or interact. The next action after a defeat resumes `explore`. `summary.seconds` is the elapsed play time, frozen at victory. The boss POI only starts its fight once all other main steps are done. A `retrieve` step completes once its POI is cleared and the key item is in the inventory.
61+
62+Optional fields: `encounter` (`Encounter`, present after a fight), `rewards` (`Rewards`, present after a won fight), `found` (items auto-collected by the latest move or interact, cleared on the next action), `threat` (`Threat`, see `/api/move`), `camp` (`Camp`, present while the party stands on a camp), `winner` (player id, set at `victory`).
5963
60-Optional fields: `encounter` (`Encounter`, present after a fight), `rewards` (`Rewards`, present after a won fight), `found` (items auto-collected by the latest move or interact, cleared on the next action), `winner` (player id, set at `victory`).
64+A lost fight sets `phase: "defeat"`, carries the party to the nearest camp at full health, takes a quarter of its gold, and grants half the fight's XP.
6165
6266 Each POI has a `level`, the enemy level of its fight. The boss is one level higher. Levels rise with the distance from the spawn, up to about 5 at the boss.
6367
@@ -85,13 +89,19 @@ Response: `GameState` with a fresh campaign.
8589
8690 ## POST /api/move
8791
88-Moves the party toward tile `x,y`. The server paths over walkable tiles, may trigger an encounter on arrival, and returns the new state. The route avoids other uncleared POI tiles unless they block the only way. Walking onto an uncleared POI tile stops the party there and starts its fight. Loot on any tile the party walks over is picked up automatically and listed in `found`; key items on a POI tile are picked up when the POI is cleared. Rejected with 400 for an unreachable tile or after victory …
92+Moves the party toward tile `x,y`. The server paths over walkable tiles and returns the new state. The route avoids other uncleared POI tiles unless they block the only way. The party never walks onto an uncleared POI: it stops on the tile before it, and `threat` describes the fight:
93+
94+```json
95+{"poi": "poi1", "enemies": [], "odds": 82, "wounds": 35, "barred": false}
96+```
97+
98+`odds` is the percent of 40 simulated fights the party wins as it stands now. `wounds` is the average percent of the party's current health lost in those fights. `barred` is true for the boss until every other main step is done. Start the fight with `POST /api/interact` on the POI id. Any other action clears `threat`. Loot on any tile the party walks over is picked up automatically and listed in `found`; key items on a POI tile are picked up when the POI is cleared. Rejected with 400 for an unre …
8999
90100 ```json
91101 {"x": 12, "y": 7}
92102 ```
93103
94-Response: `GameState` with updated `party.x`, `party.y`, and possibly `phase: "combat"` plus `encounter`.
104+Response: `GameState` with updated `party.x`, `party.y`, and possibly `threat`.
95105
96106 ## POST /api/interact
97107
@@ -127,6 +137,44 @@ Assigns an ability to the unit's equipped ability slot, used by auto-combat.
127137
128138 Response: `GameState` with updated `party.units[].abilities`.
129139
140+## Camps
141+
142+Camps are the spawns and every cleared POI of kind `camp` or `village`. While the party stands on one, `camp` is set:
143+
144+```json
145+{"id": "sp1", "name": "shrine", "stock": [], "potionPrice": 15}
146+```
147+
148+`stock` holds three items rolled from the seed for that camp, one tier above its level. The rest of this section's endpoints fail with 400 away from a camp.
149+
150+### POST /api/rest
151+
152+Heals every hero to full. Body `{}`.
153+
154+### POST /api/buy
155+
156+Buys a stock item by id, or a potion with `"potion"`. Fails with 400 if the party lacks the gold.
157+
158+```json
159+{"item": "potion"}
160+```
161+
162+### POST /api/sell
163+
164+Sells a pack item for half its `value`. Quest items cannot be sold.
165+
166+```json
167+{"item": "it-0a1b2c3d"}
168+```
169+
170+## POST /api/drink
171+
172+Drinks a potion on a hero, anywhere, healing half of their maximum health. Fails with 400 with no potions or at full health.
173+
174+```json
175+{"unit": "u1"}
176+```
177+
130178 ## GET /api/combat/log
131179
132180 Returns the combat log of the latest fight.
docs/verification.md+6-6
@@ -12,7 +12,7 @@ Needs `go`, `node`, `ffmpeg` (for the recording), `python3`, and `agent-browser`
1212
1313 1. Builds and starts the server on a free port with `--seed`.
1414 2. Opens a headed Chrome on `DISPLAY` (default `:0`) with software WebGL flags, so a window appears on the desktop. Do not touch the desktop while it runs.
15-3. For each of 1280x720, 1920x1080, 2560x1440, 1366x768, 800x600 and 390x844, resets the campaign to the seed and plays through input only: clicks Begin, clicks a ground tile, presses I, J and Escape, clicks each main-quest POI in order (walks there, fights) until the end screen shows.
15+3. For each of 1280x720, 1920x1080, 2560x1440, 1366x768, 800x600 and 390x844, resets the campaign to the seed and plays through input only: clicks Begin, clicks a ground tile, presses I, J and Escape, then for each main-quest POI in order clicks it, waits for the threat card and clicks Fight. When a hero is below half health it first walks to the nearest camp, which opens the camp panel, and clicks Rest and Potion. The end screen is reached by fast-forwarding through the API.
1616 4. Exits non-zero if any assertion failed.
1717
1818 `VERIFY_ONLY=1280x720,390x844` limits the resolutions. `VERIFY_ATTEMPTS=n` caps POI clicks (default 14).
@@ -23,19 +23,19 @@ Needs `go`, `node`, `ffmpeg` (for the recording), `python3`, and `agent-browser`
2323 scripts/playthrough.sh <outdir> <seed> [width height name]
2424 ```
2525
26-Plays one full campaign on `<seed>` through input only: clicks Begin, opens the journal, then clicks the next main POI until the end screen shows, opening the inventory and pressing `Equip best` before each leg. After two defeats at one POI it walks to a lower level POI first. It records `<name>.webm`, saves screenshots and `<name>.md`/`<name>.json`, and exits non-zero on any failed step, layout problem or console error. `PLAY_MAX_CLICKS` caps clicks (default 60).
26+Plays one full campaign on `<seed>` through input only: clicks Begin, opens the journal, then clicks the next main POI and Fight on its threat card until the end screen shows, opening the inventory and pressing `Equip best` before each leg. When a hero is below half health it rests at the nearest camp first. After two defeats at one POI it walks to a lower level POI first. It records `<name>.webm`, saves screenshots and `<name>.md`/`<name>.json`, and exits non-zero on any failed step, layout pro …
2727
2828 ## Output
2929
3030 - `report.md` and `report.json`: per resolution, a table of every interaction with the server state after it (from `/api/state`), the layout checks and console errors.
31-- `screens/<WxH>/NN-*.png`: title, explore, after-move, inventory, journal, combat, end.
31+- `screens/<WxH>/NN-*.png`: title, explore, after-move, inventory, journal, threat, combat, camp, end.
3232 - `recording.webm`: the whole 1280x720 session.
3333 - `server.log`.
3434
3535 ## Assertions
3636
3737 - After each input, `/api/state` must show the expected change (party moved, battle counted, mode changed) and the client party position from `window.__game.state()` must equal the server's.
38-- Layout, read from `window.__game.rects()` only: every `essential` rect is fully inside the viewport, and no two rects partly overlap (full containment is allowed). Checked on title, explore, inventory, journal, combat and end screens.
38+- Layout, read from `window.__game.rects()` only: every `essential` rect is fully inside the viewport, and no two rects partly overlap (full containment is allowed). Checked on title, explore, inventory, journal, threat card, combat, camp and end screens.
3939 - The page must log no console errors or uncaught exceptions.
4040
4141 ## Reviewing the output
@@ -48,9 +48,9 @@ Defined in `web/js/debug.js`, installed after boot.
4848
4949 | Member | Meaning |
5050 | --- | --- |
51-| `mode` | `loading`, `title`, `explore`, `combat`, `end` |
51+| `mode` | `loading`, `title`, `explore`, `threat`, `combat`, `end` |
5252 | `busy` | true while a move, walk or fight animation runs |
53-| `state()` | phase, seed, party x/y/gold/inventory/unit levels, summary, winner |
53+| `state()` | phase, seed, party x/y/gold/potions/inventory/unit levels and hp, threat, camp, summary, winner |
5454 | `rects()` | `[{name, x, y, w, h, essential}]` in CSS pixels |
5555 | `setRects(fn)` | replace the rect provider (use when the UI is drawn in Three.js) |
5656 | `tileScreen(x, y)` | screen position of a tile, for real clicks |
internal/gen/encounters.go+10-5
@@ -15,28 +15,33 @@ func bossName(r *rand.Rand, f model.Faction) string {
1515 return fmt.Sprintf("%s %s %s", pick(r, d.titles), pick(r, bossNames), pick(r, bossEpithets))
1616 }
1717
18-func enemy(r *rand.Rand, id, name string, f model.Faction, level int, mult float64) model.Unit {
19- hp := int(float64(14+level*6+r.Intn(5)) * mult)
18+func enemy(r *rand.Rand, id, name string, f model.Faction, level int, hpMult, atkMult float64) model.Unit {
19+ hp := int(float64(hpBase+level*hpGrow+r.Intn(5)) * hpMult)
2020 return model.Unit{
2121 ID: id, Name: name, Class: "monster", Faction: f.ID, Level: level,
2222 Stats: model.Stats{
23- HP: hp, MaxHP: hp, Attack: int(float64(3+level*3/2) * mult), Defense: 1 + level/2,
23+ HP: hp, MaxHP: hp, Attack: int(float64(atkBase+level*atkGrow/2) * atkMult), Defense: 1 + level/2,
2424 Magic: level, Speed: between(r, 3, 7), Crit: 5,
2525 },
2626 Abilities: []model.Ability{{ID: "strike", Name: "Strike", Kind: "damage", Power: 1.0, Cooldown: 0, Target: "enemy"}},
2727 }
2828 }
2929
30+const (
31+ hpBase, hpGrow, atkBase, atkGrow = 18, 8, 7, 4
32+ bossHP, bossAtk = 2.0, 1.2
33+)
34+
3035 func buildEncounter(r *rand.Rand, poi model.POI, f model.Faction, level int, boss string) model.Encounter {
3136 d := defOf(f)
3237 e := model.Encounter{ID: "enc-" + poi.ID, POI: poi.ID}
3338 if boss != "" {
3439 e.Boss = true
35- e.Enemies = append(e.Enemies, enemy(r, e.ID+"-boss", boss, f, level+1, 1.7))
40+ e.Enemies = append(e.Enemies, enemy(r, e.ID+"-boss", boss, f, level+1, bossHP, bossAtk))
3641 }
3742 count := between(r, 2, 2+min(2, level/3))
3843 for i := 0; i < count; i++ {
39- e.Enemies = append(e.Enemies, enemy(r, fmt.Sprintf("%s-e%d", e.ID, i+1), pick(r, d.minions), f, level, 1))
44+ e.Enemies = append(e.Enemies, enemy(r, fmt.Sprintf("%s-e%d", e.ID, i+1), pick(r, d.minions), f, level, 1, 1))
4045 }
4146 return e
4247 }
internal/gen/gen.go+1-1
@@ -20,7 +20,7 @@ func Generate(seed model.Seed) World {
2020 }
2121
2222 lr := sub(seed, "layout")
23- nMain := between(lr, 6, 10)
23+ nMain := between(lr, 7, 10)
2424 nSide := 0
2525 if sys.SideQuest {
2626 nSide = between(lr, 2, 4)
internal/gen/items.go+1-0
@@ -48,6 +48,7 @@ func makeItem(r *rand.Rand, id string, level int) model.Item {
4848 default:
4949 it.Bonus = model.Stats{Speed: 1 + tier, Magic: pow, Crit: r.Intn(tier + 2)}
5050 }
51+ it.Value = model.Price(it)
5152 return it
5253 }
5354
internal/model/api.go+8-0
@@ -25,6 +25,14 @@ type AbilityRequest struct {
2525 Slot int `json:"slot"`
2626 }
2727
28+type ItemRequest struct {
29+ Item string `json:"item"`
30+}
31+
32+type UnitRequest struct {
33+ Unit string `json:"unit"`
34+}
35+
2836 type SeedResponse struct {
2937 Seed Seed `json:"seed"`
3038 Systems []string `json:"systems"`
internal/model/camp.go+8-0
@@ -0,0 +1,8 @@
1+package model
2+
3+type Camp struct {
4+ ID string `json:"id"`
5+ Name string `json:"name"`
6+ Stock []Item `json:"stock"`
7+ PotionPrice int `json:"potionPrice"`
8+}
internal/model/combat.go+8-0
@@ -7,6 +7,14 @@ type Encounter struct {
77 Boss bool `json:"boss,omitempty"`
88 }
99
10+type Threat struct {
11+ POI string `json:"poi"`
12+ Enemies []Unit `json:"enemies"`
13+ Odds int `json:"odds"`
14+ Wounds int `json:"wounds"`
15+ Barred bool `json:"barred,omitempty"`
16+}
17+
1018 type CombatEvent struct {
1119 Tick int `json:"tick"`
1220 Actor string `json:"actor"`
internal/model/item.go+11-0
@@ -17,6 +17,17 @@ type Item struct {
1717 Bonus Stats `json:"bonus"`
1818 Abilities []string `json:"abilities,omitempty"`
1919 Key bool `json:"key,omitempty"`
20+ Value int `json:"value"`
21+}
22+
23+var rarityWorth = map[string]int{"common": 4, "uncommon": 6, "rare": 9, "epic": 13, "legendary": 18}
24+
25+func Price(it Item) int {
26+ if it.Key {
27+ return 0
28+ }
29+ b := it.Bonus
30+ return max(1, (b.MaxHP/3+b.Attack+b.Defense+b.Magic+(b.Speed+b.Crit)/2)*rarityWorth[it.Rarity])
2031 }
2132
2233 type Gear map[Slot]*Item
internal/model/state.go+2-0
@@ -19,6 +19,8 @@ type GameState struct {
1919 Log []CombatEvent `json:"log"`
2020 Rewards *Rewards `json:"rewards,omitempty"`
2121 Found []Item `json:"found,omitempty"`
22+ Threat *Threat `json:"threat,omitempty"`
23+ Camp *Camp `json:"camp,omitempty"`
2224 Phase string `json:"phase"`
2325 Winner string `json:"winner,omitempty"`
2426 Summary Summary `json:"summary"`
internal/model/unit.go+1-0
@@ -19,4 +19,5 @@ type Party struct {
1919 X int `json:"x"`
2020 Y int `json:"y"`
2121 Gold int `json:"gold"`
22+ Potions int `json:"potions"`
2223 }
internal/server/camp.go+162-10
@@ -1,24 +1,176 @@
11 package server
22
3-import "tinyadventure/internal/model"
3+import (
4+ "errors"
5+ "hash/fnv"
6+ "slices"
7+
8+ "tinyadventure/internal/model"
9+ "tinyadventure/internal/sim"
10+)
11+
12+const (
13+ PotionPrice = 15
14+ stockSize = 3
15+)
16+
17+type site struct {
18+ id, name string
19+ x, y int
20+ level int
21+}
22+
23+func (g *game) sites() []site {
24+ var out []site
25+ for _, s := range g.state.Map.Spawns {
26+ out = append(out, site{s.ID, s.Kind, s.X, s.Y, 1})
27+ }
28+ for _, p := range g.state.Map.POIs {
29+ if p.Cleared && (p.Kind == "camp" || p.Kind == "village") {
30+ out = append(out, site{p.ID, p.Name, p.X, p.Y, p.Level})
31+ }
32+ }
33+ return out
34+}
35+
36+func (g *game) siteAt(x, y int) *site {
37+ for _, s := range g.sites() {
38+ if s.x == x && s.y == y {
39+ return &s
40+ }
41+ }
42+ return nil
43+}
444
545 func (g *game) camp(from *model.POI) (int, int) {
646 bx, by := g.spawn.X, g.spawn.Y
747 best := dist(bx, by, from.X, from.Y)
8- try := func(x, y int) {
9- if d := dist(x, y, from.X, from.Y); d < best {
10- bx, by, best = x, y, d
48+ for _, s := range g.sites() {
49+ if d := dist(s.x, s.y, from.X, from.Y); d < best {
50+ bx, by, best = s.x, s.y, d
1151 }
1252 }
13- for _, s := range g.state.Map.Spawns {
14- try(s.X, s.Y)
53+ return bx, by
54+}
55+
56+func (g *game) stockAt(s *site) []model.Item {
57+ if g.stock == nil {
58+ g.stock = map[string][]model.Item{}
1559 }
16- for _, p := range g.state.Map.POIs {
17- if p.Cleared {
18- try(p.X, p.Y)
60+ if items, ok := g.stock[s.id]; ok {
61+ return items
62+ }
63+ h := fnv.New64a()
64+ h.Write([]byte(s.id))
65+ r := sim.NewRNG(g.state.Seed ^ model.Seed(h.Sum64()))
66+ items := make([]model.Item, stockSize)
67+ for i := range items {
68+ items[i] = sim.RollItem(r, s.level+1)
69+ }
70+ g.stock[s.id] = items
71+ return items
72+}
73+
74+func (g *game) campView() *model.Camp {
75+ s := g.siteAt(g.state.Party.X, g.state.Party.Y)
76+ if s == nil {
77+ return nil
78+ }
79+ return &model.Camp{ID: s.id, Name: s.name, Stock: slices.Clone(g.stockAt(s)), PotionPrice: PotionPrice}
80+}
81+
82+func (g *game) atCamp() (*site, error) {
83+ if g.finished() {
84+ return nil, errors.New("campaign is over, start a new game")
85+ }
86+ s := g.siteAt(g.state.Party.X, g.state.Party.Y)
87+ if s == nil {
88+ return nil, errors.New("no camp here: walk to a spawn, or a cleared camp or village")
89+ }
90+ g.begin()
91+ return s, nil
92+}
93+
94+func (g *game) healAll() {
95+ for i := range g.state.Party.Units {
96+ u := &g.state.Party.Units[i]
97+ u.Stats.HP = sim.Effective(*u).MaxHP
98+ }
99+}
100+
101+func (g *game) rest() error {
102+ if _, err := g.atCamp(); err != nil {
103+ return err
104+ }
105+ g.healAll()
106+ return nil
107+}
108+
109+func (g *game) buy(id string) error {
110+ s, err := g.atCamp()
111+ if err != nil {
112+ return err
113+ }
114+ p := &g.state.Party
115+ if id == "potion" {
116+ if p.Gold < PotionPrice {
117+ return errors.New("not enough gold for a potion")
19118 }
119+ p.Gold -= PotionPrice
120+ p.Potions++
121+ return nil
20122 }
21- return bx, by
123+ stock := g.stockAt(s)
124+ i := slices.IndexFunc(stock, func(it model.Item) bool { return it.ID == id })
125+ if i < 0 {
126+ return errors.New("item is not for sale here")
127+ }
128+ if p.Gold < stock[i].Value {
129+ return errors.New("not enough gold for " + stock[i].Name)
130+ }
131+ p.Gold -= stock[i].Value
132+ p.Inventory = append(p.Inventory, stock[i])
133+ g.stock[s.id] = slices.Delete(stock, i, i+1)
134+ return nil
135+}
136+
137+func (g *game) sell(id string) error {
138+ if _, err := g.atCamp(); err != nil {
139+ return err
140+ }
141+ p := &g.state.Party
142+ i := slices.IndexFunc(p.Inventory, func(it model.Item) bool { return it.ID == id })
143+ if i < 0 {
144+ return errors.New("item not in inventory")
145+ }
146+ if p.Inventory[i].Key {
147+ return errors.New("quest items cannot be sold")
148+ }
149+ p.Gold += SellPrice(p.Inventory[i])
150+ p.Inventory = slices.Delete(p.Inventory, i, i+1)
151+ return nil
152+}
153+
154+func SellPrice(it model.Item) int { return max(1, it.Value/2) }
155+
156+func (g *game) drink(unit string) error {
157+ if g.finished() {
158+ return errors.New("campaign is over, start a new game")
159+ }
160+ u := g.unit(unit)
161+ if u == nil {
162+ return errors.New("unknown unit")
163+ }
164+ if g.state.Party.Potions == 0 {
165+ return errors.New("no potions left: buy them at a camp")
166+ }
167+ full := sim.Effective(*u).MaxHP
168+ if u.Stats.HP >= full {
169+ return errors.New(u.Name + " is already at full health")
170+ }
171+ g.state.Party.Potions--
172+ u.Stats.HP = min(full, u.Stats.HP+full/2)
173+ return nil
22174 }
23175
24176 func dist(ax, ay, bx, by int) int {
internal/server/equip.go+1-0
@@ -22,6 +22,7 @@ func (g *game) equip(req model.EquipRequest) error {
2222 if it != nil && it.ID == req.Item {
2323 *inv = append(*inv, *it)
2424 delete(u.Gear, slot)
25+ u.Stats.HP = sim.Effective(*u).HP
2526 return nil
2627 }
2728 }
internal/server/game.go+12-3
@@ -15,6 +15,8 @@ type game struct {
1515 started time.Time
1616 ended time.Time
1717 fights uint64
18+ threat string
19+ stock map[string][]model.Item
1820 }
1921
2022 func newGame(player string, seed model.Seed) *game {
@@ -24,7 +26,7 @@ func newGame(player string, seed model.Seed) *game {
2426 for _, e := range w.Encounters {
2527 encs[e.POI] = e
2628 }
27- return &game{
29+ g := &game{
2830 state: model.GameState{
2931 Version: model.Version, PlayerID: player, Seed: seed,
3032 Campaign: w.Campaign, Map: w.Map, Party: w.Party,
@@ -34,6 +36,8 @@ func newGame(player string, seed model.Seed) *game {
3436 spawn: w.Map.Spawns[0],
3537 started: time.Now(),
3638 }
39+ g.healAll()
40+ return g
3741 }
3842
3943 func (g *game) snapshot() model.GameState {
@@ -43,6 +47,8 @@ func (g *game) snapshot() model.GameState {
4347 end = time.Now()
4448 }
4549 s.Summary.Seconds = int(end.Sub(g.started).Seconds())
50+ s.Threat = g.threatView()
51+ s.Camp = g.campView()
4652 return s
4753 }
4854
@@ -53,6 +59,7 @@ func (g *game) begin() {
5359 g.state.Rewards = nil
5460 g.state.Found = nil
5561 g.state.Log = []model.CombatEvent{}
62+ g.threat = ""
5663 if g.state.Phase == "defeat" {
5764 g.state.Phase = "explore"
5865 }
@@ -137,11 +144,13 @@ func (g *game) fight(p *model.POI) {
137144 g.state.Summary.Battles++
138145 if res.Outcome != sim.OutcomeVictory {
139146 g.state.Phase = "defeat"
140- xp := sim.Rewards(r, enc, tier).XP / 4 / max(len(g.state.Party.Units), 1)
147+ xp := sim.Rewards(r, enc, tier).XP / 2 / max(len(g.state.Party.Units), 1)
141148 for i := range g.state.Party.Units {
142- sim.Grant(&g.state.Party.Units[i], max(1, xp))
149+ sim.Grant(&g.state.Party.Units[i], sim.CatchUp(max(1, xp), tier, g.state.Party.Units[i].Level))
143150 }
144151 g.state.Party.X, g.state.Party.Y = g.camp(p)
152+ g.state.Party.Gold -= g.state.Party.Gold / 4
153+ g.healAll()
145154 return
146155 }
147156 g.state.Rewards = &res.Rewards
internal/server/move.go+4-4
@@ -56,12 +56,12 @@ func (g *game) move(tx, ty int) error {
5656 return err
5757 }
5858 for _, s := range steps {
59- g.state.Party.X, g.state.Party.Y = s[0], s[1]
60- g.pickup(s[0], s[1])
61- if p := g.poiAt(s[0], s[1]); p != nil && !p.Cleared && g.bossGate(p) {
62- g.fight(p)
59+ if g.guarded(s[0], s[1]) {
60+ g.threat = g.poiAt(s[0], s[1]).ID
6361 break
6462 }
63+ g.state.Party.X, g.state.Party.Y = s[0], s[1]
64+ g.pickup(s[0], s[1])
6565 }
6666 return nil
6767 }
internal/server/play_test.go+163-3
@@ -4,6 +4,7 @@ import (
44 "testing"
55
66 "tinyadventure/internal/model"
7+ "tinyadventure/internal/sim"
78 )
89
910 func openGame(w, h int) *game {
@@ -65,8 +66,12 @@ func TestDefeatFallsBackToNearestCamp(t *testing.T) {
6566 g.state.Map.Spawns = []model.SpawnPoint{g.spawn}
6667 g.state.Map.POIs = []model.POI{{ID: "p1", X: 20, Y: 0, Cleared: true}, {ID: "p2", X: 25, Y: 0}}
6768 x, y := g.camp(&g.state.Map.POIs[1])
68- if x != 20 || y != 0 {
69- t.Fatalf("camp %d,%d", x, y)
69+ if x != 0 || y != 0 {
70+ t.Fatalf("cleared ruin is no camp, got %d,%d", x, y)
71+ }
72+ g.state.Map.POIs[0].Kind = "camp"
73+ if x, _ := g.camp(&g.state.Map.POIs[1]); x != 20 {
74+ t.Fatalf("camp %d", x)
7075 }
7176 g.state.Map.POIs[0].Cleared = false
7277 if x, _ := g.camp(&g.state.Map.POIs[1]); x != 0 {
@@ -105,12 +110,13 @@ func TestMainRouteIsWinnableWithoutGrinding(t *testing.T) {
105110 break
106111 }
107112 }
108- if err := g.move(poi.X, poi.Y); err != nil {
113+ if err := g.engage(poi); err != nil {
109114 t.Fatalf("seed %d: %v", seed, err)
110115 }
111116 if g.state.Phase == "defeat" {
112117 defeats++
113118 }
119+ g.recover()
114120 }
115121 if !g.finished() || defeats > 12 {
116122 t.Fatalf("seed %d: finished=%v defeats=%d", seed, g.finished(), defeats)
@@ -126,3 +132,157 @@ func TestPOILevelsGrowTowardTheBoss(t *testing.T) {
126132 t.Fatalf("levels %d -> %d", first.Level, last.Level)
127133 }
128134 }
135+
136+func (g *game) engage(p *model.POI) error {
137+ if err := g.move(p.X, p.Y); err != nil {
138+ return err
139+ }
140+ if g.threat != p.ID {
141+ return nil
142+ }
143+ return g.interact(p.ID)
144+}
145+
146+func (g *game) hurt() bool {
147+ for _, u := range g.state.Party.Units {
148+ if u.Stats.HP*2 < sim.Effective(u).MaxHP {
149+ return true
150+ }
151+ }
152+ return false
153+}
154+
155+func (g *game) recover() {
156+ if g.finished() || !g.hurt() {
157+ return
158+ }
159+ near := g.sites()[0]
160+ for _, s := range g.sites() {
161+ if dist(s.x, s.y, g.state.Party.X, g.state.Party.Y) < dist(near.x, near.y, g.state.Party.X, g.state.Party.Y) {
162+ near = s
163+ }
164+ }
165+ if err := g.move(near.x, near.y); err == nil {
166+ g.rest()
167+ }
168+}
169+
170+func TestThreatStopsBeforePOIAndOffersOdds(t *testing.T) {
171+ g := newGame("local", 7)
172+ p := g.poi(g.state.Campaign.Main.Steps[0].POI)
173+ if err := g.move(p.X, p.Y); err != nil {
174+ t.Fatal(err)
175+ }
176+ st := g.snapshot()
177+ if st.Threat == nil || st.Threat.POI != p.ID || len(st.Threat.Enemies) == 0 {
178+ t.Fatalf("threat %+v", st.Threat)
179+ }
180+ if dist(st.Party.X, st.Party.Y, p.X, p.Y) != 1 || st.Summary.Battles != 0 {
181+ t.Fatalf("party at %d,%d battles %d", st.Party.X, st.Party.Y, st.Summary.Battles)
182+ }
183+ if st.Threat.Odds < 50 || st.Threat.Odds > 100 || st.Threat.Wounds <= 0 || st.Threat.Wounds > 100 {
184+ t.Fatalf("first fight odds %d wounds %d", st.Threat.Odds, st.Threat.Wounds)
185+ }
186+ if err := g.interact(p.ID); err != nil {
187+ t.Fatal(err)
188+ }
189+ if st := g.snapshot(); st.Threat != nil || st.Summary.Battles != 1 {
190+ t.Fatalf("after engage threat=%v battles=%d", st.Threat, st.Summary.Battles)
191+ }
192+}
193+
194+func TestBarredBossShowsAsBarred(t *testing.T) {
195+ g := newGame("local", 7)
196+ steps := g.state.Campaign.Main.Steps
197+ boss := g.poi(steps[len(steps)-1].POI)
198+ if err := g.move(boss.X, boss.Y); err != nil {
199+ t.Fatal(err)
200+ }
201+ if st := g.snapshot(); st.Threat == nil || !st.Threat.Barred {
202+ t.Fatalf("threat %+v", st.Threat)
203+ }
204+ if err := g.interact(boss.ID); err == nil {
205+ t.Fatal("barred boss accepted a fight")
206+ }
207+}
208+
209+func TestHPCarriesBetweenFightsAndRestHeals(t *testing.T) {
210+ g := newGame("local", 7)
211+ full := g.state.Party.Units[0].Stats.HP
212+ if full != sim.Effective(g.state.Party.Units[0]).MaxHP {
213+ t.Fatalf("not at full health at start: %d", full)
214+ }
215+ p := g.poi(g.state.Campaign.Main.Steps[0].POI)
216+ if err := g.move(p.X, p.Y); err != nil {
217+ t.Fatal(err)
218+ }
219+ sx, sy := g.state.Party.X, g.state.Party.Y
220+ if err := g.interact(p.ID); err != nil {
221+ t.Fatal(err)
222+ }
223+ if err := g.move(sx, sy); err != nil {
224+ t.Fatal(err)
225+ }
226+ if !g.hurt() && g.state.Party.Units[0].Stats.HP == full {
227+ t.Skip("party took no damage")
228+ }
229+ if err := g.rest(); err == nil {
230+ t.Fatal("rested away from a camp")
231+ }
232+ sp := g.state.Map.Spawns[0]
233+ if err := g.move(sp.X, sp.Y); err != nil {
234+ t.Fatal(err)
235+ }
236+ if err := g.rest(); err != nil {
237+ t.Fatal(err)
238+ }
239+ for _, u := range g.state.Party.Units {
240+ if u.Stats.HP != sim.Effective(u).MaxHP {
241+ t.Fatalf("%s at %d after rest", u.Name, u.Stats.HP)
242+ }
243+ }
244+}
245+
246+func TestCampTradeAndPotions(t *testing.T) {
247+ g := newGame("local", 7)
248+ g.state.Party.Gold = 1000
249+ st := g.snapshot()
250+ if st.Camp == nil || len(st.Camp.Stock) != stockSize {
251+ t.Fatalf("camp %+v", st.Camp)
252+ }
253+ it := st.Camp.Stock[0]
254+ if it.Value <= 0 {
255+ t.Fatalf("stock item has no value: %+v", it)
256+ }
257+ if err := g.buy(it.ID); err != nil {
258+ t.Fatal(err)
259+ }
260+ if g.state.Party.Gold != 1000-it.Value || len(g.campView().Stock) != stockSize-1 {
261+ t.Fatalf("gold %d stock %d", g.state.Party.Gold, len(g.campView().Stock))
262+ }
263+ if err := g.sell(it.ID); err != nil {
264+ t.Fatal(err)
265+ }
266+ if g.state.Party.Gold != 1000-it.Value+SellPrice(it) {
267+ t.Fatalf("gold after sell %d", g.state.Party.Gold)
268+ }
269+ if err := g.buy("potion"); err != nil || g.state.Party.Potions != 1 {
270+ t.Fatalf("potion %v %d", err, g.state.Party.Potions)
271+ }
272+ u := &g.state.Party.Units[0]
273+ if err := g.drink(u.ID); err == nil {
274+ t.Fatal("drank at full health")
275+ }
276+ u.Stats.HP = 1
277+ if err := g.drink(u.ID); err != nil || u.Stats.HP <= 1 || g.state.Party.Potions != 0 {
278+ t.Fatalf("drink %v hp %d potions %d", err, u.Stats.HP, g.state.Party.Potions)
279+ }
280+ g.state.Party.Gold = 0
281+ if err := g.buy("potion"); err == nil {
282+ t.Fatal("bought a potion with no gold")
283+ }
284+ g.state.Party.X++
285+ if g.snapshot().Camp != nil || g.buy("potion") == nil {
286+ t.Fatal("trade away from camp")
287+ }
288+}
internal/server/server.go+22-0
@@ -48,6 +48,28 @@ func New(seed model.Seed, webDir string) *Server {
4848 }
4949 return g.assign(req)
5050 }))
51+ s.mux.HandleFunc("POST /api/rest", s.act(func(g *game, r *http.Request) error { return g.rest() }))
52+ s.mux.HandleFunc("POST /api/buy", s.act(func(g *game, r *http.Request) error {
53+ var req model.ItemRequest
54+ if err := decode(r, &req); err != nil {
55+ return err
56+ }
57+ return g.buy(req.Item)
58+ }))
59+ s.mux.HandleFunc("POST /api/sell", s.act(func(g *game, r *http.Request) error {
60+ var req model.ItemRequest
61+ if err := decode(r, &req); err != nil {
62+ return err
63+ }
64+ return g.sell(req.Item)
65+ }))
66+ s.mux.HandleFunc("POST /api/drink", s.act(func(g *game, r *http.Request) error {
67+ var req model.UnitRequest
68+ if err := decode(r, &req); err != nil {
69+ return err
70+ }
71+ return g.drink(req.Unit)
72+ }))
5173 s.mux.HandleFunc("GET /api/combat/log", s.handleLog)
5274 s.mux.HandleFunc("GET /api/seed", s.handleSeed)
5375 s.mux.Handle("/", noCache(http.FileServer(http.Dir(webDir))))
internal/server/server_test.go+24-2
@@ -84,6 +84,21 @@ func (c client) equipBest(st model.GameState) model.GameState {
8484 return st
8585 }
8686
87+func (c client) restIfHurt(st model.GameState) model.GameState {
88+ g := &game{state: st}
89+ if !g.hurt() {
90+ return st
91+ }
92+ sp := st.Map.Spawns[0]
93+ for _, s := range g.sites() {
94+ if dist(s.x, s.y, st.Party.X, st.Party.Y) < dist(sp.X, sp.Y, st.Party.X, st.Party.Y) {
95+ sp = model.SpawnPoint{X: s.x, Y: s.y}
96+ }
97+ }
98+ c.call("POST", "/api/move", model.MoveRequest{X: sp.X, Y: sp.Y}, 200)
99+ return c.call("POST", "/api/rest", nil, 200)
100+}
101+
87102 func TestFullCampaign(t *testing.T) {
88103 for _, seed := range []model.Seed{7, 21, 1234, 987654321} {
89104 t.Run(fmt.Sprint(seed), func(t *testing.T) { playCampaign(t, seed) })
@@ -121,10 +136,17 @@ func playCampaign(t *testing.T, seed model.Seed) {
121136 poi := g.poi(step.POI)
122137 for tries := 0; tries < 40 && !(&game{state: st}).poi(step.POI).Cleared; tries++ {
123138 st = c.call("POST", "/api/move", model.MoveRequest{X: poi.X, Y: poi.Y}, 200)
124- if len(st.Log) > 0 && st.Encounter == nil {
125- t.Fatal("log without encounter")
139+ if st.Threat == nil || st.Threat.POI != poi.ID {
140+ t.Fatalf("no threat before %s", poi.ID)
141+ }
142+ st = c.call("POST", "/api/interact", model.InteractRequest{ID: poi.ID}, 200)
143+ if len(st.Log) == 0 || st.Encounter == nil {
144+ t.Fatal("fight without log or encounter")
126145 }
127146 st = c.equipBest(st)
147+ if st.Phase != "victory" {
148+ st = c.restIfHurt(st)
149+ }
128150 }
129151 if !(&game{state: st}).poi(step.POI).Cleared {
130152 t.Fatalf("could not clear %s step %s", poi.ID, step.ID)
internal/server/threat.go+19-0
@@ -0,0 +1,19 @@
1+package server
2+
3+import (
4+ "tinyadventure/internal/model"
5+ "tinyadventure/internal/sim"
6+)
7+
8+const oddsRuns = 40
9+
10+func (g *game) threatView() *model.Threat {
11+ p := g.poi(g.threat)
12+ if p == nil {
13+ return nil
14+ }
15+ enc := g.encs[p.ID]
16+ r := sim.NewRNG(g.state.Seed ^ model.Seed(g.fights+1)*104729)
17+ odds, wounds := sim.Forecast(r, g.state.Party.Units, enc.Enemies, oddsRuns)
18+ return &model.Threat{POI: p.ID, Enemies: enc.Enemies, Odds: odds, Wounds: wounds, Barred: !g.bossGate(p)}
19+}
internal/sim/combat.go+33-5
@@ -34,7 +34,7 @@ type combatant struct {
3434
3535 func newCombatant(u model.Unit, side int) *combatant {
3636 s := Effective(u)
37- return &combatant{unit: u, side: side, hp: s.MaxHP, stats: s, abils: AllAbilities(u), cd: map[string]int{}}
37+ return &combatant{unit: u, side: side, hp: s.HP, stats: s, abils: AllAbilities(u), cd: map[string]int{}}
3838 }
3939
4040 func (c *combatant) alive() bool { return c.hp > 0 }
@@ -198,7 +198,7 @@ func (b *battle) act(actor *combatant) {
198198 }
199199 }
200200
201-func Simulate(r *rand.Rand, party []model.Unit, enemies []model.Unit) (string, int, []model.CombatEvent) {
201+func Simulate(r *rand.Rand, party []model.Unit, enemies []model.Unit) (string, int, []model.CombatEvent, []int) {
202202 b := &battle{r: r}
203203 for _, u := range party {
204204 b.all = append(b.all, newCombatant(u, 0))
@@ -228,19 +228,43 @@ func Simulate(r *rand.Rand, party []model.Unit, enemies []model.Unit) (string, i
228228 if len(b.side(1)) == 0 && len(b.side(0)) > 0 {
229229 outcome = OutcomeVictory
230230 }
231- return outcome, rounds, b.log
231+ hp := make([]int, len(party))
232+ for i := range party {
233+ hp[i] = b.all[i].hp
234+ }
235+ return outcome, rounds, b.log, hp
236+}
237+
238+func Forecast(r *rand.Rand, party []model.Unit, enemies []model.Unit, runs int) (odds, wounds int) {
239+ wins, start, left := 0, 0, 0
240+ for _, u := range party {
241+ start += Effective(u).HP
242+ }
243+ for range runs {
244+ outcome, _, _, hp := Simulate(r, party, enemies)
245+ if outcome == OutcomeVictory {
246+ wins++
247+ }
248+ for _, v := range hp {
249+ left += v
250+ }
251+ }
252+ return wins * 100 / runs, 100 - left*100/max(1, start*runs)
232253 }
233254
234255 func Fight(r *rand.Rand, p *model.Party, enc model.Encounter, nodeTier int) Result {
235- outcome, rounds, log := Simulate(r, p.Units, enc.Enemies)
256+ outcome, rounds, log, hp := Simulate(r, p.Units, enc.Enemies)
236257 res := Result{Outcome: outcome, Rounds: rounds, Log: log, Rewards: model.Rewards{Items: []model.Item{}}}
237258 if outcome != OutcomeVictory {
238259 return res
239260 }
261+ for i := range p.Units {
262+ p.Units[i].Stats.HP = max(1, hp[i])
263+ }
240264 res.Rewards = Rewards(r, enc, nodeTier)
241265 share := max(1, res.Rewards.XP/max(len(p.Units), 1))
242266 for i := range p.Units {
243- Grant(&p.Units[i], share)
267+ Grant(&p.Units[i], CatchUp(share, nodeTier, p.Units[i].Level))
244268 }
245269 p.Gold += res.Rewards.Gold
246270 p.Inventory = append(p.Inventory, res.Rewards.Items...)
@@ -263,3 +287,7 @@ func Rewards(r *rand.Rand, enc model.Encounter, nodeTier int) model.Rewards {
263287 }
264288 return rw
265289 }
290+
291+func CatchUp(xp, enemyLevel, heroLevel int) int {
292+ return xp * (2 + max(0, enemyLevel-heroLevel)) / 2
293+}
internal/sim/gear.go+2-1
@@ -94,6 +94,7 @@ func BuildItem(r *rand.Rand, slot model.Slot, rarity string, tier int) model.Ite
9494 if rarityMult[rarity] >= rarityMult["rare"] {
9595 it.Abilities = []string{pick(r, slotAbilities[slot])}
9696 }
97+ it.Value = model.Price(it)
9798 return it
9899 }
99100
@@ -123,7 +124,7 @@ func Effective(u model.Unit) model.Stats {
123124 s.Speed += it.Bonus.Speed
124125 s.Crit += it.Bonus.Crit
125126 }
126- s.HP = s.MaxHP
127+ s.HP = min(u.Stats.HP, s.MaxHP)
127128 return s
128129 }
129130
internal/sim/xp.go+1-1
@@ -23,6 +23,7 @@ func Grant(u *model.Unit, xp int) int {
2323 gained++
2424 g := classOf(u.Class).Growth
2525 u.Stats.MaxHP += g.MaxHP
26+ u.Stats.HP += g.MaxHP
2627 u.Stats.Attack += g.Attack
2728 u.Stats.Defense += g.Defense
2829 u.Stats.Magic += g.Magic
@@ -32,6 +33,5 @@ func Grant(u *model.Unit, xp int) int {
3233 if u.Level >= MaxLevel {
3334 u.XP = 0
3435 }
35- u.Stats.HP = u.Stats.MaxHP
3636 return gained
3737 }
scripts/driver.mjs+38-1
@@ -2,6 +2,16 @@ import { execFileSync } from 'node:child_process';
22
33 export const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
44
5+const maxHp = (u) => u.stats.maxHp + Object.values(u.gear || {}).reduce((n, it) => n + (it?.bonus?.maxHp || 0), 0);
6+export const hurt = (s) => s.party.units.some((u) => u.stats.hp * 2 < maxHp(u));
7+export const health = (s) => s.party.units.map((u) => `${u.stats.hp}/${maxHp(u)}`).join(' ');
8+
9+export function nearestCamp(s) {
10+ const sites = [...s.map.spawns, ...s.map.pois.filter((p) => p.cleared && (p.kind === 'camp' || p.kind === 'village'))];
11+ const d = (p) => Math.abs(p.x - s.party.x) + Math.abs(p.y - s.party.y);
12+ return sites.sort((a, b) => d(a) - d(b))[0];
13+}
14+
515 export function createDriver({ session, baseUrl, w, h }) {
616 const ab = (...args) => execFileSync('agent-browser', ['--session', session, ...args], { encoding: 'utf8', stdio: ['ignore', 'pipe', 'pipe'], timeout: 60000 });
717 const ev = (expr) => {
@@ -50,6 +60,33 @@ export function createDriver({ session, baseUrl, w, h }) {
5060 await sleep(300);
5161 return waitIdle(observe);
5262 };
63+ const fight = async (observe) => {
64+ await clickRect('threat-fight');
65+ await sleep(300);
66+ return waitIdle(observe);
67+ };
68+ const restAtCamp = async (onPanel) => {
69+ const s = await api('/api/state');
70+ const site = nearestCamp(s);
71+ await clickTile(site);
72+ await sleep(500);
73+ const open = (await rects()).some((r) => r.name === 'panel-camp');
74+ if (!open) return { ok: false, detail: `camp panel did not open at ${site.x},${site.y}` };
75+ await onPanel?.();
76+ await clickRect('rest');
77+ await sleep(600);
78+ let after = await api('/api/state');

Cut short: this commit's diff is over 1000 lines.

scripts/gen-assets.sh+0-59

Cut short: this commit's diff is over 1000 lines.

scripts/playthrough.mjs+27-5

Cut short: this commit's diff is over 1000 lines.

scripts/verify.mjs+30-6

Cut short: this commit's diff is over 1000 lines.

web/assets/icons_abilities.png+0-0

Binary file, not shown.

web/assets/icons_items.png+0-0

Binary file, not shown.

web/assets/manifest.json+0-13

Cut short: this commit's diff is over 1000 lines.

web/assets/tex_dirt.png+0-0

Binary file, not shown.

web/assets/tex_dungeon.png+0-0

Binary file, not shown.

web/assets/tex_grass.png+0-0

Binary file, not shown.

web/assets/tex_sand.png+0-0

Binary file, not shown.

web/assets/tex_snow.png+0-0

Binary file, not shown.

web/assets/tex_stone.png+0-0

Binary file, not shown.

web/assets/tex_water.png+0-0

Binary file, not shown.

web/assets/tex_wood.png+0-0

Binary file, not shown.

web/assets/ui_parchment.png+0-0

Binary file, not shown.

web/js/api.js+5-1

Cut short: this commit's diff is over 1000 lines.

web/js/camera.js+18-1

Cut short: this commit's diff is over 1000 lines.

web/js/camp.js+64-0

Cut short: this commit's diff is over 1000 lines.

web/js/chrome.js+7-7

Cut short: this commit's diff is over 1000 lines.

web/js/combat.js+42-27

Cut short: this commit's diff is over 1000 lines.

web/js/compass.js+2-1

Cut short: this commit's diff is over 1000 lines.

web/js/debug.js+2-2

Cut short: this commit's diff is over 1000 lines.

web/js/floaters.js+2-1

Cut short: this commit's diff is over 1000 lines.

web/js/frames.js+29-101

Cut short: this commit's diff is over 1000 lines.

web/js/hud.js+61-95

Cut short: this commit's diff is over 1000 lines.

web/js/icons.js+0-7

Cut short: this commit's diff is over 1000 lines.

web/js/inventory.js+65-61

Cut short: this commit's diff is over 1000 lines.

web/js/journal.js+12-10

Cut short: this commit's diff is over 1000 lines.

web/js/kit.js+1-0

Cut short: this commit's diff is over 1000 lines.

web/js/layout.js+26-24

Cut short: this commit's diff is over 1000 lines.

web/js/main.js+122-54

Cut short: this commit's diff is over 1000 lines.

web/js/paint.js+33-0

Cut short: this commit's diff is over 1000 lines.

web/js/party.js+2-1

Cut short: this commit's diff is over 1000 lines.

web/js/props.js+15-32

Cut short: this commit's diff is over 1000 lines.

web/js/screens.js+35-32

Cut short: this commit's diff is over 1000 lines.

web/js/sound.js+70-0

Cut short: this commit's diff is over 1000 lines.

web/js/stats.js+4-0

Cut short: this commit's diff is over 1000 lines.

web/js/text.js+3-2

Cut short: this commit's diff is over 1000 lines.

web/js/textures.js+0-75

Cut short: this commit's diff is over 1000 lines.

web/js/theme.js+16-0

Cut short: this commit's diff is over 1000 lines.

web/js/threat.js+52-0

Cut short: this commit's diff is over 1000 lines.

web/js/ui.js+54-27

Cut short: this commit's diff is over 1000 lines.

web/js/world.js+44-44

Cut short: this commit's diff is over 1000 lines.