Open Routes 38 to 41, Olivine and Cianwood to the Mineral Badge (#32)
Enable Route 38 and its Ecruteak gate, Route 39 with the MooMoo farm, Olivine City and its buildings, the Lighthouse's six floors, Routes 40 and 41, and Cianwood City with its gym, pharmacy, Photo Studio, Mania's house, the Poke Seer and the Lugia speech house. Olivine's port, the Battle Tower gate and Whirl Islands stay closed. The story runs from the rival in Olivine through Jasmine and Amphy, Suicune and Eusine, the SecretPotion, Chuck's boulders, the STORMBADGE, TM01 and HM02, back to Amphy's cure, Jasmine, the MINERALBADGE and TM23. Port GiveShuckle and ReturnShuckie with every return code and Mania's wrong last-Pokemon speech, PokeSeer with its high-byte-only OT check and reused caught level, PhotoStudio's no-printer path (Printer Error 2), and PlaySlowCry. wMooMooBerries joins the saved script bytes. Port trainer item AI: the 13 healing, status and X items, the highest-level gate, item use while Mean Look or Wrap prevents switching, and the original's random and state quirks, checked against the ROM over 5,632 states. Leaders with items are no longer refused. Game Corner sprites match the original frame by frame: cursor and reel positions, Golem's whole-frame flips, frame timing, the frame a removed sprite is still drawn, and the Golem roll's screen shake. The Burned Tower rival's garbage trainer header is documented as a boundary: its seen text dispatches text command $7f into home code before any battle. The playthrough continues for six stages to Jasmine; its driver can Surf, fish and travel through floors joined by holes. New tests cover trainer items, Olivine and Cianwood side content, and reference checks for trainer items, trainer sight and Game Corner animations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c4e8521d4
commit
b5c2b19094
29 files changed
+2708
-139
No files matched your search
@@ -105,6 +105,44 @@ const EVENT_RELEASED_THE_BEASTS = 0x7b,
|
||||
RAIKOU = 0xf3,
|
||||
ENTEI = 0xf4,
|
||||
ROUTE_42 = "2:5";
|
||||
const ROUTE_38_GATE = "1:9",
|
||||
ROUTE_38 = "1:12",
|
||||
ROUTE_39 = "1:13",
|
||||
OLIVINE = "1:14",
|
||||
OLIVINE_CENTER = "1:1",
|
||||
OLIVINE_GYM = "1:2",
|
||||
OLIVINE_CAFE = "1:7",
|
||||
GOOD_ROD_HOUSE = "1:6",
|
||||
OLIVINE_MART = "1:8",
|
||||
LIGHTHOUSE = ["3:42", "3:43", "3:44", "3:45", "3:46", "3:47"],
|
||||
ROUTE_40 = "22:1",
|
||||
ROUTE_41 = "22:2",
|
||||
CIANWOOD = "22:3",
|
||||
CIANWOOD_GYM = "22:5",
|
||||
CIANWOOD_CENTER = "22:6",
|
||||
CIANWOOD_PHARMACY = "22:7";
|
||||
const GOOD_ROD = 0x3b,
|
||||
SECRETPOTION = 0x43,
|
||||
HM02 = 0xf4,
|
||||
HM03 = 0xf5,
|
||||
HM04 = 0xf6,
|
||||
KRABBY = 98,
|
||||
SURF = 0x39,
|
||||
STRENGTH = 0x46,
|
||||
EVENT_GOT_HM04_STRENGTH = 0x13,
|
||||
EVENT_GOT_GOOD_ROD = 0x18,
|
||||
EVENT_RIVAL_OLIVINE_CITY = 0x6c3,
|
||||
EVENT_JASMINE_EXPLAINED_AMPHYS_SICKNESS = 0x37,
|
||||
EVENT_FOUGHT_EUSINE = 0x333,
|
||||
EVENT_GOT_SECRETPOTION_FROM_PHARMACY = 0x23,
|
||||
EVENT_BEAT_CHUCK = 0x4c2,
|
||||
EVENT_GOT_TM01_DYNAMICPUNCH = 0xa,
|
||||
EVENT_GOT_HM02_FLY = 0x11,
|
||||
EVENT_JASMINE_RETURNED_TO_GYM = 0x20,
|
||||
EVENT_BEAT_JASMINE = 0x4c1,
|
||||
EVENT_GOT_TM23_IRON_TAIL = 0xd,
|
||||
ENGINE_MINERALBADGE = 31,
|
||||
ENGINE_STORMBADGE = 32;
|
||||
|
||||
/** The acceptance run for PLAN section 2: a new game played from the
|
||||
* introduction to the catching tutorial through the world's own inputs,
|
||||
@@ -131,6 +169,8 @@ describe.skipIf(!existsSync(romPath))(
|
||||
train,
|
||||
stairs,
|
||||
route,
|
||||
travel,
|
||||
sail,
|
||||
toChoice,
|
||||
choose,
|
||||
choosePack,
|
||||
@@ -798,5 +838,191 @@ describe.skipIf(!existsSync(romPath))(
|
||||
reload();
|
||||
writeTestSave("ecruteak-city");
|
||||
}, 240_000);
|
||||
|
||||
it("crosses Routes 38 and 39 to Olivine City, where the rival is waiting", () => {
|
||||
traceFailures();
|
||||
// Ecruteak's west gate and the gate's own west side are edge warps.
|
||||
exit(ROUTE_38_GATE, "left");
|
||||
exit(ROUTE_38, "left");
|
||||
cross("left", ROUTE_39);
|
||||
cross("down", OLIVINE);
|
||||
// OlivineCityRivalSceneTop/Bottom: the way from Route 39 to the
|
||||
// Pokémon Center crosses one of the two coordinate events.
|
||||
heal(OLIVINE_CENTER, OLIVINE);
|
||||
expect(p.log.join(" ")).toContain("GYM LEADER isn't\nhere.");
|
||||
expect(p.world.state.events.has(EVENT_RIVAL_OLIVINE_CITY)).toBe(true);
|
||||
reload();
|
||||
}, 240_000);
|
||||
|
||||
it("gets HM04 and the Good Rod, fishes up a Krabby and teaches it Surf", () => {
|
||||
traceFailures();
|
||||
enter(OLIVINE_CAFE, "up");
|
||||
talkTo(p.world.map.objects[0].id); // OLIVINECAFE_SAILOR1
|
||||
play();
|
||||
expect(p.world.state.events.has(EVENT_GOT_HM04_STRENGTH)).toBe(true);
|
||||
exit(OLIVINE);
|
||||
enter(GOOD_ROD_HOUSE, "up");
|
||||
talkTo(p.world.map.objects[0].id);
|
||||
play([1]);
|
||||
expect(p.world.state.events.has(EVENT_GOT_GOOD_ROD)).toBe(true);
|
||||
expect(p.world.state.bag.keyItems).toContain(GOOD_ROD);
|
||||
exit(OLIVINE);
|
||||
// Olivine's Mart has Great Balls, not Poké Balls.
|
||||
enter(OLIVINE_MART, "up");
|
||||
buy(p.world.map.objects[0].id, C.GREAT_BALL, 5);
|
||||
exit(OLIVINE);
|
||||
// Typhlosion cannot learn Surf: fish a Krabby (FISHGROUP_SHORE's
|
||||
// Good Rod table) from the nearest shore tile facing open water.
|
||||
const STEP = { up: [0, -1], down: [0, 1], left: [-1, 0], right: [1, 0] } as const;
|
||||
const map = p.world.map;
|
||||
const shore = (Object.keys(STEP) as (keyof typeof STEP)[])
|
||||
.flatMap((face) =>
|
||||
Array.from({ length: map.width * map.height }, (_, i) => {
|
||||
const x = i % map.width,
|
||||
y = Math.floor(i / map.width);
|
||||
const [dx, dy] = STEP[face];
|
||||
if (p.world.assets.collision(map, x + dx, y + dy) !== 0x29) return [];
|
||||
try {
|
||||
return [{ x, y, face, length: findPath(p.world, x, y).length }];
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}).flat(),
|
||||
)
|
||||
.sort((a, b) => a.length - b.length)[0];
|
||||
walk(shore.x, shore.y);
|
||||
p.wanted = KRABBY;
|
||||
for (let cast = 0; cast < 40; cast++) {
|
||||
if (p.world.state.party.some((mon) => mon.species === KRABBY)) break;
|
||||
p.world.move(shore.face);
|
||||
expect(p.world.openStartMenu()).toBe(true);
|
||||
choose("PACK");
|
||||
choosePack(GOOD_ROD);
|
||||
choose("USE");
|
||||
play();
|
||||
}
|
||||
p.wanted = 0;
|
||||
const krabby = p.world.state.party.findIndex((mon) => mon.species === KRABBY);
|
||||
expect(krabby).toBeGreaterThan(0);
|
||||
p.teach(HM03, krabby);
|
||||
// Strength replaces Tackle (the first move) on the lead.
|
||||
p.teach(HM04, 0);
|
||||
expect(p.world.state.party[krabby].moves).toContain(SURF);
|
||||
expect(lead().moves).toContain(STRENGTH);
|
||||
reload();
|
||||
}, 240_000);
|
||||
|
||||
it("climbs the Lighthouse to Jasmine and her sick Ampharos", () => {
|
||||
traceFailures();
|
||||
enter(LIGHTHOUSE[0], "up");
|
||||
// Two stairways and the outside ledges lead up; Jasmine stands by
|
||||
// Amphy in 6F's far corner.
|
||||
expect(route(LIGHTHOUSE[5], LIGHTHOUSE, 12, { x: 8, y: 9 })).toBe(true);
|
||||
talkTo(p.world.map.objects[0].id); // OLIVINELIGHTHOUSE6F_JASMINE
|
||||
play();
|
||||
expect(p.world.state.events.has(EVENT_JASMINE_EXPLAINED_AMPHYS_SICKNESS)).toBe(true);
|
||||
expect(p.log.join(" ")).toContain("wonderful PHARMACY\nin CIANWOOD");
|
||||
reload();
|
||||
}, 240_000);
|
||||
|
||||
it("drops back down the Lighthouse and surfs Routes 40 and 41 to Cianwood City", () => {
|
||||
traceFailures();
|
||||
// The holes by the windows drop to the floor below; some land in
|
||||
// corners cut off from the next hole, so search the floors.
|
||||
travel(OLIVINE, LIGHTHOUSE);
|
||||
heal(OLIVINE_CENTER, OLIVINE);
|
||||
cross("left", ROUTE_40);
|
||||
cross("down", ROUTE_41, { water: true });
|
||||
cross("left", CIANWOOD, { water: true });
|
||||
expect(p.world.mapId).toBe(CIANWOOD);
|
||||
reload();
|
||||
}, 240_000);
|
||||
|
||||
it("meets Suicune and Eusine, gets the SecretPotion and beats Chuck for the STORMBADGE and HM02", () => {
|
||||
traceFailures();
|
||||
sail(23, 44); // ashore by the Pokémon Center
|
||||
heal(CIANWOOD_CENTER, CIANWOOD);
|
||||
// ReleaseTheBeasts armed SCENE_CIANWOODCITY_SUICUNE_AND_EUSINE; its
|
||||
// coordinate event is on the way north.
|
||||
walk(11, 16);
|
||||
expect(p.world.state.events.has(EVENT_FOUGHT_EUSINE)).toBe(true);
|
||||
expect(p.log.join(" ")).toContain("SUICUNE running on\nthe waves.");
|
||||
heal(CIANWOOD_CENTER, CIANWOOD);
|
||||
enter(CIANWOOD_PHARMACY, "up");
|
||||
talkTo(p.world.map.objects[0].id);
|
||||
play();
|
||||
expect(p.world.state.events.has(EVENT_GOT_SECRETPOTION_FROM_PHARMACY)).toBe(true);
|
||||
expect(p.world.state.bag.keyItems).toContain(SECRETPOTION);
|
||||
// Afterwards the pharmacist runs MARTTYPE_PHARMACY.
|
||||
buy(p.world.map.objects[0].id, C.SUPER_POTION, 10);
|
||||
exit(CIANWOOD);
|
||||
// The four black belts stand on the way to the boulders.
|
||||
enter(CIANWOOD_GYM, "up");
|
||||
walk(3, 8);
|
||||
exit(CIANWOOD);
|
||||
// Chuck's Poliwrath can win with critical hits; a loss whites out to
|
||||
// Cianwood's Pokémon Center and the boulders go back in place.
|
||||
for (let attempt = 0; attempt < 3; attempt++) {
|
||||
if (p.world.state.events.has(EVENT_BEAT_CHUCK)) break;
|
||||
heal(CIANWOOD_CENTER, CIANWOOD);
|
||||
enter(CIANWOOD_GYM, "up");
|
||||
walk(3, 8);
|
||||
// AskStrengthScript from the left boulder, then push it up, the
|
||||
// right one up and the middle one left into the gap.
|
||||
p.world.move("up");
|
||||
p.world.interact();
|
||||
play([1]);
|
||||
p.world.move("up");
|
||||
play();
|
||||
walk(5, 8);
|
||||
p.world.move("up");
|
||||
play();
|
||||
walk(5, 7);
|
||||
p.world.move("left");
|
||||
play();
|
||||
walk(4, 2);
|
||||
p.world.move("up");
|
||||
p.world.interact();
|
||||
play([1]);
|
||||
}
|
||||
expect(p.world.state.events.has(EVENT_BEAT_CHUCK)).toBe(true);
|
||||
expect(p.world.state.flags.has(ENGINE_STORMBADGE)).toBe(true);
|
||||
expect(p.world.state.events.has(EVENT_GOT_TM01_DYNAMICPUNCH)).toBe(true);
|
||||
expect(p.world.state.bag.tmsHms[0]).toBe(1); // TM01
|
||||
exit(CIANWOOD);
|
||||
talkTo(p.world.map.objects[9].id); // CIANWOODCITY_POKEFAN_F
|
||||
play();
|
||||
expect(p.world.state.events.has(EVENT_GOT_HM02_FLY)).toBe(true);
|
||||
expect(p.world.state.bag.tmsHms[51]).toBe(1); // HM02
|
||||
reload();
|
||||
writeTestSave("cianwood-city");
|
||||
}, 240_000);
|
||||
|
||||
it("brings the SecretPotion to Amphy and beats Jasmine for the MINERALBADGE and TM23", () => {
|
||||
traceFailures();
|
||||
// Nobody in the party learns Fly; surf back.
|
||||
cross("right", ROUTE_41, { water: true });
|
||||
cross("up", ROUTE_40, { water: true });
|
||||
cross("right", OLIVINE, { water: true });
|
||||
heal(OLIVINE_CENTER, OLIVINE);
|
||||
enter(LIGHTHOUSE[0], "up");
|
||||
expect(route(LIGHTHOUSE[5], LIGHTHOUSE, 12, { x: 8, y: 9 })).toBe(true);
|
||||
talkTo(p.world.map.objects[0].id);
|
||||
play([1]);
|
||||
expect(p.world.state.events.has(EVENT_JASMINE_RETURNED_TO_GYM)).toBe(true);
|
||||
expect(p.world.state.bag.keyItems).not.toContain(SECRETPOTION);
|
||||
travel(OLIVINE, LIGHTHOUSE);
|
||||
heal(OLIVINE_CENTER, OLIVINE);
|
||||
enter(OLIVINE_GYM, "up");
|
||||
talkTo(p.world.map.objects[0].id);
|
||||
play([1]);
|
||||
expect(p.world.state.events.has(EVENT_BEAT_JASMINE)).toBe(true);
|
||||
expect(p.world.state.flags.has(ENGINE_MINERALBADGE)).toBe(true);
|
||||
expect(p.world.state.events.has(EVENT_GOT_TM23_IRON_TAIL)).toBe(true);
|
||||
expect(p.world.state.bag.tmsHms[22]).toBe(1); // TM23
|
||||
exit(OLIVINE);
|
||||
reload();
|
||||
writeTestSave("olivine-city");
|
||||
}, 240_000);
|
||||
},
|
||||
);
|
||||
Reference in new issue
Block a user