#note can now save the last action's text. Resolves #36

This commit is contained in:
raeleus 2024-10-02 22:19:14 -07:00
parent 655a539bd3
commit 2ab67ebe71
2 changed files with 8 additions and 4 deletions

View file

@ -24,7 +24,7 @@ const removeSkillSynonyms = ["removeskill", "deleteskill", "cancelskill"]
const clearSkillsSynonyms = ["clearskills"]
const checkSynonyms = ["check", "checkstat", "checkstatistic", "checkattribute", "checkability", "checkskill", "skillcheck", "abilitycheck"]
const showNotesSynonyms = ["notes", "shownotes", "viewnotes"]
const noteSynonyms = ["note", "takenote", "setnote", "createnote"]
const noteSynonyms = ["note", "takenote", "setnote", "createnote", "remember"]
const clearNotesSynonyms = ["clearnotes"]
const eraseNoteSynonyms = ["erasenote", "removenote", "deletenote", "cancelnote"]
const takeSynonyms = ["take", "steal", "get", "grab", "receive", "loot"]
@ -1180,7 +1180,11 @@ function doNote(command) {
state.notes.push(arg0)
state.show = "none"
return "\n[Note added successfully]\n"
} else return doShowNotes(command)
} else {
state.notes.push(history[history.length - 1].text)
state.show = "none"
return "\n[The last action was successfully added to the notes]"
}
}
function doShowNotes(command) {

View file

@ -217,8 +217,8 @@ const modifier = (text) => {
text += "\n Retrieves a random name from a list of names in the specified gender and genre. The parameters can be listed in any order."
text += "\n#shownotes"
text += "\n Shows all the notes."
text += "\n#note message"
text += "\n Adds the specified message as a note. Quotes are not necessary."
text += "\n#note (message)"
text += "\n Adds the specified message as a note. If the message is not specified, the last action's text will be saved as a note. Keep in mind that player adventures have a limited amount of state storage (an unspecified amount) so avoid saving too many notes. Quotes are not necessary."
text += "\n#clearnotes"
text += "\n Removes all notes."
text += "\n#removenote value"