New source found from dndbeyond.com

This commit is contained in:
2025-06-18 01:00:16 -07:00
parent 451d940294
commit 0b403376c5
30 changed files with 496 additions and 418 deletions
@@ -281,3 +281,7 @@ export function getDefinitionRepeatableParentId(feat) {
export function getRepeatableParentId(feat) {
return getDefinitionRepeatableParentId(feat);
}
export function getSpellListIds(feat) {
var _a, _b;
return (_b = (_a = getDefinition(feat)) === null || _a === void 0 ? void 0 : _a.spellListIds) !== null && _b !== void 0 ? _b : [];
}
@@ -14,7 +14,7 @@ import { ModifierGenerators } from '../Modifier';
import { OptionAccessors, OptionGenerators } from '../Option';
import { RaceAccessors } from '../Race';
import { SpellGenerators } from '../Spell';
import { getComponentId, getComponentTypeId, getCreatureRules, getEntityTypeId, getId, getModifiers, getOptions, getUniqueKey, } from './accessors';
import { getComponentId, getComponentTypeId, getCreatureRules, getEntityTypeId, getId, getModifiers, getOptions, getSpellListIds, getUniqueKey, } from './accessors';
/**
*
* @param feat
@@ -342,3 +342,20 @@ export function generateDataOriginPairedFeats(feats) {
}
return lookup;
}
/**
* Generates a list of spell list IDs from the feats.
* This is used to determine which spell lists are available globally.
*
* @param feats - Array of Feat objects
* @returns Array of spell list IDs
*/
export function generateGlobalFeatsSpellListIds(feats) {
const spellListIds = [];
feats.forEach((feat) => {
const spellListIdsForFeat = getSpellListIds(feat);
if (spellListIdsForFeat.length > 0) {
spellListIds.push(...spellListIdsForFeat);
}
});
return spellListIds;
}