mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-07-22 02:19:54 +02:00
Fixed so that the forced critical toggle in the DamageDialog sets damageRoll.options.isCritical
This commit is contained in:
parent
c0fe127df4
commit
cfb6bc2479
3 changed files with 22 additions and 4 deletions
|
|
@ -8,6 +8,8 @@ export class ChatDamageData extends foundry.abstract.DataModel {
|
|||
}
|
||||
|
||||
get isCritical() {
|
||||
if (!this.parent?.parent) return false;
|
||||
|
||||
const roll = Roll.fromJSON(this.parent.parent._source.rolls[0]);
|
||||
return roll.isCritical;
|
||||
}
|
||||
|
|
@ -33,7 +35,14 @@ export class ChatDamageData extends foundry.abstract.DataModel {
|
|||
}
|
||||
|
||||
_prepareRolls() {
|
||||
this.main &&= Roll.fromData({ ...this.main, options: { ...this.main.options, isCritical: this.isCritical } });
|
||||
this.main &&= Roll.fromData({
|
||||
...this.main,
|
||||
options: {
|
||||
...this.main.options,
|
||||
isCritical: this.main.options.isCritical || this.isCritical
|
||||
}
|
||||
});
|
||||
|
||||
for (const key of Object.keys(this.resources)) {
|
||||
this.resources[key] = Roll.fromData(this.resources[key]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue