#Exploding Dice on multiple values
1 messages · Page 1 of 1 (latest)
I suppose the super-easy "duct-tape" fix is to just replace the , in the formula with something else that the parser eats up, and then continue to do the processing in Die.prototype.explode/Die.prototype._evaluateModifiers, since this particular capture group, [^ (){}[\]$+\-*/,], appears to be excluding commas from formulas.
But I'm not sure if this is the "clean" solution 🤔
1d6x1&6appears to work, after I slapped a bunch of asyncs / awaits everywhere (apparently both the above methods have become asyncin some past release). Still, should & for some reason be axed in the parsing methods in the future, this solution isn't bulletproof enough, so if there are alternative suggestions or ideas, please do share.
That capture group is mainly just excluding any symbols that are used as part of regular formulae
i.e. anything that couldn't be mistaken as part of the overall formula might be a modifier
We don't have any plans to support an & operator, so it's probably safe. I would stay away from ? and : though
As for implementing custom modifiers, what you are currently doing seems correct. The only hurdle is making sure the parser is able to identify the custom modifier as an actual modifier