From 9f8c3f0f3dd9f0800c9163c9005ad0ea1291f316 Mon Sep 17 00:00:00 2001 From: Jonpot Date: Mon, 21 Nov 2022 16:20:48 -0800 Subject: [PATCH] Update applyAction.js As per the docs, $attackDiceRoll should be the value of the d20 before modifiers, and $attackRoll should the the total value, after modifiers. Pre-patch, the former variable is never defined, and the latter variable has the wrong value. --- .../api/engine/actions/applyPropertyByType/applyAction.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js index becf0775..ab9ed8e1 100644 --- a/app/imports/api/engine/actions/applyPropertyByType/applyAction.js +++ b/app/imports/api/engine/actions/applyPropertyByType/applyAction.js @@ -163,8 +163,9 @@ function rollAttack(attack, scope) { value = rollDice(1, 20)[0]; resultPrefix = `1d20 [${value}] ${rollModifierText}` } - scope['$attackRoll'] = { value }; + scope['$attackDiceRoll'] = { value }; const result = value + attack.value; + scope['$attackRoll'] = { result }; const { criticalHit, criticalMiss } = applyCrits(value, scope); return { resultPrefix, result, value, criticalHit, criticalMiss }; }