From 85d0a12b4594f3c19a60076beab044827f1d3af6 Mon Sep 17 00:00:00 2001 From: Marty Sluijtman Date: Thu, 22 Sep 2022 17:24:48 +0200 Subject: [PATCH] I can English... I swear --- main.go | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/main.go b/main.go index 27b4b45..5073cf2 100644 --- a/main.go +++ b/main.go @@ -108,59 +108,59 @@ func main() { fmt.Println("You can't roll with both advantage and disadvantage") os.Exit(1) case len(saveString) > 0: - result, planeResult, err := savingThrow(getStat(saveString)) + result, plainResult, err := savingThrow(getStat(saveString)) badCheck(saveString, err) if advantage { color.Yellow("Rolling %s saving throw with advantage...", saveString) fmt.Printf("x: %d\ty: %d\n", X, Y) - fmt.Printf("Modifier: %d\n", result-planeResult) + fmt.Printf("Modifier: %d\n", result-plainResult) color.Green("%d\n", result) } else if disadvantage { color.Yellow("Rolling %s saving throw with disadvantage...", saveString) fmt.Printf("x: %d\ty: %d\n", X, Y) - fmt.Printf("Modifier: %d\n", result-planeResult) + fmt.Printf("Modifier: %d\n", result-plainResult) color.Red("%d\n", result) } else { color.Yellow("Rolling %s saving throw...", saveString) - fmt.Printf("Without modifier: %d\tModifier: %d\n", planeResult, result-planeResult) + fmt.Printf("Without modifier: %d\tModifier: %d\n", plainResult, result-plainResult) color.Green("%d\n", result) } case len(skillString) > 0: - result, planeResult, err := skillCheck(getSkill(skillString)) + 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-planeResult) + fmt.Printf("Modifier: %d\n", result-plainResult) color.Green("%d\n", result) } 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-planeResult) + fmt.Printf("Modifier: %d\n", result-plainResult) color.Red("%d\n", result) } else { color.Yellow("Rolling %s check...", skillString) - fmt.Printf("Without modifier: %d\tModifier: %d\n", planeResult, result-planeResult) + fmt.Printf("Without modifier: %d\tModifier: %d\n", plainResult, result-plainResult) color.Green("%d\n", result) } case len(statString) > 0: - result, planeResult, err := statCheck(getStat(statString)) + result, plainResult, err := statCheck(getStat(statString)) badCheck(statString, err) if advantage { color.Yellow("Rolling %s check with advantage...", statString) fmt.Printf("x: %d\ty: %d\n", X, Y) - fmt.Printf("Modifier: %d\n", result-planeResult) + fmt.Printf("Modifier: %d\n", result-plainResult) color.Green("%d\n", result) } else if disadvantage { color.Yellow("Rolling %s check with disadvantage...", statString) fmt.Printf("x: %d\ty: %d\n", X, Y) - fmt.Printf("Modifier: %d\n", result-planeResult) + fmt.Printf("Modifier: %d\n", result-plainResult) color.Red("%d\n", result) } else { color.Yellow("Rolling %s check...", statString) - fmt.Printf("Without modifier: %d\tModifier: %d\n", planeResult, result-planeResult) + fmt.Printf("Without modifier: %d\tModifier: %d\n", plainResult, result-plainResult) color.Green("%d\n", result) } @@ -240,12 +240,12 @@ func statCheck(stat Stat) (int, int, error) { func savingThrow(stat Stat) (int, int, error) { die := rollDice() - planeDie := die + plainDie := die if stat.Proficient { die += getProficiency() } - return die + getModifier(stat), planeDie, statErrorCheck() + return die + getModifier(stat), plainDie, statErrorCheck() } func skillCheck(skill Skill) (int, int, error) { @@ -253,7 +253,7 @@ func skillCheck(skill Skill) (int, int, error) { if char.Misc.ReliableTalent && skill.Proficient && die < 10 { die = 10 } - planeDie := die + plainDie := die die += getModifier(getStat(skill.BaseStat)) @@ -265,7 +265,7 @@ func skillCheck(skill Skill) (int, int, error) { case !skill.Proficient && char.Misc.JackOfAllTrades: die += (getProficiency() / 2) } - return die, planeDie, skillErrorCheck() + return die, plainDie, skillErrorCheck() } func printStatList(verbose bool) {