import { CrystalAssets } from "../src/game/rom/assets"; import { GameWorld } from "../src/game/world/world"; import { OW } from "../src/game/world/constants"; 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. */ export function foundationFixture( assets: CrystalAssets, room: boolean | "poster" | "center" | "candy", ) { const world = new GameWorld( assets, () => new Date("2026-09-22T12:00:00"), () => 0, ); world.state.scenes["24:4"] = 1; world.state.bag.keyItems.push(OW.BICYCLE); if (room === "center" || room === "candy") { world.state.party = [155, 16].map((species, i) => generatePartyMon(assets.pokemon, { species, level: room === "candy" && !i ? 13 : 8 - i * 4, item: 0, otId: world.playerId, ot: "CHRIS", dvs: 0x9abc, caughtData: 0, }), ); world.state.bag.items = [{ item: 18, quantity: 5 }]; // POTION if (room === "candy") world.state.bag.items.push({ item: 0x20, quantity: 1 }); } 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]; world.restore({ ...save, map, x, y, direction: "up", objects: [], }); return world; }