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,74 @@
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getUniqueKey(conditionLevel) {
|
||||
return `${getId(conditionLevel)}-${getEntityTypeId(conditionLevel)}`;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getEffect(conditionLevel) {
|
||||
return getDefinitionEffect(conditionLevel);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getDefinitionEffect(conditionLevel) {
|
||||
var _a, _b;
|
||||
return (_b = (_a = conditionLevel.definition) === null || _a === void 0 ? void 0 : _a.effect) !== null && _b !== void 0 ? _b : null;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getEntityTypeId(conditionLevel) {
|
||||
return getDefinitionEntityTypeId(conditionLevel);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getDefinitionEntityTypeId(conditionLevel) {
|
||||
var _a, _b;
|
||||
return (_b = (_a = conditionLevel.definition) === null || _a === void 0 ? void 0 : _a.entityTypeId) !== null && _b !== void 0 ? _b : -1;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getId(conditionLevel) {
|
||||
return getDefinitionId(conditionLevel);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getDefinitionId(conditionLevel) {
|
||||
var _a, _b;
|
||||
return (_b = (_a = conditionLevel.definition) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : -1;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getLevel(conditionLevel) {
|
||||
return getDefinitionLevel(conditionLevel);
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getDefinitionLevel(conditionLevel) {
|
||||
var _a, _b;
|
||||
return (_b = (_a = conditionLevel.definition) === null || _a === void 0 ? void 0 : _a.level) !== null && _b !== void 0 ? _b : -1;
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
*/
|
||||
export function getModifiers(conditionLevel) {
|
||||
return conditionLevel.modifiers;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import { DataOriginTypeEnum } from '../DataOrigin';
|
||||
import { ModifierGenerators } from '../Modifier';
|
||||
import { getEntityTypeId, getId } from './accessors';
|
||||
/**
|
||||
*
|
||||
* @param conditionLevel
|
||||
* @param condition
|
||||
* @param modifierLookup
|
||||
*/
|
||||
export function generateConditionLevel(conditionLevel, condition, modifierLookup) {
|
||||
const modifiers = ModifierGenerators.generateModifiers(getId(conditionLevel), getEntityTypeId(conditionLevel), modifierLookup, DataOriginTypeEnum.CONDITION, condition);
|
||||
return Object.assign(Object.assign({}, conditionLevel), { modifiers });
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import * as ConditionLevelAccessors from './accessors';
|
||||
import * as ConditionLevelGenerators from './generators';
|
||||
import * as ConditionLevelTypings from './typings';
|
||||
export * from './typings';
|
||||
export { ConditionLevelAccessors, ConditionLevelGenerators };
|
||||
export default Object.assign(Object.assign(Object.assign({}, ConditionLevelAccessors), ConditionLevelGenerators), ConditionLevelTypings);
|
||||
Reference in New Issue
Block a user