fix(rules): confused creatures make no attacks of opportunity (simplification documented)

This commit is contained in:
2026-09-16 19:30:08 +02:00
parent def8533197
commit 68a03a34f6
3 changed files with 28 additions and 2 deletions
+22
View File
@@ -154,3 +154,25 @@ def test_nauseated_guard_makes_no_aoo() -> None:
assert engine._aoo_used.get("guard", 0) == 0
assert len(engine._rng._queue) == 2
assert runner_s.hp == 20
def test_confused_guard_makes_no_aoo() -> None:
"""Given: the guard is confused (SRD: "will not make attacks of
opportunity against anything that it is not already devoted to
attacking" — simplified to no AoOs at all, the engine has no
"already devoted" concept)
When: the runner provokes an AoO
Then: no opportunity is taken — no die rolled, no budget spent."""
runner = make_combatant("runner", hp=20, ac=12)
guard = make_combatant("guard", hp=20, ac=15, attack_bonus=5)
states = [
make_state(runner, "players", (2, 1)),
make_state(guard, "monsters", (2, 0)),
]
engine = CombatEngine(ScriptedRng([15, 3]), _grid(("....", "....")), states)
runner_s, guard_s = engine._states
_add_condition(guard_s, "confused")
assert engine._resolve_aoo(guard_s, runner_s) is False
assert engine._aoo_used.get("guard", 0) == 0
assert len(engine._rng._queue) == 2
assert runner_s.hp == 20
+1 -1
View File
@@ -320,4 +320,4 @@ def test_snapshot_exposes_bleed_damage() -> None:
defs = dict(snap["condition_definitions"])
assert len(defs) == len(CONDITIONS_BY_NAME)
assert defs["bleeding"]["flags"] == []
assert defs["confused"]["flags"] == []
assert defs["confused"]["flags"] == ["cant_aoo"]