From 2f3f0057b1923bb431a534e274cc2ccd51d89770 Mon Sep 17 00:00:00 2001 From: Octoturge Date: Sat, 17 Oct 2026 10:19:24 +0200 Subject: [PATCH] feat: signatureSpells lists all spells of a discipline Co-Authored-By: Claude Sonnet 5.5 --- scripts/build-packs.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/build-packs.ts b/scripts/build-packs.ts index ee073a2..cef495c 100644 --- a/scripts/build-packs.ts +++ b/scripts/build-packs.ts @@ -54,18 +54,18 @@ allDocs.push(...(await parseGear(ctx))); console.log(`[build-packs] parsed ${allDocs.length} documents total`); -// 2b. Assign signature spells: every discipline lists the spells of its own school. -// Sacred Magic lists only the common prayers (the rest are deity-specific). +// 2b. signatureSpells = every spell belonging to the discipline (own school or +// listed in the spell's requirements.discipline). for (const disc of allDocs) { if (disc.subType !== 'discipline') continue; const sys = disc.system as Record; - const spells = allDocs.filter((d) => { - if (d.subType !== 'spell') return false; - const sp = d.system as Record; - if (sp.school !== disc.id || sp.isSuperspell) return false; - return disc.id !== 'sacred' || sp.deity === 'common'; - }); - sys.signatureSpells = spells.map((d) => d.name); + sys.signatureSpells = allDocs + .filter((d) => { + if (d.subType !== 'spell') return false; + const sp = d.system as Record; + return sp.school === disc.id || (sp.requirements?.discipline ?? []).includes(disc.id); + }) + .map((d) => d.name); } // 3. Group by pack and emit one JSON per doc into packs-src//.