diff --git a/Library.js b/Library.js index 8b62389..0fc5123 100644 --- a/Library.js +++ b/Library.js @@ -376,9 +376,9 @@ function executeTurn(activeCharacter) { var diceMatches = spell.match(/(?<=^.*)\d*d\d+((\+|-)\d+)?$/gi) if (diceMatches == null) text += `${activeCharacterName} casts spell ${spell}!` else { + var spell = spell.substring(0, spell.length - diceMatches[0].length) if (hit) { var damage = calculateRoll(diceMatches[0]) - var spell = spell.substring(0, spell.length - diceMatches[0].length) target.health = Math.max(target.health - damage, 0) text += `\n[Character AC: ${target.ac} Attack roll: ${attack}]\n` @@ -419,9 +419,9 @@ function executeTurn(activeCharacter) { var diceMatches = spell.match(/(?<=^.*)\d*d\d+((\+|-)\d+)?$/gi) if (diceMatches == null) text += `${activeCharacterName} casts spell ${spell}!` else { + var spell = spell.substring(0, spell.length - diceMatches[0].length) if (hit) { var damage = calculateRoll(diceMatches[0]) - var spell = spell.substring(0, spell.length - diceMatches[0].length) target.health = Math.max(target.health - damage, 0) text += `\n[Character AC: ${target.ac} Attack roll: ${attack}]\n` diff --git a/README.md b/README.md index 92a02e3..7c83ce9 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,7 @@ Hashtag-DnD has another new scenario! Check out the [VTOL-Knights Repository](ht v.0.7.0 * Added allies which are NPC characters that fight alongside the characters in encounters +* Fixed enemy spells showing the damage dice in the output text. v. 0.6.0 * Added Memory/Matchmaking Game