From 911b0320f3f9f22f6ae370ad3e349842fe887fe8 Mon Sep 17 00:00:00 2001 From: raeleus Date: Sun, 22 Sep 2024 16:10:47 -0700 Subject: [PATCH] Fixed casing of abilities and skills. --- Input.js | 4 ++-- Output.js | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Input.js b/Input.js index 7a5ec2c..555b95a 100644 --- a/Input.js +++ b/Input.js @@ -572,7 +572,7 @@ function doSetStat(command) { } state.show = "none" - return `\n[${possessiveName} ${arg0} stat is now ${arg1}.]\n` + return `\n[${possessiveName} ${toTitleCase(arg0)} ability is now ${arg1}.]\n` } function doSetSpellStat(command) { @@ -684,7 +684,7 @@ function doSetSkill(command) { } state.show = "none" - return `\n[${possessiveName} ${arg0} skill is now ${arg2 >= 0 ? "+" + arg2 : "-" + arg2} and based on ${arg1}.]\n` + return `\n[${possessiveName} ${toTitleCase(arg0)} skill is now ${arg2 >= 0 ? "+" + arg2 : "-" + arg2} and based on ${toTitleCase(arg1)}.]\n` } function doSetExperience(command) { diff --git a/Output.js b/Output.js index e043892..640cdab 100644 --- a/Output.js +++ b/Output.js @@ -51,7 +51,7 @@ const modifier = (text) => { text += `-ABILITIES-\n` character.stats.forEach(function(x) { - text += `* ${x.name} ${x.value}\n` + text += `* ${toTitleCase(x.name)} ${x.value}\n` }) text += `----\n\n` @@ -62,7 +62,7 @@ const modifier = (text) => { const stat = character.stats.find(y => y.name.toLowerCase() == x.stat.toLowerCase()) var modifier = x.modifier + (stat != null ? getModifier(stat.value): 0) if (modifier >= 0) modifier = `+${modifier}` - text += `* ${toTitleCase(x.name)} (${x.stat}) ${modifier}\n` + text += `* ${toTitleCase(x.name)} (${toTitleCase(x.stat)}) ${modifier}\n` }) text += `----\n\n` @@ -75,7 +75,7 @@ const modifier = (text) => { text += `-SPELLS-\n` character.spells.forEach(function(x) { - text += `* ${x}\n` + text += `* ${toTitleCase(x)}\n` }) text += `----\n\n` @@ -119,7 +119,7 @@ const modifier = (text) => { text += `*** CHARACTERS ***` if (state.characters.length > 0) { state.characters.forEach(function(x) { - text += `\n* ${x.name} the ${x.className}: ${x.summary}` + text += `\n* ${toTitleCase(x.name)} the ${toTitleCase(x.className)}: ${x.summary}` }) } else { text += `\n${possessiveName} inventory is empty!` @@ -130,7 +130,7 @@ const modifier = (text) => { text += `*** ${possessiveName.toUpperCase()} SPELLBOOK ***` if (character.spells.length > 0) { character.spells.forEach(function(x) { - text += "\n* " + x + text += "\n* " + toTitleCase(x) }) } else { text += `\n${possessiveName} spellbook is empty!` @@ -141,7 +141,7 @@ const modifier = (text) => { text += `*** ${possessiveName.toUpperCase()} ABILITIES ***\n` if (character.stats.length > 0) { character.stats.forEach(function(x) { - text += `* ${x.name} ${x.value}\n` + text += `* ${toTitleCase(x.name)} ${x.value}\n` }) } else { text += `${character.name} has no abilities!\n` @@ -155,7 +155,7 @@ const modifier = (text) => { const stat = character.stats.find(y => y.name.toLowerCase() == x.stat.toLowerCase()) var modifier = x.modifier + (stat != null ? getModifier(stat.value): 0) if (modifier >= 0) modifier = `+${modifier}` - text += `* ${toTitleCase(x.name)} (${x.stat}) ${modifier}\n` + text += `* ${toTitleCase(x.name)} (${toTitleCase(x.stat)}) ${toTitleCase(modifier)}\n` }) } else { text += `${character.name} has no skills!\n`