Body, Mind & Soul — API Reference
    Preparing search index...

    Function _buildCheckFormula

    • Apply advantage/disadvantage stage and take-10 substitution to a roll formula.

      Rules:

      • Success-dice formulas (contain cs>=) are never modified — pass advantageStage = 0 for those.
      • take10 replaces the leading d20 with 10 regardless of stage.
      • stage > 0: d20Nd20kh1 (keep highest, N = 1 + stage).
      • stage < 0: d20Nd20kl1 (keep lowest, N = 1 + |stage|).
      • stage 0, not take10: formula unchanged.

      Parameters

      • baseFormula: string
      • choice: "roll" | "take10" | "decline"
      • advantageStage: number

        Pass 0 for success-dice formulas.

      Returns string