From 0942413c4f9dcc164f994f2051b89542284ab26a Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Wed, 24 Apr 2024 23:53:36 -0400 Subject: [PATCH] Don't allow a damage with no type for Chaos Bolt Fixes #1086 --- src/dndbeyond/base/utils.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dndbeyond/base/utils.js b/src/dndbeyond/base/utils.js index 4e775d26..58798804 100644 --- a/src/dndbeyond/base/utils.js +++ b/src/dndbeyond/base/utils.js @@ -198,6 +198,11 @@ async function buildAttackRoll(character, attack_source, name, description, prop damages.splice(0, 0, base_damage); damage_types.splice(0, 0, "Chaotic Energy"); } + // Chaos Bolt has a 1d6 damage with no damage type assigned + const no_type_idx = damage_types.findIndex(t => t === ""); + if (no_type_idx > -1) { + damage_types[no_type_idx] = "Chaotic Energy"; + } } else if (roll_properties.name == "Toll the Dead") { const ttd_dice = await dndbeyondDiceRoller.queryGeneric(roll_properties.name, "Is the target missing any of its hit points ?", { "d12": "Yes", "d8": "No" }, "ttd_dice", ["d12", "d8"]); if (ttd_dice === null) return null;