Fixed ArmorEffect max being a string

This commit is contained in:
WBHarry 2026-02-11 10:22:24 +01:00
parent b0f8442aaa
commit 49e834062b
37 changed files with 144 additions and 107 deletions

View file

@ -173,7 +173,7 @@ export default class DamageReductionDialog extends HandlebarsApplicationMixin(Ap
? Object.values(this.availableStressReductions).filter(red => red.selected)
: [];
const currentMarks =
this.actor.system.armor.system.marks.value + selectedArmorMarks.length + selectedStressMarks.length;
this.actor.system.armorScore.value + selectedArmorMarks.length + selectedStressMarks.length;
const armorMarkReduction =
selectedArmorMarks.length * this.actor.system.rules.damageReduction.increasePerArmorMark;

View file

@ -42,11 +42,12 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
{
initial: [
{
key: 'system.armorScore',
type: CONFIG.DH.GENERAL.activeEffectModes.armor.id,
phase: 'initial',
priority: 20,
value: 0,
max: 1
max: '1'
}
]
}
@ -161,6 +162,7 @@ export default class ArmorEffect extends foundry.data.ActiveEffectTypeDataModel
static getDefaultObject() {
return {
key: 'system.armorScore',
type: 'armor',
name: game.i18n.localize('DAGGERHEART.EFFECTS.Armor.newArmorEffect'),
img: 'icons/equipment/chest/breastplate-helmet-metal.webp'

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "I0649iXfgoME38fU",
"_id": "xU3zAv0sBiOGAE4i",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!LzLOJ9EVaHWAjoq9.I0649iXfgoME38fU"
"_key": "!items.effects!LzLOJ9EVaHWAjoq9.xU3zAv0sBiOGAE4i"
}
],
"sort": 0,

View file

@ -80,11 +80,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "kRaWET7LV25rD4jy",
"_id": "TMxnzDzCmVibJWQ0",
"disabled": false,
"start": null,
"duration": {
@ -105,7 +106,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!crIbCb9NZ4K0VpoU.kRaWET7LV25rD4jy"
"_key": "!items.effects!crIbCb9NZ4K0VpoU.TMxnzDzCmVibJWQ0"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "lJBLFQHDjmgLsLL8",
"_id": "HxZEKljAth8b5Wcv",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!epkAmlZVk7HOfUUT.lJBLFQHDjmgLsLL8"
"_key": "!items.effects!epkAmlZVk7HOfUUT.HxZEKljAth8b5Wcv"
}
],
"sort": 0,

View file

@ -37,11 +37,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "1vzHmkVScl1KyHxy",
"_id": "jSGmBv0I5FhxmTen",
"disabled": false,
"start": null,
"duration": {
@ -62,7 +63,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!itSOp2GCyem0f7oM.1vzHmkVScl1KyHxy"
"_key": "!items.effects!itSOp2GCyem0f7oM.jSGmBv0I5FhxmTen"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 3
"max": "3",
"key": "system.armorScore"
}
]
},
"_id": "B5hlwTWBUSJYZurq",
"_id": "rm3t1XHFXaoZvw5v",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!ITAjcigTcUw5pMCN.B5hlwTWBUSJYZurq"
"_key": "!items.effects!ITAjcigTcUw5pMCN.rm3t1XHFXaoZvw5v"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "lDRMjmZXRJDbhK03",
"_id": "34OQBJZZV3d5AN7U",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!WuoVwZA53XRAIt6d.lDRMjmZXRJDbhK03"
"_key": "!items.effects!WuoVwZA53XRAIt6d.34OQBJZZV3d5AN7U"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "qYkj3jKDdFzflfh4",
"_id": "6AGrG6Y1wUSY3mg5",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!mNN6pvcsS10ChrWF.qYkj3jKDdFzflfh4"
"_key": "!items.effects!mNN6pvcsS10ChrWF.6AGrG6Y1wUSY3mg5"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "d6ICO5qZArh0xF1y",
"_id": "RXsc2d47cauTWTf0",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!haULhuEg37zUUvhb.d6ICO5qZArh0xF1y"
"_key": "!items.effects!haULhuEg37zUUvhb.RXsc2d47cauTWTf0"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "2q3uXc7EbTNSIjs8",
"_id": "dKK4sbP3DZQYdmTn",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!vMJxEWz1srfwMsoj.2q3uXc7EbTNSIjs8"
"_key": "!items.effects!vMJxEWz1srfwMsoj.dKK4sbP3DZQYdmTn"
}
],
"sort": 0,

View file

@ -74,11 +74,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "a8frrkkR4i2TBFdF",
"_id": "kNq8nLq1ljLZZGDg",
"disabled": false,
"start": null,
"duration": {
@ -99,7 +100,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!mdQ69eFHyAQUDmE7.a8frrkkR4i2TBFdF"
"_key": "!items.effects!mdQ69eFHyAQUDmE7.kNq8nLq1ljLZZGDg"
}
],
"sort": 0,

View file

@ -100,11 +100,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 7
"max": "7",
"key": "system.armorScore"
}
]
},
"_id": "a1x2R28RtXE2jqu5",
"_id": "sBTZAS0aYcE15RwZ",
"disabled": false,
"start": null,
"duration": {
@ -125,7 +126,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!hAY6UgdGT7dj22Pr.a1x2R28RtXE2jqu5"
"_key": "!items.effects!hAY6UgdGT7dj22Pr.sBTZAS0aYcE15RwZ"
}
],
"sort": 0,

View file

@ -76,11 +76,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "4yImObrCOaWLGxgH",
"_id": "uFvhPlk3FVGfQST4",
"disabled": false,
"start": null,
"duration": {
@ -101,7 +102,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!Q6LxmtFetDDkoZVZ.4yImObrCOaWLGxgH"
"_key": "!items.effects!Q6LxmtFetDDkoZVZ.uFvhPlk3FVGfQST4"
}
],
"sort": 0,

View file

@ -98,11 +98,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "8VtWedDMEX0tbqTn",
"_id": "Dg8Gx6G3nwAH9wt2",
"disabled": false,
"start": null,
"duration": {
@ -123,7 +124,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!bcQUh4QG3qFX0Vx6.8VtWedDMEX0tbqTn"
"_key": "!items.effects!bcQUh4QG3qFX0Vx6.Dg8Gx6G3nwAH9wt2"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "TRI0rfHs8RTSCmuY",
"_id": "XPbNhspFyOj8RIQJ",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!7emTSt6nhZuTlvt5.TRI0rfHs8RTSCmuY"
"_key": "!items.effects!7emTSt6nhZuTlvt5.XPbNhspFyOj8RIQJ"
}
],
"sort": 0,

View file

@ -76,15 +76,16 @@
"system": {
"changes": [
{
"key": "system.armorScore",
"type": "armor",
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4"
}
]
},
"_id": "VpaGM3KSKQFG5wC8",
"_id": "zji5nzTC1y8BUWHn",
"disabled": false,
"start": null,
"duration": {
@ -105,7 +106,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!UdUJNa31WxFW2noa.VpaGM3KSKQFG5wC8"
"_key": "!items.effects!UdUJNa31WxFW2noa.zji5nzTC1y8BUWHn"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 3
"max": "3",
"key": "system.armorScore"
}
]
},
"_id": "qNXDdLhZkPe6Wnxa",
"_id": "72LkcLIihluGgx48",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!yJFp1bfpecDcStVK.qNXDdLhZkPe6Wnxa"
"_key": "!items.effects!yJFp1bfpecDcStVK.72LkcLIihluGgx48"
}
],
"sort": 0,

View file

@ -91,11 +91,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "E3Zwl9T3EuK7hOOB",
"_id": "GYRwYD3CHW9q4N29",
"disabled": false,
"start": null,
"duration": {
@ -116,7 +117,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!dvyQeUVRLc9y6rnt.E3Zwl9T3EuK7hOOB"
"_key": "!items.effects!dvyQeUVRLc9y6rnt.GYRwYD3CHW9q4N29"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "QXvJ3gL1kNcOLaqC",
"_id": "2KD6EdRL2L2gQkMR",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!K5WkjS0NGqHYmhU3.QXvJ3gL1kNcOLaqC"
"_key": "!items.effects!K5WkjS0NGqHYmhU3.2KD6EdRL2L2gQkMR"
}
],
"sort": 0,

View file

@ -80,11 +80,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "7ahyQs2byVwsUVAF",
"_id": "ehijWY3PGw1OaQr0",
"disabled": false,
"start": null,
"duration": {
@ -105,7 +106,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!9f7RozpPTqrzJS1m.7ahyQs2byVwsUVAF"
"_key": "!items.effects!9f7RozpPTqrzJS1m.ehijWY3PGw1OaQr0"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "uF8AksqGBBfKrrVM",
"_id": "d6QRNZ1X4wdoy82q",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!jphnMZjnS2FkOH3s.uF8AksqGBBfKrrVM"
"_key": "!items.effects!jphnMZjnS2FkOH3s.d6QRNZ1X4wdoy82q"
}
],
"sort": 0,

View file

@ -37,11 +37,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "OqL5x4lkQvjbzSGx",
"_id": "lQNHCtW6HnIj0b7F",
"disabled": false,
"start": null,
"duration": {
@ -62,7 +63,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!t91M61pSCMKStTNt.OqL5x4lkQvjbzSGx"
"_key": "!items.effects!t91M61pSCMKStTNt.lQNHCtW6HnIj0b7F"
}
],
"sort": 0,

View file

@ -87,11 +87,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "wKp8iBd3KfaMlzJh",
"_id": "jnjdtSTQF1zTSkEr",
"disabled": false,
"start": null,
"duration": {
@ -112,7 +113,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!tzZntboNtHL5C6VM.wKp8iBd3KfaMlzJh"
"_key": "!items.effects!tzZntboNtHL5C6VM.jnjdtSTQF1zTSkEr"
}
],
"sort": 0,

View file

@ -37,11 +37,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 3
"max": "3",
"key": "system.armorScore"
}
]
},
"_id": "TbWKQ0R6AfNNeqNd",
"_id": "bkEJ55HhIYFnX1Tz",
"disabled": false,
"start": null,
"duration": {
@ -62,7 +63,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!nibfdNtp2PtxvbVz.TbWKQ0R6AfNNeqNd"
"_key": "!items.effects!nibfdNtp2PtxvbVz.bkEJ55HhIYFnX1Tz"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 7
"max": "7",
"key": "system.armorScore"
}
]
},
"_id": "QAkiVlwfclxQ6JSD",
"_id": "PZsaURELHOaRJK28",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!EsIN5OLKe9ZYFNXZ.QAkiVlwfclxQ6JSD"
"_key": "!items.effects!EsIN5OLKe9ZYFNXZ.PZsaURELHOaRJK28"
}
],
"sort": 0,

View file

@ -80,11 +80,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 7
"max": "7",
"key": "system.armorScore"
}
]
},
"_id": "mMYVCcmoBJxjU0er",
"_id": "IMPH2qFG7zXaxefg",
"disabled": false,
"start": null,
"duration": {
@ -105,7 +106,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!SXWjUR2aUR6bYvdl.mMYVCcmoBJxjU0er"
"_key": "!items.effects!SXWjUR2aUR6bYvdl.IMPH2qFG7zXaxefg"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "vgnBNFSXks1BcFQ5",
"_id": "TtMaMntKKpcTU054",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!c6tMXz4rPf9ioQrf.vgnBNFSXks1BcFQ5"
"_key": "!items.effects!c6tMXz4rPf9ioQrf.TtMaMntKKpcTU054"
}
],
"sort": 0,

View file

@ -37,11 +37,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "m6HRZpgaMnuw1dE7",
"_id": "UtbfSKO8hmJanog5",
"disabled": false,
"start": null,
"duration": {
@ -62,7 +63,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!Tptgl5WOj76TyFn7.m6HRZpgaMnuw1dE7"
"_key": "!items.effects!Tptgl5WOj76TyFn7.UtbfSKO8hmJanog5"
}
],
"sort": 0,

View file

@ -75,11 +75,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "aRwIF0ss6R7AYNZf",
"_id": "kskfQTQTgCgmQR6b",
"disabled": false,
"start": null,
"duration": {
@ -100,7 +101,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!AQzU2RsqS5V5bd1v.aRwIF0ss6R7AYNZf"
"_key": "!items.effects!AQzU2RsqS5V5bd1v.kskfQTQTgCgmQR6b"
}
],
"sort": 0,

View file

@ -67,11 +67,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "YvXWUYVaXDHugsEr",
"_id": "eT5j1FNPPQOdLO2Q",
"disabled": false,
"start": null,
"duration": {
@ -92,7 +93,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!tN8kAeBvNKM3EBFo.YvXWUYVaXDHugsEr"
"_key": "!items.effects!tN8kAeBvNKM3EBFo.eT5j1FNPPQOdLO2Q"
}
],
"sort": 0,

View file

@ -74,11 +74,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "vkJeIaXB25W3MAt1",
"_id": "UmpUTOMR2UBmrAu6",
"disabled": false,
"start": null,
"duration": {
@ -99,7 +100,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!P4qAEDJUoNLgVRsA.vkJeIaXB25W3MAt1"
"_key": "!items.effects!P4qAEDJUoNLgVRsA.UmpUTOMR2UBmrAu6"
}
],
"sort": 0,

View file

@ -74,11 +74,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 4
"max": "4",
"key": "system.armorScore"
}
]
},
"_id": "2dj1LoZcV6tCKpKj",
"_id": "s39jgXMmi4fDHuaE",
"disabled": false,
"start": null,
"duration": {
@ -99,7 +100,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!tHlBUDQC24YMZqd6.2dj1LoZcV6tCKpKj"
"_key": "!items.effects!tHlBUDQC24YMZqd6.s39jgXMmi4fDHuaE"
}
],
"sort": 0,

View file

@ -105,11 +105,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 8
"max": "8",
"key": "system.armorScore"
}
]
},
"_id": "3Kn7ZRjhrw1WfALW",
"_id": "SWXFcH4qbmPYI7WH",
"disabled": false,
"start": null,
"duration": {
@ -130,7 +131,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!8X16lJQ3xltTwynm.3Kn7ZRjhrw1WfALW"
"_key": "!items.effects!8X16lJQ3xltTwynm.SWXFcH4qbmPYI7WH"
}
],
"sort": 0,

View file

@ -80,11 +80,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "6YpS3uYWIbeSgreg",
"_id": "OtOaxh7BCM2OMOmS",
"disabled": false,
"start": null,
"duration": {
@ -105,7 +106,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!QjwsIhXKqnlvRBMv.6YpS3uYWIbeSgreg"
"_key": "!items.effects!QjwsIhXKqnlvRBMv.OtOaxh7BCM2OMOmS"
}
],
"sort": 0,

View file

@ -67,11 +67,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 5
"max": "5",
"key": "system.armorScore"
}
]
},
"_id": "tiE0sRrTm2Ex9TAO",
"_id": "DgAQc09o3x6zn6DQ",
"disabled": false,
"start": null,
"duration": {
@ -92,7 +93,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!PSW3BxCGmtLeWOxM.tiE0sRrTm2Ex9TAO"
"_key": "!items.effects!PSW3BxCGmtLeWOxM.DgAQc09o3x6zn6DQ"
}
],
"sort": 0,

View file

@ -67,11 +67,12 @@
"phase": "initial",
"priority": 20,
"value": 0,
"max": 6
"max": "6",
"key": "system.armorScore"
}
]
},
"_id": "fpPIhNaFxaz40Iaj",
"_id": "2gMOVh1Hty0nVWy4",
"disabled": false,
"start": null,
"duration": {
@ -92,7 +93,7 @@
"_stats": {
"compendiumSource": null
},
"_key": "!items.effects!OvzgUTYy2RCN85vV.fpPIhNaFxaz40Iaj"
"_key": "!items.effects!OvzgUTYy2RCN85vV.2gMOVh1Hty0nVWy4"
}
],
"sort": 0,