Jump to navigation Jump to search
Generates random numbers to emulate dice rolls. The
addparameter is added to each die and all intermediate results that are then higher than the
maximumparameter are replaced with that value instead. The total is returned.
rollAddWithUpper(times, sides, add, maximum)
times- The number of times to roll the dice.
sides- The number of sides the dice possess.
add- The number to add to each die roll.
maximum- The maximum value (after the addition) that each individual die can contribute to the total.
Roll five twenty-sided dice. Add 6 to each. Any value now higher than 18 is treated as 18.
Returns a number that is between 35 and 90 (and no longer 5 to 100 as with a regular
[t: rollAddWithUpper(5, 20, 6, 18)]
The corresponding dice roll expression is
XdYaZuW. For other methods of rolling dice, see Dice Expressions.