diff --git a/Input.js b/Input.js index 3d836cc..23b94b8 100644 --- a/Input.js +++ b/Input.js @@ -125,7 +125,7 @@ const modifier = (text) => { return { text } } - if (!found) found = processCommandSynonyms(command, commandName, helpSynonyms.concat(rollSynonyms, noteSynonyms, eraseNoteSynonyms, showNotesSynonyms, clearNotesSynonyms, showCharactersSynonyms, removeCharacterSynonyms, generateNameSynonyms, setDefaultDifficultySynonyms, showDefaultDifficultySynonyms, renameCharacterSynonyms, cloneCharacterSynonyms, createLocationSynonyms, showLocationsSynonyms, goToLocationSynonyms, removeLocationSynonyms, getLocationSynonyms, clearLocationsSynonyms, goNorthSynonyms, goSouthSynonyms, goEastSynonyms, goWestSynonyms, encounterSynonyms, showEnemiesSynonyms, addEnemySynonyms, removeEnemySynonyms, clearEnemiesSynonyms, initiativeSynonyms, turnSynonyms, fleeSynonyms, versionSynonyms, setupEnemySynonyms, resetSynonyms), function () {return true}) + if (!found) found = processCommandSynonyms(command, commandName, helpSynonyms.concat(rollSynonyms, noteSynonyms, eraseNoteSynonyms, showNotesSynonyms, clearNotesSynonyms, showCharactersSynonyms, removeCharacterSynonyms, generateNameSynonyms, setDefaultDifficultySynonyms, showDefaultDifficultySynonyms, renameCharacterSynonyms, cloneCharacterSynonyms, createLocationSynonyms, showLocationsSynonyms, goToLocationSynonyms, removeLocationSynonyms, getLocationSynonyms, clearLocationsSynonyms, goNorthSynonyms, goSouthSynonyms, goEastSynonyms, goWestSynonyms, encounterSynonyms, showEnemiesSynonyms, addEnemySynonyms, removeEnemySynonyms, clearEnemiesSynonyms, initiativeSynonyms, turnSynonyms, fleeSynonyms, versionSynonyms, setupEnemySynonyms, damageSynonyms, resetSynonyms), function () {return true}) if (found == null) { if (state.characterName == null) { @@ -1222,9 +1222,14 @@ function doDamage(command) { return "\n[Error: Not enough parameters. See #help]\n" } - var arg1 = getArgument(command, 1) + var arg1 = getArgumentRemainder(command, 1) if (arg1 == null) { + if (character == null) { + state.show = "none" + return "\n[Error: Character must be specified. See #help]\n" + } + var damage var damageMatches = arg0.match(/\d*d\d+((\+|-)d+)?/gi) diff --git a/Output.js b/Output.js index 08f1562..5654fe0 100644 --- a/Output.js +++ b/Output.js @@ -334,7 +334,7 @@ const modifier = (text) => { text += "\n Sets the character's health to specified value. It's capped at the character's max health." text += "\n#heal value" text += "\n Increases the character's health by the specified value. It's capped at the character's max health." - text += "\n#damage (enemy) damage or dice_roll" + text += "\n#damage value or dice_roll (enemy) " text += "\n Decreases the enemy's health by the specified damage or dice_roll. If an enemy isn't specified, the character calling the command is damaged. Reaching 0 causes the character to become \"unconscious\"." text += "\n#setac value" text += "\n Sets the armor class of the character. The default is 10"