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

+92 -1
View File
@@ -1,6 +1,6 @@
# Recovered Claude session
Latest continuation: see **Field moves, SEL and moving Pokémon: 2026-09-30**
Latest continuation: see **Mom's bank and her purchases: 2026-10-01**
at the end of this file. Earlier sections are historical snapshots.
Recovered on 2026-09-23 from the local Claude Code transcript
@@ -795,3 +795,94 @@ physical-device run.
Next: the Pokégear (clock, map, phone and radio cards), then the trainer
card and options; later the Fly map and Teleport/Dig warps (they need
script commands after a warp).
## The Pokégear, phone calls and Mom's savings: 2026-10-01
Resumed with "Continue the plan" after `3456aa4`, taking the recorded next
item (the Pokégear).
- `src/game/scripts/pokegear.ts` (`Pokegear`): POKéGEAR in the start menu
runs the clock, map and phone cards with the original joypad rules,
yielding a `pokegear` effect per card answered with a button name. The
world routes A/B/directions/Start/Select to it, keeps `world.pokegear` on
screen during call texts and refreshes the clock every tick. The radio
card (Goldenrod only) gives a notice.
- Calls: no-service text, two "……" rings, out-of-hours or same-map scripts,
otherwise the callee script from `PhoneContacts` in `ScriptRun` on the
start menu's draft (adopted with `Object.assign` when it ends), then
`HangUp`. Elm's and Mom's callee scripts run; Mom's lecture after the Dude
sets `ENGINE_MOM_SAVING_MONEY`.
- Interpreter: `random`, `givemoney`/`takemoney`/`checkmoney`/`getmoney`
for both accounts, `getcurlandmarkname`, `getlandmarkname` (operand order
checked against the macros), `ScriptHost.phoneService`, `landmarkName`.
`HangUp` is now "Click!" 10 ticks, then "……" 60 ticks (it was "Click!" for
140 ticks, double the original's 140 frames); two `mr-pokemon` assertions
were updated.
- Mom's savings: `momsMoney` in `ScriptState` and saves (migrated by absence
to 0). Battles take `mom: { saving, money }` and return `momMoney`;
`WinTrainerBattle.give_money` sends a quarter while she saves some.
`MomTriesToBuySomething` refuses once her balance reaches ¥900 (not
reachable in the open area).
- Map headers decode `phoneService`. New `POKEGEAR` profile table and OW
constants (landmark limits, card/Mom engine flags, money results), all
verified by `check:reference`.
- UI: `#pokegear` panel (card labels, clock, Town Map canvas with the
cursor frame, phone list with ▶/▷ and the submenu); the textbox is the
native dialogue, hidden on the map card; the minimap hides while it is
open. `drawTownMap` takes an optional card (region, player, cursor).
Checks: 381 unit tests with the local ROM (131 passed, 250 skipped without
it; new `tests/pokegear.test.ts`, plus Mom tests in `trainer-battle` and
`trainer-world`); 113 Chromium/WebKit browser tests passed, 19 skipped
intentionally (a new Pokégear flow in both browsers); native and reference
builds; reference, vendor and release checks; `git diff --check`. No
emulator comparison of the Pokégear; no CI or physical-device run. Not
committed.
Next: `BankOfMom` (talking to Mom after the Egg still refuses with special
34), then Mom's purchases (`MomTriesToBuySomething`, `wWhichMomItem`,
`wMomItemTriggerBalance`), the trainer card and options; later the Fly map
and Teleport/Dig warps.
## Mom's bank and her purchases: 2026-10-01
Resumed with "Continue the plan" on top of the uncommitted Pokégear
increment above (still not committed), taking the recorded next items.
- `src/game/scripts/mom.ts` (`bankOfMom`): `BankOfMom` as a special. First
visit: `MomLeavingText1`–`3` and the saving question; later: "Or is this
about your money?", then GET/SAVE/CHANGE/CANCEL from
`BankOfMom_MenuHeader`. The amount box is a `mombank` effect answered
with button names (the world routes A, B and directions to it like the
Pokégear, via `buttonChoice`). `DigitQuantities` is read from the ROM;
`GiveMoney`/`TakeMoney` limits, cursor 0–5 starting on 5, zero or B
cancels, refusals return to a fresh box. Declining runs `DSTChecks`
(near-midnight booklet refusal; `shiftClockHour` wraps `minuteOffset`
into ±720 and moves `weekdayOffset` the other way).
- `MomTriesToBuySomething` is ported (it had to be: deposits make the ¥900
trigger reachable at once, and it refused after every trainer win):
MomItems_2 triggers, the ¥2300 `wMomItemTriggerBalance` steps with the
exact-match `RandomRange(5)` MomItems_1 purchase, PC items (full PC
cancels), doll decoration events, and the call through the existing
`memscript` path (`Script_ReceivePhoneCall` with
`Mom_GetScriptPointer`'s item or doll script). `.ASMFunction`'s cost and
`wWhichMomItem` are applied when the call is queued. `randomRange` is
shared with `Script_random`.
- Saves gained `momItem` (0–10) and `momItemTriggerBalance`, migrated by
absence to 0 and ¥2300.
- New `MOM` profile table and extra `POKEGEAR` entries (MomItems lists,
item/doll scripts), verified by `check:reference`.
- UI: the amount box in the dialogue choice (`.mom-bank`, a blinking digit
that respects reduced motion) with ◀ ▼ ▲ ▶, OK and CANCEL buttons.
Checked visually at desktop and 390px widths.
Checks: 398 unit tests with the local ROM (132 passed, 266 skipped without
it; new `tests/mom.test.ts`, purchase tests replace the refusal test in
`tests/trainer-world.test.ts`); 115 Chromium/WebKit browser tests passed,
19 skipped intentionally (new deposit flow in both browsers); native and
reference builds; reference, vendor and release checks; `git diff --check`.
No emulator comparison of the bank or purchases; no CI or physical-device
run. Not committed.
Next: the trainer card and options; later the Fly map and Teleport/Dig
warps.