mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-22 07:23:37 +02:00
[v14] Add toggle for critical damage (#1762)
* Fix rolling critical damage after rerolling into a crit * Add toggle for critical damage --------- Co-authored-by: WBHarry <williambjrklund@gmail.com>
This commit is contained in:
parent
e3b433cce9
commit
2b8e4cb2fa
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