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; otherwise outdoors. */ export function foundationFixture( assets: CrystalAssets, room: boolean | "poster" | "center", ) { 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") { world.state.party = [155, 16].map((species, i) => generatePartyMon(assets.pokemon, { species, level: 8 - i * 4, item: 0, otId: world.playerId, ot: "CHRIS", dvs: 0x9abc, caughtData: 0, }), ); world.state.bag.items = [{ item: 18, quantity: 5 }]; // POTION } const save = world.save(); const [map, x, y] = room === "center" ? ["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; }