Readded so that armor items have their system defined armor instead of using an ActiveEffect

This commit is contained in:
WBHarry 2026-03-21 18:55:03 +01:00
parent 50dcbf4396
commit 1cdabf15a5
11 changed files with 198 additions and 161 deletions

View file

@ -220,6 +220,19 @@ export default class BaseDataItem extends foundry.abstract.TypeDataModel {
addLinkedItemsDiff(changed.system?.features, this.features, options);
const autoSettings = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.Automation);
const armorChanged =
changed.system?.armor?.current !== undefined && changed.system.armor.current !== this.armor.current;
if (armorChanged && autoSettings.resourceScrollTexts && this.parent.parent?.type === 'character') {
const armorChangeValue = changed.system.armor.current - this.armor.current;
const armorData = getScrollTextData(
this.parent.parent,
{ value: armorChangeValue + this.parent.parent.system.armorScore.value },
'armor'
);
options.scrollingTextData = [armorData];
}
if (changed.system?.actions) {
const triggersToRemove = Object.keys(changed.system.actions).reduce((acc, key) => {
const action = changed.system.actions[key];