TabletopAssistant / DiceKit

Swift framework for expressing and evaluating dice notation (e.g., d20, 4d6+4, 3d8×10+2), which is commonly used in tabletop role-playing games.
Apache License 2.0
14 stars 1 forks source link

Support re-evaluating an expression on Failure/Success #88

Open brentleyjones opened 9 years ago

brentleyjones commented 9 years ago

After implementing #59 we will have thew ability to have a roll or expression be a success or failure depending on certain success criteria. A common thing to do is something like 4d6 reroll 1's. In this case we can just have each die have a failure case of == 1 and also wrap them with a retry on failure (we can't wrap the whole thing, because if any of the dice fail the expression will be a failure).