aus "Ohmnibus.NET"

Usage

Format

expUp(roll[, target[, newRoll[, newTarget[, limit]]]])

Parameters

roll: A formula representing the dice to roll. Must be an indeterministic formula.target: Optional. The value to reach to obtain an explosion. If not specified is equal to the maximum of roll.newRoll: Optional. The formula representing the dice to roll after an explosion. If not specified is equal to roll.newTarget: Optional. The value to reach to obtain an explosion from newRoll. If not specified is equal to the maximum of newRoll.limit: Optional. The maximum number of explosions. Set to 0 to make explosions limitless. If not specified is set to 0.

Returns

The value of roll, eventually exploded. Read the description for further details.

Description

Makes an exploding roll. In such rolls if the outcome is high enough the die is rolled again and the result is added to the previous.

The value of roll is evaluated once. If its value is greater or equal to target, newRoll is evaluated and added to the previous result.

As long as the result of newRoll is greater or equal to newTarget, newRoll is evaluated again (for a maximum of limit times) and added to the previous result.

To avoid infinite loops, at least one outcome out of 3 of roll and newRoll should not explode, otherwise an error is generated and the function is not computed.