From 4ff1f60a76e7e0bf1a39c674cf2b3aacbb32edbf Mon Sep 17 00:00:00 2001 From: Oliver-Akins Date: Tue, 17 Jun 2025 00:49:07 -0600 Subject: [PATCH] Add nullish coalescing to the DialogManager return types --- Axolotl-with-a-Gun/guns/AK-47/base.mjs | 4 ++-- Axolotl-with-a-Gun/guns/glock/2-not-1.mjs | 4 ++-- Axolotl-with-a-Gun/guns/glock/base.mjs | 4 ++-- Axolotl-with-a-Gun/guns/gunsword/base.mjs | 4 ++-- Axolotl-with-a-Gun/guns/hand-cannon/base.mjs | 6 +++--- Axolotl-with-a-Gun/guns/mini-gun/base.mjs | 4 ++-- Axolotl-with-a-Gun/guns/rocket-launcher/base.mjs | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Axolotl-with-a-Gun/guns/AK-47/base.mjs b/Axolotl-with-a-Gun/guns/AK-47/base.mjs index cf29f78..6a2f868 100644 --- a/Axolotl-with-a-Gun/guns/AK-47/base.mjs +++ b/Axolotl-with-a-Gun/guns/AK-47/base.mjs @@ -44,11 +44,11 @@ async function rollDice() { const { statBase, bonusThreshold, extraDice, } = answers; let rollMode = game.settings.get(`core`, `rollMode`); - let diceCount = statBase; + let diceCount = statBase ?? 1; if (statBase <= bonusThreshold) { diceCount += 3; }; - diceCount += extraDice; + diceCount += extraDice ?? 0; let successes = 0; let critsOnly = 0; diff --git a/Axolotl-with-a-Gun/guns/glock/2-not-1.mjs b/Axolotl-with-a-Gun/guns/glock/2-not-1.mjs index 6d9cf49..e247fe7 100644 --- a/Axolotl-with-a-Gun/guns/glock/2-not-1.mjs +++ b/Axolotl-with-a-Gun/guns/glock/2-not-1.mjs @@ -39,8 +39,8 @@ async function rollDice() { const { statBase, extraDice } = answers; let rollMode = game.settings.get(`core`, `rollMode`); - let diceCount = statBase; - diceCount += extraDice; + let diceCount = statBase ?? 1; + diceCount += extraDice ?? 0; let successes = 0; let critsOnly = 0; diff --git a/Axolotl-with-a-Gun/guns/glock/base.mjs b/Axolotl-with-a-Gun/guns/glock/base.mjs index 3ec6301..70b2310 100644 --- a/Axolotl-with-a-Gun/guns/glock/base.mjs +++ b/Axolotl-with-a-Gun/guns/glock/base.mjs @@ -39,8 +39,8 @@ async function rollDice() { const { statBase, extraDice } = answers; let rollMode = game.settings.get(`core`, `rollMode`); - let diceCount = statBase; - diceCount += extraDice; + let diceCount = statBase ?? 1; + diceCount += extraDice ?? 0; let successes = 0; let critsOnly = 0; diff --git a/Axolotl-with-a-Gun/guns/gunsword/base.mjs b/Axolotl-with-a-Gun/guns/gunsword/base.mjs index f1b7f77..6fab6e9 100644 --- a/Axolotl-with-a-Gun/guns/gunsword/base.mjs +++ b/Axolotl-with-a-Gun/guns/gunsword/base.mjs @@ -47,8 +47,8 @@ async function rollDice() { const { statBase, extraDice } = answers; let rollMode = game.settings.get(`core`, `rollMode`); - let diceCount = statBase; - diceCount += extraDice; + let diceCount = statBase ?? 1; + diceCount += extraDice ?? 0; let successes = 0; let critsOnly = 0; diff --git a/Axolotl-with-a-Gun/guns/hand-cannon/base.mjs b/Axolotl-with-a-Gun/guns/hand-cannon/base.mjs index ec38fb3..8ea1d75 100644 --- a/Axolotl-with-a-Gun/guns/hand-cannon/base.mjs +++ b/Axolotl-with-a-Gun/guns/hand-cannon/base.mjs @@ -39,8 +39,8 @@ async function rollDice() { const { statBase, extraDice } = answers; let rollMode = game.settings.get(`core`, `rollMode`); - let diceCount = statBase; - diceCount += extraDice; + let diceCount = statBase ?? 1; + diceCount += extraDice ?? 0; let successes = 0; let critsOnly = 0; @@ -117,7 +117,7 @@ async function rollDice() { const chatData = ChatMessage.applyRollMode( { - flavor: `(Gun: Hand Cannon)`, + flavor: `(Gun: Hand Cannon 0x000)`, content, }, rollMode, diff --git a/Axolotl-with-a-Gun/guns/mini-gun/base.mjs b/Axolotl-with-a-Gun/guns/mini-gun/base.mjs index a3dcce1..2457714 100644 --- a/Axolotl-with-a-Gun/guns/mini-gun/base.mjs +++ b/Axolotl-with-a-Gun/guns/mini-gun/base.mjs @@ -40,8 +40,8 @@ async function main() { let { statBase } = answers; let rollMode = game.settings.get(`core`, `rollMode`); - let diceCount = statBase; - diceCount += extraDice; + let diceCount = statBase ?? 1; + diceCount += extraDice ?? 0; if (statBase === 6) { diceCount += 6; }; diff --git a/Axolotl-with-a-Gun/guns/rocket-launcher/base.mjs b/Axolotl-with-a-Gun/guns/rocket-launcher/base.mjs index 4e08bbb..0a52a20 100644 --- a/Axolotl-with-a-Gun/guns/rocket-launcher/base.mjs +++ b/Axolotl-with-a-Gun/guns/rocket-launcher/base.mjs @@ -39,8 +39,8 @@ async function rollDice() { const { statBase, extraDice, } = answers; let rollMode = game.settings.get(`core`, `rollMode`); - let diceCount = statBase; - diceCount += extraDice; + let diceCount = statBase ?? 1; + diceCount += extraDice ?? 0; let successes = 0; let critsOnly = 0;