Single-file ink-painting wuxia sect-survival RPG. Lead a sect through 100 days: martial arts combos, cultivation, tactical combat, faction war, chronicle endings. - src/ 13 modules (data, sim, combat, render, UI, app shell) - wuxia.html self-contained build (no dependencies) - tools/build.js bundler - tests: headless 100-day sims + jsdom UI smoke + real-browser Chromium click-through (playwright)
78 lines
3.9 KiB
Markdown
78 lines
3.9 KiB
Markdown
# WUXIA: 100 DAYS AFTER — 武林百日后
|
||
|
||
A single-file, browser-based wuxia sect-survival RPG in the style of a Chinese ink
|
||
painting. Lead a small martial-arts school through exactly **100 days** of the
|
||
jianghu — recruit disciples, learn (or steal) techniques, combine martial arts into
|
||
devastating sets, survive faction war, and decide what your legend becomes.
|
||
|
||
**Everything ships in one file: [`wuxia.html`](wuxia.html)** (~390 KB, no dependencies,
|
||
no network). Open it directly in any modern browser (`file://` works), or serve it:
|
||
|
||
```bash
|
||
python3 -m http.server 8080
|
||
# → http://localhost:8080/wuxia.html
|
||
```
|
||
|
||
## The game
|
||
|
||
- **Core loop:** PLAN (limited AP) → TRAVEL an procedurally-drawn jianghu → EXPLORE /
|
||
gather / recruit / spy → EVENTS with real consequences → turn-based tactical COMBAT →
|
||
TRAIN disciples & assign sect duties → manage gold/food/medicine → ADVANCE DAY.
|
||
- **Martial arts combinations:** equip up to 4 arts. Certain sets fuse into **combos**
|
||
(13 total) — e.g. *Iron Palm + Lightning Step + Drunken Fist* unlocks the
|
||
**Drunken Thunder** ultimate. Forbidden pairings (*Nine Yin + Phantom Steps*) grant
|
||
power but inflict round-by-round backlash.
|
||
- **Cultivation realms:** Mortal → Legend, with risky breakthroughs (failure injures;
|
||
catastrophic failure can kill). Pills and high Medicine help.
|
||
- **Living characters:** traits, loyalty, relationships, memories, romance; disciples
|
||
train assigned arts, gain scars, and can die permanently.
|
||
- **9 factions & 2 rival sects:** reputation on five axes (Honor/Fear/Mercy/Ambition/
|
||
Deception), fame titles, war that erupts mid-run, raids on your mountain, and a
|
||
scripted final invasion around day 92.
|
||
- **Endings:** 11 chronicle-driven endings (Legend, New Era, Conqueror, Demonic,
|
||
Hermit, Betrayer, Martyr…) computed from what you actually did.
|
||
- **Presentation:** canvas isometric ink-painting rendering (weather, day/night,
|
||
parallax mountains), procedural portraits & event scene art, cinematic brush-stroke
|
||
technique FX, generative pentatonic soundtrack + synthesized SFX (WebAudio),
|
||
autosave/slots/export codes, 11 achievements, 4 difficulties.
|
||
|
||
## Repository layout
|
||
|
||
```
|
||
wuxia.html ← the game (self-contained build output; also copied to index.html)
|
||
src/
|
||
00_boot.js W namespace, seeded RNG, utils, event bus, constants
|
||
05_audio.js generative music + SFX engine (WebAudio)
|
||
10_data_arts.js 47 martial arts, 13 combos, realms
|
||
12_data_world.js backgrounds, factions, items, buildings, enemies, locations…
|
||
14_data_events.js ~40 data-driven events (world / travel / sect)
|
||
20_state.js state factory, world gen, save/load/export
|
||
22_sim.js simulation API: actions, days, events, meetings, breakthroughs
|
||
24_combat.js tactical grid combat (AI, statuses, combo ultimates)
|
||
30_render_world.js isometric ink renderer
|
||
32_render_fx.js portraits, scene art, cinematic FX
|
||
40_ui.js all screens, HUD, panels, modals
|
||
50_app.js boot, main loop, input, achievements, flow orchestration
|
||
style.css ink/lacquer theme
|
||
tools/build.js bundles src/* into wuxia.html
|
||
test/headless.js full-game simulations (random play, N seeds)
|
||
test/ui_smoke.js jsdom boot + click-through smoke test of the real UI
|
||
```
|
||
|
||
## Development
|
||
|
||
```bash
|
||
node tools/build.js # rebuild wuxia.html after editing src/
|
||
node test/headless.js 40 # simulate 40 complete runs headlessly
|
||
node test/ui_smoke.js # boot the built file in jsdom and drive the UI
|
||
```
|
||
|
||
## Tips for new sect leaders
|
||
|
||
- Rest when hurt; dead disciples do not come back. Medicine heals injuries fast.
|
||
- Spar with wandering masters — losing teaches you their art anyway.
|
||
- Recruit early: assigned disciples generate inner-force growth every day.
|
||
- Watch your food. Hungry sects lose morale, then people.
|
||
- When the war comes (around day 45–60), neutrality is also a choice… but someone
|
||
always remembers who stood aside.
|