feat: signatureSpells lists all spells of a discipline

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-17 10:19:24 +02:00
co-authored by Claude Sonnet 5.5
parent 9ca94268c5
commit 2f3f0057b1
+9 -9
View File
@@ -54,18 +54,18 @@ allDocs.push(...(await parseGear(ctx)));
console.log(`[build-packs] parsed ${allDocs.length} documents total`); console.log(`[build-packs] parsed ${allDocs.length} documents total`);
// 2b. Assign signature spells: every discipline lists the spells of its own school. // 2b. signatureSpells = every spell belonging to the discipline (own school or
// Sacred Magic lists only the common prayers (the rest are deity-specific). // listed in the spell's requirements.discipline).
for (const disc of allDocs) { for (const disc of allDocs) {
if (disc.subType !== 'discipline') continue; if (disc.subType !== 'discipline') continue;
const sys = disc.system as Record<string, any>; const sys = disc.system as Record<string, any>;
const spells = allDocs.filter((d) => { sys.signatureSpells = allDocs
if (d.subType !== 'spell') return false; .filter((d) => {
const sp = d.system as Record<string, any>; if (d.subType !== 'spell') return false;
if (sp.school !== disc.id || sp.isSuperspell) return false; const sp = d.system as Record<string, any>;
return disc.id !== 'sacred' || sp.deity === 'common'; return sp.school === disc.id || (sp.requirements?.discipline ?? []).includes(disc.id);
}); })
sys.signatureSpells = spells.map((d) => d.name); .map((d) => d.name);
} }
// 3. Group by pack and emit one JSON per doc into packs-src/<pack>/. // 3. Group by pack and emit one JSON per doc into packs-src/<pack>/.