fix(spells): correct the sound burst save
PF1e (SRD spells/sound-burst.md): "Every creature in the area takes 1d8 points of sonic damage and must succeed on a Fortitude save to avoid being stunned for 1 round" — the Fortitude partial negates the stun only, never the dice. The damage component declared half_on_save: true, halving the sonic damage on a successful save. DamageEffect gains a save_negates flag (default True, existing behavior unchanged); sound_burst.json declares half_on_save: false + save_negates: false so the 1d8 is full regardless while the condition keeps save_negates. README updated. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -5534,7 +5534,7 @@ class CombatEngine:
|
||||
raw = effect.formula.max_value()
|
||||
if saved and effect.half_on_save:
|
||||
dmg = max(0, raw // 2)
|
||||
elif saved:
|
||||
elif saved and effect.save_negates:
|
||||
dmg = 0
|
||||
else:
|
||||
dmg = raw
|
||||
|
||||
@@ -39,6 +39,11 @@ class DamageEffect:
|
||||
types: tuple[str, ...]
|
||||
# False = save negates (targeted); True = half damage on save (ray/line/cone/AoE)
|
||||
half_on_save: bool = False
|
||||
# Only consulted when half_on_save is False. True = a successful save deals
|
||||
# no damage (save negates, the targeted-spell default); False = the save has
|
||||
# no effect on this damage at all (SRD Sound Burst: "Fortitude partial"
|
||||
# negates only the stun — every creature takes the full dice regardless).
|
||||
save_negates: bool = True
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -258,6 +263,7 @@ def _parse_effect(data: Json) -> SpellEffect:
|
||||
formula=parse_dice(_as_str(effect["formula"])),
|
||||
types=tuple(_as_str(t) for t in _as_list(effect["types"])),
|
||||
half_on_save=bool(effect.get("half_on_save", False)),
|
||||
save_negates=bool(effect.get("save_negates", True)),
|
||||
)
|
||||
if effect_type == "condition":
|
||||
return ConditionEffect(
|
||||
|
||||
Reference in New Issue
Block a user