I can English... I swear

This commit is contained in:
Nox Sluijtman 2022-09-22 17:24:48 +02:00
parent 2037f51b26
commit 85d0a12b45

32
main.go
View file

@ -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) {