New source found from dndbeyond.com
This commit is contained in:
@@ -437,6 +437,13 @@ export function getUniqueClassFeatures(charClass) {
|
||||
export function getVisibileClassFeatures(charClass) {
|
||||
return charClass.visibleClassFeatures;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param charClass
|
||||
*/
|
||||
export function getHigherLevelClassFeatures(charClass) {
|
||||
return charClass.higherLevelClassFeatures;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param charClass
|
||||
|
||||
@@ -145,11 +145,14 @@ export function deriveClassFeatureGroups(charClass, classFeatures, appContext) {
|
||||
}
|
||||
return acc;
|
||||
}, []);
|
||||
const higherLevelFeatures = classFeatures.filter((feature) => ClassFeatureAccessors.getRequiredLevel(feature) > getLevel(charClass) &&
|
||||
(appContext === null || !ClassFeatureUtils.getHideInContext(feature, appContext)));
|
||||
return {
|
||||
activeFeatures,
|
||||
visibleFeatures,
|
||||
orderedFeatures,
|
||||
uniqueFeatures,
|
||||
higherLevelFeatures,
|
||||
};
|
||||
}
|
||||
/**
|
||||
|
||||
@@ -62,11 +62,11 @@ export function generateBaseCharClass(charClass, optionalClassFeatures, allClass
|
||||
featureSpells.push(...OptionAccessors.getSpells(option));
|
||||
});
|
||||
});
|
||||
const { activeFeatures, visibleFeatures, orderedFeatures, uniqueFeatures } = deriveClassFeatureGroups(charClass, updatedFeatures, appContext);
|
||||
const { activeFeatures, visibleFeatures, orderedFeatures, uniqueFeatures, higherLevelFeatures } = deriveClassFeatureGroups(charClass, updatedFeatures, appContext);
|
||||
// do any class features or modifiers enable hex, pact or dedicated weapons
|
||||
//TODO eventually should just be able to use modifiers here and not have to check class feature names
|
||||
const { enablesHexWeapon, enablesPactWeapon, enablesDedicatedWeapon } = deriveDedicatedHexAndPactWeaponEnabled(updatedFeatures, classModifiers);
|
||||
return Object.assign(Object.assign({}, charClass), { activeId: deriveActiveId(charClass), spells: SpellGenerators.updateClassSpells(featureSpells, classSpells), modifiers: classModifiers, featureSpells, classFeatures: updatedFeatures, optionalClassFeatures, activeClassFeatures: activeFeatures, visibleClassFeatures: visibleFeatures, orderedClassFeatures: orderedFeatures, uniqueClassFeatures: uniqueFeatures, feats,
|
||||
return Object.assign(Object.assign({}, charClass), { activeId: deriveActiveId(charClass), spells: SpellGenerators.updateClassSpells(featureSpells, classSpells), modifiers: classModifiers, featureSpells, classFeatures: updatedFeatures, optionalClassFeatures, activeClassFeatures: activeFeatures, visibleClassFeatures: visibleFeatures, orderedClassFeatures: orderedFeatures, uniqueClassFeatures: uniqueFeatures, higherLevelClassFeatures: higherLevelFeatures, feats,
|
||||
actions,
|
||||
enablesDedicatedWeapon,
|
||||
enablesHexWeapon,
|
||||
|
||||
@@ -217,7 +217,7 @@ export function getCastLevelRange(spell, spellCasterInfo, ruleData) {
|
||||
...spellCasterInfo.availableSpellLevels,
|
||||
...spellCasterInfo.availablePactMagicLevels,
|
||||
].filter((level) => level >= getLevel(spell));
|
||||
startLevel = Math.max(getLevel(spell), Math.min(...availableLevels));
|
||||
startLevel = Math.max(getLevel(spell), availableLevels.length > 0 ? Math.min(...availableLevels) : 0);
|
||||
endLevel = Math.max(getLevel(spell), ...availableLevels);
|
||||
if (limitedUse && getDataOriginType(spell) === DataOriginTypeEnum.CLASS_FEATURE) {
|
||||
const dataOrigin = getDataOrigin(spell);
|
||||
|
||||
Reference in New Issue
Block a user