mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
dnd_zone_cmd.go ships handleDnDZoneCmd with subdispatch over the D1b state machine: list, enter <id|#|name>, status, map, advance, abandon. Bare !zone (or !zone list) shows zones available at the player's level with !zone enter hints; an active run is flagged inline so the player can't lose track of it. Enter resolves zone input by ID, 1-based list index, or display name (case/whitespace-insensitive, "the " prefix tolerated), and rejects unknown / tier-locked zones plus duplicate concurrent runs without clobbering the active run. Status reports current room / cleared / loot / GM mood with a band label (effusive/friendly/neutral/grumpy/ hostile per design doc §3.2). Map prints an ASCII layout with ✓ for cleared rooms and ▶ for the current room. Advance is a deliberate D1c stub that calls markRoomCleared and reports the next room — combat resolution per room wires in D1e. Abandon delegates to abandonZoneRun and is idempotent (no-active surfaces a friendly DM, not an error). Wired into adventure.go OnMessage right after the existing D&D commands. 10 new tests cover dispatch (no-char nudge, list with char, enter by ID and by index, unknown-zone rejection, duplicate-run guard, status/map with no run, advance moves the room cursor, abandon clears active and is idempotent), resolveZoneInput across ID/display/index/ case forms, and gmMoodLabel band edges. Full repo test suite green (modulo a pre-existing RNG flake in TestSimulateCombat_FirstAttackBonusImprovesEarlyHits unrelated to this change). TwinBee narration + mood triggers land in D1d. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
12 KiB
12 KiB