Fixed enemy spells showing the damage dice in the output text.

This commit is contained in:
raeleus 2025-05-17 10:55:15 -07:00
parent 8db353f486
commit 226c82442b
2 changed files with 3 additions and 2 deletions

View file

@ -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`

View file

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