
So I'm working on editing a sheet and making it custom. The way the sheet was set up originally you have to manually write what the crit damage would be. But with several characters, often changing weapons, different stats, and a whole bunch of other stuff to keep track of... that's just not convenient for anyone... So here's what I'd like to do: I'd like to calculate the crit so that the sheet automatically knows what the crit is. It's just the max possible damage roll for the weapon + a mod. But... how do I get that max possible roll? If they type into the sheet that a weapon does for example 1d6 + 1, how do I take that and in code get it to be 7 every time? Is there a convenient way? Basically, how can I get the maximum possible from a roll in the code?