Port multi-hit moves and the special-damage move effects

Multi-hit moves loop back to the script's critical command as EndLoop
does, with its hit-count draws, Triple Kick's growing kicks and Beat Up's
party members, and say "Hit n times!" from the borrowed high byte of the
user's damage taken. ConstantDamage covers Seismic Toss, Night Shade,
Sonicboom, Dragon Rage, Psywave, Super Fang and Flail/Reversal.

One-hit KO moves, Counter, Mirror Coat, False Swipe, Magnitude, Present,
Hidden Power, Return, Frustration, Selfdestruct, Dream Eater, Thief, Pay
Day, freezing, Tri Attack, added confusion, Swagger, thawing by fire
moves, Jump Kick's crash and Minimize with Stomp now run. Pay Day's coins
are paid after a win, and the Amulet Coin is checked at every send-out.
A Focus Band now also holds on at 1 HP.

The original's arithmetic commands are compared with the native ones in
the reference emulator on shared states and random streams.

Part of #28

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sébastien QUEROLandClaude Opus 5.5 committed 2026-10-03 10:45:07 +02:00
1 parent 802397b668
commit 9e0a2cd2a8
9 files changed
+1707 -29

No files matched your search

+7 -2
View File
@@ -29,6 +29,7 @@ import {
import {
OPTIONS_BUTTONS,
shiftBattleStyle,
battleSceneOn,
validOptions,
defaultOptions,
type GameOptions,
@@ -2474,6 +2475,7 @@ export class GameWorld {
money: draft.momsMoney,
},
shift: shiftBattleStyle(draft.options),
battleScene: battleSceneOn(draft.options),
});
this.battle = { engine, selected: 1 };
this.battleRun = engine.run();
@@ -3102,8 +3104,11 @@ export class GameWorld {
if (next.done) {
if (this.script) {
const draft = this.script.run.state,
{ prizeMoney = 0, momMoney = 0 } = next.value;
draft.money = Math.min(C.MAX_MONEY, draft.money + prizeMoney);
{ prizeMoney = 0, momMoney = 0, payDayMoney = 0 } = next.value;
draft.money = Math.min(
C.MAX_MONEY,
draft.money + prizeMoney + payDayMoney,
);
draft.momsMoney = Math.min(C.MAX_MONEY, draft.momsMoney + momMoney);
}
this.battle = undefined;