fix(rules): Weapon Focus filter matches weapon names case-insensitively (substring)

The filter 'Pistol' now matches 'Braises d'Automne (pistolet ?)' via
case-insensitive substring matching, so the feat is no longer dead.
Golden test_tammara_vs_goblin updated: round-4 pistol shot gains the +1
feat bonus (total 15 -> 16 vs AC 16), turning the MISS into a lethal HIT
(17 damage, goblin 6 -> -11); the goblin dies on round 4 so the old
rounds 4-10 exchange and the draw are gone.
This commit is contained in:
2026-09-16 19:45:56 +02:00
parent f31cc88124
commit 4d45409941
3 changed files with 64 additions and 20 deletions
+18 -19
View File
@@ -57,10 +57,21 @@ class TestGoldenCombats:
"""Golden tests for each PC vs goblin - deterministic combats with pinned transcripts."""
def test_tammara_vs_goblin(self):
"""Tammara (Gunslinger/Warpriest) vs Goblin — full pinned transcript."""
"""Tammara (Gunslinger/Warpriest) vs Goblin — full pinned transcript.
Golden updated by the Weapon Focus conformance fix: the feat filter
"Pistol" now matches her pistol names ("... (pistolet ?)"), so every
pistol attack gains the +1 feat bonus. Line-by-line:
- rounds 1-3: unchanged (Bull's Strength casts, goblin misses).
- round 4 tammara: total 15 -> 16 (the +1 Weapon Focus), AC 16 is now
met: MISS -> HIT 17 damage, goblin 6 -> -11 (below its -CON death
threshold).
- "goblin down" + "players win in 4 rounds": the goblin dies on round
4, so the old rounds 4-10 goblin shots and the draw are gone.
"""
result, _ = run_golden("tammara")
assert result.winner is None
assert result.rounds == 10
assert result.winner == "players"
assert result.rounds == 4
assert result.transcript == (
"initiative: tammara d20=15+7=22",
"initiative: goblin d20=10+6=16",
@@ -73,22 +84,10 @@ class TestGoldenCombats:
("round 3 tammara: cast Bull's Strength vs tammara DC15 SAVED -> buff 3 mods (60r) "
"(36->36)"),
"round 3 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
"round 4 tammara: Braises d'Automne (pistolet ?) vs goblin d20=10+9-6=15 AC 16 -> 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 d20=10+9-6=15 AC 16 -> MISS",
"round 5 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
"round 6 tammara: Braises d'Automne (pistolet ?) vs goblin d20=10+9-6=15 AC 16 -> MISS",
"round 6 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
"round 7 tammara: Braises d'Automne (pistolet ?) vs goblin d20=10+9-6=15 AC 16 -> MISS",
"round 7 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
"round 8 tammara: Braises d'Automne (pistolet ?) vs goblin d20=10+9-6=15 AC 16 -> MISS",
"round 8 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
"round 9 tammara: Braises d'Automne (pistolet ?) vs goblin d20=10+9-6=15 AC 16 -> MISS",
"round 9 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
("round 10 tammara: Braises d'Automne (pistolet ?) vs goblin d20=10+9-6=15 AC 16 "
"-> MISS"),
"round 10 goblin: short bow vs tammara d20=15+4-2=17 AC 20 -> MISS",
"battle over: draw after 10 rounds",
("round 4 tammara: Braises d'Automne (pistolet ?) vs goblin d20=10+9-6=16 "
"AC 16 -> HIT 17 damage (6->-11)"),
"round 4 tammara: goblin down",
"battle over: players win in 4 rounds",
)
def test_tammara_vs_lich(self):