feat: exclude Bonded feature from Ikonis augment slot calculation
This commit is contained in:
parent
328932d6b0
commit
4a7aa554f3
1 changed files with 6 additions and 3 deletions
|
|
@ -115,10 +115,13 @@ export function patchIkonisSheet() {
|
||||||
const weaponFeatures = this.document.system.weaponFeatures || [];
|
const weaponFeatures = this.document.system.weaponFeatures || [];
|
||||||
const allAugments = getAugments();
|
const allAugments = getAugments();
|
||||||
|
|
||||||
// Filter out native features that aren't Ikonis augments if needed,
|
// Exclude Bonded from slot count
|
||||||
// but for now we'll just count total weapon features against slots
|
const allNativeFeatures = CONFIG.DH.ITEM.allWeaponFeatures() || {};
|
||||||
|
const bondedId = Object.keys(allNativeFeatures).find(k => allNativeFeatures[k].name === "Ikonis: Bonded");
|
||||||
|
const usedSlotsCount = weaponFeatures.filter(f => f.value !== bondedId).length;
|
||||||
|
|
||||||
const maxSlots = getSlotCount(this.document);
|
const maxSlots = getSlotCount(this.document);
|
||||||
if (weaponFeatures.length >= maxSlots) {
|
if (usedSlotsCount >= maxSlots) {
|
||||||
ui.notifications.warn(`No more augment slots available! (Max: ${maxSlots})`);
|
ui.notifications.warn(`No more augment slots available! (Max: ${maxSlots})`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue