fix(rules): scale dirty trick duration and drop nauseated

PF1e (APG Dirty Trick): "This condition lasts for 1 round. For every 5
by which your attack exceeds your opponent's CMD, the penalty lasts 1
additional round" — rounds_left = 1 + margin//5. The RAW condition list
(blinded, dazzled, deafened, entangled, shaken, sickened) does not include
nauseated, so it is removed from TrickCondition. README updated.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-09-12 11:34:20 +02:00
parent 34be75c492
commit f9420c7b09
3 changed files with 39 additions and 15 deletions
+26 -10
View File
@@ -2,8 +2,11 @@
L6 of the ``llm-policy-contract`` plan: ``Action`` gains a
``trick_condition`` field that lets a policy choose which condition a
successful dirty trick applies (blinded, deafened, entangled, nauseated)
instead of always applying ``dazzled``.
successful dirty trick applies (blinded, dazzled, deafened, entangled)
instead of always applying ``dazzled``. APG Dirty Trick limits the penalty
to those conditions — nauseated is NOT on the RAW list and is not a valid
choice. The condition lasts 1 round plus 1 more per 5 by which the attack
exceeds the target's CMD.
When ``trick_condition`` is ``None`` the previous behavior (``dazzled``) is
kept bit-identical.
@@ -119,14 +122,27 @@ def test_dirty_trick_entangled() -> None:
assert _condition_names(b) == ["entangled"]
def test_dirty_trick_nauseated() -> None:
a_spec = make_combatant("a")
b_spec = make_combatant("b")
a = make_state(a_spec, "players", (1, 1))
b = make_state(b_spec, "monsters", (1, 2))
engine = make_engine([1, 12], [a, b])
engine._execute_maneuver(a, b, "dirty_trick", trick_condition="nauseated")
assert _condition_names(b) == ["nauseated"]
def test_dirty_trick_duration_scales_with_margin() -> None:
# APG Dirty Trick: "This condition lasts for 1 round. For every 5 by
# which your attack exceeds your opponent's CMD, the penalty lasts 1
# additional round." b CMD 12, a CMB 2: d20 17 -> total 19, margin 7
# -> 2 rounds; d20 20 -> total 22, margin 10 -> 3 rounds.
for roll, expected_rounds in ((17, 2), (20, 3)):
a = make_state(make_combatant("a"), "players", (1, 1))
b = make_state(make_combatant("b"), "monsters", (1, 2))
engine = make_engine([1, roll], [a, b]) # leading 1: AoO auto-miss
engine._execute_maneuver(a, b, "dirty_trick")
assert b.active_conditions[0].rounds_left == expected_rounds
assert f"dazzled {expected_rounds}r" in engine._transcript[-1]
def test_dirty_trick_small_margin_stays_one_round() -> None:
# Margin 0-4 (d20 10-14 -> total 12-16 vs CMD 12): exactly 1 round.
a = make_state(make_combatant("a"), "players", (1, 1))
b = make_state(make_combatant("b"), "monsters", (1, 2))
engine = make_engine([1, 13], [a, b])
engine._execute_maneuver(a, b, "dirty_trick")
assert b.active_conditions[0].rounds_left == 1
# --- Test 4: failed maneuver applies no condition ----------------------------