diff --git a/APKBUILD b/APKBUILD index 5be0dd7..2f79327 100644 --- a/APKBUILD +++ b/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Marty Sluijtman pkgname=sheet-parser pkgver=0.3 -pkgrel=5 +pkgrel=6 pkgdesc="A little D&D character sheet parser written in go" url="https://gitlab.com/EternalWanderer/sheet-parser" arch="all" @@ -28,7 +28,7 @@ package() { } sha512sums=" -adb4868c65a3e2c338cfc66028ffc41f7e2e93a113b8e77172cee089c85c04c0c72239b7fc2056cb257d05a60b13b5cf4bfe23a0ec4f4ae4d17f8a05c9988106 sheet-parser-0.3.tar.gz +425236cc04fa682b62efe876e036e2d4bbc8d6b9082c72e59ad3bc0e4c04ac8062fb7155420cc9d8fcd92e2b14509fc8fead434d687d9c65295c0bddd3b999d5 sheet-parser-0.3.tar.gz c1800a72d8d229d46a7ea2dffb83f97c7edaf773a9a875a2ae10b449ae84ab854b80eac05a62002f6a686bb8b014c9b1bc8e2359286b2edccda4d90227a473e5 zsh.completion -a685291e2d6e6cad66ec4169301b698c1764fc2bc7a16cc57c0261ee70b55a95eccfa3f78ca418ad1bdb6814179209b215fc5181f42ba5500b1871152b7cd383 example.json +b2c696f4dec885014fb39a313f0cf80798aa80ad119c9fc4d9b10b7d80d62df603852142115aa9f925fc49bc865e6fafd37c0fe143bcde406bf380ff96655591 example.json " diff --git a/example.json b/example.json index 5a8681c..c41b9ee 100644 --- a/example.json +++ b/example.json @@ -6,7 +6,8 @@ "class": "Fighter", "background": "Generic", "reliableTalent": false, - "jackOfAllTrades": false + "jackOfAllTrades": false, + "isKurthog": false }, "stats":[ {"statName":"strength", "score":20, "proficient":false }, diff --git a/main.go b/main.go index 5073cf2..b916623 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "fmt" "io/ioutil" "os" + "strings" "github.com/fatih/color" "gitlab.com/EternalWanderer/dice-roller/Dice" @@ -126,6 +127,28 @@ func main() { 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: result, plainResult, err := skillCheck(getSkill(skillString)) badCheck(skillString, err) diff --git a/sheet-parser.1.scd b/sheet-parser.1.scd index d87ef2a..dc94e8d 100644 --- a/sheet-parser.1.scd +++ b/sheet-parser.1.scd @@ -134,3 +134,5 @@ your rolls. ... ] ``` + +The "isKurthog" boolean is an injoke that I took a little too far. diff --git a/sheetContent.go b/sheetContent.go index 5788732..ce767fd 100644 --- a/sheetContent.go +++ b/sheetContent.go @@ -14,6 +14,7 @@ type Misc struct { Background string `json:"background"` ReliableTalent bool `json:"reliableTalent"` JackOfAllTrades bool `json:"jackOfAllTrades"` + IsKurthog bool `json:"isKurthog"` } type Skill struct { SkillName string `json:"skillName"`