fix(combat): Block run action when cant_charge flag is set

SRD Conditions Fatigued: A fatigued character can neither run nor
charge. _execute_charge already checked cant_charge; _execute_run did
not -- a fatigued/exhausted/entangled combatant could still run.

Added cant_charge guard to _execute_run (mirrors _execute_charge),
logging wait (cannot run) and returning ok. Two engine-level tests:
fatigued cannot run, exhausted cannot run.
This commit is contained in:
2026-09-16 13:28:17 +02:00
parent 2cc2ba1907
commit 7fc7a1d6ec
2 changed files with 83 additions and 2 deletions
+5
View File
@@ -4097,6 +4097,11 @@ class CombatEngine:
if self.has_condition_flag(state, "cant_move"):
self._log(f"round {self._current_round} {state.combatant.id}: wait (cannot move)")
return ActionResult(kind=kind, ok=True, reason=_REASON_OK)
# SRD "Conditions — Fatigued": "A fatigued character can neither run
# nor charge" (same for exhausted/entangled via cant_charge).
if self.has_condition_flag(state, "cant_charge"):
self._log(f"round {self._current_round} {state.combatant.id}: wait (cannot run)")
return ActionResult(kind=kind, ok=True, reason=_REASON_OK)
if action.destination is not None:
if action.destination == state.pos:
path: list[Pos] = [] # already there: a valid zero-length run