mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 23:43:37 +02:00
[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:
parent
dbd5ef8bb0
commit
f156b12d79
20 changed files with 267 additions and 249 deletions
|
|
@ -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'];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue