diff --git a/module/apps/textroll/text-roll-carac-competence.js b/module/apps/textroll/text-roll-carac-competence.js index 71349c63..7c2f5572 100644 --- a/module/apps/textroll/text-roll-carac-competence.js +++ b/module/apps/textroll/text-roll-carac-competence.js @@ -1,5 +1,4 @@ import "../xregexp-all.js"; -import { ACTOR_TYPES } from "../../item.js"; import { RdDCarac } from "../../rdd-carac.js"; import { RdDItemCompetence } from "../../item-competence.js"; import { RdDUtility } from "../../rdd-utility.js"; @@ -8,7 +7,6 @@ import { TextRollManager } from "./text-roll-formatter.js"; const REGECP_CARAC = "(?[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+)" const REGEXP_COMP = "(\\/(?[A-Za-zÀ-ÖØ-öø-ÿ\\s\\-]+))?" const REGEXP_DIFF = "(/(?[\\+\\-]?\\d+(d\\d+)?))?" -const REGEX_DICE_DIFF = /[\+\-]?\d+d\d+/; const REGEXP_ROLL_CARAC_COMP = REGECP_CARAC + REGEXP_COMP + REGEXP_DIFF const XREGEXP_ROLL_CARAC_COMP = XRegExp("@roll\\[" + REGEXP_ROLL_CARAC_COMP + "\\]", 'giu') @@ -38,7 +36,7 @@ export class TextRollCaracCompetence { async calculDiff(node) { const diff = node.data('diff') ?? 0 - if (diff.match(REGEX_DICE_DIFF)) { + if (!Number.isInteger(diff)) { const roll = new Roll(diff) await roll.evaluate() await roll.toMessage({ flavor: `La difficulté de ${diff} a donné ${roll.total}` })