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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user