fix(rules): undead and constructs are destroyed at hp <= 0

SRD Undead/Construct traits: 'immediately destroyed when reduced to 0 hit
points or fewer' — undead and constructs have no Constitution score, so
the PF1e hp <= -CON death rule does not apply to them.

- combat.py: CombatantState.death_threshold returns 0 for creature_type
  undead/construct (in addition to the opt-in dies_at_zero flag)
- tests: TestUndeadDeathThreshold pins undead dead at 0 and below, living
  keeps the disabled band at 0 and the dying band down to -CON
- golden unchanged: tammara-vs-lich has the lich winning in 1 round
  without taking damage
This commit is contained in:
2026-09-16 11:45:23 +02:00
parent 5e3505dc8c
commit 59caf67909
2 changed files with 42 additions and 1 deletions
+5 -1
View File
@@ -769,9 +769,13 @@ class CombatantState:
@property
def death_threshold(self) -> int:
"""PF1e (CRB): death when negative hp reaches the CON score (no -10 rule).
The optional simple monster-death rule raises the threshold to 0."""
Undead and constructs have no Constitution score and are "immediately
destroyed when reduced to 0 hit points or fewer" (SRD Undead/Construct
traits). The optional simple monster-death rule raises the threshold to 0."""
if self.dies_at_zero:
return 0
if self.combatant.creature_type in ("undead", "construct"):
return 0
return -self.combatant.abilities.con_score