Combat: wire turn-based elite/boss fights to the command surface

Routes Elite/Boss rooms off the auto-resolve SimulateCombat path and onto
the persisted turn-based engine. !zone advance now stops at an Elite/Boss
doorway; the player engages with !fight, then resolves one full round per
!attack / !flee. A won CombatSession is the record that the room's combat
is done, so a fresh !zone advance clears the room and advances the graph.

- buildZoneCombatants: shared player/enemy Combatant builder extracted from
  runZoneCombat; combatantsForSession rebuilds the pair from a session row.
- runCombatRound loops the phase state machine through a whole round;
  finishCombatSession runs HP/XP/loot/kill/threat/mood close-out.
- getCombatSessionForEncounter lets the room resolver tell "already won"
  apart from "not yet fought".
- !zone advance/enter/go blocked while a session is active.
- resolveBossRoom deleted (dead after the reroute).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-14 06:16:45 -07:00
parent 269d13ffe8
commit 886eb5a75b
8 changed files with 711 additions and 130 deletions

View File

@@ -321,6 +321,15 @@ func (p *AdventurePlugin) OnMessage(ctx MessageContext) error {
if p.IsCommand(ctx.Body, "zone") {
return p.handleDnDZoneCmd(ctx, p.GetArgs(ctx.Body, "zone"))
}
if p.IsCommand(ctx.Body, "fight") {
return p.handleFightCmd(ctx)
}
if p.IsCommand(ctx.Body, "attack") {
return p.handleAttackCmd(ctx)
}
if p.IsCommand(ctx.Body, "flee") {
return p.handleFleeCmd(ctx)
}
if p.IsCommand(ctx.Body, "expedition") {
return p.handleDnDExpeditionCmd(ctx, p.GetArgs(ctx.Body, "expedition"))
}