The fundamental design of the DiceRoller and RollExpressions is not 5e related. We can decouple the DiceRoller package into its own library which would lend itself to wider use among other game systems. It would also have the added benefit of reducing the amount of macros in Lib:DnD5e, which until we are better at ignoring trivial changes in macro XMLs, is a bit unwieldy at check-in time.
[ ] Define a new token library, say Lib:DiceRoller? Prefixed here as 'dre', subject to change.
[ ] Migrate all of the macros in Dice Roller and RollExpression, with the exceptions of:
[ ] 5e DiceRoller.roll has most of its logic migrated and now injects 5e rollers into the dre DiceRoller.roll
[ ] advantageRoll, applyConditions(*), critableRoll, luckyRoll are 5e artifacts.
[ ] Template RollExpressions _Ability, _Attack, _Bless, _Damage, _Healing, _Save are all 5e artifacts.
[ ] Some RollExpression getters/setters are 5e centric, like damageType, onCritAdd, Dis-/Advantage. These are behavioral functions implied by type. They'll have to stay w/ 5e.
[ ] hasType has to be extended to chain from 5e to dre. Thus the 5e rollers will call 5e hasType, which will call dre hasType in addition to its own type detection.
[ ] buildOutput will have to be extended with one version on dre and another in 5e. Or figure out a better way to get 5e things like Damage Type into the output built by dre.
[ ] Will have to refactor several macros calling the 5e RollExpression_get/set functions to use dre get/set.
The fundamental design of the DiceRoller and RollExpressions is not 5e related. We can decouple the DiceRoller package into its own library which would lend itself to wider use among other game systems. It would also have the added benefit of reducing the amount of macros in Lib:DnD5e, which until we are better at ignoring trivial changes in macro XMLs, is a bit unwieldy at check-in time.
[ ] Define a new token library, say Lib:DiceRoller? Prefixed here as 'dre', subject to change.
[ ] Migrate all of the macros in Dice Roller and RollExpression, with the exceptions of:
[ ] 5e DiceRoller.roll has most of its logic migrated and now injects 5e rollers into the dre DiceRoller.roll
[ ] advantageRoll, applyConditions(*), critableRoll, luckyRoll are 5e artifacts.
[ ] Template RollExpressions _Ability, _Attack, _Bless, _Damage, _Healing, _Save are all 5e artifacts.
[ ] Some RollExpression getters/setters are 5e centric, like damageType, onCritAdd, Dis-/Advantage. These are behavioral functions implied by type. They'll have to stay w/ 5e.
[ ] hasType has to be extended to chain from 5e to dre. Thus the 5e rollers will call 5e hasType, which will call dre hasType in addition to its own type detection.
[ ] buildOutput will have to be extended with one version on dre and another in 5e. Or figure out a better way to get 5e things like Damage Type into the output built by dre.
[ ] Will have to refactor several macros calling the 5e RollExpression_get/set functions to use dre get/set.