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 lower than the
minimumparameter are replaced with that value instead. The total is returned.
rollSubWithLower(times, sides, sub, minimum)
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.
minimum- The minimum value (after the subtraction) that each individual die will contribute to the total.
Roll five twenty-sided dice. Subtract 2 from each. Any value now lower than 3 is treated as 3.
Returns a number that is between 15 and 90 (and no longer 5 to 100 as with a regular
[t: rollSubWithLower(5, 20, 2, 3)]
The corresponding dice roll expression is
XdYsZlW. For other methods of rolling dice, see Dice Expressions.