diff --git a/app/Main.hs b/app/Main.hs index 0f7b19c..876aaa7 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,6 +1,7 @@ module Main where import DND.Sheet.Parser +import DND.Dice testfile :: FilePath testfile = "./example.json" @@ -10,4 +11,4 @@ main = do createExample testfile sheet <- parseSheet testfile putStrLn $ "wrote example character named \"" ++ getName sheet ++ "\" to: " ++ testfile - listSkillNames sheet + mapM_ putStrLn . getSkillNames $ sheet diff --git a/example.json b/example.json index 925e9b6..40a3eb6 100644 --- a/example.json +++ b/example.json @@ -1 +1 @@ -{"preamble":{"charClass":"Fighter","charLevel":1,"charName":"Bob","charRace":"Elf","jackOfAllTrades":false},"spells":[{"atHighLevel":"Cast more of the sodding things","attackSave":"Dexterity","castingTime":"3 Minutes","components":["Verbal","Somatic"],"damageEffect":"Fire","description":"Shoots a huge testicle shaped fireball","duration":"Instant","range":50,"school":"Conjuration","spellLevel":3,"spellName":"Firetesticle"}],"stats":[{"proficient":false,"score":10,"skills":[{"skillMod":"None","skillName":"Athletics"}],"stat":"Strength"},{"proficient":false,"score":10,"skills":[{"skillMod":"None","skillName":"Acrobatics"},{"skillMod":"None","skillName":"Sleight of Hand"},{"skillMod":"None","skillName":"Stealth"}],"stat":"Dexterity"},{"proficient":false,"score":10,"skills":[],"stat":"Constitution"},{"proficient":false,"score":10,"skills":[{"skillMod":"None","skillName":"Arcana"},{"skillMod":"None","skillName":"History"},{"skillMod":"None","skillName":"Investigation"},{"skillMod":"None","skillName":"Nature"},{"skillMod":"None","skillName":"Religion"}],"stat":"Intelligence"},{"proficient":false,"score":10,"skills":[{"skillMod":"None","skillName":"Animal Handling"},{"skillMod":"None","skillName":"Insight"},{"skillMod":"None","skillName":"Medicine"},{"skillMod":"None","skillName":"Perception"},{"skillMod":"None","skillName":"Survival"}],"stat":"Wisdom"},{"proficient":false,"score":10,"skills":[{"skillMod":"None","skillName":"Deception"},{"skillMod":"None","skillName":"Intimidation"},{"skillMod":"None","skillName":"Performance"},{"skillMod":"None","skillName":"Persuasion"}],"stat":"Charisma"}],"trivia":{"background":"farmer","bonds":"yay","flaws":"all","ideals":"I me likey fun things","personalityTrait":"none","quirk":"idk"}} \ No newline at end of file +{"feats":[{"featInfo":{"featDescription":"allows you to ride a 'fiets'","featName":"fiets"},"tag":"Roleplay"}],"preamble":{"charClass":"Fighter","charLevel":1,"charName":"Bob","charRace":"Elf","jackOfAllTrades":false},"skills":[{"relatedStat":"Strength","skillMod":"None","skillName":"Athletics"},{"relatedStat":"Dexterity","skillMod":"None","skillName":"Acrobatics"},{"relatedStat":"Dexterity","skillMod":"None","skillName":"Sleight of Hand"},{"relatedStat":"Dexterity","skillMod":"None","skillName":"Stealth"},{"relatedStat":"Intelligence","skillMod":"None","skillName":"Arcana"},{"relatedStat":"Intelligence","skillMod":"None","skillName":"History"},{"relatedStat":"Intelligence","skillMod":"None","skillName":"Investigation"},{"relatedStat":"Intelligence","skillMod":"None","skillName":"Nature"},{"relatedStat":"Intelligence","skillMod":"None","skillName":"Religion"},{"relatedStat":"Wisdom","skillMod":"None","skillName":"Animal Handling"},{"relatedStat":"Wisdom","skillMod":"None","skillName":"Insight"},{"relatedStat":"Wisdom","skillMod":"None","skillName":"Medicine"},{"relatedStat":"Wisdom","skillMod":"None","skillName":"Perception"},{"relatedStat":"Wisdom","skillMod":"None","skillName":"Survival"},{"relatedStat":"Charisma","skillMod":"None","skillName":"Deception"},{"relatedStat":"Charisma","skillMod":"None","skillName":"Intimidation"},{"relatedStat":"Charisma","skillMod":"None","skillName":"Performance"},{"relatedStat":"Charisma","skillMod":"None","skillName":"Persuasion"}],"spells":[{"atHighLevel":"Cast more of the sodding things","attackSave":"Dexterity","castingTime":"3 Minutes","components":["Verbal","Somatic"],"damageEffect":"Fire","description":"Shoots a huge testicle shaped fireball","duration":"Instant","range":50,"school":"Conjuration","spellLevel":3,"spellName":"Firetesticle"}],"stats":[{"proficient":false,"score":10,"statName":"Strength"},{"proficient":false,"score":10,"statName":"Dexterity"},{"proficient":false,"score":10,"statName":"Constitution"},{"proficient":false,"score":10,"statName":"Intelligence"},{"proficient":false,"score":10,"statName":"Wisdom"},{"proficient":false,"score":10,"statName":"Charisma"}],"trivia":{"background":"farmer","bonds":"yay","flaws":"all","ideals":"I me likey fun things","personalityTrait":"none","quirk":"idk"}} \ No newline at end of file diff --git a/lib/DND/Bob.hs b/lib/DND/Bob.hs index ac462c6..012cb85 100644 --- a/lib/DND/Bob.hs +++ b/lib/DND/Bob.hs @@ -9,7 +9,13 @@ testStats :: [Stat] testStats = [strStat, dexStat, conStat, intStat, wisStat, chaStat] testPreamble :: Preamble -testPreamble = Preamble 1 "Bob" "Elf" "Fighter" False +testPreamble = Preamble + { charLevel = 5 + , charName = "Bob" + , charRace = "Elf" + , charClass = "Fighter" + , jackOfAllTrades = False + } testTrivia :: Trivia testTrivia = Trivia "farmer" "none" "I me likey fun things" "yay" "all" "idk" @@ -44,11 +50,11 @@ intSkills = [ Skill "Arcana" None "Intelligence" ] wisStat :: Stat -wisStat = Stat "Wisdom" 10 False +wisStat = Stat "Wisdom" 20 False wisSkills :: [Skill] -wisSkills = [ Skill "Animal Handling" None "Wisdom" - , Skill "Insight" None "Wisdom" +wisSkills = [ Skill "Animal Handling" Proficient "Wisdom" + , Skill "Insight" Expertise "Wisdom" , Skill "Medicine" None "Wisdom" , Skill "Perception" None "Wisdom" , Skill "Survival" None "Wisdom" diff --git a/lib/DND/Sheet/Content.hs b/lib/DND/Sheet/Content.hs index c714472..c87701a 100644 --- a/lib/DND/Sheet/Content.hs +++ b/lib/DND/Sheet/Content.hs @@ -49,6 +49,7 @@ instance ToJSON SpellComponent data ScoreMod = None | Proficient | Expertise + | Half deriving (Show, Eq, Ord, Generic, Enum) data Character = Character @@ -78,14 +79,14 @@ data Trivia = Trivia } deriving ( Show, Eq, Ord, Generic) data Skill = Skill - { skillName :: String - , skillMod :: ScoreMod - , relatedStat :: String + { skillName :: String + , skillMod :: ScoreMod + , skillStat :: String } deriving ( Show, Eq, Ord, Generic) data Stat = Stat { statName :: String - , score :: Int + , statScore :: Int , proficient :: Bool } deriving ( Show, Eq, Ord, Generic)