From 26ae17c3cf66d5c0eedd4d3190d8e332d0482299 Mon Sep 17 00:00:00 2001 From: WBHarry Date: Wed, 11 Feb 2026 11:04:40 +0100 Subject: [PATCH] Fixed SRD armor effects --- module/data/activeEffect/armorEffect.mjs | 14 ++- .../domainCard_Armorer_cy8GjBPGc9w9RaGO.json | 46 ++++--- ...omainCard_Bare_Bones_l5D9kq901JDESaXw.json | 95 ++++++++++++++- ...mainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json | 48 ++++---- ...inCard_Valor_Touched_k1AtYd3lSchIymBr.json | 46 ++++--- .../folders_Splendor_TL1TutmbeCVJ06nR.json | 2 +- .../armor_Bare_Bones_ITAjcigTcUw5pMCN.json | 114 ------------------ .../folders_Special_tI3bfr6Sgi16Z7zm.json | 12 -- 8 files changed, 168 insertions(+), 209 deletions(-) delete mode 100644 src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json delete mode 100644 src/packs/items/armors/folders_Special_tI3bfr6Sgi16Z7zm.json diff --git a/module/data/activeEffect/armorEffect.mjs b/module/data/activeEffect/armorEffect.mjs index 93a7ed3d..d32d24b2 100644 --- a/module/data/activeEffect/armorEffect.mjs +++ b/module/data/activeEffect/armorEffect.mjs @@ -107,9 +107,13 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel const actor = this.parent.actor?.type === 'character' ? this.parent.actor : null; const changeData = this.changes[0]; + const maxParse = actor ? itemAbleRollParse(changeData.max, actor, this.parent.parent) : null; + const maxRoll = maxParse ? new Roll(maxParse).evaluateSync() : null; + const maxEvaluated = maxRoll ? (maxRoll.isDeterministic ? maxRoll.total : null) : null; + return { ...changeData, - max: actor ? itemAbleRollParse(changeData.max, actor, this.parent.parent) : changeData.max + max: maxEvaluated ?? changeData.max }; } @@ -153,9 +157,11 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel } }; - return armorEffects.sort((a, b) => - increasing ? getEffectWeight(b) - getEffectWeight(a) : getEffectWeight(a) - getEffectWeight(b) - ); + return armorEffects + .filter(x => !x.disabled && !x.isSuppressed) + .sort((a, b) => + increasing ? getEffectWeight(b) - getEffectWeight(a) : getEffectWeight(a) - getEffectWeight(b) + ); } /* Overrides */ diff --git a/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json b/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json index aa9910dc..cb7bec9f 100644 --- a/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json +++ b/src/packs/domains/domainCard_Armorer_cy8GjBPGc9w9RaGO.json @@ -90,46 +90,42 @@ "effects": [ { "name": "Armorer", - "type": "base", + "type": "armor", "system": { - "rangeDependence": { - "enabled": false, - "type": "withinRange", - "target": "hostile", - "range": "melee" - } + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "1" + } + ] }, - "_id": "cED730OjuMW5haJR", + "_id": "PczrmraHWZ54NJsW", "img": "icons/tools/hand/hammer-and-nail.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "1", - "priority": null - } - ], "disabled": false, + "start": null, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "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, "statuses": [], + "showIcon": 1, + "folder": null, "sort": 0, "flags": {}, "_stats": { "compendiumSource": null }, - "_key": "!items.effects!cy8GjBPGc9w9RaGO.cED730OjuMW5haJR" + "_key": "!items.effects!cy8GjBPGc9w9RaGO.PczrmraHWZ54NJsW" } ], "ownership": { diff --git a/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json b/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json index 3b1ea76a..f6474623 100644 --- a/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json +++ b/src/packs/domains/domainCard_Bare_Bones_l5D9kq901JDESaXw.json @@ -4,7 +4,7 @@ "type": "domainCard", "folder": "QpOL7jPbMBzH96qR", "system": { - "description": "

When you choose not to equip armor, you have a base Armor Score of 3 + your Strength and use the following as your base damage thresholds:

Equip the below armor to use Bare Bones.

@UUID[Compendium.daggerheart.armors.Item.ITAjcigTcUw5pMCN]{Bare Bones}

", + "description": "

When you choose not to equip armor, you have a base Armor Score of 3 + your Strength and use the following as your base damage thresholds:

Equip the below armor to use Bare Bones.

", "domain": "valor", "recallCost": 0, "level": 1, @@ -19,7 +19,98 @@ } }, "flags": {}, - "effects": [], + "effects": [ + { + "name": "Bare Bones Armor", + "type": "armor", + "system": { + "changes": [ + { + "value": 0, + "max": "3 + @system.traits.strength.value", + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20 + } + ] + }, + "_id": "Zn1nNUwjlkbRfbMc", + "img": "icons/magic/control/buff-strength-muscle-damage-orange.webp", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "

You have a base Armor Score of 3 + your Strength

", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!l5D9kq901JDESaXw.Zn1nNUwjlkbRfbMc" + }, + { + "name": "Bare Bones", + "type": "base", + "system": { + "changes": [ + { + "key": "system.damageThresholds.major", + "type": "add", + "value": "9 + (@tier - 1) * 5 + max(0, (@tier -2) * 2 )", + "priority": null, + "phase": "initial" + }, + { + "key": "system.damageThresholds.severe", + "type": "add", + "value": "19 + (@tier - 1) * 5 + max(0, (@tier -2) * 2 )", + "priority": null, + "phase": "initial" + } + ], + "rangeDependence": { + "enabled": false, + "type": "withinRange", + "target": "hostile", + "range": "melee" + } + }, + "_id": "FazU8RFjMmTpXs7Z", + "img": "icons/magic/control/buff-strength-muscle-damage-orange.webp", + "disabled": false, + "start": null, + "duration": { + "value": null, + "units": "seconds", + "expiry": null, + "expired": false + }, + "description": "

You use the following as your base damage thresholds:

", + "origin": null, + "tint": "#ffffff", + "transfer": true, + "statuses": [], + "showIcon": 1, + "folder": null, + "sort": 0, + "flags": {}, + "_stats": { + "compendiumSource": null + }, + "_key": "!items.effects!l5D9kq901JDESaXw.FazU8RFjMmTpXs7Z" + } + ], "ownership": { "default": 0, "MQSznptE5yLT7kj8": 3 diff --git a/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json b/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json index 4ed5bd63..6dfc851a 100644 --- a/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json +++ b/src/packs/domains/domainCard_Book_of_Ava_YtZzYBtR0yLPPA93.json @@ -105,7 +105,7 @@ }, "effects": [ { - "_id": "LdcT1nrkd5ORCU4n", + "_id": "OKf8Kjr6Px8A3ubJ", "onSave": false } ], @@ -252,43 +252,39 @@ "img": "icons/magic/defensive/shield-barrier-glowing-triangle-blue.webp", "origin": "Compendium.daggerheart.domains.Item.YtZzYBtR0yLPPA93", "transfer": false, - "_id": "LdcT1nrkd5ORCU4n", - "type": "base", + "type": "armor", + "_id": "OKf8Kjr6Px8A3ubJ", "system": { - "rangeDependence": { - "enabled": false, - "type": "withinRange", - "target": "hostile", - "range": "melee" - } + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "1" + } + ] }, - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "1", - "priority": null - } - ], "disabled": false, + "start": null, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, - "description": "

+1 bonus to your Armor Score until your next rest, or the caster cast's Tava’s Armor again.

", + "description": "

Spend a Hope to give a target you can touch a +1 bonus to their Armor Score until their next rest or you cast Tava’s Armor again.

", "tint": "#ffffff", "statuses": [], + "showIcon": 1, + "folder": null, "sort": 0, "flags": {}, "_stats": { "compendiumSource": null }, - "_key": "!items.effects!YtZzYBtR0yLPPA93.LdcT1nrkd5ORCU4n" + "_key": "!items.effects!YtZzYBtR0yLPPA93.OKf8Kjr6Px8A3ubJ" } ], "ownership": { diff --git a/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json b/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json index 20fe18ea..ee6e377e 100644 --- a/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json +++ b/src/packs/domains/domainCard_Valor_Touched_k1AtYd3lSchIymBr.json @@ -91,46 +91,42 @@ "effects": [ { "name": "Valor-Touched", - "type": "base", + "type": "armor", "system": { - "rangeDependence": { - "enabled": false, - "type": "withinRange", - "target": "hostile", - "range": "melee" - } + "changes": [ + { + "key": "system.armorScore", + "type": "armor", + "phase": "initial", + "priority": 20, + "value": 0, + "max": "1" + } + ] }, - "_id": "H9lgIqqp1imSNOv9", + "_id": "JLw50ONfq1KJh1iM", "img": "icons/magic/control/control-influence-rally-purple.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "1", - "priority": null - } - ], "disabled": false, + "start": null, "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null + "value": null, + "units": "seconds", + "expiry": null, + "expired": false }, - "description": "", + "description": "

+1 bonus to your Armor Score

", "origin": null, "tint": "#ffffff", "transfer": true, "statuses": [], + "showIcon": 1, + "folder": null, "sort": 0, "flags": {}, "_stats": { "compendiumSource": null }, - "_key": "!items.effects!k1AtYd3lSchIymBr.H9lgIqqp1imSNOv9" + "_key": "!items.effects!k1AtYd3lSchIymBr.JLw50ONfq1KJh1iM" } ], "ownership": { diff --git a/src/packs/domains/folders_Splendor_TL1TutmbeCVJ06nR.json b/src/packs/domains/folders_Splendor_TL1TutmbeCVJ06nR.json index d7032288..9c220def 100644 --- a/src/packs/domains/folders_Splendor_TL1TutmbeCVJ06nR.json +++ b/src/packs/domains/folders_Splendor_TL1TutmbeCVJ06nR.json @@ -6,7 +6,7 @@ "sorting": "m", "_id": "TL1TutmbeCVJ06nR", "description": "", - "sort": 900000, + "sort": 750000, "flags": {}, "_key": "!folders!TL1TutmbeCVJ06nR" } diff --git a/src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json b/src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json deleted file mode 100644 index e555854d..00000000 --- a/src/packs/items/armors/armor_Bare_Bones_ITAjcigTcUw5pMCN.json +++ /dev/null @@ -1,114 +0,0 @@ -{ - "folder": "tI3bfr6Sgi16Z7zm", - "name": "Bare Bones", - "type": "armor", - "_id": "ITAjcigTcUw5pMCN", - "img": "icons/magic/control/buff-strength-muscle-damage.webp", - "system": { - "description": "

When you choose not to equip armor, you have a base Armor Score of 3 + your Strength and use the following as your base damage thresholds:

", - "actions": {}, - "attached": [], - "tier": 1, - "equipped": false, - "baseScore": 3, - "armorFeatures": [], - "marks": { - "value": 0 - }, - "baseThresholds": { - "major": 9, - "severe": 19 - } - }, - "effects": [ - { - "name": "Bare Bones", - "type": "base", - "system": { - "rangeDependence": { - "enabled": false, - "type": "withinRange", - "target": "hostile", - "range": "melee" - } - }, - "_id": "8ze88zUwdkQSKKJq", - "img": "icons/magic/control/buff-strength-muscle-damage.webp", - "changes": [ - { - "key": "system.armorScore", - "mode": 2, - "value": "@system.traits.strength.value", - "priority": 21 - } - ], - "disabled": false, - "duration": { - "startTime": null, - "combat": null, - "seconds": null, - "rounds": null, - "turns": null, - "startRound": null, - "startTurn": null - }, - "description": "

When you choose not to equip armor, you have a base Armor Score of 3 + your Strength and use the following as your base damage thresholds:

", - "origin": null, - "tint": "#ffffff", - "transfer": true, - "statuses": [], - "sort": 0, - "flags": {}, - "_stats": { - "compendiumSource": null - }, - "_key": "!items.effects!ITAjcigTcUw5pMCN.8ze88zUwdkQSKKJq" - }, - { - "type": "armor", - "name": "Armor Effect", - "img": "icons/equipment/chest/breastplate-helmet-metal.webp", - "system": { - "changes": [ - { - "type": "armor", - "phase": "initial", - "priority": 20, - "value": 0, - "max": "3", - "key": "system.armorScore" - } - ] - }, - "_id": "rm3t1XHFXaoZvw5v", - "disabled": false, - "start": null, - "duration": { - "value": null, - "units": "seconds", - "expiry": null, - "expired": false - }, - "description": "", - "origin": null, - "tint": "#ffffff", - "transfer": true, - "statuses": [], - "showIcon": 1, - "folder": null, - "sort": 0, - "flags": {}, - "_stats": { - "compendiumSource": null - }, - "_key": "!items.effects!ITAjcigTcUw5pMCN.rm3t1XHFXaoZvw5v" - } - ], - "sort": 0, - "ownership": { - "default": 0, - "MQSznptE5yLT7kj8": 3 - }, - "flags": {}, - "_key": "!items!ITAjcigTcUw5pMCN" -} diff --git a/src/packs/items/armors/folders_Special_tI3bfr6Sgi16Z7zm.json b/src/packs/items/armors/folders_Special_tI3bfr6Sgi16Z7zm.json deleted file mode 100644 index 65c4eca8..00000000 --- a/src/packs/items/armors/folders_Special_tI3bfr6Sgi16Z7zm.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "Item", - "folder": null, - "name": "Special", - "color": null, - "sorting": "a", - "_id": "tI3bfr6Sgi16Z7zm", - "description": "", - "sort": 0, - "flags": {}, - "_key": "!folders!tI3bfr6Sgi16Z7zm" -}