diff --git a/lang/en.json b/lang/en.json index 14218311..9f528c14 100755 --- a/lang/en.json +++ b/lang/en.json @@ -751,6 +751,11 @@ "bruiser": "for each Bruiser adversary.", "solo": "for each Solo adversary." }, + "ArmorInteraction": { + "none": { "label": "Ignores Armor" }, + "active": { "label": "Only Active With Armor" }, + "inactive": { "label": "Only Active Without Armor" } + }, "ArmorFeature": { "burning": { "name": "Burning", @@ -1851,7 +1856,13 @@ "transferHint": "If checked, this effect will be applied to any actor that owns this Effect's parent Item. The effect is always applied if this Item is attached to another one." }, "Armor": { - "newArmorEffect": "Armor Effect" + "newArmorEffect": "Armor Effect", + "FIELDS": { + "armorInteraction": { + "label": "Armor Interaction", + "hint": "Does the character wearing armor suppress this effect?" + } + } } }, "GENERAL": { diff --git a/module/applications/sheets-configs/armorActiveEffectConfig.mjs b/module/applications/sheets-configs/armorActiveEffectConfig.mjs index 7d8070e0..3dca8ef1 100644 --- a/module/applications/sheets-configs/armorActiveEffectConfig.mjs +++ b/module/applications/sheets-configs/armorActiveEffectConfig.mjs @@ -9,6 +9,7 @@ export default class ArmorActiveEffectConfig extends HandlebarsApplicationMixin( submitOnChange: true, closeOnSubmit: false }, + position: { width: 560 }, actions: { finish: ArmorActiveEffectConfig.#finish } diff --git a/module/config/generalConfig.mjs b/module/config/generalConfig.mjs index 80ac546e..b2833580 100644 --- a/module/config/generalConfig.mjs +++ b/module/config/generalConfig.mjs @@ -890,3 +890,9 @@ export const activeEffectModes = { label: 'EFFECT.CHANGES.TYPES.override' } }; + +export const activeEffectArmorInteraction = { + none: { id: 'none', label: 'DAGGERHEART.CONFIG.ArmorInteraction.none.label' }, + active: { id: 'active', label: 'DAGGERHEART.CONFIG.ArmorInteraction.active.label' }, + inactive: { id: 'inactive', label: 'DAGGERHEART.CONFIG.ArmorInteraction.inactive.label' } +}; diff --git a/module/data/activeEffect/armorEffect.mjs b/module/data/activeEffect/armorEffect.mjs index d32d24b2..894bf3ff 100644 --- a/module/data/activeEffect/armorEffect.mjs +++ b/module/data/activeEffect/armorEffect.mjs @@ -51,10 +51,30 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel } ] } - ) + ), + armorInteraction: new fields.StringField({ + required: true, + choices: CONFIG.DH.GENERAL.activeEffectArmorInteraction, + initial: CONFIG.DH.GENERAL.activeEffectArmorInteraction.none.id, + label: 'DAGGERHEART.EFFECTS.Armor.FIELDS.armorInteraction.label', + hint: 'DAGGERHEART.EFFECTS.Armor.FIELDS.armorInteraction.hint' + }) }; } + get isSuppressed() { + if (this.parent.actor?.type !== 'character') return false; + + switch (this.armorInteraction) { + case CONFIG.DH.GENERAL.activeEffectArmorInteraction.active.id: + return !this.parent.actor.system.armor; + case CONFIG.DH.GENERAL.activeEffectArmorInteraction.inactive.id: + return Boolean(this.parent.actor.system.armor); + default: + return false; + } + } + /* Type Functions */ /** diff --git a/module/documents/activeEffect.mjs b/module/documents/activeEffect.mjs index 055267b2..56981c52 100644 --- a/module/documents/activeEffect.mjs +++ b/module/documents/activeEffect.mjs @@ -8,6 +8,8 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect { /**@override */ get isSuppressed() { + if (this.system.isSuppressed === true) return true; + // If this is a copied effect from an attachment, never suppress it // (These effects have attachmentSource metadata) if (this.flags?.daggerheart?.attachmentSource) { diff --git a/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json b/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json index c06a34ab..096be253 100644 --- a/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json +++ b/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json @@ -101,7 +101,8 @@ "value": 0, "max": "1" } - ] + ], + "armorInteraction": "active" }, "_id": "tJw2JIPcT9hEMRXg", "img": "icons/tools/hand/hammer-and-nail.webp", @@ -112,7 +113,7 @@ "expiry": null, "expired": false }, - "description": "
While you’re wearing armor, gain a +1 bonus to your Armor Score.
", + "description": "While you’re wearing armor, gain a +1 bonus to your Armor Score.
", "origin": null, "tint": "#ffffff", "transfer": true, diff --git a/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json b/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json index 7e0129d7..40af13a7 100644 --- a/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json +++ b/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json @@ -33,7 +33,8 @@ "phase": "initial", "priority": 20 } - ] + ], + "armorInteraction": "inactive" }, "_id": "FCsgz7Tdsw6QUzBs", "img": "icons/magic/control/buff-strength-muscle-damage-orange.webp", diff --git a/styles/less/sheets/activeEffects/armorEffects.less b/styles/less/sheets/activeEffects/armorEffects.less index 9756edce..fd5c89b1 100644 --- a/styles/less/sheets/activeEffects/armorEffects.less +++ b/styles/less/sheets/activeEffects/armorEffects.less @@ -1,16 +1,5 @@ .application.sheet.daggerheart.dh-style.armor-effect-config { - .armor-effects-container { - display: flex; - flex-direction: column; - gap: 8px; - - .armor-effect-container { - display: flex; - gap: 4px; - - * { - flex: 1; - } - } + .tab-form-footer { + margin-top: 8px; } } diff --git a/templates/sheets/activeEffect/armor/settings.hbs b/templates/sheets/activeEffect/armor/settings.hbs index c0f77b35..12ca2154 100644 --- a/templates/sheets/activeEffect/armor/settings.hbs +++ b/templates/sheets/activeEffect/armor/settings.hbs @@ -1,10 +1,17 @@