From cb143756e38f1cb9af16c2af55df0853a9577cef Mon Sep 17 00:00:00 2001 From: Chris Ryan Date: Mon, 12 Jan 2026 22:53:08 +1000 Subject: [PATCH] Update the current Hope value if the scar value change affects it --- module/data/actor/character.mjs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/module/data/actor/character.mjs b/module/data/actor/character.mjs index 6885dc84..0108a80a 100644 --- a/module/data/actor/character.mjs +++ b/module/data/actor/character.mjs @@ -679,6 +679,20 @@ export default class DhCharacter extends BaseDataActor { changes.system.experiences[experience].core = true; } } + + /* Scars can alter the amount of current hope */ + if (changes.system?.scars) { + const diff = this.system.scars - changes.system.scars; + const newHopeMax = this.system.resources.hope.max + diff; + const newHopeValue = Math.min(newHopeMax, this.system.resources.hope.value); + if (newHopeValue != this.system.resources.hope.value) { + changes.system.resources = { + hope: { + value: newHopeValue + } + }; + } + } } async _preDelete() {