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 "doubling" (ie. 5e Crits) #108

Open brentleyjones opened 8 years ago

brentleyjones commented 8 years ago

With #70 we have the ability to support a form of D&D crits in which the damage is simply maxed. In 5e though when you crit you double the number of dice rolled. Simply evaluating an expression twice doesn't achieve this because of all of the other modifiers that can be happening, including just simple constants.

So, we need to easily be able to take an expression and "double the number of dice".

We need to be weary of #28, because if we only pick the highest, what happens when doubling that?