diff --git a/module/dice/dualityRoll.mjs b/module/dice/dualityRoll.mjs index e466b7fc..6c1d0fe4 100644 --- a/module/dice/dualityRoll.mjs +++ b/module/dice/dualityRoll.mjs @@ -143,6 +143,6 @@ export default class DualityRoll extends D20Roll { label: roll.totalLabel }; - setDiceSoNiceForDualityRoll(roll, config.roll.advantage); + setDiceSoNiceForDualityRoll(roll, config.roll.advantage.type); } } diff --git a/module/helpers/utils.mjs b/module/helpers/utils.mjs index 81da1edb..8156736d 100644 --- a/module/helpers/utils.mjs +++ b/module/helpers/utils.mjs @@ -122,16 +122,14 @@ export const getCommandTarget = () => { return target; }; -export const setDiceSoNiceForDualityRoll = (rollResult, advantage) => { +export const setDiceSoNiceForDualityRoll = (rollResult, advantageState) => { const diceSoNicePresets = getDiceSoNicePresets(); rollResult.dice[0].options = { appearance: diceSoNicePresets.hope }; rollResult.dice[1].options = { appearance: diceSoNicePresets.fear }; //diceSoNicePresets.fear; - if (rollResult.dice[2]) { - if (advantage.type === 1) { - rollResult.dice[2].options = { appearance: diceSoNicePresets.advantage }; - } else if (advantage.type === -1) { - rollResult.dice[2].options = { appearance: diceSoNicePresets.disadvantage }; - } + if (rollResult.dice[2] && advantageState) { + rollResult.dice[2].options = { + appearance: advantageState === 1 ? diceSoNicePresets.advantage : diceSoNicePresets.disadvantage + }; } };