mirror of
https://gitlab.com/EternalWanderer/sheet-parser.git
synced 2024-11-29 05:23:49 +01:00
The important feature to date *cough cough*
This commit is contained in:
parent
85d0a12b45
commit
38a75b86af
6
APKBUILD
6
APKBUILD
|
@ -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.3
|
pkgver=0.3
|
||||||
pkgrel=5
|
pkgrel=6
|
||||||
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="
|
||||||
adb4868c65a3e2c338cfc66028ffc41f7e2e93a113b8e77172cee089c85c04c0c72239b7fc2056cb257d05a60b13b5cf4bfe23a0ec4f4ae4d17f8a05c9988106 sheet-parser-0.3.tar.gz
|
425236cc04fa682b62efe876e036e2d4bbc8d6b9082c72e59ad3bc0e4c04ac8062fb7155420cc9d8fcd92e2b14509fc8fead434d687d9c65295c0bddd3b999d5 sheet-parser-0.3.tar.gz
|
||||||
c1800a72d8d229d46a7ea2dffb83f97c7edaf773a9a875a2ae10b449ae84ab854b80eac05a62002f6a686bb8b014c9b1bc8e2359286b2edccda4d90227a473e5 zsh.completion
|
c1800a72d8d229d46a7ea2dffb83f97c7edaf773a9a875a2ae10b449ae84ab854b80eac05a62002f6a686bb8b014c9b1bc8e2359286b2edccda4d90227a473e5 zsh.completion
|
||||||
a685291e2d6e6cad66ec4169301b698c1764fc2bc7a16cc57c0261ee70b55a95eccfa3f78ca418ad1bdb6814179209b215fc5181f42ba5500b1871152b7cd383 example.json
|
b2c696f4dec885014fb39a313f0cf80798aa80ad119c9fc4d9b10b7d80d62df603852142115aa9f925fc49bc865e6fafd37c0fe143bcde406bf380ff96655591 example.json
|
||||||
"
|
"
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
"class": "Fighter",
|
"class": "Fighter",
|
||||||
"background": "Generic",
|
"background": "Generic",
|
||||||
"reliableTalent": false,
|
"reliableTalent": false,
|
||||||
"jackOfAllTrades": false
|
"jackOfAllTrades": false,
|
||||||
|
"isKurthog": false
|
||||||
},
|
},
|
||||||
"stats":[
|
"stats":[
|
||||||
{"statName":"strength", "score":20, "proficient":false },
|
{"statName":"strength", "score":20, "proficient":false },
|
||||||
|
|
23
main.go
23
main.go
|
@ -7,6 +7,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/fatih/color"
|
"github.com/fatih/color"
|
||||||
"gitlab.com/EternalWanderer/dice-roller/Dice"
|
"gitlab.com/EternalWanderer/dice-roller/Dice"
|
||||||
|
@ -126,6 +127,28 @@ func main() {
|
||||||
color.Green("%d\n", result)
|
color.Green("%d\n", result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case len(skillString) > 0 && char.Misc.IsKurthog && strings.Contains(skillString, "performance"):
|
||||||
|
result, plainResult, err := skillCheck(getSkill(skillString))
|
||||||
|
badCheck(skillString, err)
|
||||||
|
if advantage {
|
||||||
|
color.Yellow("Rolling %s check with advantage...", skillString)
|
||||||
|
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
||||||
|
fmt.Printf("Modifier: %d\n", result-plainResult)
|
||||||
|
fmt.Printf("Kurthogifier: %d\n", -1)
|
||||||
|
color.Green("%d\n", result*-1)
|
||||||
|
} else if disadvantage {
|
||||||
|
color.Yellow("Rolling %s check with disadvantage...", skillString)
|
||||||
|
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
||||||
|
fmt.Printf("Modifier: %d\n", result-plainResult)
|
||||||
|
fmt.Printf("Kurthogifier: %d\n", -1)
|
||||||
|
color.Red("%d\n", result*-1)
|
||||||
|
} else {
|
||||||
|
color.Yellow("Rolling %s check...", skillString)
|
||||||
|
fmt.Printf("Without modifier: %d\tModifier: %d\n", plainResult, result-plainResult)
|
||||||
|
fmt.Printf("Kurthogifier: %d\n", -1)
|
||||||
|
color.Green("%d\n", result*-1)
|
||||||
|
}
|
||||||
|
|
||||||
case len(skillString) > 0:
|
case len(skillString) > 0:
|
||||||
result, plainResult, err := skillCheck(getSkill(skillString))
|
result, plainResult, err := skillCheck(getSkill(skillString))
|
||||||
badCheck(skillString, err)
|
badCheck(skillString, err)
|
||||||
|
|
|
@ -134,3 +134,5 @@ your rolls.
|
||||||
...
|
...
|
||||||
]
|
]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The "isKurthog" boolean is an injoke that I took a little too far.
|
||||||
|
|
|
@ -14,6 +14,7 @@ type Misc struct {
|
||||||
Background string `json:"background"`
|
Background string `json:"background"`
|
||||||
ReliableTalent bool `json:"reliableTalent"`
|
ReliableTalent bool `json:"reliableTalent"`
|
||||||
JackOfAllTrades bool `json:"jackOfAllTrades"`
|
JackOfAllTrades bool `json:"jackOfAllTrades"`
|
||||||
|
IsKurthog bool `json:"isKurthog"`
|
||||||
}
|
}
|
||||||
type Skill struct {
|
type Skill struct {
|
||||||
SkillName string `json:"skillName"`
|
SkillName string `json:"skillName"`
|
||||||
|
|
Loading…
Reference in a new issue