fix(rules): minimum damage - a landed hit reduced below 1 by DR/energy resistance deals 1 (CRB Damage - Minimum Damage, nonlethal approximated as normal)

This commit is contained in:
2026-09-16 21:46:04 +02:00
parent 1c2663d21c
commit ae037c984f
3 changed files with 39 additions and 7 deletions
+26 -3
View File
@@ -200,15 +200,38 @@ def test_dr_reduces_damage() -> None:
assert b.hp == 4
def test_dr_floors_damage_at_zero() -> 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).
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))
b = make_state(b_spec, "monsters", (1, 2))
engine = make_engine([12, 3], [a, b])
result = engine.resolve_attack(a, b, a_spec.attacks[0])
assert result.damage == 0
assert b.hp == 6
assert result.hit is True
assert result.damage == 1
assert b.hp == 5
def test_energy_resistance_floors_hit_at_one() -> None:
a_spec = make_combatant("a", attack_bonus=2)
b_spec = make_combatant("b").model_copy(update={"resistances": {"fire": 10}})
fire = AttackSpec(
id="a-fire",
name="flame blade",
kind="melee",
attack_bonus=2,
damage=[DamageComponent(formula=parse_dice("1d6"), types=["fire"])],
)
a = make_state(a_spec, "players", (1, 1))
b = make_state(b_spec, "monsters", (1, 2))
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
def test_dr_bypass_ignores_reduction() -> None: