Spell additions

- zsh completions
- check spell amount
This commit is contained in:
Nox Sluijtman 2023-02-01 13:17:58 +01:00
parent d4162eab2b
commit 3667b65b04
2 changed files with 6 additions and 1 deletions

View file

@ -394,7 +394,11 @@ func listFeats() {
} }
func listSpells(verbose bool) { func listSpells(verbose bool) {
if len(char.Spells) == 0 {
color.Magenta("%s has no spells\n", char.Misc.Name)
} else {
color.Magenta("Listing spells...") color.Magenta("Listing spells...")
}
for i := 0; i < len(char.Spells); i++ { for i := 0; i < len(char.Spells); i++ {
fmt.Printf("Name: %s\t%s\n", char.Spells[i].Name, spellLevel(char.Spells[i].Level)) fmt.Printf("Name: %s\t%s\n", char.Spells[i].Name, spellLevel(char.Spells[i].Level))
fmt.Printf("Casting Time: %s\tRange: %dft\n", char.Spells[i].CastingTime, char.Spells[i].Range) fmt.Printf("Casting Time: %s\tRange: %dft\n", char.Spells[i].CastingTime, char.Spells[i].Range)

View file

@ -1,6 +1,7 @@
#compdef sheet-parser #compdef sheet-parser
arguments=( arguments=(
'(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t)--spells[Print spell list'
'(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t)--feats[Print charater feats]' '(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t)--feats[Print charater feats]'
'(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t --feats)--trivia[Print character trivia]' '(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t --feats)--trivia[Print character trivia]'
'(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t --feats)-t[Print character trivia]' '(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t --feats)-t[Print character trivia]'