diff options
author | Your Name <you@example.com> | 2021-12-25 16:52:34 -0500 |
---|---|---|
committer | Your Name <you@example.com> | 2021-12-25 16:52:34 -0500 |
commit | 52b91a1aca6640b1797a63afc8a9e9a778b0964a (patch) | |
tree | 0cfb8ebe6a0a511607b3acc6c67228b796cd9c90 /files | |
parent | d8d1056af0383f0ef67c6d70d1594bcb430d7281 (diff) | |
download | dmtool-52b91a1aca6640b1797a63afc8a9e9a778b0964a.tar.gz dmtool-52b91a1aca6640b1797a63afc8a9e9a778b0964a.tar.bz2 dmtool-52b91a1aca6640b1797a63afc8a9e9a778b0964a.zip |
Added capability to cause two npcs to attack each other
Diffstat (limited to 'files')
-rw-r--r-- | files/dmtool.bash | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/files/dmtool.bash b/files/dmtool.bash index 8bbd673..43aba72 100644 --- a/files/dmtool.bash +++ b/files/dmtool.bash @@ -81,7 +81,7 @@ _dmtool() { COMPREPLY=() local cur="${COMP_WORDS[COMP_CWORD]}" - local commands="ls cp mkdir mv rm attacks roll damage heal reset set edit add del spellcasting help git" + local commands="ls cp mkdir mv rm attacks roll attack damage heal reset set edit add del spellcasting help git" if [[ $COMP_CWORD -gt 1 ]]; then local lastarg="${COMP_WORDS[$COMP_CWORD-1]}" case "${COMP_WORDS[1]}" in @@ -93,7 +93,7 @@ _dmtool() _dmtool_complete_entries fi ;; - attacks|roll|damage|heal|set|edit|del|spellcasting) + attacks|roll|attack|damage|heal|set|edit|del|spellcasting) if [[ $COMP_CWORD -le 2 ]]; then _dmtool_complete_entries else @@ -105,6 +105,16 @@ _dmtool() opts="$(${COMP_WORDS[0]} attacks ${COMP_WORDS[2]})" COMPREPLY+=($(compgen -W "$opts" -- ${cur})) ;; + attack) + COMPREPLY+=($(compgen -W "-1 -2" -- ${cur})) + if [[ $COMP_CWORD -eq 3 ]]; then + local IFS=$'\n' + opts="$(${COMP_WORDS[0]} attacks ${COMP_WORDS[2]})" + COMPREPLY+=($(compgen -W "$opts" -- ${cur})) + elif [[ $COMP_CWORD -eq 4 ]]; then + _dmtool_complete_entries + fi + ;; damage) COMPREPLY+=($(compgen -W "--magical -m --silvered -s --adamantine -a" -- ${cur})) if [[ $COMP_CWORD -eq 4 ]]; then |