Spell info and cleanup

- Removed save specific proficiency
- Added "at high level" description string for spells
This commit is contained in:
Nox Sluijtman 2023-02-01 19:07:51 +01:00
parent 27cbb060be
commit ea8cf0ff5f
4 changed files with 23 additions and 17 deletions

View file

@ -2,7 +2,7 @@
# Maintainer: Marty Sluijtman <marty.wanderer@disroot.org> # Maintainer: Marty Sluijtman <marty.wanderer@disroot.org>
pkgname=sheet-parser pkgname=sheet-parser
pkgver=0.6 pkgver=0.6
pkgrel=0 pkgrel=2
pkgdesc="A little D&D character sheet parser written in go" pkgdesc="A little D&D character sheet parser written in go"
url="https://gitlab.com/EternalWanderer/sheet-parser" url="https://gitlab.com/EternalWanderer/sheet-parser"
arch="all" arch="all"
@ -28,7 +28,7 @@ package() {
} }
sha512sums=" sha512sums="
9477c9f16c8a1103cdefbe4bd6dccfaf383e8ba2ef39b8f0db222d9381f6e4ff3ac27aa32a607a7663c64ab870147f3095d47abd52e5f155b0884348dcb4a107 sheet-parser-0.6.tar.gz 80d8be4f0e6b0c29d5303607c2eeb7a78d7fadd4ffc2120df00cec39989cf2d33588afaa0cc0ddf779bc388d587e87e47972a90c236db00527b29db08712c4de sheet-parser-0.6.tar.gz
b901eb7ec27ba079224df700a6e6676e15ea5d24a712dadb76a6f7e7d1fde9c1c83ff0b3bfcdb762bb63bca2965b90af8b97e42a53b73154567bf98b9f21fdc5 zsh.completion 9386512f6ece159cf7a7ae142560791a40c670fcea0d042849cb23f82abc185aeeec41a55a4311f7085c2435d7af29280991e82bc5829ef065814a92dc241871 zsh.completion
3280db6458beeb6c7f10e29607d48c6973b940dd1bd1e90fdd3b40c1b55ac3855163837c841a6627fc95aba045795400ae955f7e30c4951ba8169efe0f2c1740 example.json 517b15a2cf3cff229687047618e27b40735f239c06bfbf6b9d75b68bd7a82dfb9410ac3d29f93e0249bddf1a1b40aa2bbeb621323e9dfaf9de01cec5c243dce4 example.json
" "

View file

@ -15,12 +15,12 @@
"isKurthog": false "isKurthog": false
}, },
"stats":[ "stats":[
{"name":"strength", "score":20, "proficient":false, "saveProficient":false }, {"name":"strength", "score":20, "proficient":false},
{"name":"dexterity", "score":1, "proficient":false, "saveProficient":false }, {"name":"dexterity", "score":1, "proficient":false},
{"name":"constitution", "score":15, "proficient":false, "saveProficient":false }, {"name":"constitution", "score":15, "proficient":false},
{"name":"intelligence", "score":10, "proficient":false, "saveProficient":false }, {"name":"intelligence", "score":10, "proficient":false},
{"name":"wisdom", "score":10, "proficient":false, "saveProficient":false }, {"name":"wisdom", "score":10, "proficient":false},
{"name":"charisma", "score":10, "proficient":false, "saveProficient":false } {"name":"charisma", "score":10, "proficient":false}
], ],
"skills":[ "skills":[
{"name":"athletics", "proficient":true, "expertise":false, "baseStat":"strength"}, {"name":"athletics", "proficient":true, "expertise":false, "baseStat":"strength"},
@ -44,7 +44,7 @@
], ],
"spells":[ "spells":[
{"name":"Eldritch Blast", "level":0, "castingTime":"1 Action", "range": 120, "components":"v,s", "duration":"Instantaneous","attack_save":"Ranged", "damage_effect":"Force", "school":"Evocation", "description":"A beam of crackling energy streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, the target takes 1d10 force damage."}, {"name":"Eldritch Blast", "level":0, "castingTime":"1 Action", "range": 120, "components":"v,s", "duration":"Instantaneous","attack_save":"Ranged", "damage_effect":"Force", "school":"Evocation", "description":"A beam of crackling energy streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, the target takes 1d10 force damage."},
{"name":"Absorb Elements", "level":1, "castingTime":"1 Reaction", "range": 0, "components":"s", "duration":"1 Round","attack_save":"None", "damage_effect":"The Absorbed effect", "school":"Abjuration", "description":"The spell captures some of the incoming energy, lessening its effect on you and storing it for your next melee attack. You have resistance to the triggering damage type until the start of your next turn. Also, the first time you hit with a melee attack on your next turn, the target takes an extra 1d6 damage of the triggering type, and the spell ends."} {"name":"Absorb Elements", "level":1, "castingTime":"1 Reaction", "range": 0, "components":"s", "duration":"1 Round","attack_save":"None", "damage_effect":"The Absorbed effect", "school":"Abjuration", "description":"The spell captures some of the incoming energy, lessening its effect on you and storing it for your next melee attack. You have resistance to the triggering damage type until the start of your next turn. Also, the first time you hit with a melee attack on your next turn, the target takes an extra 1d6 damage of the triggering type, and the spell ends.", "atHighLevel":"nothing, methinks"}
], ],
"feats":[ "feats":[
{"name":"Boring", "description":"Due to being excessivly generic, Bob gains... something"}, {"name":"Boring", "description":"Due to being excessivly generic, Bob gains... something"},

View file

@ -287,7 +287,7 @@ func savingThrow(stat Stat) (int, int, error) {
die := rollDice() die := rollDice()
plainDie := die plainDie := die
if stat.SaveProficient { if stat.Proficient {
die += GetProficiency() die += GetProficiency()
} }
return die + GetModifier(stat), plainDie, statErrorCheck() return die + GetModifier(stat), plainDie, statErrorCheck()
@ -404,10 +404,15 @@ func listSpells(verbose bool) {
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)
fmt.Printf("Components: %s\t\tDuration: %s\n", char.Spells[i].Components, char.Spells[i].Duration) fmt.Printf("Components: %s\t\tDuration: %s\n", char.Spells[i].Components, char.Spells[i].Duration)
fmt.Printf("Attack/Save: %s\tDamage/Effect: %s\n", char.Spells[i].Attack_Save, char.Spells[i].Damage_Effect) fmt.Printf("Attack/Save: %s\tDamage/Effect: %s\n", char.Spells[i].Attack_Save, char.Spells[i].Damage_Effect)
fmt.Printf("School: %s\n", char.Spells[i].School)
if verbose { if verbose {
fmt.Printf("\n") fmt.Printf("\n")
fmt.Printf("%s\n", char.Spells[i].Description) fmt.Printf("Description: %s\n", char.Spells[i].Description)
if len(char.Spells[i].AtHighLevel) != 0 {
fmt.Printf("\n")
fmt.Printf("Description: %s\n", char.Spells[i].AtHighLevel)
}
} }
// hack for string formatting // hack for string formatting
if len(char.Spells) != (i + 1) { if len(char.Spells) != (i + 1) {

View file

@ -36,7 +36,6 @@ type Stat struct {
Name string `json:"name"` Name string `json:"name"`
Score int `json:"score"` Score int `json:"score"`
Proficient bool `json:"proficient"` Proficient bool `json:"proficient"`
SaveProficient bool `json:"saveProficient"`
} }
type Spell struct { type Spell struct {
@ -49,6 +48,8 @@ type Spell struct {
Attack_Save string `json:"attack_save"` Attack_Save string `json:"attack_save"`
Damage_Effect string `json:"damage_effect"` Damage_Effect string `json:"damage_effect"`
Description string `json:"description"` Description string `json:"description"`
School string `json:"school"`
AtHighLevel string `json:"atHighLevel"`
} }
type Feat struct { type Feat struct {