From b56d515a4734bc85237de9ea9a47decfe956be27 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Wed, 1 Feb 2023 10:54:27 +0100 Subject: [PATCH] Spells and trivia - Trivia logic in sheet and main - Spell logic in sheet --- example.json | 12 +++++++++++- main.go | 10 ++++++++++ sheetContent.go | 33 +++++++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 9 deletions(-) diff --git a/example.json b/example.json index 47bd49d..53e50a9 100644 --- a/example.json +++ b/example.json @@ -5,6 +5,11 @@ "race": "Human", "class": "Fighter", "background": "Generic", + "personalityTrait":"Cardboard Cutout", + "ideals":"For king and country!", + "bonds":"I am loyal to the crown", + "flaws":"I am loyal to the crown", + "quirk":"Sometimes I stutter a little bit", "reliableTalent": false, "jackOfAllTrades": false, "isKurthog": false @@ -37,7 +42,12 @@ {"skillName":"performance", "proficient":true, "expertise":false, "baseStat":"charisma"}, {"skillName":"persuasion", "proficient":false, "expertise":false, "baseStat":"charisma"} ], + "spells":[ + {"spellName":"Eldritch Blast", "level":0, "castingTime":"1 Action", "range": 120, "components":"v,s", "duration":"Instantaneous","attack_save":"Ranged", "damage_effect":"Force"}, + {"spellName":"Eldritch Blast", "castingTime":"1 Action", "range": 120, "components":"v,s", "duration":"Instantaneous","attack_save":"Ranged", "damage_effect":"Force"} + ], "feats":[ - {"featName":"Boring", "featDescription":"Due to being excessivly generic, Bob gains... something"} + {"featName":"Boring", "featDescription":"Due to being excessivly generic, Bob gains... something"}, + {"featName":"Test Dummy", "featDescription":"As the test dummy for this project, you gain the ability to use things from other classes willy nilly."} ] } diff --git a/main.go b/main.go index 4d4938f..f70e32a 100644 --- a/main.go +++ b/main.go @@ -99,6 +99,16 @@ func main() { fmt.Printf("Name: %s\tLevel: %d\tProficiency: %d\n", char.Misc.Name, char.Misc.Level, GetProficiency()) fmt.Printf("Race: %s\tClass: %s\tBackground: %s\n", char.Misc.Race, char.Misc.Class, char.Misc.Background) + fmt.Printf("\n") + + fmt.Printf("Personality trait: %s\n", char.Misc.PersonalityTrait) + fmt.Printf("Ideals: %s\n", char.Misc.Ideals) + fmt.Printf("Bonds: %s\n", char.Misc.Bonds) + fmt.Printf("Flaws: %s\n", char.Misc.Flaws) + fmt.Printf("Quirk: %s\n", char.Misc.Quirk) + + fmt.Printf("\n") + fmt.Printf("Passive perception: %d\n", passiveSkillCheck(GetSkill("perception"))) fmt.Printf("Passive investigation: %d\n", passiveSkillCheck(GetSkill("investigation"))) diff --git a/sheetContent.go b/sheetContent.go index afc6a43..6dacca6 100644 --- a/sheetContent.go +++ b/sheetContent.go @@ -8,14 +8,20 @@ type Character struct { } type Misc struct { - Level int `json:"level"` - Name string `json:"name"` - Race string `json:"race"` - Class string `json:"class"` - Background string `json:"background"` - ReliableTalent bool `json:"reliableTalent"` - JackOfAllTrades bool `json:"jackOfAllTrades"` - IsKurthog bool `json:"isKurthog"` + Level int `json:"level"` + Name string `json:"name"` + Race string `json:"race"` + Class string `json:"class"` + Background string `json:"background"` + PersonalityTrait string `json:"personalityTrait"` + Ideals string `json:"ideals"` + Bonds string `json:"bonds"` + Flaws string `json:"flaws"` + Quirk string `json:"quirk"` + + ReliableTalent bool `json:"reliableTalent"` + JackOfAllTrades bool `json:"jackOfAllTrades"` + IsKurthog bool `json:"isKurthog"` } type Skill struct { @@ -32,6 +38,17 @@ type Stat struct { SaveProficient bool `json:"saveProficient"` } +type Spell struct { + SpellName string `json:"spellName"` + Level int `json:"level"` + CastingTime string `json:"castingTime"` + Range int `json:"range"` + Components string `json:"components"` + Duration string `json:"duration"` + Attack_Save string `json:"attack_save"` + Damage_Effect string `json:"damage_effect"` +} + type Feat struct { FeatName string `json:"featName"` FeatDescription string `json:"featDescription"`