Open Routes 35 to 37, the National Park and Ecruteak to the Fog Badge (#32)
Enable Route 35, Route 36, Route 37, the National Park and its gates, Ecruteak City and its buildings, the Tin Tower entrance, the Wise Trio's room and both floors of the Burned Tower. The story runs from Floria, the SquirtBottle and Sudowoodo through the Kimono Girls' HM03 Surf, the rival in the Burned Tower and the beasts' release to Ecruteak Gym, Morty, the FOGBADGE and TM30. Port roaming Pokémon (InitRoamMons, UpdateRoamMons, JumpRoamMons, CheckEncounterRoamMon) with their state in the save; only Continue moves them on restore, so a failed import's rollback keeps them in place. Port the Bug-Catching Contest: registration on contest days, Park Balls, contestants, the timer, QUIT, the catch-and-swap prompt, judging from the ROM's contestant table, prizes and the saved contest state. Port the Game Corner's SlotMachine and CardFlip on a new realtime tile screen that advances two frames per tick with buffered buttons: reel strips and scrolling, bias tables, the seven streak, Golem and Chansey, payouts, the Card Flip board, cursor and navigation. Their tilemaps are checked against the ROM's own data. Also port getnum, a plain warp that continues its script on the new map, and PokemonNames' EGG entry. A trainer whose script is ObjectEvent (the Burned Tower rival) is no longer sighted once its own flag is set, as the original's read of bit 1 of wNumKeyItems gives with the usual key items. The playthrough walks through the National Park and continues to Morty; its driver chooses moves by type matchup, buys at Marts and uses Super Potions and Awakenings in trainer battles. New tests cover roaming, the contest, the Game Corner and Ecruteak's side content. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0930b780fc
commit
2640fa2725
31 files changed
+4743
-91
No files matched your search
@@ -79,6 +79,15 @@ const OPPOSITE = { up: "down", down: "up", left: "right", right: "left" } as con
|
||||
const edges = (tile: number): readonly Direction[] =>
|
||||
(tile & 0xf0) === 0xb0 || (tile & 0xf0) === 0xc0 ? EDGES[tile & 7] : [];
|
||||
|
||||
/** CheckWarpCollision's own two hazard nybbles ($6x pits, $7x doors/
|
||||
* stairs/carpets): a tile only needs avoiding here if stepping onto it
|
||||
* could actually trigger a warp. Burned Tower B1F's fall/ladder warps
|
||||
* (e.g. the coordinates `warpcheck` and a `changeblock`-revealed ladder
|
||||
* read) sit on ordinary $00 floor and never fire from an ordinary step,
|
||||
* so they are left walkable like any other floor tile. */
|
||||
const isWarpHazard = (tile: number) =>
|
||||
(tile & 0xf0) === 0x60 || (tile & 0xf0) === 0x70;
|
||||
|
||||
/** Shortest walkable path on the current map, avoiding other warps. */
|
||||
export function findPath(
|
||||
world: GameWorld,
|
||||
@@ -108,6 +117,7 @@ export function findPath(
|
||||
if (world.objects().some((object) => object.x === x && object.y === y))
|
||||
continue;
|
||||
if (
|
||||
isWarpHazard(tile) &&
|
||||
world.map.warps.some((warp) => warp.x === x && warp.y === y) &&
|
||||
(x !== targetX || y !== targetY)
|
||||
)
|
||||
@@ -158,3 +168,14 @@ export function withoutPlayTime<T extends { gameTime?: unknown }>(save: T) {
|
||||
const { gameTime: _, ...rest } = save;
|
||||
return rest;
|
||||
}
|
||||
|
||||
/** Restoring a save always moves the roam-mon bookkeeping to the map just
|
||||
* loaded (Continue's own farcall JumpRoamMons, then _BackUpMapIndices),
|
||||
* even before any roaming Pokémon has been released; a round-trip
|
||||
* comparison needs `reloaded`'s own `roamMons`/`roamMonsMap` in place of
|
||||
* `saved`'s to still match everything else exactly. */
|
||||
export function afterRestore<
|
||||
T extends { roamMons?: unknown; roamMonsMap?: unknown },
|
||||
>(saved: T, reloaded: T) {
|
||||
return { ...saved, roamMons: reloaded.roamMons, roamMonsMap: reloaded.roamMonsMap };
|
||||
}
|
||||
Reference in new issue
Block a user