Functions

Built-in functions can be used to manipulate numeric results within your formula.

  • `floor(expression)` - Rounds the result of the expression down to the nearest whole number.
    Example: `floor(1d10 / 2)` -> If 1d10 is 7, `floor(3.5)` -> Result `3`.

  • `ceil(expression)` - Rounds the result of the expression up to the nearest whole number.
    Example: `ceil(1d10 / 2)` -> If 1d10 is 7, `ceil(3.5)` -> Result `4`.

  • `round(expression)` - Rounds the result of the expression to the nearest whole number (0.5 rounds up).
    Example: `round(1d10 / 2)` -> If 1d10 is 7, `round(3.5)` -> Result `4`. If 1d10 is 6, `round(3.0)` -> Result `3`.

  • `abs(expression)` - Returns the absolute (non-negative) value of the expression's result.
    Example: `abs(d6 - d6)` -> If rolls are [2, 5], `abs(2 - 5) = abs(-3)` -> Result `3`.

  • `min(a, b)` - Returns the smaller of two numbers.
    Example: `min(1d8, 1d10)` -> If the rolls are 5 and 7, the result is `5`.

  • `max(a, b)` - Returns the larger of two numbers.
    Example: `max(1d8, 1d10)` -> If the rolls are 5 and 7, the result is `7`.

  • `if(condition, then_expr, else_expr)` - Evaluates the `condition`. If the condition's result is non-zero (true), it evaluates and returns `then_expr`. Otherwise (if the condition is zero/false), it evaluates and returns `else_expr`.

    Example: `if(d20>10, d8, d4)` -> If d20 rolls 15 (`15>10` is true), the formula evaluates `d8`. If d20 rolls 5 (`5>10` is false), the formula evaluates `d4`.

More fun at the table, less fuss around it

The tavern falls quiet. You spent all week on this villain: the scarred voice, the secret letter, the slow reveal in the final act. Your players have other plans. They have just set fire to the only bridge out of town, the paladin is deep in an argument with a goat, and the rogue has quietly pocketed the letter that was supposed to unravel everything. Somewhere across the river, your villain stands alone in the rain, waiting for an entrance that will never come. The bard leans back, grinning. Four faces turn to you.

What do
you do?

Start Free

30 days free · no card needed