Integrate battles with the overworld UI and validate browser flows
Checks / web (push) Canceled after 0s
Checks / web (push) Canceled after 0s
- Drive wild battles through the real UI in Chromium and WebKit using a test-only encounter fixture: victory with level-up, escape, whiteout, mid-battle backup restore and unsupported-effect rollback. - Add keyboard and on-screen D-pad navigation for battle menus. - Accept pending stat experience in saves (awarded without CalcMonStats). - Commit whiteout healing, money loss and destination callbacks together; aborted scripts restore state and map. - Give long notices their own status-bar row on narrow screens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c08d250cf6
commit
11d1153802
11 files changed
+462
-13
No files matched your search
+8
-1
@@ -21,6 +21,8 @@ export class NativeRuntime implements GameRuntime {
|
||||
private onUpdate: (world: GameWorld) => void,
|
||||
private onError: (error: unknown) => void,
|
||||
private player: () => { name: string; avatar: "chris" | "kris" },
|
||||
/** Presentation handles menu navigation; battle rules stay in the world. */
|
||||
private battleInput?: (button: Button) => boolean,
|
||||
) {}
|
||||
async load(bytes: Uint8Array, canvas: HTMLCanvasElement) {
|
||||
this.dispose();
|
||||
@@ -55,9 +57,14 @@ export class NativeRuntime implements GameRuntime {
|
||||
if (this.pressed.has(button) || !this.world) return;
|
||||
this.pressed.add(button);
|
||||
const world = this.world;
|
||||
if (world.battle && this.battleInput?.(button)) {
|
||||
this.publish();
|
||||
return;
|
||||
}
|
||||
if (button === "a") world.interact();
|
||||
if (button === "b") world.advanceDialogue();
|
||||
if ((button === "up" || button === "down") && world.dialogue?.choice)
|
||||
if ((button === "up" || button === "down") &&
|
||||
(world.dialogue?.choice || world.battle?.prompt?.kind === "yesno"))
|
||||
world.moveCursor(button);
|
||||
if ((button === "start" || button === "select") && !world.busy)
|
||||
world.notice =
|
||||
|
||||
Reference in new issue
Block a user