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
@@ -52,6 +52,8 @@ describe.skipIf(!existsSync(romPath))("trainer battles", () => {
|
||||
party: trainers.createParty(trainer),
|
||||
aiFlags: trainer.attributes.aiMoveFlags,
|
||||
switchFlags: trainer.attributes.aiItemSwitchFlags,
|
||||
items: [...trainer.attributes.items] as [number, number],
|
||||
baseReward: trainer.attributes.baseReward,
|
||||
reward: trainer.reward,
|
||||
},
|
||||
};
|
||||
@@ -302,4 +304,55 @@ describe.skipIf(!existsSync(romPath))("trainer battles", () => {
|
||||
expect(result.result).toBe(0);
|
||||
expect(result.texts).toContain("was defeated!");
|
||||
});
|
||||
it("Clair's AI_TryItem heals her Kingdra with the real Hyper Potion, stranding the Full Heal behind it", () => {
|
||||
// CLAIR's real class attributes (items.asm): FULL_HEAL then HYPER_POTION,
|
||||
// CONTEXT_USE and SWITCH_SOMETIMES. Her Kingdra (party index 3, level
|
||||
// 40) is the only one of her four Pokémon .IsHighestLevel ever lets use
|
||||
// an item; the other three are level 37. A single Kingdra, taken from
|
||||
// her real ROM party and class data, is enough to exercise that gate
|
||||
// through a real Battle.run(), without needing her map open yet.
|
||||
const clair = trainers.trainer(8, 1);
|
||||
expect(clair.name).toBe("CLAIR");
|
||||
expect(clair.attributes.items).toEqual([0x26, 0x10]); // FULL_HEAL, HYPER_POTION
|
||||
const kingdra = trainers.createParty(clair)[3];
|
||||
expect(kingdra.species).toBe(230); // KINGDRA
|
||||
// Well under a quarter of max HP: AI_TryItem heals on Clair's very
|
||||
// first turn, before any Random draw.
|
||||
kingdra.hp = Math.floor(kingdra.stats[0] / 10);
|
||||
const weak = generatePartyMon(assets.pokemon, {
|
||||
species: 155, level: 5, item: 0, otId: 1234, ot: "CHRIS", dvs: 0x823b, caughtData: 0,
|
||||
});
|
||||
weak.moves = [33, 0, 0, 0]; // Tackle: never one-shots a level 40 Kingdra
|
||||
weak.pp = [35, 0, 0, 0];
|
||||
let seed = 1;
|
||||
const options: BattleOptions = {
|
||||
data: assets.pokemon,
|
||||
party: [weak],
|
||||
playerId: 1234,
|
||||
playerName: "CHRIS",
|
||||
timeOfDay: 1,
|
||||
pokedex: { seen: new Set(), caught: new Set() },
|
||||
random: () => {
|
||||
seed = (seed * 1103515245 + 12345) >>> 0;
|
||||
return (seed >>> 16) & 255;
|
||||
},
|
||||
text: () => defaultTextContext("CHRIS"),
|
||||
trainer: {
|
||||
name: clair.name,
|
||||
className: clair.className,
|
||||
party: [kingdra],
|
||||
aiFlags: clair.attributes.aiMoveFlags,
|
||||
switchFlags: clair.attributes.aiItemSwitchFlags,
|
||||
items: [...clair.attributes.items] as [number, number],
|
||||
baseReward: clair.attributes.baseReward,
|
||||
reward: clair.reward,
|
||||
},
|
||||
};
|
||||
const before = kingdra.hp;
|
||||
const result = finish(new Battle(options));
|
||||
expect(result.texts).toContain("LEADER CLAIR used HYPER POTION on KINGDRA!");
|
||||
// The Full Heal is still held; it is the Hyper Potion slot that empties.
|
||||
expect(options.trainer!.items).toEqual([0x26, 0]);
|
||||
expect(kingdra.hp).toBeGreaterThan(before);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user