Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { ClassAccessors } from '../Class';
|
||||
import { AppContextTypeEnum, DB_STRING_MARTIAL_ARTS, DB_STRING_PACT_MAGIC, DB_STRING_SPELLCASTING, DB_STRING_DEDICATED_WEAPON, } from '../Core';
|
||||
import { getHideInBuilder, getHideInSheet, getLevelScale, getName } from './accessors';
|
||||
export function doesEnableSpellcasting(feature) {
|
||||
return getName(feature) === DB_STRING_SPELLCASTING;
|
||||
}
|
||||
export function doesEnablePactMagic(feature) {
|
||||
return getName(feature) === DB_STRING_PACT_MAGIC;
|
||||
}
|
||||
export function doesEnableDedicatedWeapon(feature) {
|
||||
return getName(feature) === DB_STRING_DEDICATED_WEAPON;
|
||||
}
|
||||
export function doesEnableMartialArts(feature) {
|
||||
return getName(feature).indexOf(DB_STRING_MARTIAL_ARTS) === 0;
|
||||
}
|
||||
export function getContextData(feature, charClass) {
|
||||
return {
|
||||
levelScale: getLevelScale(feature),
|
||||
classLevel: charClass ? ClassAccessors.getLevel(charClass) : null,
|
||||
};
|
||||
}
|
||||
export function getHideInContext(feature, context) {
|
||||
if (context === AppContextTypeEnum.SHEET) {
|
||||
return getHideInSheet(feature);
|
||||
}
|
||||
return getHideInBuilder(feature);
|
||||
}
|
||||
Reference in New Issue
Block a user