mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-15 08:32:41 +00:00
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:
@@ -287,6 +287,9 @@ func buildSpellList() []SpellDefinition {
|
|||||||
{ID: "animate_dead", Name: "Animate Dead", Level: 3, School: "necromancy",
|
{ID: "animate_dead", Name: "Animate Dead", Level: 3, School: "necromancy",
|
||||||
Classes: mageCleric, Effect: EffectUtility, CastTime: CastAction,
|
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."},
|
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 ────────────────────────────────────────────────
|
// ── 3rd level — Cleric ────────────────────────────────────────────────
|
||||||
{ID: "spirit_guardians", Name: "Spirit Guardians", Level: 3, School: "conjuration",
|
{ID: "spirit_guardians", Name: "Spirit Guardians", Level: 3, School: "conjuration",
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ func TestSpellDescriptionsAreJargonFree(t *testing.T) {
|
|||||||
{"ability modifier", regexp.MustCompile(`(?i)ability modifier`)},
|
{"ability modifier", regexp.MustCompile(`(?i)ability modifier`)},
|
||||||
{"hit points equal to", regexp.MustCompile(`(?i)hit points equal to`)},
|
{"hit points equal to", regexp.MustCompile(`(?i)hit points equal to`)},
|
||||||
{"NdN dice notation", regexp.MustCompile(`\b\d+d\d+\b`)},
|
{"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 {
|
for id, s := range dndSpellRegistry {
|
||||||
|
|||||||
Reference in New Issue
Block a user