diff --git a/module/dialogs/d20RollDialog.mjs b/module/dialogs/d20RollDialog.mjs index af7c215a..814630cd 100644 --- a/module/dialogs/d20RollDialog.mjs +++ b/module/dialogs/d20RollDialog.mjs @@ -6,10 +6,9 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio this.config = config; this.config.experiences = []; - /* this.diceOptions = [ - { id:12, value: 'd12' }, - { id:20, value: 'd20' } - ]; */ + + this.item = config.actor.parent.items.get(config.source.item); + this.action = this.item.system.actions.find(a => a._id === config.source.action); } static DEFAULT_OPTIONS = { @@ -52,9 +51,9 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio /* context.diceOptions = this.diceOptions; */ context.canRoll = true; if(this.config.costs?.length) { - const updatedCosts = this.config.action.calcCosts(this.config.costs); + const updatedCosts = this.action.calcCosts(this.config.costs); context.costs = updatedCosts - context.canRoll = this.config.action.getRealCosts(updatedCosts)?.hasCost; + context.canRoll = this.action.getRealCosts(updatedCosts)?.hasCost; } return context; }