fix(rules): shield of faith grants its SRD deflection AC buff (+2, +1 per six caster levels, max +5) via a new BuffEffect flat scaling
This commit is contained in:
@@ -213,8 +213,17 @@ class HealEffect:
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class BuffEffect:
|
||||
"""Transient stat modifiers (PF1e buff spells).
|
||||
|
||||
``scaling_flat`` (SRD shield of faith "+2 deflection, +1 per six caster
|
||||
levels (maximum +5)", divine favor "+1 per three caster levels (maximum
|
||||
+3)") adds the resolved flat bonus to EVERY modifier's value at cast
|
||||
time, mirroring ``DamageEffect.effective_formula``'s flat scaling.
|
||||
"""
|
||||
|
||||
modifiers: tuple[StatModifier, ...]
|
||||
duration_rounds: int
|
||||
scaling_flat: DamageFlatScaling | None = None
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@@ -611,9 +620,12 @@ def _parse_heal_effect(effect: dict[str, Json]) -> HealEffect:
|
||||
|
||||
|
||||
def _parse_buff_effect(effect: dict[str, Json]) -> BuffEffect:
|
||||
flat_raw = effect.get("scaling_flat")
|
||||
scaling_flat = None if flat_raw is None else _parse_flat_scaling(flat_raw)
|
||||
return BuffEffect(
|
||||
modifiers=tuple(_parse_modifier(m) for m in _as_list(effect["modifiers"])),
|
||||
duration_rounds=_as_int(effect.get("duration_rounds", 0)),
|
||||
scaling_flat=scaling_flat,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user