Port MAIL in the party menu and the PC's MAIL BOX

Giving MAIL opens the mail entry: two lines of up to sixteen characters,
kept with the player's name and ID, the holder's species and the MAIL.
The party submenu's MAIL reads the letter or takes it, either to the PC's
MAILBOX (ten at most) or into the pack without its message. The player's
PC lists the MAILBOX by author to read, put in the pack or attach, and
Bill's PC keeps a Pokémon holding MAIL out of the boxes. Saves keep each
holder's MAIL and the MAILBOX.

The letter shows its message and author natively; the stationery's
graphics are not drawn yet.

Closes #27

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Sébastien QUEROLandClaude Opus 5.5 committed 2026-10-03 01:10:08 +02:00
1 parent e2dc5ba520
commit 5c1ac9d726
17 files changed
+871 -54

No files matched your search

+37 -1
View File
@@ -20,7 +20,8 @@ async function start(
| "mom"
| "fly"
| "headbutt"
| "fishing" = false,
| "fishing"
| "mail" = false,
) {
await page.route("**/src/game/runtime.ts", async (route) => {
const response = await route.fetch(),
@@ -539,6 +540,41 @@ test("Select moves an item within the pack", async ({ page }) => {
]);
});
test("MAIL is written when given, and read from the party menu", async ({
page,
}) => {
await start(page, "mail");
const text = page.locator("#dialogue-text"),
choices = page.locator("#dialogue-choice"),
pack = page.locator("#mart"),
letter = page.locator("#mail-view");
await page.keyboard.press("Enter");
await choices.getByRole("option", { name: /^PACK/ }).click();
await pack.getByRole("button", { name: /^FLOWER MAIL/ }).click();
await choices.getByRole("option", { name: "GIVE", exact: true }).click();
await choices.getByRole("option", { name: /^CYNDAQUIL/ }).click();
await expect(text).toHaveText(/Made CYNDAQUIL\s+hold FLOWER MAIL\./);
await page.keyboard.press("KeyX");
await choices.getByLabel("MAIL line 1").fill("HELLO, CHRIS!");
await choices.getByLabel("MAIL line 2").fill("SEE YOU!");
await choices.getByRole("button", { name: "OK" }).click();
await expect(pack).toBeVisible();
await page.keyboard.press("KeyZ");
await choices.getByRole("option", { name: /^POKéMON/ }).click();
await choices.getByRole("option", { name: /^CYNDAQUIL/ }).click();
await choices.getByRole("option", { name: "MAIL", exact: true }).click();
await choices.getByRole("option", { name: "READ", exact: true }).click();
await expect(letter).toBeVisible();
await expect(page.locator("#mail-type")).toHaveText("FLOWER MAIL");
await expect(page.locator("#mail-message")).toHaveText(
"HELLO, CHRIS! \nSEE YOU!",
);
await expect(page.locator("#mail-author")).toHaveText("CHRIS");
await page.locator("#mail-close").click();
await expect(letter).toBeHidden();
await expect(page.locator("#game-notice")).toHaveText("");
});
test("the Old Rod hooks a Magikarp from New Bark Town's shore", async ({
page,
}) => {