Fixed SRD armor effects

This commit is contained in:
WBHarry 2026-02-11 11:04:40 +01:00
parent 49e834062b
commit 26ae17c3cf
8 changed files with 168 additions and 209 deletions

View file

@ -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,7 +157,9 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
}
};
return armorEffects.sort((a, b) =>
return armorEffects
.filter(x => !x.disabled && !x.isSuppressed)
.sort((a, b) =>
increasing ? getEffectWeight(b) - getEffectWeight(a) : getEffectWeight(a) - getEffectWeight(b)
);
}

View file

@ -90,46 +90,42 @@
"effects": [
{
"name": "Armorer",
"type": "base",
"type": "armor",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "cED730OjuMW5haJR",
"img": "icons/tools/hand/hammer-and-nail.webp",
"changes": [
{
"key": "system.armorScore",
"mode": 2,
"value": "1",
"priority": null
"type": "armor",
"phase": "initial",
"priority": 20,
"value": 0,
"max": "1"
}
],
"disabled": false,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
]
},
"description": "<p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">While youre wearing armor, gain a +1 bonus to your </span><span class=\"tooltip-convert\" style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\">Armor Score</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">.</p>",
"_id": "PczrmraHWZ54NJsW",
"img": "icons/tools/hand/hammer-and-nail.webp",
"disabled": false,
"start": null,
"duration": {
"value": null,
"units": "seconds",
"expiry": null,
"expired": false
},
"description": "<p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline !important\">While youre wearing armor, gain a +1 bonus to your </span><span style=\"box-sizing:border-box;scrollbar-width:thin;scrollbar-color:rgb(93, 20, 43) rgba(0, 0, 0, 0);color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial\" class=\"tooltip-convert\">Armor Score</span><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.376);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline !important\">.</span></p>",
"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": {

View file

@ -4,7 +4,7 @@
"type": "domainCard",
"folder": "QpOL7jPbMBzH96qR",
"system": {
"description": "<p class=\"Body-Foundation\">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:</p><ul><li class=\"vertical-card-list-found\"><em><strong>Tier 1:</strong></em> 9/19</li><li class=\"vertical-card-list-found\"><em><strong>Tier 2:</strong></em> 11/24</li><li class=\"vertical-card-list-found\"><em><strong>Tier 3:</strong></em> 13/31</li><li class=\"vertical-card-list-found\"><em><strong>Tier 4:</strong></em> 15/38</li></ul><p>Equip the below armor to use Bare Bones.</p><p>@UUID[Compendium.daggerheart.armors.Item.ITAjcigTcUw5pMCN]{Bare Bones}</p>",
"description": "<p class=\"Body-Foundation\">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:</p><ul><li class=\"vertical-card-list-found\"><p><em><strong>Tier 1:</strong></em> 9/19</p></li><li class=\"vertical-card-list-found\"><p><em><strong>Tier 2:</strong></em> 11/24</p></li><li class=\"vertical-card-list-found\"><p><em><strong>Tier 3:</strong></em> 13/31</p></li><li class=\"vertical-card-list-found\"><p><em><strong>Tier 4:</strong></em> 15/38</p></li></ul><p>Equip the below armor to use Bare Bones.</p>",
"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": "<p><span style=\"color:rgb(239, 230, 216);font-family:Montserrat, sans-serif;font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;orphans:2;text-align:start;text-indent:0px;text-transform:none;widows:2;word-spacing:0px;-webkit-text-stroke-width:0px;white-space:normal;background-color:rgba(24, 22, 46, 0.565);text-decoration-thickness:initial;text-decoration-style:initial;text-decoration-color:initial;display:inline !important;float:none\">You have a base Armor Score of 3 + your Strength</span></p>",
"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": "<p>You use the following as your base damage thresholds:</p><ul><li class=\"vertical-card-list-found\"><p><em><strong>Tier 1:</strong></em> 9/19</p></li><li class=\"vertical-card-list-found\"><p><em><strong>Tier 2:</strong></em> 11/24</p></li><li class=\"vertical-card-list-found\"><p><em><strong>Tier 3:</strong></em> 13/31</p></li><li class=\"vertical-card-list-found\"><p><em><strong>Tier 4:</strong></em> 15/38</p></li></ul>",
"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

View file

@ -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",
"mode": 2,
"value": "1",
"priority": null
"type": "armor",
"phase": "initial",
"priority": 20,
"value": 0,
"max": "1"
}
],
"disabled": false,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
]
},
"description": "<p>+1 bonus to your Armor Score until your next rest, or the caster cast's Tavas Armor again.</p>",
"disabled": false,
"start": null,
"duration": {
"value": null,
"units": "seconds",
"expiry": null,
"expired": false
},
"description": "<p><strong>Spend a Hope</strong> to give a target you can touch a +1 bonus to their Armor Score until their next rest or you cast Tavas Armor again.</p>",
"tint": "#ffffff",
"statuses": [],
"showIcon": 1,
"folder": null,
"sort": 0,
"flags": {},
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!YtZzYBtR0yLPPA93.LdcT1nrkd5ORCU4n"
"_key": "!items.effects!YtZzYBtR0yLPPA93.OKf8Kjr6Px8A3ubJ"
}
],
"ownership": {

View file

@ -91,46 +91,42 @@
"effects": [
{
"name": "Valor-Touched",
"type": "base",
"type": "armor",
"system": {
"rangeDependence": {
"enabled": false,
"type": "withinRange",
"target": "hostile",
"range": "melee"
}
},
"_id": "H9lgIqqp1imSNOv9",
"img": "icons/magic/control/control-influence-rally-purple.webp",
"changes": [
{
"key": "system.armorScore",
"mode": 2,
"value": "1",
"priority": null
"type": "armor",
"phase": "initial",
"priority": 20,
"value": 0,
"max": "1"
}
],
"disabled": false,
"duration": {
"startTime": null,
"combat": null,
"seconds": null,
"rounds": null,
"turns": null,
"startRound": null,
"startTurn": null
]
},
"description": "<ul><li class=\"vertical-card-list-found\"><p>+1 bonus to your Armor Score</p></li><li class=\"vertical-card-list-found\"><p>When you mark 1 or more Hit Points without marking an Armor Slot, clear an Armor Slot.</p></li></ul>",
"_id": "JLw50ONfq1KJh1iM",
"img": "icons/magic/control/control-influence-rally-purple.webp",
"disabled": false,
"start": null,
"duration": {
"value": null,
"units": "seconds",
"expiry": null,
"expired": false
},
"description": "<p>+1 bonus to your Armor Score</p>",
"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": {

View file

@ -6,7 +6,7 @@
"sorting": "m",
"_id": "TL1TutmbeCVJ06nR",
"description": "",
"sort": 900000,
"sort": 750000,
"flags": {},
"_key": "!folders!TL1TutmbeCVJ06nR"
}

View file

@ -1,114 +0,0 @@
{
"folder": "tI3bfr6Sgi16Z7zm",
"name": "Bare Bones",
"type": "armor",
"_id": "ITAjcigTcUw5pMCN",
"img": "icons/magic/control/buff-strength-muscle-damage.webp",
"system": {
"description": "<p></p><p class=\"Body-Foundation\">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:</p><ul><li class=\"vertical-card-list-found\"><em><strong>Tier 1:</strong></em> 9/19</li><li class=\"vertical-card-list-found\"><em><strong>Tier 2:</strong></em> 11/24</li><li class=\"vertical-card-list-found\"><em><strong>Tier 3:</strong></em> 13/31</li><li class=\"vertical-card-list-found\"><em><strong>Tier 4:</strong></em> 15/38</li></ul>",
"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": "<p></p><p class=\"Body-Foundation\">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:</p><ul><li class=\"vertical-card-list-found\"><em><strong>Tier 1:</strong></em> 9/19</li><li class=\"vertical-card-list-found\"><em><strong>Tier 2:</strong></em> 11/24</li><li class=\"vertical-card-list-found\"><em><strong>Tier 3:</strong></em> 13/31</li><li class=\"vertical-card-list-found\"><em><strong>Tier 4:</strong></em> 15/38</li></ul>",
"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"
}

View file

@ -1,12 +0,0 @@
{
"type": "Item",
"folder": null,
"name": "Special",
"color": null,
"sorting": "a",
"_id": "tI3bfr6Sgi16Z7zm",
"description": "",
"sort": 0,
"flags": {},
"_key": "!folders!tI3bfr6Sgi16Z7zm"
}