diff --git a/example.json b/example.json index 40a3eb6..2dfd012 100644 --- a/example.json +++ b/example.json @@ -1 +1 @@ -{"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 +{"feats":[{"featInfo":{"featDescription":"allows you to ride a 'fiets'","featName":"fiets"},"tag":"Roleplay"}],"preamble":{"charClass":"Fighter","charLevel":5,"charName":"Bob","charRace":"Elf","jackOfAllTrades":false},"skills":[{"skillMod":"None","skillName":"Athletics","skillStat":"Strength"},{"skillMod":"None","skillName":"Acrobatics","skillStat":"Dexterity"},{"skillMod":"None","skillName":"Sleight of Hand","skillStat":"Dexterity"},{"skillMod":"None","skillName":"Stealth","skillStat":"Dexterity"},{"skillMod":"None","skillName":"Arcana","skillStat":"Intelligence"},{"skillMod":"None","skillName":"History","skillStat":"Intelligence"},{"skillMod":"None","skillName":"Investigation","skillStat":"Intelligence"},{"skillMod":"None","skillName":"Nature","skillStat":"Intelligence"},{"skillMod":"None","skillName":"Religion","skillStat":"Intelligence"},{"skillMod":"Proficient","skillName":"Animal Handling","skillStat":"Wisdom"},{"skillMod":"Expertise","skillName":"Insight","skillStat":"Wisdom"},{"skillMod":"None","skillName":"Medicine","skillStat":"Wisdom"},{"skillMod":"None","skillName":"Perception","skillStat":"Wisdom"},{"skillMod":"None","skillName":"Survival","skillStat":"Wisdom"},{"skillMod":"None","skillName":"Deception","skillStat":"Charisma"},{"skillMod":"None","skillName":"Intimidation","skillStat":"Charisma"},{"skillMod":"None","skillName":"Performance","skillStat":"Charisma"},{"skillMod":"None","skillName":"Persuasion","skillStat":"Charisma"}],"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,"statName":"Strength","statScore":10},{"proficient":false,"statName":"Dexterity","statScore":10},{"proficient":false,"statName":"Constitution","statScore":10},{"proficient":false,"statName":"Intelligence","statScore":10},{"proficient":false,"statName":"Wisdom","statScore":20},{"proficient":false,"statName":"Charisma","statScore":10}],"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/flake.lock b/flake.lock index 061263f..841d73b 100644 --- a/flake.lock +++ b/flake.lock @@ -20,16 +20,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1704290814, - "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", + "lastModified": 1731676054, + "narHash": "sha256-OZiZ3m8SCMfh3B6bfGC/Bm4x3qc1m2SVEAlkV6iY7Yg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", + "rev": "5e4fbfb6b3de1aa2872b76d49fafc942626e2add", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-23.05", + "ref": "nixos-unstable", "repo": "nixpkgs", "type": "github" } diff --git a/flake.nix b/flake.nix index 198698b..474f63d 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ description = "Sheet parser hacked together in Haskell"; inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; diff --git a/lib/DND/Sheet/Parser.hs b/lib/DND/Sheet/Parser.hs index 877cbd3..2a75e68 100644 --- a/lib/DND/Sheet/Parser.hs +++ b/lib/DND/Sheet/Parser.hs @@ -37,7 +37,7 @@ getSkill :: Character -> String -> Skill getSkill char s = head . filter (\a -> skillName a == s) . skills $ char getSkillNames :: Character -> [String] -getSkillNames = map skillStat . skills +getSkillNames = map skillName . skills getStatNames :: Character -> [String] getStatNames = map statName . stats diff --git a/sheet-parser-hs.cabal b/sheet-parser-hs.cabal index 3666132..22028a1 100644 --- a/sheet-parser-hs.cabal +++ b/sheet-parser-hs.cabal @@ -63,7 +63,7 @@ library , DND.Sheet.Content , DND.Sheet.Parser - build-depends: base ^>=4.16.4.0 + build-depends: base , aeson , bytestring , utf8-string @@ -88,7 +88,7 @@ executable sheet-parser-hs -- other-extensions: -- Other library packages from which modules are imported. - build-depends: base ^>=4.16.4.0 + build-depends: base , optparse-applicative , aeson , sheet-parser-hs