Corrected rules.attack.roll.trait

This commit is contained in:
WBHarry 2025-07-26 21:14:47 +02:00
parent 45300c03d2
commit 73d1edb0a1
2 changed files with 6 additions and 2 deletions

View file

@ -253,7 +253,9 @@ export default class DhCharacter extends BaseDataActor {
roll: new fields.SchemaField({
trait: new fields.StringField({
required: true,
initial: CONFIG.DH.ACTOR.abilities.strength.id,
choices: CONFIG.DH.ACTOR.abilities,
nullable: true,
initial: null,
label: 'DAGGERHEART.GENERAL.Rules.attack.roll.trait.label'
})
})
@ -544,6 +546,7 @@ export default class DhCharacter extends BaseDataActor {
prepareDerivedData() {
const baseHope = this.resources.hope.value + (this.companion?.system?.resources?.hope ?? 0);
this.resources.hope.value = Math.min(baseHope, this.resources.hope.max);
this.attack.roll.trait = this.rules.attack.roll.trait ?? this.attack.roll.trait;
}
getRollData() {

View file

@ -55,7 +55,8 @@ export default class DhActiveEffect extends ActiveEffect {
}
static applyField(model, change, field) {
change.value = this.effectSafeEval(itemAbleRollParse(change.value, model, change.effect.parent));
const evalValue = this.effectSafeEval(itemAbleRollParse(change.value, model, change.effect.parent));
change.value = evalValue ?? change.value;
super.applyField(model, change, field);
}