Phase B1 follow-up: regex catches bare-die notation; blink overlay shim

The A1 regex banned \b\d+d\d+\b (e.g. '1d20') but missed bare die
notation ('d20', 'd6') with no leading count. SRD's 'blink' Description
slipped through with 'Roll a d20 at the end of each of your turns...'.

- Add \bd(4|6|8|10|12|20|100)\b ban to the prose regex sweep.
- Add hand-authored overlay shim for blink in dnd_spells_data.go.
  Classes union with SRD preserves Cleric/Sorcerer/Warlock availability.

Test now passes the wider sweep; no other reachable spells leak.
This commit is contained in:
prosolis
2026-05-15 07:18:16 -07:00
parent f198041530
commit 20647eeafc
2 changed files with 4 additions and 0 deletions

View File

@@ -287,6 +287,9 @@ func buildSpellList() []SpellDefinition {
{ID: "animate_dead", Name: "Animate Dead", Level: 3, School: "necromancy",
Classes: mageCleric, Effect: EffectUtility, CastTime: CastAction,
Description: "Three nearby corpses sit up and look at you for orders. Frowned upon at parties; useful in dungeons."},
{ID: "blink", Name: "Blink", Level: 3, School: "transmutation",
Classes: mage, Effect: EffectUtility, CastTime: CastAction,
Description: "You flicker in and out of reality at random. Foes swing at empty air half the time."},
// ── 3rd level — Cleric ────────────────────────────────────────────────
{ID: "spirit_guardians", Name: "Spirit Guardians", Level: 3, School: "conjuration",

View File

@@ -29,6 +29,7 @@ func TestSpellDescriptionsAreJargonFree(t *testing.T) {
{"ability modifier", regexp.MustCompile(`(?i)ability modifier`)},
{"hit points equal to", regexp.MustCompile(`(?i)hit points equal to`)},
{"NdN dice notation", regexp.MustCompile(`\b\d+d\d+\b`)},
{"bare die notation", regexp.MustCompile(`\bd(4|6|8|10|12|20|100)\b`)},
}
for id, s := range dndSpellRegistry {