I created a little program that outputs the probability of each roll, as well as the mean and deviation for each d&d die: d4, d6, d8, d10 and d12, which you can find here. In my case, since I'm using a halberd, I've got a d10 damage dice:
Quick Dice Roller - it's a great free app that doesn't have ads, which is awesome.
What is great about the app is that you can edit the dice and include your own custom die rolls. Is your attack roll 1d20+3? You can easily edit an existing die or add a new one and set the formula that you like.
The function that can approximate this ability is the 'Exploding' function. 'Exploding' a die usually means that if you roll the maximum value of that die, you can roll it again and add it to the total; so if you roll a d6 and you get 6, you can roll it again - let's say that the second roll turns up to be 3, then you get a total of 9.
Quick Dice Roller's exploding function lets you define the target to obtain an explosion - so you can set it to something lower than the maximum value of the die - in my case that threshold would be 2.
I decided to implement the formula as following: expUp(1d10, 2, 1d10-2,-1,1) which, in english, means: if you get a die roll equal to or higher than 2, explode it once, but subtract two from the second roll. Unfortunately this isn't what I wanted, as Great Weapon Fighting enables you to reroll on die rolls less than or equal to 2, not higher than that value.
Then it hit me! What if you use negative values instead? I didn't know if Quick Dice Roller would support negative values in its functions, but I was pleasantly surprised when I found out it did!
Here is the final formula:
check out my formula with anydice, to see that everything is OK and I'm not doing anything wrong. Unfortunately what I feared was correct:
Unfortunately, unless the application is updated to include a reroll x times on y threshold function or a feature to reference the exploded die roll is added, this can't be fixed, so I'll take it over physically rolling all that dice or making my own application from scratch.
My final custom formulas. First of all, here are my named values:
level (level) used to determine the proficiency bonus. strength (str) used to determine attack and damage bonus. constitution (con) used to determine hit points. advantage (advan) is the number of d20 dice that will be used when attacking. smite (smt) is the number of smite dice that will be used on the damage roll. blessed (bls) adds a d4 on attack rolls if the named value is set to 1. weapon (wpn) is the weapon damage die. In my case it's d10, so it's set to 10.And here are the custom formulas for my attack & damage:
(1-abs(advan))*1d20+abs(rak(1d20*advan,abs(advan)+1,1))Rolls |advan|+1 times 1d20 dice and picks the highest one if advan = 1 or the lowest if advan = -1. If advan = 0 rolls only one die. Use this function to implement advantage/disadvantage.
((level-1)/4)+2This is the formula for the proficiency bonus, assuming that 'level' holds your current level.
(level-1)*((hd/2)+1) + hd + con*levelReturns your total hit points, assuming that you're using the half+1 rule. 'hd' should hold your hit die (6, 8, 10, etc) and 'level' your total levels. This can be expanded to include all hit dice, but it will be quite complicated for no good reason, as you usually calculate this once and forget about it.
expup(-1d(wpn),-2,-1d(wpn)+2,0,1)*(-1)Implements the Great Weapon Fighting ability, as approximate as possible, for the reasons explained above (you're dealing slightly less damage - 6.20 mean instead of 6.30 for a d10 weapon die). 'wpn' is a named value holding your weapon's damage die.
rak(expup(-1d(wpn),-2,-1d(wpn)+2,0,1)*(-1),wpd,wpd)As above, but with a Roll and Keep (rak) function, just in case you're using a heavy weapon with two damage dice (Greatsword or Maul). 'wpd' is the code for a named value that holds the number of your weapon dice (1 or 2 typically).
rak(expup(-1d8,-2,-1d8+2,0,1)*(-1),smt,smt)Implements the Great Weapon Fighting ability when using your smite ability. 'smt' is the code for the named value that holds your smite dice - change it before rolling according to the spell level that you're going to expend.
Remember that you can also combine all these - for instance, my damage roll looks like this:
Damage rak(expup(-1d(wpn),-2,-1d(wpn)+2,0,1)*(-1),wpd,wpd)+str+10*(hwm)+rak(expup(-1d8,-2,-1d8+2,0,1)*(-1),smt,smt) wpn = 10 (using a halberd) wpd = 1 hwm = 1 (I'm always using the -5 attack +10 damage option of heavy weapon master) smt = 0..3 (I'm level 7, so I just have access to 1st- and 2nd-level spells)and this is my attack formula:
Attack (1-abs(advan))*1d20+abs(rak(1d20*advan,abs(advan)+1,1))+((level-1)/4)+2+str-5*(hwm)+(bls)d4 advan = -1,0,1 (based on whether I have advantage/disadvantage or neither str = 4 hwm = 1 bls = 0,1 (based on if I'm blessed or not)
AddendumI figured out a way to make the damage function better. You're still going to deal slightly less damage if you use it, 1% of the time, but this way it's not possible to deal 0 damage. Without further ado, here's the best formula that approximates Great Weapon Fighting using Quick Dice Roller:
Damage rak(expup(-1d(wpn),-2,min(-1d(wpn)+2,0),0,1)*(-1),wpd,wpd)+str+10*(hwm)+rak(expup(-1d8,-2,min(-1d8+2,0),0,1)*(-1),smt,smt) wpn = 10 (using a halberd) wpd = 1 hwm = 1 (I'm always using the -5 attack +10 damage option of heavy weapon master) smt = 0..3 (I'm level 7, so I just have access to 1st- and 2nd-level spells)