feat: exclude Bonded feature from Ikonis augment slot calculation

This commit is contained in:
CPTN Cosmo 2026-04-26 19:09:38 +02:00
parent 328932d6b0
commit 4a7aa554f3

View file

@ -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;
}