Modifying damage rolls for secial critical / custom damage types
So, I'm looking at the new rulesets and have been thinking of refactoring my extensions (Theogeek's Improved Critical and Nat20) to be a bit less complicated and it might be time. So sort of basic questions regarding the new ruleset (5e specifically).
Currently, I hijack the base handlers, do all sorts of string manipulation, regex searches, etc. of fields in rRoll at various times to handle effects, add or remove crit dice, maximize damage of the various die, etc. then call the base handler to finish things up.
It's worked well so far, but ruleset changes like this one are proving to be more work than I have time. :)
So my basic question is this: "Is there a better way to modify the roll than searching for and replacing things that are already there?"
Also, in the Nat20 extension, I can't get the ruleset to recognize an effect like this: "DMG: 1d8 slashing,nat20". I have added "nat20" to DataCommon.dmgtypes and DataCommon.specialdmgtypes programmatically in an onInit function in the Nat20 extension, but doing that results in that clause not being added to the roll. However, if I change DataCommon's lua file to add "nat20" to those tables, it adds the clauses like I'd expect. Adding them programmatically works for the LIVE channel but no longer works in the TEST channel.
thoughts there?
Thanks all!
Theo.