New source found from dndbeyond.com
This commit is contained in:
@@ -57,7 +57,8 @@ export class ItemManager extends PartyManager {
|
||||
else {
|
||||
const isContainer = this.isContainer();
|
||||
const infusion = this.getInfusion();
|
||||
this.dispatch(characterActions.itemDestroy(this.getMappingId(), isContainer && infusion ? false : true, this.handleAcceptOnSuccess(isShared, onSuccess)));
|
||||
const itemPlan = this.getItemPlan();
|
||||
this.dispatch(characterActions.itemDestroy(this.getMappingId(), isContainer && (infusion || itemPlan) ? false : true, this.handleAcceptOnSuccess(isShared, onSuccess)));
|
||||
}
|
||||
};
|
||||
this.handleMove = ({ containerDefinitionKey }, onSuccess, onError) => {
|
||||
@@ -124,6 +125,13 @@ export class ItemManager extends PartyManager {
|
||||
this.getPrimarySourceCategoryId = () => ItemAccessors.getPrimarySourceCategoryId(this.item);
|
||||
this.getSecondarySourceCategoryIds = () => ItemAccessors.getSecondarySourceCategoryIds(this.item);
|
||||
this.getAllSourceCategoryIds = () => ItemUtils.getAllSourceCategoryIds(this.item);
|
||||
this.getDefinitionKey = () => { var _a; return (_a = ItemAccessors.getDefinition(this.item)) === null || _a === void 0 ? void 0 : _a.definitionKey; };
|
||||
this.getOriginDefinitionKey = () => ItemAccessors.getOriginDefinitionKey(this.item);
|
||||
this.getDescription = () => ItemAccessors.getDescription(this.item);
|
||||
this.getRarity = () => ItemAccessors.getRarity(this.item);
|
||||
this.canAttune = () => ItemAccessors.canAttune(this.item);
|
||||
this.getAttunementDescription = () => ItemAccessors.getAttunementDescription(this.item);
|
||||
this.getPartyInventoryRestrictions = () => ItemAccessors.getPartyInventoryRestrictions(this.item);
|
||||
// Validator
|
||||
this.isShared = () => this.requiresContainer().isShared();
|
||||
this.isArmorContract = () => ItemUtils.isArmorContract(this.item);
|
||||
@@ -134,10 +142,7 @@ export class ItemManager extends PartyManager {
|
||||
const canEquip = ItemAccessors.canEquip(this.item);
|
||||
const isEquipped = ItemAccessors.isEquipped(this.item);
|
||||
if (isShared && canEquip) {
|
||||
if (this.isSharingTurnedOn() || (this.isSharingTurnedDeleteOnly() && isEquipped)) {
|
||||
return isEquipped ? this.isEquippedToCurrentCharacter() : true;
|
||||
}
|
||||
return false;
|
||||
return isEquipped ? this.isEquippedToCurrentCharacter() : true;
|
||||
}
|
||||
return canEquip;
|
||||
};
|
||||
@@ -145,6 +150,7 @@ export class ItemManager extends PartyManager {
|
||||
const characterId = rulesEngineSelectors.getId(this.state);
|
||||
return ItemValidators.isEquippedToCurrentCharacter(this.item, characterId);
|
||||
};
|
||||
this.isReplicated = () => ItemUtils.isReplicated(this.item);
|
||||
// Utils
|
||||
this.getRarityLevel = () => ItemUtils.getRarityLevel(this.item);
|
||||
this.generateContainerDefinitionKey = () => {
|
||||
@@ -161,12 +167,61 @@ export class ItemManager extends PartyManager {
|
||||
}
|
||||
return DefaultCharacterName;
|
||||
};
|
||||
this.getItemPlan = () => {
|
||||
const itemPlans = rulesEngineSelectors.getAvailableItemPlans(this.state);
|
||||
return ItemUtils.getItemPlan(this.item, itemPlans);
|
||||
};
|
||||
this.getNotes = () => {
|
||||
const weaponSpellDamageGroups = rulesEngineSelectors.getWeaponSpellDamageGroups(this.state);
|
||||
const ruleData = rulesEngineSelectors.getRuleData(this.state);
|
||||
const abilityLookup = rulesEngineSelectors.getAbilityLookup(this.state);
|
||||
const proficiencyBonus = rulesEngineSelectors.getProficiencyBonus(this.state);
|
||||
return ItemNotes.getNoteComponents(this.item, weaponSpellDamageGroups, ruleData, abilityLookup, proficiencyBonus);
|
||||
return ItemNotes.getNoteComponents(this.item, weaponSpellDamageGroups, ruleData, abilityLookup, proficiencyBonus, this.getItemPlan());
|
||||
};
|
||||
this.getIntroText = () => {
|
||||
const strings = [];
|
||||
const subType = this.getSubType();
|
||||
const rarity = this.getRarity();
|
||||
const attunementDescription = this.getAttunementDescription();
|
||||
let type = this.getType();
|
||||
if (this.isWeaponContract()) {
|
||||
if (this.isMagic()) {
|
||||
type = `Weapon (${type})`;
|
||||
}
|
||||
else {
|
||||
type = 'Weapon';
|
||||
}
|
||||
}
|
||||
else if (this.isArmorContract()) {
|
||||
if (this.isMagic()) {
|
||||
type = `Armor (${this.getBaseArmorName()})`;
|
||||
}
|
||||
else {
|
||||
type = 'Armor';
|
||||
}
|
||||
}
|
||||
else if (this.isGearContract()) {
|
||||
type = subType || type;
|
||||
}
|
||||
else if (this.isCustom()) {
|
||||
type = 'Custom';
|
||||
}
|
||||
if (this.isLegacy()) {
|
||||
strings.push('Legacy • ');
|
||||
}
|
||||
if (type) {
|
||||
strings.push(type);
|
||||
}
|
||||
if (!this.isCustom() && rarity) {
|
||||
strings.push(`, ${rarity}`);
|
||||
}
|
||||
if (this.canAttune()) {
|
||||
strings.push(` (requires attunement${attunementDescription ? ` by a ${attunementDescription}` : ''})`);
|
||||
}
|
||||
if (this.isContainer()) {
|
||||
strings.push(', container');
|
||||
}
|
||||
return strings.join('');
|
||||
};
|
||||
this.getMetaText = () => {
|
||||
const appliedWeaponReplacementStats = this.getAppliedWeaponReplacementStats();
|
||||
|
||||
Reference in New Issue
Block a user