Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

Adding a constant value to each die roll

In Gamma World there are certain effects that add bonus damage to each damage dice.  eg plus +3 per damage dice would do +3 on 1d6 or 1d8, but +9 on a 3d6 roll. Obviously I could just have the player enter the total damage bonus, for each weapon.  This gets a little confusing for them, IME, but not unpossible to do. Alternatively, I could separate the number of dice from the die type in the character sheet, then build the roll piece by piece.  eg @{numOfDice}d@{dieType} + ((@{numOfDice}*@{perDieDmgBonus} )  + @{stdDmgBonus}) Ideally though, I'd rather do something like  3d(6+@{perDieDmgBonus} ) + @{stdDmgBonus} Obviously that does not work (it rolls a d9 instead), but hopefully you get the gist.
1513132587
Silvyre
Forum Champion
If you're using a single Attribute to handle number and type of dice rolled, you can do something like this to account for the per-die bonus: [[ @{damageDice} + [[@{damageDice}>0 * 3]] + @{stdDmgBonus} ]]
That looks great.  Can you explain to me how it works?  I assume the '>0' is the magic bit?  Going to try it now. Also, would this be a legit construction. [[ @{damageDice} + [[@{damageDice}>0 * @{perDieDmgBonus}]] + @{stdDmgBonus} ]]
The >0 is how many of the dice rolled greater than 0. So as all of them will this is the number of dice in the roll. So 3d6>0 will be 3 which you can then * the per die bonus. It is using the success format to extract the number of dice essentially. [[ @{damageDice} + [[@{damageDice}>0 * @{perDieDmgBonus}]] + @{stdDmgBonus} ]] should work as long as everything is linked up right.
1513184746
The Aaron
Pro
API Scripter
For historic reasons, > is actually "Greater than or equal to" in dice context.