Run the forced-shiny, trap, forced-item, Celebi, Suicune, roaming and Bug-Catching Contest battle types. Roaming battles keep their struct's DVs and HP byte, and every other battle makes CleanUpBattleRAM's roaming roll. The contest shows PARKBALL×, counts down Park Balls, ends when they run out, keeps its catch outside the party and asks before switching. Scripts load the special types with loadvar, and while a contest runs, encounters use BugCatchingContestBattleScript and ContestMons.
Validated with 596 unit tests, 155 browser tests (including the contest menu and switch screen), native/reference builds and reference/vendor/release checks. National Park's contest event, the roaming release and the Ilex Forest Celebi event come with their maps.
Closes#28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add the Heavy, Level, Lure, Fast, Friend, Moon and Love Balls with their documented bugs, the Park Ball's multiplier outside the contest, and Friend Ball happiness in the party and the PC. The Heavy Ball is refused for Kadabra and Sunflora, whose original weight read runs into VRAM.
The reference emulator compares 6,153 more catch states per browser against the unmodified PokeBallEffect. Validated with 582 unit tests, 153 browser tests, native/reference builds and reference/vendor/release checks. The Bug-Catching Contest and other special battle types remain on #28.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Toxic, Leech Seed, Nightmare and Curse hurt in ResidualDamage's order.
Protect, Detect, Endure, Destiny Bond, Spite, Heal Bell, Disable, Encore,
Attract, Mist, Focus Energy, Haze, the healing moves and Rest, Mean Look,
Pain Split, Belly Drum, Psych Up, Safeguard, Perish Song, Spikes, Rapid
Spin, AncientPower and Future Sight now run, with Future Sight, Perish
Song, Safeguard and Encore handled between turns and Spikes on entry.
A trainer's party struct now follows its Pokémon where the original
updates it, and the enemy's moves spend PP there or in the wild
Pokémon's kept PP, so a caught Pokémon keeps the PP it used.
Part of #28
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Battle PACK opens the Balls pocket and runs PokeBallEffect: the Poké,
Great, Ultra and Master Ball multipliers, the original HP arithmetic
(including the overflow above 341 maximum HP), the sleep/freeze bonus
(BRN/PSN/PAR add nothing), HELD_CATCH_CHANCE and the catch draw.
GetPokeBallWobble draws per shake from WobbleProbabilities and picks the
break-free text. Trainer battles block the ball but still use it and the
turn.
A catch reloads the Pokémon as LoadEnemyMon does (the wild item roll is
redrawn, then the item restored), keeps its HP, status, item and DVs,
restores the moves and PP it appeared with, adds it to the party with
SetCaughtData, registers it and offers a nickname with InitName's
default. A catch with six Pokémon needs the PC and is refused.
catchtutorial runs BATTLETYPE_TUTORIAL as "DUDE": no send-out, an
automatic catch that keeps nothing and prompts that continue on their
own. Both Route 29 triggers, declining and the Dude's repeat offer run
from the ROM. The text reader now handles TX_LOW.
PLAN.md gains a status overview and done/remaining checklists; the
README, help dialog, routine map and handoff describe the milestone.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>