From bbce05dfea06cce5b8d961d264c22a58f1792777 Mon Sep 17 00:00:00 2001 From: cosmo Date: Sun, 26 Apr 2026 18:46:34 +0200 Subject: [PATCH] remove Ikonis effect injection patch from Actor prototype --- scripts/ikonis-data.js | 59 ------------------------------------------ 1 file changed, 59 deletions(-) diff --git a/scripts/ikonis-data.js b/scripts/ikonis-data.js index 6d20a30..66a0766 100644 --- a/scripts/ikonis-data.js +++ b/scripts/ikonis-data.js @@ -68,65 +68,6 @@ export function getSlotCount(item) { } } -/** - * Patches the system to ensure Ikonis effects are applied to the actor. - */ -export function patchIkonisLogic() { - console.log("DH-Ikonis | Patching Actor for Ikonis effect injection..."); - - const originalAllEffects = Actor.prototype.allApplicableEffects; - Actor.prototype.allApplicableEffects = function* (options) { - yield* originalAllEffects.call(this, options); - - for (const item of this.items) { - if (item.type !== 'weapon' || !item.system.equipped) continue; - - const installedIds = item.getFlag('dh-ikonis', 'installedAugments') || []; - const allAugs = getAugments(); - - for (const id of installedIds) { - const aug = allAugs.find(a => String(a.id) === String(id)); - if (!aug?.featureUuid) continue; - - // Try cache first, then sync - const feature = _featureCache.get(aug.featureUuid) || fromUuidSync(aug.featureUuid); - if (!feature || !feature.effects) continue; - - for (const effect of feature.effects) { - if (effect.transfer) { - console.log(`DH-Ikonis | Injecting effect '${effect.name}' from augment '${feature.name}' on ${this.name}`); - - // Clone the effect and set this actor as parent to ensure application - const effectData = effect.toObject(); - effectData.disabled = false; - const ActiveEffectClass = getDocumentClass("ActiveEffect"); - const effectInstance = new ActiveEffectClass(effectData, { parent: this }); - yield effectInstance; - } - } - } - - const bondedUuid = item.getFlag('dh-ikonis', 'bondedFeatureUuid'); - if (bondedUuid) { - const feature = _featureCache.get(bondedUuid) || fromUuidSync(bondedUuid); - if (feature?.effects) { - for (const effect of feature.effects) { - if (effect.transfer) { - console.log(`DH-Ikonis | Injecting bonded effect '${effect.name}' from '${feature.name}' on ${this.name}`); - - const effectData = effect.toObject(); - effectData.disabled = false; - const ActiveEffectClass = getDocumentClass("ActiveEffect"); - const effectInstance = new ActiveEffectClass(effectData, { parent: this }); - yield effectInstance; - } - } - } - } - } - }; -} - /** * Synchronizes Ikonis Augments into the Daggerheart Homebrew settings. * This makes them "Real" Weapon Features to the system.