aboutsummaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authorYour Name <you@example.com>2022-01-03 16:25:45 -0500
committerYour Name <you@example.com>2022-01-03 16:25:45 -0500
commit3f78a7e1647ba94129236bd2bf4fc855c109628a (patch)
tree0a1538d44715738c8cbbae00bf1995777227b963 /files
parentd222c5a39943ed9f83f11d63a42bdff4978179af (diff)
downloaddmtool-3f78a7e1647ba94129236bd2bf4fc855c109628a.tar.gz
dmtool-3f78a7e1647ba94129236bd2bf4fc855c109628a.tar.bz2
dmtool-3f78a7e1647ba94129236bd2bf4fc855c109628a.zip
Added command to force a saving throw
Diffstat (limited to 'files')
-rw-r--r--files/dmtool.bash28
1 files changed, 25 insertions, 3 deletions
diff --git a/files/dmtool.bash b/files/dmtool.bash
index 43aba72..0d7116f 100644
--- a/files/dmtool.bash
+++ b/files/dmtool.bash
@@ -70,6 +70,11 @@ _dmtool_abilities()
echo -e "str\ndex\ncon\nint\nwis\ncha"
}
+_dmtool_dmgtypes()
+{
+ echo -e "slashing\npiercing\nbludgeoning\npoison\nacid\nfire\ncold\nradiant\nnecrotic\nlightning\nthunder\nforce\npsychic"
+}
+
_dmtool_complete_skills_abilities()
{
local IFS=$'\n'
@@ -81,7 +86,7 @@ _dmtool()
{
COMPREPLY=()
local cur="${COMP_WORDS[COMP_CWORD]}"
- local commands="ls cp mkdir mv rm attacks roll attack damage heal reset set edit add del spellcasting help git"
+ local commands="ls cp mkdir mv rm attacks roll attack damage heal save 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 +98,23 @@ _dmtool()
_dmtool_complete_entries
fi
;;
- attacks|roll|attack|damage|heal|set|edit|del|spellcasting)
+ save)
+ if [[ $COMP_CWORD -eq 2 ]]; then
+ local IFS=$'\n'
+ COMPREPLY+=($(compgen -W "$(_dmtool_abilities)" -- ${cur}))
+ elif [[ "$lastarg" == "--type" ]]; then
+ local IFS=$'\n'
+ COMPREPLY+=($(compgen -W "$(_dmtool_dmgtypes)" -- ${cur}))
+ elif [[ "$lastarg" == "--damage" ]]; then
+ :
+ elif [[ $COMP_CWORD -eq 4 ]]; then
+ _dmtool_complete_entries
+ elif [[ $COMP_CWORD -ge 5 ]]; then
+ COMPREPLY+=($(compgen -W "--magical -m --silvered -s --adamantine -a --damage --type --halves" -- ${cur}))
+ _dmtool_complete_entries
+ fi
+ ;;
+ attacks|roll|attack|damage|heal|save|set|edit|del|spellcasting)
if [[ $COMP_CWORD -le 2 ]]; then
_dmtool_complete_entries
else
@@ -118,7 +139,8 @@ _dmtool()
damage)
COMPREPLY+=($(compgen -W "--magical -m --silvered -s --adamantine -a" -- ${cur}))
if [[ $COMP_CWORD -eq 4 ]]; then
- COMPREPLY+=($(compgen -W "slashing piercing bludgeoning poison acid fire cold radiant necrotic lightning thunder force psychic" -- ${cur}))
+ local IFS=$'\n'
+ COMPREPLY+=($(compgen -W "$(_dmtool_dmgtypes)" -- ${cur}))
fi
;;
set)