fix(rules): stabilize a dying creature when healed

PF1e (CRB, Stable Characters and Recovery): any healing that cures a
dying creature of even 1 point makes it stable. _apply_heal_effect and
_channel_heal now set stabilized_hp when the healed hp stays negative,
so the creature stops losing 1 hp per round.

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 10:35:44 +02:00
parent e8cca954d0
commit 4b4e6f2726
2 changed files with 57 additions and 0 deletions
+10
View File
@@ -4622,6 +4622,11 @@ class CombatEngine:
) -> None:
old_hp = affected_state.hp
affected_state.hp = min(affected_state.hp + dmg, affected_state.combatant.hp_max)
# PF1e (CRB, Stable Characters and Recovery): "If any sort of healing
# cures the dying character of even 1 point of damage, he becomes
# stable and stops losing hit points."
if affected_state.hp < 0:
affected_state.stabilized_hp = affected_state.hp
actual = affected_state.hp - old_hp
self._stats[state.combatant.id].damage_dealt += actual
self._stop_bleeding(affected_state)
@@ -5503,6 +5508,11 @@ class CombatEngine:
heal = int(heal * 1.5)
old_hp = target.hp
target.hp = min(target.hp + heal, target.combatant.hp_max)
# PF1e (CRB, Stable Characters and Recovery): "If any sort of healing
# cures the dying character of even 1 point of damage, he becomes
# stable and stops losing hit points."
if target.hp < 0:
target.stabilized_hp = target.hp
actual = target.hp - old_hp
self._stop_bleeding(target)
return f"+{actual} HP"