D&D: import Open5e SRD spell lists, make the five casters playable

Rebuilds the cmd/open5e-import CLI (fetch/gen × spells) to vendor
data/open5e/spells.json (319 SRD spells) and generate
dnd_spells_srd_data.go (237 after the level>5 filter). mapClasses unions
the API's incomplete structured spell_lists field with the complete
free-text dnd_class field so all eight casters get spells.

dndSpellRegistry loads buildSRDSpellList() first; the hand-authored
buildSpellList() overlays it (hand wins on ID collision). Playable=true
flipped for Druid/Bard/Sorcerer/Warlock/Paladin, each with a
defaultKnownSpells case. TestDefaultKnownSpellsExistInRegistry now covers
all eight classes.

.gitignore: vendor data/open5e/ while keeping the rest of data/ ignored,
and anchor the open5e-import binary pattern so it stops swallowing the
cmd/open5e-import source dir. NOTICE adds CC-BY-4.0 / SRD attribution.
This commit is contained in:
prosolis
2026-05-14 15:18:18 -07:00
parent e6e0009253
commit 6ef8b9fd0a
9 changed files with 7110 additions and 10 deletions

View File

@@ -87,12 +87,13 @@ var dndClasses = []DnDClassInfo{
{ClassMage, "Mage", 6, 4, "INT", "WIS", true},
{ClassCleric, "Cleric", 8, 5, "WIS", "CHA", true},
{ClassRanger, "Ranger", 8, 5, "DEX", "WIS", true},
// Open5e caster scaffold — Playable=false until spell lists land.
{ClassDruid, "Druid", 8, 5, "WIS", "CON", false},
{ClassBard, "Bard", 8, 5, "CHA", "DEX", false},
{ClassSorcerer, "Sorcerer", 6, 4, "CHA", "CON", false},
{ClassWarlock, "Warlock", 8, 5, "CHA", "CON", false},
{ClassPaladin, "Paladin", 10, 6, "STR", "CHA", false},
// Open5e caster scaffold — Playable flipped on once the SRD spell import
// gave each of them a real spell list (see dnd_spells_srd_data.go).
{ClassDruid, "Druid", 8, 5, "WIS", "CON", true},
{ClassBard, "Bard", 8, 5, "CHA", "DEX", true},
{ClassSorcerer, "Sorcerer", 6, 4, "CHA", "CON", true},
{ClassWarlock, "Warlock", 8, 5, "CHA", "CON", true},
{ClassPaladin, "Paladin", 10, 6, "STR", "CHA", true},
}
func raceInfo(r DnDRace) (DnDRaceInfo, bool) {