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
|
|
@ -121,7 +121,14 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application
|
|||
}
|
||||
|
||||
static async submitRoll() {
|
||||
const isCritical = this.config.isCritical;
|
||||
const { damageFormula, resourceFormulas } = this.roll.constructFormulas({ ...this.config, isCritical: false });
|
||||
/* Sideeffect occuring in constructFormulas that sets this.config.isCritical to the false value. Can remove the below if it can be prevented */
|
||||
this.config.isCritical = isCritical;
|
||||
damageFormula.roll.options.isCritical = isCritical;
|
||||
for (const formula of resourceFormulas)
|
||||
formula.roll.options.isCritical = isCritical;
|
||||
|
||||
this.config.damageFormula = damageFormula;
|
||||
this.config.resourceFormulas = resourceFormulas;
|
||||
await this.close({ submitted: true });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue