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:

PhaseStateDescription
Cost promptInnConfirmShows cost for one stay and a Yes / No cursor.
CommitDeducts 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 InnConfirm entry sub-screen. Pending overlay_shop_save capture.
  • 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.members without a slot-active gate.

Full reference

Complete flow and provenance at docs/subsystems/inn.md. Source: crates/engine-core/src/inn.rs.