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.
This commit is contained in:
Jonpot
2022-11-21 16:20:48 -08:00
committed by GitHub
parent c55d572134
commit 9f8c3f0f3d

View File

@@ -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 };
}