Port Fly, Dig, Teleport and the Escape Rope
FLY opens _FlyMap in the party menu: the region's Town Map with "Where?", the visited flypoints in turn and the Fly user's icon, then FlyScript flies the icon off along SpriteAnimFunc_FlyFrom's path, enters the spawn point and lands it with SpriteAnimFunc_FlyTo. Teleport returns to the last Pokémon Center's town through IsSpawnPoint. Dig and the Escape Rope lead out of a cave to the warp EnterMapWarp's SaveDigWarp recorded, which saves now keep. newloadmap stops its script as StopScript does and the world resumes it on the new map, which the landing and return movements need. A destination that is not ported yet gives a notice. Closes #25 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c4cc0e756c
commit
a7aceda089
21 files changed
+1166
-97
No files matched your search
@@ -11,7 +11,14 @@ test.beforeEach(() =>
|
||||
|
||||
async function start(
|
||||
page: Page,
|
||||
room: boolean | "poster" | "center" | "candy" | "pokegear" | "mom" = false,
|
||||
room:
|
||||
| boolean
|
||||
| "poster"
|
||||
| "center"
|
||||
| "candy"
|
||||
| "pokegear"
|
||||
| "mom"
|
||||
| "fly" = false,
|
||||
) {
|
||||
await page.route("**/src/game/runtime.ts", async (route) => {
|
||||
const response = await route.fetch(),
|
||||
@@ -431,6 +438,48 @@ test("the options change the battle style and the menu account", async ({
|
||||
});
|
||||
});
|
||||
|
||||
test("Fly picks a visited town on the Fly map and lands there", async ({
|
||||
page,
|
||||
}) => {
|
||||
await start(page, "fly");
|
||||
const choices = page.locator("#dialogue-choice"),
|
||||
flyMap = page.locator("#fly-map"),
|
||||
bubble = page.locator("#fly-map-bubble");
|
||||
await page.keyboard.press("Enter");
|
||||
await choices.getByRole("option", { name: /^POKéMON/ }).click();
|
||||
await choices.getByRole("option", { name: /^PIDGEOT/ }).click();
|
||||
await choices.getByRole("option", { name: "FLY", exact: true }).click();
|
||||
await expect(flyMap).toBeVisible();
|
||||
await expect(page.locator("#native-dialogue")).toBeHidden();
|
||||
await expect(bubble).toContainText("Where?");
|
||||
await expect(bubble).toContainText("NEW BARK TOWN");
|
||||
await expect(page.locator("#fly-map-canvas")).toHaveAttribute(
|
||||
"aria-label",
|
||||
"Fly map: NEW BARK TOWN, you are here",
|
||||
);
|
||||
// Up skips to the next visited flypoint; B returns to the party menu.
|
||||
await page.keyboard.press("ArrowUp");
|
||||
await expect(bubble).toContainText("CHERRYGROVE CITY");
|
||||
await page.keyboard.press("KeyZ");
|
||||
await expect(flyMap).toBeHidden();
|
||||
await expect(page.locator("#dialogue-text")).toHaveText("Choose a POKéMON.");
|
||||
await choices.getByRole("option", { name: /^PIDGEOT/ }).click();
|
||||
await choices.getByRole("option", { name: "FLY", exact: true }).click();
|
||||
await page.keyboard.press("ArrowUp");
|
||||
await expect(bubble).toContainText("CHERRYGROVE CITY");
|
||||
await page.keyboard.press("KeyX");
|
||||
await expect(flyMap).toBeHidden();
|
||||
await page.clock.runFor(5_000);
|
||||
const screen = page.locator("#game-screen");
|
||||
await expect(screen).toHaveAttribute("data-map", "26:3");
|
||||
await expect(screen).toHaveAttribute("data-x", "29");
|
||||
await expect(screen).toHaveAttribute("data-y", "4");
|
||||
await expect(screen).toHaveAttribute("data-activity", "idle");
|
||||
await expect(page.locator("#game-notice")).toHaveText("");
|
||||
const { state } = await backup(page);
|
||||
expect([state.map, state.x, state.y]).toEqual(["26:3", 29, 4]);
|
||||
});
|
||||
|
||||
test("Mom keeps the player's money with the digit box", async ({ page }) => {
|
||||
await start(page, "mom");
|
||||
const text = page.locator("#dialogue-text"),
|
||||
|
||||
Reference in new issue
Block a user