I need a probability calculation script that works with various dice and dice pool sizes, that accounts for a mechanic that allows you to reroll up to X dice that are failures, but ONLY once per die. ...
In D&D's basic D20 system, you roll one d20 and add in some modifiers, then compare the result to a target number. Each modifier effectively adds or removes a 5% chance of success with the roll. ...