From 5ac4a0af1790c5da78076c612790ccc29e79167d Mon Sep 17 00:00:00 2001 From: cosmo Date: Sun, 26 Apr 2026 18:24:56 +0200 Subject: [PATCH] set system type to ikonis and scope feature IDs to item IDs to prevent duplicate sheet entries --- scripts/ikonis-data.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/ikonis-data.js b/scripts/ikonis-data.js index a747cc0..4ced4f5 100644 --- a/scripts/ikonis-data.js +++ b/scripts/ikonis-data.js @@ -162,7 +162,13 @@ export function patchDhCharacter(DhCharacter) { if (feature) { // Use clone() to preserve internal action state const featureClone = feature.clone({ parent: this.parent }, { keepId: true }); - const virtualId = `ikonis-${feature.id}`; + + // Set system type to 'ikonis' so the original sheetLists ignores it + // This prevents features from appearing twice on the sheet + featureClone.system.type = "ikonis"; + + // Use unique ID per weapon to prevent overwriting same-tech on different weapons + const virtualId = `ikonis-${item.id}-${feature.id}`; Object.defineProperty(featureClone, "id", { value: virtualId, enumerable: true }); // ALWAYS inject into memory collection so it's resolvable @@ -171,9 +177,7 @@ export function patchDhCharacter(DhCharacter) { // ONLY add to the sheet list if the weapon is equipped if (isEquipped) { ikonisFeatures.push(featureClone); - console.log(`DH-Ikonis | Resolved ${type} feature: ${feature.name} (Equipped)`); - } else { - console.log(`DH-Ikonis | Resolved ${type} feature: ${feature.name} (Unequipped - Hidden from sheet)`); + console.log(`DH-Ikonis | Resolved ${type} feature: ${feature.name} for ${item.name} (Equipped)`); } } };