feat(rules): scale healing spells with caster level

PF1e (SRD spells/cure-light-wounds.md): 'cures 1d8 points of damage +1
point per caster level (maximum +5)'; (spells/cure-moderate-wounds.md):
'cures 2d8 points of damage +1 point per caster level (maximum +10)'.
A HealEffect now carries the same DamageFlatScaling spec as damage
effects (S1b) and resolves it through effective_formula(caster_level)
at cast time, so the flat bonus grows with the caster and stops at the
stated cap. The engine passes the caster's level into _apply_heal_effect
(required keyword: no silent level-0 under-heal); Maximize Spell
maximizes the scaled formula. Cure Light/Moderate Wounds ship the SRD
values; inflict_light_wounds already carried its scaling_flat.

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-13 17:19:58 +02:00
parent a2a80b8690
commit b84238792c
9 changed files with 290 additions and 18 deletions
+4 -2
View File
@@ -220,7 +220,8 @@ def test_heal_spell_stabilizes_dying_creature() -> None:
s.hp = -3
eng._rng = ScriptedRng([1]) # 1d8 -> 1: only 1 point cured
result = eng._apply_heal_effect(
HealEffect(formula=parse_dice("1d8")), s, empower=False, maximize=False
HealEffect(formula=parse_dice("1d8")), s, caster_level=1,
empower=False, maximize=False,
)
assert result == "+1 HP"
assert s.hp == -2
@@ -251,7 +252,8 @@ def test_heal_to_positive_hp_does_not_stabilize() -> None:
s.hp = -3
eng._rng = ScriptedRng([8])
eng._apply_heal_effect(
HealEffect(formula=parse_dice("1d8")), s, empower=False, maximize=False
HealEffect(formula=parse_dice("1d8")), s, caster_level=1,
empower=False, maximize=False,
)
assert s.hp == 5
assert s.stabilized_hp is None