Aliharu / Foundry-Ex3

Foundry module for Exalted Third Edition
MIT License
7 stars 12 forks source link

Modifying dice value with Pre-Roll Macros has no effect on the dice roll #41

Closed Rhapsody-Sky closed 4 months ago

Rhapsody-Sky commented 6 months ago

Hey, I tried writing a full excellency charm with a pre-roll macro that automatically deducts the motes spent and adds dice to a roll.

this.object.cost.motes = this.object.cost.motes + this.actor.system.abilities[this.object.ability].value + this.actor.system.attributes[this.object.attribute].value;
this.object.dice = this.object.dice + this.actor.system.abilities[this.object.ability].value + this.actor.system.attributes[this.object.attribute].value;
this.object.charmDiceAdded = this.object.charmDiceAdded + this.actor.system.abilities[this.object.ability].value + this.actor.system.attributes[this.object.attribute].value;

When I roll it though the motes get deducted correctly but the new dice are not added to the roll. It shows "20 dice" instead of 10 on a 5/5 ability/attribute roll but they do not get calculated.

I tried this with dice, diceModifier, charmDiceAdded to no effect.

Aliharu commented 5 months ago

So this was an oversight in how Dice works.

As of 2.9.0 You should be able to do something like

return {dice: newDiceValue}

in the macro to update the dice.

You can also now add Full Excellency as an in built charm trigger.