Added ActiveEffect rules for default hope and fear dice

This commit is contained in:
WBHarry 2026-01-10 21:59:48 +01:00
parent 0b343c9f52
commit f37f3ea899
6 changed files with 176 additions and 15 deletions

View file

@ -280,6 +280,22 @@ export default class DhCharacter extends BaseDataActor {
})
})
}),
dualityRoll: new fields.SchemaField({
defaultHopeDice: new fields.StringField({
nullable: false,
required: true,
choices: CONFIG.DH.GENERAL.diceTypes,
initial: CONFIG.DH.GENERAL.diceTypes.d12,
label: 'DAGGERHEART.ACTORS.Character.defaultHopeDice'
}),
defaultFearDice: new fields.StringField({
nullable: false,
required: true,
choices: CONFIG.DH.GENERAL.diceTypes,
initial: CONFIG.DH.GENERAL.diceTypes.d12,
label: 'DAGGERHEART.ACTORS.Character.defaultFearDice'
})
}),
runeWard: new fields.BooleanField({ initial: false }),
burden: new fields.SchemaField({
ignore: new fields.BooleanField()

View file

@ -130,9 +130,14 @@ export default class DualityRoll extends D20Roll {
this.terms = [this.terms[0], this.terms[1], this.terms[2]];
return;
}
this.terms[0] = new foundry.dice.terms.Die({ faces: 12 });
const { defaultHopeDice, defaultFearDice } = this.data.rules.dualityRoll;
const hopeFaces = Number.parseInt(defaultHopeDice.substring(1));
const fearFaces = Number.parseInt(defaultFearDice.substring(1));
this.terms[0] = new foundry.dice.terms.Die({ faces: hopeFaces });
this.terms[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' });
this.terms[2] = new foundry.dice.terms.Die({ faces: 12 });
this.terms[2] = new foundry.dice.terms.Die({ faces: fearFaces });
}
applyAdvantage() {