mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 00:52:40 +00:00
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:
@@ -171,7 +171,10 @@ func TestSpellAttackBonus(t *testing.T) {
|
||||
// ── Default known list ──────────────────────────────────────────────────────
|
||||
|
||||
func TestDefaultKnownSpellsExistInRegistry(t *testing.T) {
|
||||
for _, class := range []DnDClass{ClassMage, ClassCleric, ClassRanger} {
|
||||
for _, class := range []DnDClass{
|
||||
ClassMage, ClassCleric, ClassRanger,
|
||||
ClassDruid, ClassBard, ClassSorcerer, ClassWarlock, ClassPaladin,
|
||||
} {
|
||||
for _, lvl := range []int{1, 3, 5, 9, 13, 20} {
|
||||
for _, sid := range defaultKnownSpells(class, lvl) {
|
||||
if _, ok := lookupSpell(sid); !ok {
|
||||
|
||||
Reference in New Issue
Block a user