fix(rules): divine favor grants its SRD luck bonus on attack and weapon damage (+1 per three caster levels, max +3) for 1 minute

This commit is contained in:
2026-09-17 22:41:00 +02:00
parent 47f563e11a
commit bee224ab37
2 changed files with 64 additions and 66 deletions
+12 -2
View File
@@ -6,6 +6,16 @@
"save": "none", "save": "none",
"base_dc": 10, "base_dc": 10,
"cast_time": "standard", "cast_time": "standard",
"effects": [], "effects": [
"description": "You draw upon divine power for 1 round/level: a +1 luck bonus on attack rolls and weapon damage per 4 caster levels. Simplified: the engine has no luck-bonus self-buff that preserves the pinned default-policy casting order, so no mechanical effect is applied." {
"type": "buff",
"modifiers": [
{ "target": "attack", "value": 1, "bonus_type": "luck" },
{ "target": "damage", "value": 1, "bonus_type": "luck" }
],
"duration_rounds": 10,
"scaling_flat": { "amount": 1, "per_levels": 3, "max": 2 }
}
],
"description": "SRD spells/divine-favor.md: evocation, level 1 (cleric/inquisitor/oracle/paladin/warpriest), range personal, duration 1 minute. You gain a +1 luck bonus on attack and weapon damage rolls, +1 for every three caster levels (at least +1, maximum +3). The bonus does not apply to spell damage - the engine's 'damage' modifier target only rides weapon damage rolls, so that clause holds by construction. Duration 1 minute = 10 rounds."
} }
+52 -64
View File
@@ -63,81 +63,69 @@ class TestGoldenCombats:
"Pistol" now matches her pistol names ("... (pistolet ?)"), so every "Pistol" now matches her pistol names ("... (pistolet ?)"), so every
pistol attack gains the +1 feat bonus. pistol attack gains the +1 feat bonus.
Updated again by the SRD shield-of-faith fix (data/spells/ Updated again by the SRD spell-effect fixes (shield of faith and
shield_of_faith.json now carries its real +2 deflection AC buff): divine favor now carry their real buffs): _find_buff_spell returns the
_find_buff_spell returns the FIRST buff spell in her known-spell FIRST buff spell in her known-spell order, and Divine Favor (list
order, and Shield of Faith (list index 30) precedes Bull's Strength index 20) precedes Shield of Faith (30) and Bull's Strength (46) — so
(index 46) — so the policy's buff pick is now Shield of Faith. the policy's buff pick is now Divine Favor.
Line-by-line: Line-by-line:
- rounds 1-4 tammara: "cast Shield of Faith ... DC14 SAVED -> buff 1 - rounds 1-4 tammara: "cast Divine Favor vs tammara DC14 NO SAVE ->
mods (10r)" — DC 14 = 10 + spell level 1 + her +3 Wis; the deflection buff 2 mods (10r)" — save "none" (SRD: personal, no save), so no d20
buff does not stack with itself, so the re-casts just refresh it. She is consumed by the cast; the +1 luck attack / +1 luck weapon-damage
has four level-1 slots, so the buff phase now runs rounds 1-4 (the buff scales +1 per three caster levels (level 4 -> +2/+2), luck not
old Bull's Strength phase ran rounds 1-3 on three level-2 slots). stacking with itself so the re-casts just refresh it. Four level-1
- rounds 1-10 goblin: "AC 22" (was 20) — the +2 deflection raises her slots cover rounds 1-4 (the old Bull's Strength phase ran rounds 1-3
AC; the goblin's d20=15+4-2=17 shot still misses. on three level-2 slots).
- rounds 5-10 tammara: "d20=10+9-6=14 AC 16 -> MISS" — out of level-1 - rounds 1-5 goblin: the un-consumed save rolls shift the scripted
slots she shoots; without Bull's Strength's +2 enhancement attack dice queue — the goblin's shots alternate d20=10/15 (+4-2 range),
bonus the scripted d20=10 shot totals 14, below the goblin's AC 16. 12/17 vs her unchanged AC 20: all MISS.
- "battle over: draw after 10 rounds": the goblin is never dropped - round 5 tammara: out of level-1 slots she shoots; the Divine Favor
within the round cap. This is a default_policy first-match heuristic +2 luck on attack and weapon damage reproduces the old Bull's
artifact (Shield of Faith is a legitimate SRD buff, just a Strength totals: d20=10+9-6=16 meets AC 16 -> HIT 17 damage, goblin
defensively-picked one), not an SRD regression. 6 -> -11 (below its -CON death threshold).
- "goblin down" + "players win in 5 rounds": the goblin dies one round
later than before (four level-1 buff casts instead of three
level-2 casts).
""" """
result, _ = run_golden("tammara") result, _ = run_golden("tammara")
assert result.winner is None assert result.winner == "players"
assert result.rounds == 10 assert result.rounds == 5
assert result.transcript == ( assert result.transcript == (
"initiative: tammara d20=15+7=22", "initiative: tammara d20=15+7=22",
"initiative: goblin d20=10+6=16", "initiative: goblin d20=10+6=16",
("round 1 tammara: cast Shield of Faith vs tammara DC14 SAVED " ("round 1 tammara: cast Divine Favor vs tammara DC14 NO SAVE "
"-> buff 1 mods (10r) (36->36)"), "-> buff 2 mods (10r) (36->36)"),
"round 1 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS", "round 1 goblin: short bow vs tammara d20=10+4-2=12 AC 20 -> MISS",
("round 2 tammara: cast Shield of Faith vs tammara DC14 SAVED " ("round 2 tammara: cast Divine Favor vs tammara DC14 NO SAVE "
"-> buff 1 mods (10r) (36->36)"), "-> buff 2 mods (10r) (36->36)"),
"round 2 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS", "round 2 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
("round 3 tammara: cast Shield of Faith vs tammara DC14 SAVED " ("round 3 tammara: cast Divine Favor vs tammara DC14 NO SAVE "
"-> buff 1 mods (10r) (36->36)"), "-> buff 2 mods (10r) (36->36)"),
"round 3 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS", "round 3 goblin: short bow vs tammara d20=10+4-2=12 AC 20 -> MISS",
("round 4 tammara: cast Shield of Faith vs tammara DC14 SAVED " ("round 4 tammara: cast Divine Favor vs tammara DC14 NO SAVE "
"-> buff 1 mods (10r) (36->36)"), "-> buff 2 mods (10r) (36->36)"),
"round 4 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS", "round 4 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
("round 5 tammara: Braises d'Automne (pistolet ?) vs goblin " ("round 5 tammara: Braises d'Automne (pistolet ?) vs goblin "
"d20=10+9-6=14 AC 16 -> MISS"), "d20=10+9-6=16 AC 16 -> HIT 17 damage (6->-11)"),
"round 5 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS", "round 5 tammara: goblin down",
("round 6 tammara: Braises d'Automne (pistolet ?) vs goblin " "battle over: players win in 5 rounds",
"d20=10+9-6=14 AC 16 -> MISS"),
"round 6 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS",
("round 7 tammara: Braises d'Automne (pistolet ?) vs goblin "
"d20=10+9-6=14 AC 16 -> MISS"),
"round 7 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS",
("round 8 tammara: Braises d'Automne (pistolet ?) vs goblin "
"d20=10+9-6=14 AC 16 -> MISS"),
"round 8 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS",
("round 9 tammara: Braises d'Automne (pistolet ?) vs goblin "
"d20=10+9-6=14 AC 16 -> MISS"),
"round 9 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS",
("round 10 tammara: Braises d'Automne (pistolet ?) vs goblin "
"d20=10+9-6=14 AC 16 -> MISS"),
"round 10 goblin: short bow vs tammara d20=15+4-2=17 AC 22 -> MISS",
"battle over: draw after 10 rounds",
) )
def test_tammara_vs_lich(self): def test_tammara_vs_lich(self):
"""Tammara vs Lich (boss fight) — full pinned transcript. """Tammara vs Lich (boss fight) — full pinned transcript.
Updated (S2b): the lich is caster level 11, so Magic Missile now fires Updated (S2b): the lich is caster level 11, so Magic Missile now fires
its SRD full five missiles (1d4+1 each) instead of a single one. Three its SRD full five missiles (1d4+1 each).
missiles (16 + 11 + 16 = 43) drop Tammara below 0 hp on round 1; the
remaining two are lost (the engine's target-drops-mid-sequence
convention), so the lich wins in 1 round.
Updated by the SRD shield-of-faith fix: her round-1 buff pick is now Updated by the SRD spell-effect fixes: her round-1 buff pick is now
Shield of Faith (first buff spell in her known-spell order, index 30 Divine Favor (first buff spell in her known-spell order, index 20) —
before Bull's Strength's 46) — "cast Shield of Faith ... DC14 SAVED -> "cast Divine Favor vs tammara DC14 NO SAVE -> buff 2 mods (10r)"
buff 1 mods (10r)" (DC 14 = 10 + level 1 + her +3 Wis). Magic Missile (DC 14 = 10 + level 1 + her +3 Wis; save "none" consumes no d20, so
auto-hits and ignores the +2 deflection it would otherwise grant, so the scripted queue feeding the lich's five missile damage rolls
the lich's line and the outcome are unchanged. shifts: 38 total instead of 43). Three missiles still drop Tammara
below 0 hp on round 1 (36 -> -2) and the remaining two are lost (the
engine's target-drops-mid-sequence convention), so the lich wins in 1
round — outcome unchanged.
""" """
result, _ = run_golden("tammara", "lich") result, _ = run_golden("tammara", "lich")
assert result.winner == "monsters" assert result.winner == "monsters"
@@ -145,9 +133,9 @@ class TestGoldenCombats:
assert result.transcript == ( assert result.transcript == (
"initiative: tammara d20=15+7=22", "initiative: tammara d20=15+7=22",
"initiative: lich d20=10+6=16", "initiative: lich d20=10+6=16",
("round 1 tammara: cast Shield of Faith vs tammara DC14 SAVED " ("round 1 tammara: cast Divine Favor vs tammara DC14 NO SAVE "
"-> buff 1 mods (10r) (36->36)"), "-> buff 2 mods (10r) (36->36)"),
"round 1 lich: cast Magic Missile vs tammara DC16 NO SAVE -> 43 damage (36->-7)", "round 1 lich: cast Magic Missile vs tammara DC16 NO SAVE -> 38 damage (36->-2)",
"battle over: monsters win in 1 rounds", "battle over: monsters win in 1 rounds",
) )