mirror of
https://gitlab.com/EternalWanderer/sheet-parser.git
synced 2024-11-28 21:13:51 +01:00
Feats feature
This commit is contained in:
parent
01252f30c3
commit
0d6ad6267e
|
@ -36,5 +36,8 @@
|
|||
{"skillName":"intimidation", "proficient":false, "expertise":true, "baseStat":"charisma"},
|
||||
{"skillName":"performance", "proficient":true, "expertise":false, "baseStat":"charisma"},
|
||||
{"skillName":"persuasion", "proficient":false, "expertise":false, "baseStat":"charisma"}
|
||||
],
|
||||
"feats":[
|
||||
{"featName":"Boring", "featDescription":"Due to being excessivly generic, Bob gains... something"}
|
||||
]
|
||||
}
|
||||
|
|
26
main.go
26
main.go
|
@ -16,13 +16,13 @@ import (
|
|||
const exampleFile string = "/etc/sheet-parser/example.json"
|
||||
|
||||
var (
|
||||
path, pathFlag, skillString, saveString, statString string
|
||||
modifier, diceThrows, surfaces int
|
||||
X, Y int
|
||||
char Character
|
||||
skillMap = make(map[string]int)
|
||||
statMap = make(map[string]int)
|
||||
advantage, disadvantage, stat_list, skill_list, verbose, trivia bool
|
||||
path, pathFlag, skillString, saveString, statString string
|
||||
modifier, diceThrows, surfaces int
|
||||
X, Y int
|
||||
char Character
|
||||
skillMap = make(map[string]int)
|
||||
statMap = make(map[string]int)
|
||||
advantage, disadvantage, stat_list, skill_list, verbose, trivia, feats bool
|
||||
)
|
||||
|
||||
func parseFlags() {
|
||||
|
@ -43,6 +43,8 @@ func parseFlags() {
|
|||
flag.BoolVar(&trivia, "t", false, "Print character name, level and proficiency")
|
||||
flag.BoolVar(&trivia, "trivia", false, "Print character name, level and proficiency")
|
||||
|
||||
flag.BoolVar(&feats, "feats", false, "Print character feats")
|
||||
|
||||
flag.Parse()
|
||||
}
|
||||
|
||||
|
@ -109,6 +111,9 @@ func main() {
|
|||
}
|
||||
fmt.Printf("Passive perception: %d\n", passivePerception)
|
||||
|
||||
case feats:
|
||||
listFeats()
|
||||
|
||||
case stat_list && skill_list:
|
||||
printStatList(verbose)
|
||||
printSkillList(verbose)
|
||||
|
@ -353,3 +358,10 @@ func printSkillList(verbose bool) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
func listFeats() {
|
||||
color.Magenta("Listing feats...")
|
||||
for i := 0; i < len(char.Feats); i++ {
|
||||
fmt.Printf("%25s\t%s\n", char.Feats[i].FeatName, char.Feats[i].FeatDescription)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ type Character struct {
|
|||
Misc Misc `json:"misc"`
|
||||
Stats []Stat `json:"stats"`
|
||||
Skills []Skill `json:"skills"`
|
||||
Feats []Feat `json:"feats"`
|
||||
}
|
||||
|
||||
type Misc struct {
|
||||
|
@ -16,14 +17,21 @@ type Misc struct {
|
|||
JackOfAllTrades bool `json:"jackOfAllTrades"`
|
||||
IsKurthog bool `json:"isKurthog"`
|
||||
}
|
||||
|
||||
type Skill struct {
|
||||
SkillName string `json:"skillName"`
|
||||
Proficient bool `json:"proficient"`
|
||||
Expertise bool `json:"expertise"`
|
||||
BaseStat string `json:"baseStat"`
|
||||
}
|
||||
|
||||
type Stat struct {
|
||||
StatName string `json:"statName"`
|
||||
Score int `json:"score"`
|
||||
Proficient bool `json:"proficient"`
|
||||
}
|
||||
|
||||
type Feat struct {
|
||||
FeatName string `json:"featName"`
|
||||
FeatDescription string `json:"featDescription"`
|
||||
}
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
#compdef sheet-parser
|
||||
|
||||
arguments=(
|
||||
'(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t)--trivia[Print character trivia]'
|
||||
'(--advantage --disadvantage --skill --save --stat --skill-list --stat-list -v --verbose --trivia -t)-t[Print character trivia]'
|
||||
'(--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)-t[Print character trivia]'
|
||||
'(--file)-f=[Path to character sheet]:character sheet:_files -g "*.(json)(-.)"'
|
||||
'(-f)--file=[Path to character sheet]:character sheet:_files -g "*.(json)(-.)"'
|
||||
'(--trivia -t --advantage --disadvantage --skill-list --stat-list --skill --save --stat --verbose)-v[To be used in conjuction with list parameters]'
|
||||
'(--trivia -t --advantage --disadvantage --skill-list --stat-list --skill --save --stat -v)--verbose[To be used in conjuction with list parameters]'
|
||||
'(--skill --stat --save --advantage --disadvantage --skill-list --stat-list)--stat-list[List stats found in file]'
|
||||
'(--skill --stat --save --advantage --disadvantage --skill-list --stat-list)--skill-list[List skills found in file]'
|
||||
'(--trivia -t --advantage --disadvantage --skill-list --stat-list --skill --save --stat --verbose --feats)-v[To be used in conjuction with list parameters]'
|
||||
'(--trivia -t --advantage --disadvantage --skill-list --stat-list --skill --save --stat -v --feats)--verbose[To be used in conjuction with list parameters]'
|
||||
'(--skill --stat --save --advantage --disadvantage --skill-list --stat-list --feats)--stat-list[List stats found in file]'
|
||||
'(--skill --stat --save --advantage --disadvantage --skill-list --stat-list --feats)--skill-list[List skills found in file]'
|
||||
'(--advantage --disadvantage)--advantage[Roll with advantage]'
|
||||
'(--advantage --disadvantage)--disadvantage[Roll with disadvantage]'
|
||||
'(--skill --save --stat --skill-list --stat-list -v --verbose)--stat[Roll a stat check]:stat to roll:(strength dexterity constitution intelligence wisdom charisma)'
|
||||
'(--skill --save --stat --skill-list --stat-list -v --verbose)--save[Roll a saving throw]:stat to roll:(strength dexterity constitution intelligence wisdom charisma)'
|
||||
'(--skill --save --stat --skill-list --stat-list -v --verbose)--skill[Roll a skill check]:stat to roll:(athletics acrobatics sleight_of_hand stealth arcana history investigation nature religion animal_handling insight medicine perception survival deception intimidation performance persuasion)'
|
||||
'(--skill --save --stat --skill-list --stat-list -v --verbose --feats)--stat[Roll a stat check]:stat to roll:(strength dexterity constitution intelligence wisdom charisma)'
|
||||
'(--skill --save --stat --skill-list --stat-list -v --verbose --feats)--save[Roll a saving throw]:stat to roll:(strength dexterity constitution intelligence wisdom charisma)'
|
||||
'(--skill --save --stat --skill-list --stat-list -v --verbose --feats)--skill[Roll a skill check]:stat to roll:(athletics acrobatics sleight_of_hand stealth arcana history investigation nature religion animal_handling insight medicine perception survival deception intimidation performance persuasion)'
|
||||
)
|
||||
_arguments : $arguments
|
||||
|
|
Loading…
Reference in a new issue