mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-23 07:53:39 +02:00
Add toggle for critical damage
This commit is contained in:
parent
90d58a55ee
commit
cb19e1d96f
6 changed files with 51 additions and 2 deletions
|
|
@ -7,6 +7,10 @@ export default class DamageRoll extends DHRoll {
|
|||
super(formula, data, options);
|
||||
}
|
||||
|
||||
get isCritical() {
|
||||
return !!this.options.isCritical;
|
||||
}
|
||||
|
||||
static DefaultDialog = DamageDialog;
|
||||
|
||||
static async buildEvaluate(roll, config = {}, message = {}) {
|
||||
|
|
@ -138,6 +142,7 @@ export default class DamageRoll extends DHRoll {
|
|||
}
|
||||
|
||||
constructFormula(config) {
|
||||
this.options.isCritical = config.isCritical;
|
||||
for (const [index, part] of this.options.roll.entries()) {
|
||||
part.roll = new Roll(Roll.replaceFormulaData(part.formula, config.data));
|
||||
part.roll.terms = Roll.parse(part.roll.formula, config.data);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue