From a8fbc6df5ba4c0692c6b2fa3d9470aeb70959f24 Mon Sep 17 00:00:00 2001 From: raeleus Date: Sat, 5 Oct 2024 20:43:20 -0700 Subject: [PATCH] Added #version. Resolved #42 --- Input.js | 10 +++++++++- Output.js | 2 ++ README.md | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Input.js b/Input.js index 5b11ff5..7eb0677 100644 --- a/Input.js +++ b/Input.js @@ -1,3 +1,4 @@ +const version = "Hashtag DnD v0.2.0" const rollSynonyms = ["roll"] const createSynonyms = ["create", "generate", "start", "begin", "setup", "party", "member", "new"] const renameCharacterSynonyms = ["renamecharacter", "renameperson"] @@ -73,6 +74,7 @@ const initiativeSynonyms = ["initiative"] const setAcSynonyms = ["setac", "setarmorclass", "ac", "armorclass"] const turnSynonyms = ["turn", "doturn", "taketurn"] const fleeSynonyms = ["flee", "retreat", "runaway"] +const versionSynonyms = ["version", "ver", "showversion"] const helpSynonyms = ["help"] const modifier = (text) => { @@ -114,7 +116,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, initiativeSynonyms, turnSynonyms, fleeSynonyms, 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, initiativeSynonyms, turnSynonyms, fleeSynonyms, versionSynonyms, resetSynonyms), function () {return true}) if (found == null) { if (state.characterName == null) { @@ -195,6 +197,7 @@ const modifier = (text) => { if (text == null) text = processCommandSynonyms(command, commandName, cloneCharacterSynonyms, doCloneCharacter) if (text == null) text = processCommandSynonyms(command, commandName, showDaySynonyms, doShowDay) if (text == null) text = processCommandSynonyms(command, commandName, setDaySynonyms, doSetDay) + if (text == null) text = processCommandSynonyms(command, commandName, versionSynonyms, doVersion) if (text == null) text = processCommandSynonyms(command, commandName, helpSynonyms, doHelp) if (text == null) { var character = getCharacter() @@ -2135,6 +2138,11 @@ function doClearSkills(command) { return " " } +function doVersion(command) { + state.show = "none" + return version +} + function doReset(command) { state.notes = [] state.characters = [] diff --git a/Output.js b/Output.js index 73eded5..a45b859 100644 --- a/Output.js +++ b/Output.js @@ -392,6 +392,8 @@ const modifier = (text) => { text += "\n Removes all characters, locations, and notes. Changes all settings to their defaults. Use with caution!" text += "\n\n--Other--" + text += "\n#version" + text += "\n Returns the current version of this scenario." text += "\n#help" text += "\n This long ass help menu. I am paid by lines of codes." diff --git a/README.md b/README.md index 14fbbbb..15da336 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,7 @@ v. 0.2.0 * You may use commas in coordinates now * The scenario keeps track of how many days have passed since the adventure has started. See `#rest`, `#showday`, `#setday`. * Added automatic difficulty which is DC 0 +* Added `#version` * Minor bug fixes and improvements v. 0.1.0