[V14] Message Rolls Rework (#1757)

* Basic rework to the roll data in messages

* .

* Fixed advantage/disadvantage

* .

* .

* Fixed TagTeamDialog

* Reuse getter in faces setter

* Simplify fate roll type css class

* Add more caution to the dualityRoll fromData function

* Apply suggestion from @CarlosFdez

* Compute modifiers using deterministic terms (#1758)

---------

Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
WBHarry 2026-03-31 17:20:22 +02:00 committed by GitHub
parent dbd5ef8bb0
commit f156b12d79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 267 additions and 249 deletions

View file

@ -21,8 +21,8 @@ export default class FateRoll extends D20Roll {
}
set dHope(faces) {
if (!(this.dice[0] instanceof foundry.dice.terms.Die)) this.createBaseDice();
this.dice[0].faces = this.getFaces(faces);
// TODO this should not be asymmetrical with the getter. updateRollConfiguration() should use dHope.faces
this.dHope.faces = this.getFaces(faces);
}
get dFear() {
@ -31,8 +31,8 @@ export default class FateRoll extends D20Roll {
}
set dFear(faces) {
if (!(this.dice[0] instanceof foundry.dice.terms.Die)) this.createBaseDice();
this.dice[0].faces = this.getFaces(faces);
// TODO this should not be asymmetrical with the getter. updateRollConfiguration() should use dFear.faces
this.dFear.faces = this.getFaces(faces);
}
get isCritical() {
@ -43,6 +43,22 @@ export default class FateRoll extends D20Roll {
return this.data.fateType;
}
get withHope() {
if (!this._evaluatedl) return;
return this.dHope.total >= this.dFear.total;
}
get withFear() {
if (!this._evaluated) return;
return this.dHope.total < this.dFear.total;
}
get totalLabel() {
const label = this.withHope ? 'DAGGERHEART.GENERAL.hope' : 'DAGGERHEART.GENERAL.fear';
return game.i18n.localize(label);
}
static getHooks(hooks) {
return [...(hooks ?? []), 'Fate'];
}