From 18e6c31b5c14577eaa50591b53e65062688506c4 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Sat, 13 Mar 2021 22:15:58 +0100 Subject: [PATCH] Fix slying dice usage in CheckFactory --- src/module/rolls/check-factory.ts | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/module/rolls/check-factory.ts b/src/module/rolls/check-factory.ts index 2b3556b7..7e4997b1 100644 --- a/src/module/rolls/check-factory.ts +++ b/src/module/rolls/check-factory.ts @@ -36,12 +36,8 @@ class CheckFactory { async execute(): Promise { const rollCls = CONFIG.Dice.rolls[0]; - const formula = [ - "ds", - this.createTargetValueTerm(), - this.createCritTerm(), - this.createSlayingDiceTerm(), - ].filterJoin(""); + const innerFormula = ["ds", this.createTargetValueTerm(), this.createCritTerm()].filterJoin(""); + const formula = this.checkOptions.useSlayingDice ? `{${innerFormula}}x` : innerFormula; const roll = new rollCls(formula); const rollModeTemplate = this.checkOptions.rollMode; @@ -62,15 +58,11 @@ class CheckFactory { const maxCritRequired = this.checkOptions.maxCritSuccess !== defaultCheckOptions.maxCritSuccess; if (minCritRequired || maxCritRequired) { - return "c" + (this.checkOptions.maxCritSuccess ?? "") + "," + (this.checkOptions.minCritFailure ?? ""); + return "c" + (this.checkOptions.maxCritSuccess ?? "") + ":" + (this.checkOptions.minCritFailure ?? ""); } else { return null; } } - - createSlayingDiceTerm(): string | null { - return this.checkOptions.useSlayingDice ? "x" : null; - } } /**