Inn
HP / MP restore flow at in-game inns. Lives inside the menu overlay (same 129-function binary as shop, save screen, and status screens). Clean-room session state: engine-core::inn::InnSession. Per-scene costs are pending a full trace of overlay_shop_save.
Flow
The retail engine enters the inn from the field-VM shop-trigger opcode (same entry point as the shop, different sub-screen ID). Two phases:
| Phase | State | Description |
|---|---|---|
| Cost prompt | InnConfirm | Shows cost for one stay and a Yes / No cursor. |
| Commit | — | Deducts gold; restores all active party members’ HP and MP to their current maxima. |
On commit: InnSession::can_afford(world_money) gates the transaction. If affordable, gold is deducted (World::money -= cost) and every active roster member gets hp_cur = hp_max, mp_cur = mp_max. save_party() is called to sync the roster records.
InnSession
InnSession { cost: u32 } is installed on MenuRuntime by open_inn(cost) before the menu VM enters InnConfirm. can_afford(world_money: i32) -> bool checks world_money ≥ cost.
Open items
- Per-scene costs. Retail inn prices are in the menu overlay DATA segment. Locating them requires tracing the
InnConfirmentry sub-screen. Pendingoverlay_shop_savecapture. - Render layout. Cost prompt pixel offsets and layout pending overlay trace.
- Party filtering. Retail may only restore active-roster members (not reserve bench). The current port iterates all
World::roster.memberswithout a slot-active gate.
Full reference
Complete flow and provenance at docs/subsystems/inn.md. Source: crates/engine-core/src/inn.rs.