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 allAugments = getAugments();
|
||||
|
||||
// Filter out native features that aren't Ikonis augments if needed,
|
||||
// but for now we'll just count total weapon features against slots
|
||||
// Exclude Bonded from slot count
|
||||
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);
|
||||
if (weaponFeatures.length >= maxSlots) {
|
||||
if (usedSlotsCount >= maxSlots) {
|
||||
ui.notifications.warn(`No more augment slots available! (Max: ${maxSlots})`);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue