#setdefaultdifficulty can be used without parameters. Resolves #24

This commit is contained in:
raeleus 2024-09-29 11:41:00 -07:00
parent ccc922028d
commit 28e74279ac
2 changed files with 4 additions and 6 deletions

View file

@ -708,10 +708,8 @@ function doSetDefaultDifficulty(command) {
const difficultyPatternNames = [...new Set(difficultyNames)]
difficultyPatternNames.push("\\d+")
var difficulty = getArgument(command, 0)
if (difficulty == null) {
state.show = "none"
return "\n[Error: Not enough parameters. See #help]\n"
}
if (difficulty == null) difficulty = "easy"
var difficultyIndex = difficultyNames.indexOf(difficulty)
if (difficultyIndex >= 0 && difficultyIndex < difficultyNames.length) {
difficulty = difficultyScores[difficultyIndex]

View file

@ -232,9 +232,9 @@ const modifier = (text) => {
text += "\n#levelup"
text += "\n Increases the character's experience by the exact amount needed to reach the next level."
text += "\n#setdefaultdifficulty (difficulty_class or effortless|easy|medium|hard|impossible)"
text += "\n Sets the default difficulty for #check, #try, #attack, and #cast when a difficulty is not specified. The normal default is 10 (easy)"
text += "\n Sets the default difficulty for #check, #try, #attack, and #cast when a difficulty is not specified. The normal default is 10 (easy). If you do not pass any parameters, the default will be set to 10 (easy)."
text += "\n#showdefaultdifficulty"
text += "\n Shows the default difficulty for #check, #try, #attack, and #cast when a difficulty is not specified. The normal default is 10 (easy)"
text += "\n Shows the default difficulty for #check, #try, #attack, and #cast when a difficulty is not specified. The normal default is 10 (easy)."
text += "\n#showcharacters"
text += "\n Lists all current characters and their classes/summaries."
text += "\n#removecharacter name"