fix(rules): cure spells damage undead instead of healing
SRD Cure Light Wounds: 'Since undead are powered by negative energy, this spell deals damage to them instead of curing their wounds. An undead creature can apply spell resistance, and can attempt a Will save to take half damage.' - _apply_heal_effect takes the rolled save; an undead target takes the rolled healing as damage (halved on a successful save; SR already resolved upstream, DR never applies to spell energy, no bleeding stop or stabilization). Living targets are bit-identical. - cure_light/cure_moderate descriptions fixed: the SRD save line is 'Will half (harmless)', not 'negates'. - Deafened 20% verbal spell failure DEFERRED to the README « Limites hors perimetre »: SpellSpec carries no components data (would need a verbal flag on all 108 spells) and sound-based Perception is not modeled either.
This commit is contained in:
@@ -6287,7 +6287,7 @@ class CombatEngine:
|
||||
if isinstance(effect, HealEffect):
|
||||
return self._apply_heal_effect(
|
||||
effect, target, caster_level=caster.combatant.level,
|
||||
empower=empower, maximize=maximize,
|
||||
empower=empower, maximize=maximize, saved=saved,
|
||||
)
|
||||
return self._apply_buff_effect(effect, target, spell_name=spell_name)
|
||||
|
||||
@@ -6475,6 +6475,7 @@ class CombatEngine:
|
||||
caster_level: int,
|
||||
empower: bool,
|
||||
maximize: bool,
|
||||
saved: bool,
|
||||
) -> str:
|
||||
formula = effect.effective_formula(caster_level)
|
||||
heal = formula.roll(self._rng)
|
||||
@@ -6482,6 +6483,17 @@ class CombatEngine:
|
||||
heal = formula.max_value()
|
||||
if empower:
|
||||
heal = int(heal * 1.5)
|
||||
if target.combatant.creature_type == "undead":
|
||||
# PF1e (SRD "Cure Light Wounds"): "Since undead are powered by
|
||||
# negative energy, this spell deals damage to them instead of
|
||||
# curing their wounds. An undead creature can apply spell
|
||||
# resistance, and can attempt a Will save to take half damage."
|
||||
# SR is resolved upstream (_spell_delivery_blocked); the rolled
|
||||
# save halves here. Cure damage is spell energy: never reduced by
|
||||
# DR, and it does not stop bleeding or stabilize.
|
||||
dmg = heal // 2 if saved else heal
|
||||
target.hp -= dmg
|
||||
return f"{dmg} damage (undead)"
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user