diff --git a/daggerheart.mjs b/daggerheart.mjs index 80f070f4..bc2c2238 100644 --- a/daggerheart.mjs +++ b/daggerheart.mjs @@ -219,11 +219,21 @@ Hooks.on('chatMessage', (_, message) => { const config = { title: title, - roll: { formula }, - targets: target, + roll: { + formula, + trait: traitValue + }, + data: { + traits: { + [traitValue]: trait + } + }, + source: target, hasSave: false, dialog: { configure: false }, - evaluate: true + evaluate: true, + advantage: rollCommand.advantage == true, + disadvantage: rollCommand.disadvantage == true }; await CONFIG.Dice.daggerheart['DualityRoll'].build(config); diff --git a/module/applications/roll.mjs b/module/applications/roll.mjs index a81ac071..2c2415c6 100644 --- a/module/applications/roll.mjs +++ b/module/applications/roll.mjs @@ -395,7 +395,12 @@ export class DualityRoll extends D20Roll { static async buildEvaluate(roll, config = {}, message = {}) { if (config.evaluate !== false) await roll.evaluate(); - const advantageState = this.hasAdvantage ? true : this.hasDisadvantage ? false : null; + const advantageState = + config.advantage == this.ADV_MODE.ADVANTAGE + ? true + : config.advantage == this.ADV_MODE.DISADVANTAGE + ? false + : null; setDiceSoNiceForDualityRoll(roll, advantageState); this.postEvaluate(roll, config); } diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 0d31e80a..9d7a1fdb 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -128,9 +128,9 @@ export const setDiceSoNiceForDualityRoll = (rollResult, advantageState) => { rollResult.dice[1].options = { appearance: diceSoNicePresets.fear }; //diceSoNicePresets.fear; if (rollResult.dice[2]) { if (advantageState === true) { - rollResult.dice[2].options.appearance = diceSoNicePresets.advantage; + rollResult.dice[2].options = { appearance: diceSoNicePresets.advantage }; } else if (advantageState === false) { - rollResult.dice[2].options.appearance = diceSoNicePresets.disadvantage; + rollResult.dice[2].options = { appearance: diceSoNicePresets.disadvantage }; } } };