Port the Pokégear, phone calls and Mom's bank
Checks / web (push) Canceled after 0s

POKéGEAR in the start menu runs the clock, Town Map and phone cards with
the original joypad rules. Calls to Elm and Mom run their callee scripts,
with the out-of-area and out-of-hours cases and HangUp's corrected timing.
Mom saves a quarter of trainer prizes once asked, talking to her at home
opens BankOfMom (GET, SAVE, CHANGE and the DST checks) with its digit
amount box, and MomTriesToBuySomething buys items and dolls with her
savings. Saves gain Mom's money, her next item and its trigger balance.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sébastien QUEROLandClaude Opus 5.5 committed 2026-10-01 11:38:22 +02:00
1 parent 3456aa4e11
commit 209778cabe
29 files changed
+2726 -47

No files matched your search

+38 -6
View File
@@ -5,10 +5,13 @@ import { generatePartyMon } from "../src/game/party/pokemon";
/** `room` places the player at the bedroom PC or poster, "center" at
* Cherrygrove's Pokémon Center PC with two Pokémon ("candy": the first at
* level 13, with a Rare Candy); otherwise outdoors. */
* level 13, with a Rare Candy); otherwise outdoors ("pokegear": with the
* Pokégear, its map and phone cards, and Mom's and Elm's numbers). "mom"
* faces Mom in the living room after the Mystery Egg, with her bank open
* and ¥2300 saved. */
export function foundationFixture(
assets: CrystalAssets,
room: boolean | "poster" | "center" | "candy",
room: boolean | "poster" | "center" | "candy" | "pokegear" | "mom",
) {
const world = new GameWorld(
assets,
@@ -32,21 +35,50 @@ export function foundationFixture(
world.state.bag.items = [{ item: 18, quantity: 5 }]; // POTION
if (room === "candy") world.state.bag.items.push({ item: 0x20, quantity: 1 });
}
if (room === "pokegear" || room === "mom") {
world.state.party = [
generatePartyMon(assets.pokemon, {
species: 155,
level: 8,
item: 0,
otId: world.playerId,
ot: "CHRIS",
dvs: 0x9abc,
caughtData: 0,
}),
];
for (const flag of [OW.ENGINE_MAP_CARD, OW.ENGINE_PHONE_CARD, 4])
world.state.flags.add(flag); // 4: ENGINE_POKEGEAR
world.state.phone = [OW.PHONECONTACT_MOM, OW.PHONECONTACT_ELM];
world.state.events.add(26); // EVENT_GOT_A_POKEMON_FROM_ELM
// Walking outside clears the bedroom's temporary events.
for (let event = 0; event < 8; event++) world.state.events.delete(event);
}
if (room === "mom") {
// EVENT_GOT_MYSTERY_EGG_FROM_MR_POKEMON, EVENT_GAVE_MYSTERY_EGG_TO_ELM
// and EVENT_TALKED_TO_MOM_AFTER_MYSTERY_EGG_QUEST.
for (const event of [30, 31, 64]) world.state.events.add(event);
world.state.flags.add(OW.ENGINE_MOM_ACTIVE);
world.state.scenes["24:6"] = 1;
world.state.momsMoney = 2300;
}
const save = world.save();
const [map, x, y] =
room === "center" || room === "candy"
? ["26:5", 9, 2]
: room === "poster"
? ["24:7", 6, 1]
: room
? ["24:7", 2, 2]
: ["24:4", 9, 6];
: room === "mom"
? ["24:6", 7, 3]
: room && room !== "pokegear"
? ["24:7", 2, 2]
: ["24:4", 9, 6];
world.restore({
...save,
map,
x,
y,
direction: "up",
direction: room === "mom" ? "down" : "up",
objects: [],
});
return world;