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:
1 parent
802397b668
commit
9e0a2cd2a8
9 files changed
+1707
-29
No files matched your search
@@ -255,6 +255,15 @@ The numbered sections below keep their full scope. Each one opens with a checkli
|
||||
- Wild Magikarp now battle: `LoadEnemyMon` draws their DVs again as the original does, through `CalcMagikarpLength` (compared with the original routine) and its filters, whose millimetre limits only work as a floor of four feet that about 39% of draws skip (39 percent + 1), nowhere in map group 9 or on maps numbered 6 (the Lake of Rage check). Unown are still refused.
|
||||
- Save format 3 gained `repel`, `coins` and `blueCardBalance`, migrated by absence to 0.
|
||||
|
||||
## Implemented: multi-hit and special-damage moves
|
||||
|
||||
- Multi-hit moves loop as `BattleCommand_EndLoop` does: back to the script's `critical`, so accuracy is checked once; two to five hits (a second draw above two), two for Double Kick, Bonemerang and Twineedle, one to three kicks for Triple Kick with growing damage (its count lives in `wBattleAnimParam`). "Hit n times!" reads the high byte of the user's `wDamageTaken`, which the loop borrows; effectiveness is said on the first hit only. A target that faints mid-loop ends the move without the count.
|
||||
- Beat Up hits once per party member that is neither fainted nor statused, with its base Attack and level against the target's base Defense. The original's bugs are kept: the player's active member is recognised by comparing `wCurBattleMon` with the HP's low byte, a lone Pokémon skips King's Rock, and a wild user says "But it failed!" after hitting. A party with an Egg is refused until eggs exist.
|
||||
- `ConstantDamage`: Seismic Toss and Night Shade (the level), Sonicboom and Dragon Rage, Psywave (below 1.5 × level; a level-1 user is refused, as the original loops forever), Super Fang and Flail/Reversal (HP bar pixels into `FlailReversalPower`, then the move's power becomes 1). Immune types make them miss (`ResetTypeMatchup`).
|
||||
- One-hit KO moves, Counter and Mirror Coat (twice the opponent's last physical or special damage when it moved first, still working after the opponent used an item), False Swipe, Magnitude, Present (a full target refuses the gift, said only with battle animations off), Hidden Power, Return and Frustration (no damage at the extremes of happiness, a kept bug), Selfdestruct and Explosion, Dream Eater, Thief (not MAIL; a trainer's Pokémon keeps the player's item), Pay Day (paid out after a win, doubled by an Amulet Coin, which is now checked at every send-out), freezing, Tri Attack, added confusion, Swagger, Flame Wheel and Sacred Fire thawing their user, fire moves thawing their target, Jump Kick's crash damage, Minimize with Stomp's double damage, Earthquake against a digging target and Thunder's weather accuracy.
|
||||
- A Focus Band now hangs on at 1 HP even when the hit would only take that 1 HP, and cancels a one-hit KO's text.
|
||||
- `tests/reference-move-effects.spec.ts` runs the original `ConstantDamage`, `OHKO`, `Counter`, `MirrorCoat`, `EndLoop`, `TripleKick`, `HiddenPower` with `DamageCalc`, and `FalseSwipe` in the reference emulator on the same state as the native commands, with the Link RNG; damage, flags, move structs, loop counters, the script position and the random stream must agree. Deliberate mutations of six rules each made a comparison fail.
|
||||
|
||||
## Native battles: current state
|
||||
|
||||
The battle core, ROM tables, encounter hooks, battle UI and whiteout hooks are present. Unit tests cover wins, escape, loss, experience, move learning and capture; reference tests compare damage, type effectiveness, stat calculation and experience curves. Browser tests drive a test-only wild encounter through the real UI: victory with level-up and move learning, escape, whiteout, catching with a nickname, keyboard and on-screen D-pad menu navigation, mid-battle backup restore, rollback of unsupported effects, switching through the party menu and a Potion from the Items pocket. Real Route 29 encounters now use the ROM's encounter tables. Only the special Kurt and Park balls remain unported among battle items.
|
||||
|
||||
Reference in new issue
Block a user