Fixed attack disadvantage being treated as advantage
This commit is contained in:
@@ -127,7 +127,7 @@ function applyAttackToTarget({attack, target, scope, log}){
|
|||||||
function rollAttack(attack, scope){
|
function rollAttack(attack, scope){
|
||||||
const rollModifierText = numberToSignedString(attack.value, true);
|
const rollModifierText = numberToSignedString(attack.value, true);
|
||||||
let value, resultPrefix;
|
let value, resultPrefix;
|
||||||
if (attack.advantage === 1 || scope['$attackAdvantage']){
|
if (scope['$attackAdvantage'] === 1){
|
||||||
const [a, b] = rollDice(2, 20);
|
const [a, b] = rollDice(2, 20);
|
||||||
if (a >= b) {
|
if (a >= b) {
|
||||||
value = a;
|
value = a;
|
||||||
@@ -136,7 +136,7 @@ function rollAttack(attack, scope){
|
|||||||
value = b;
|
value = b;
|
||||||
resultPrefix = `1d20 [ ~~${a}~~, ${b} ] ${rollModifierText}`;
|
resultPrefix = `1d20 [ ~~${a}~~, ${b} ] ${rollModifierText}`;
|
||||||
}
|
}
|
||||||
} else if (attack.advantage === -1 || scope['$attackDisadvantage']){
|
} else if (scope['$attackAdvantage'] === -1){
|
||||||
const [a, b] = rollDice(2, 20);
|
const [a, b] = rollDice(2, 20);
|
||||||
if (a <= b) {
|
if (a <= b) {
|
||||||
value = a;
|
value = a;
|
||||||
|
|||||||
Reference in New Issue
Block a user