feat(rules): nonlethal sources - unarmed strikes deal nonlethal by default (SRD Unarmed Attacks), Minimum Damage floor lands 1 nonlethal (CRB Damage), transcript + AttackResult expose the track

This commit is contained in:
2026-09-20 18:54:22 +02:00
parent cba7bbf3c9
commit 83c6e541ac
4 changed files with 257 additions and 38 deletions
+11 -6
View File
@@ -203,7 +203,8 @@ def test_dr_reduces_damage() -> None:
def test_dr_floors_hit_at_one_minimum_damage() -> None:
# PF1e (CRB "Damage" - Minimum Damage): "If penalties reduce the damage
# result to less than 1, a hit still deals 1 point of nonlethal damage"
# (no nonlethal track: floored to 1 point of normal damage).
# (nonlethal track implemented: the floor lands on the separate track,
# never on hp).
a_spec = make_combatant("a", attack_bonus=2)
b_spec = make_combatant("b", dr=DamageReduction(amount=5))
a = make_state(a_spec, "players", (1, 1))
@@ -211,11 +212,13 @@ def test_dr_floors_hit_at_one_minimum_damage() -> None:
engine = make_engine([12, 3], [a, b])
result = engine.resolve_attack(a, b, a_spec.attacks[0])
assert result.hit is True
assert result.damage == 1
assert b.hp == 5
assert result.damage == 0
assert result.nonlethal == 1
assert b.hp == 6
assert b.nonlethal == 1
def test_energy_resistance_floors_hit_at_one() -> None:
def test_energy_resistance_floors_hit_at_one_nonlethal() -> None:
a_spec = make_combatant("a", attack_bonus=2)
b_spec = make_combatant("b").model_copy(update={"resistances": {"fire": 10}})
fire = AttackSpec(
@@ -230,8 +233,10 @@ def test_energy_resistance_floors_hit_at_one() -> None:
engine = make_engine([12, 5], [a, b])
result = engine.resolve_attack(a, b, fire)
assert result.hit is True
assert result.damage == 1
assert b.hp == 5
assert result.damage == 0
assert result.nonlethal == 1
assert b.hp == 6
assert b.nonlethal == 1
def test_dr_bypass_ignores_reduction() -> None: