New source found from dndbeyond.com
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import { orderBy } from 'lodash';
|
||||
import { TypeScriptUtils } from '../../utils';
|
||||
import { ActionAccessors } from '../Action';
|
||||
import { PartyRestrictionTypeEnum } from '../Campaign';
|
||||
import { ContainerValidators } from '../Container';
|
||||
import { ItemPlanAccessors } from '../ItemPlan';
|
||||
import { ValueHacks, ValueUtils } from '../Value';
|
||||
import { canAttune, getArmorTypeId, getAttackType, getBaseItemId, getBaseType, getBaseTypeId, getContainerDefinitionKey, getGearTypeId, getItemWeaponBehaviors, getMappingEntityTypeId, getMappingId, getMasteryName, getName, getPrimarySourceCategoryId, getProperties, getRarity, getSecondarySourceCategoryIds, isAttuned, isContainer, } from './accessors';
|
||||
import { canAttune, getArmorTypeId, getAttackType, getBaseItemId, getBaseType, getBaseTypeId, getContainerDefinitionKey, getDefinition, getGearTypeId, getItemWeaponBehaviors, getMappingEntityTypeId, getMappingId, getMasteryName, getName, getOriginDefinitionKey, getPartyInventoryRestrictions, getPrimarySourceCategoryId, getProperties, getRarity, getSecondarySourceCategoryIds, isAttuned, isContainer, } from './accessors';
|
||||
import { ArmorTypeEnum, ItemBaseTypeEnum, ItemBaseTypeIdEnum, ItemRarityNameEnum, ItemTypeEnum, } from './constants';
|
||||
//TODO probably move alot of these to validators and validate naming :)
|
||||
export function isShield(armor) {
|
||||
@@ -177,3 +179,15 @@ export function getMasteryAction(item, actions) {
|
||||
export function getAllSourceCategoryIds(item) {
|
||||
return [getPrimarySourceCategoryId(item), ...getSecondarySourceCategoryIds(item)];
|
||||
}
|
||||
/// Returns the item plan for the given item if it exists in the provided item plans.
|
||||
export function getItemPlan(item, itemPlans) {
|
||||
return (itemPlans.find((plan) => {
|
||||
var _a;
|
||||
return ((_a = getDefinition(item)) === null || _a === void 0 ? void 0 : _a.definitionKey) === ItemPlanAccessors.getItemDefinitionKey(plan) &&
|
||||
getOriginDefinitionKey(item) === ItemPlanAccessors.getOriginDefinitionKey(plan);
|
||||
}) || null);
|
||||
}
|
||||
export function isReplicated(item) {
|
||||
const partyRestrictions = getPartyInventoryRestrictions(item);
|
||||
return partyRestrictions.some((restriction) => restriction.type === PartyRestrictionTypeEnum.REPLICATED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user