feat(rules): alignment-gated protection from evil/law wards via attacker context

Add attacker-alignment modifier conditions (attacker_is_evil/lawful/good/
chaotic) evaluated against an optional attacker context threaded through
_stat_modifiers/_modifier_condition_holds, _attack_ac_mods (resolve_attack
AC path), resolve_save and _area_save (spell save paths), plus the fear
aura. Without a source in scope the condition is False, so existing rolls
are untouched (golden transcripts bit-identical).

Give the four protection_from_evil/law(+communal) JSONs their SRD buff:
+2 deflection to AC and +2 resistance on fort/ref/will, gated on the
attacker/caster alignment (SRD: bonuses apply 'against attacks or effects
created by evil creatures'); duration 1 min/level approximated as 10
rounds (engine convention). Descriptions document the unmodeled mental-
control suppression and communal duration-split clauses. Level/range/
save/SR verified against the KB.
This commit is contained in:
2026-09-20 12:57:29 +02:00
parent 6a18d456f6
commit 3be22b9c55
8 changed files with 452 additions and 22 deletions
+13 -2
View File
@@ -8,6 +8,17 @@
"base_dc": 10,
"cast_time": "standard",
"spell_resistance": false,
"effects": [],
"description": "A barrier wards the subject from evil for 1 min/level: +2 deflection bonus to AC and +2 resistance bonus on saves against attacks and effects created by evil creatures, renewed saves and suppression of mental control, and lawful summoned evil creatures cannot touch it. Will negates (harmless). The engine has no alignment system, so alignment-restricted bonuses cannot be modeled and the spell has no mechanical effects here."
"effects": [
{
"type": "buff",
"modifiers": [
{ "target": "ac", "value": 2, "bonus_type": "deflection", "condition": "attacker_is_evil" },
{ "target": "fort", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_evil" },
{ "target": "ref", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_evil" },
{ "target": "will", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_evil" }
],
"duration_rounds": 10
}
],
"description": "SRD spells/protection-from-evil.md: a barrier wards the subject from evil for 1 min./level. The subject gains a +2 deflection bonus to AC and a +2 resistance bonus on saves - the exact SRD wording: \"+2 deflection bonus to AC and a +2 resistance bonus on saves against attacks or effects created by evil creatures\" - so both bonuses are gated on the attacker/caster alignment (condition attacker_is_evil) and never apply against a creature that is not evil. Will negates (harmless), spell resistance no. Duration 1 min/level approximated as 10 rounds (engine convention for 1-minute durations). Not modeled: the SRD's second effect (immediate renewed saving throw with a +2 morale bonus against mental-control spells and effects, suppression for the duration, immunity to new attempts) - the engine has no mental-control tracking to suppress; and the third effect (evil summoned creatures cannot touch the warded creature) - the engine has no summoned-subtype contact restriction."
}
+13 -2
View File
@@ -8,6 +8,17 @@
"base_dc": 10,
"cast_time": "standard",
"spell_resistance": false,
"effects": [],
"description": "Functions like protection from evil (+2 deflection to AC and +2 resistance on saves vs evil creatures, protection from mental control), except the 1 min/level duration is divided in 1-minute intervals among the touched creatures. Will negates (harmless). Alignment-restricted bonuses and duration-sharing are not modeled, so the spell has no mechanical effects here."
"effects": [
{
"type": "buff",
"modifiers": [
{ "target": "ac", "value": 2, "bonus_type": "deflection", "condition": "attacker_is_evil" },
{ "target": "fort", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_evil" },
{ "target": "ref", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_evil" },
{ "target": "will", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_evil" }
],
"duration_rounds": 10
}
],
"description": "SRD spells/protection-from-evil-communal.md: functions like protection from evil - each touched creature gains the +2 deflection bonus to AC and +2 resistance bonus on saves against attacks or effects created by evil creatures (gated on the attacker/caster alignment via condition attacker_is_evil, never applying against a non-evil source). Will negates (harmless), spell resistance no. Not modeled: the SRD duration split - \"you divide the duration in 1-minute intervals among the creatures touched\" - the engine gives every touched creature the same fixed duration as protection from evil (1 min/level approximated as 10 rounds each) instead of draining one shared pool; and the mental-control suppression clause of the base spell (see protection_from_evil.json)."
}
+13 -2
View File
@@ -8,6 +8,17 @@
"base_dc": 10,
"cast_time": "standard",
"spell_resistance": false,
"effects": [],
"description": "A barrier wards the subject from lawful creatures for 1 min/level: +2 deflection bonus to AC and +2 resistance bonus on saves against attacks and effects created by lawful creatures, plus renewed saves against mental control by lawful creatures. Will negates (harmless). The engine has no alignment system, so alignment-restricted bonuses cannot be modeled and the spell has no mechanical effects here."
"effects": [
{
"type": "buff",
"modifiers": [
{ "target": "ac", "value": 2, "bonus_type": "deflection", "condition": "attacker_is_lawful" },
{ "target": "fort", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_lawful" },
{ "target": "ref", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_lawful" },
{ "target": "will", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_lawful" }
],
"duration_rounds": 10
}
],
"description": "SRD spells/protection-from-law.md: functions like protection from evil, except the deflection and resistance bonuses apply against lawful creatures - \"+2 deflection bonus to AC and a +2 resistance bonus on saves against attacks or effects created by lawful creatures\" - so both bonuses are gated on the attacker/caster alignment (condition attacker_is_lawful) and never apply against a creature that is not lawful. Will negates (harmless), spell resistance no. Duration 1 min/level approximated as 10 rounds (engine convention for 1-minute durations). Not modeled: the renewed saving throw against mental control by lawful creatures and the lawful summoned creature contact restriction (same gaps as protection from evil)."
}
+13 -2
View File
@@ -8,6 +8,17 @@
"base_dc": 10,
"cast_time": "standard",
"spell_resistance": false,
"effects": [],
"description": "Functions like protection from law (+2 deflection to AC and +2 resistance on saves vs lawful creatures, protection from mental control), except the 1 min/level duration is divided in 1-minute intervals among the touched creatures. Will negates (harmless). Alignment-restricted bonuses and duration-sharing are not modeled, so the spell has no mechanical effects here."
"effects": [
{
"type": "buff",
"modifiers": [
{ "target": "ac", "value": 2, "bonus_type": "deflection", "condition": "attacker_is_lawful" },
{ "target": "fort", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_lawful" },
{ "target": "ref", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_lawful" },
{ "target": "will", "value": 2, "bonus_type": "resistance", "condition": "attacker_is_lawful" }
],
"duration_rounds": 10
}
],
"description": "SRD spells/protection-from-law-communal.md: functions like protection from law - each touched creature gains the +2 deflection bonus to AC and +2 resistance bonus on saves against attacks or effects created by lawful creatures (gated on the attacker/caster alignment via condition attacker_is_lawful, never applying against a non-lawful source). Will negates (harmless), spell resistance no. Not modeled: the SRD duration split - \"you divide the duration in 1-minute intervals among the creatures touched\" - the engine gives every touched creature the same fixed duration as protection from law (1 min/level approximated as 10 rounds each) instead of draining one shared pool; and the mental-control suppression clause of the base spell (see protection_from_law.json)."
}