From RPTools WikiJump to navigationJump to search
Generates random numbers to emulate dice rolls. The
subparameter is subtracted from each die and all intermediate results that are then higher than the
maximumparameter are replaced with that value instead. The total is returned.
rollSubWithUpper(times, sides, sub, maximum)
times- The number of times to roll the dice.
sides- The number of sides the dice possess.
sub- The number to subtract from each die roll.
maximum- The maximum value (after the subtraction) that each individual die can contribute to the total.
Roll five twenty-sided dice. Subtract 3 from each. Any value now higher than 14 is treated as 14.
Returns a number that is between -10 and 70 (and no longer 5 to 100 as with a regular
[t: rollSubWithUpper(5, 20, 3, 14)]
The corresponding dice roll expression is
XdYsZuW. For other methods of rolling dice, see Dice Expressions.