mirror of
https://github.com/raeleus/Hashtag-DnD.git
synced 2025-07-05 21:20:27 -04:00
Allow flipping around check and try with the ability/skill first.
This commit is contained in:
parent
9e7a69087b
commit
bfd87c5f90
2 changed files with 27 additions and 1 deletions
24
Input.js
24
Input.js
|
@ -141,6 +141,18 @@ const modifier = (text) => {
|
|||
if (text == null) text = processCommandSynonyms(command, commandName, setAutoXpSynonyms, doSetAutoXp)
|
||||
if (text == null) text = processCommandSynonyms(command, commandName, showAutoXpSynonyms, doShowAutoXp)
|
||||
if (text == null) text = processCommandSynonyms(command, commandName, helpSynonyms, doHelp)
|
||||
if (text == null) {
|
||||
var character = getCharacter()
|
||||
var statNames = []
|
||||
character.stats.forEach(x => {
|
||||
statNames.push(x.name.toLowerCase())
|
||||
})
|
||||
character.skills.forEach(x => {
|
||||
statNames.push(x.name.toLowerCase())
|
||||
})
|
||||
|
||||
text = processCommandSynonyms(command, commandName, statNames, doTest)
|
||||
}
|
||||
|
||||
return { text }
|
||||
}
|
||||
|
@ -840,6 +852,18 @@ function doRest(command) {
|
|||
return `\n[All characters have rested and feel rejuvinated]\n`
|
||||
}
|
||||
|
||||
function doTest(command) {
|
||||
var ability = getCommandName(command)
|
||||
var arg0 = getArgument(command, 0)
|
||||
if (arg0 == null) return;
|
||||
var remainder = getArgumentRemainder(command, 1)
|
||||
|
||||
command = `${arg0} ${ability} ${remainder}`
|
||||
text = processCommandSynonyms(command, arg0, checkSynonyms, doCheck)
|
||||
if (text == null) text = processCommandSynonyms(command, arg0, trySynonyms, doTry)
|
||||
return text
|
||||
}
|
||||
|
||||
function doCheck(command) {
|
||||
const advantageNames = ["normal", "advantage", "disadvantage"]
|
||||
const difficultyNames = ["impossible", "extreme", "hard", "medium", "easy", "effortless"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue