mirror of
https://gitlab.com/EternalWanderer/sheet-parser.git
synced 2024-11-29 05:23:49 +01:00
I can English... I swear
This commit is contained in:
parent
2037f51b26
commit
85d0a12b45
32
main.go
32
main.go
|
@ -108,59 +108,59 @@ func main() {
|
||||||
fmt.Println("You can't roll with both advantage and disadvantage")
|
fmt.Println("You can't roll with both advantage and disadvantage")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
case len(saveString) > 0:
|
case len(saveString) > 0:
|
||||||
result, planeResult, err := savingThrow(getStat(saveString))
|
result, plainResult, err := savingThrow(getStat(saveString))
|
||||||
badCheck(saveString, err)
|
badCheck(saveString, err)
|
||||||
if advantage {
|
if advantage {
|
||||||
color.Yellow("Rolling %s saving throw with advantage...", saveString)
|
color.Yellow("Rolling %s saving throw with advantage...", saveString)
|
||||||
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
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)
|
color.Green("%d\n", result)
|
||||||
} else if disadvantage {
|
} else if disadvantage {
|
||||||
color.Yellow("Rolling %s saving throw with disadvantage...", saveString)
|
color.Yellow("Rolling %s saving throw with disadvantage...", saveString)
|
||||||
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
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)
|
color.Red("%d\n", result)
|
||||||
} else {
|
} else {
|
||||||
color.Yellow("Rolling %s saving throw...", saveString)
|
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)
|
color.Green("%d\n", result)
|
||||||
}
|
}
|
||||||
|
|
||||||
case len(skillString) > 0:
|
case len(skillString) > 0:
|
||||||
result, planeResult, err := skillCheck(getSkill(skillString))
|
result, plainResult, err := skillCheck(getSkill(skillString))
|
||||||
badCheck(skillString, err)
|
badCheck(skillString, err)
|
||||||
if advantage {
|
if advantage {
|
||||||
color.Yellow("Rolling %s check with advantage...", skillString)
|
color.Yellow("Rolling %s check with advantage...", skillString)
|
||||||
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
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)
|
color.Green("%d\n", result)
|
||||||
} else if disadvantage {
|
} else if disadvantage {
|
||||||
color.Yellow("Rolling %s check with disadvantage...", skillString)
|
color.Yellow("Rolling %s check with disadvantage...", skillString)
|
||||||
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
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)
|
color.Red("%d\n", result)
|
||||||
} else {
|
} else {
|
||||||
color.Yellow("Rolling %s check...", skillString)
|
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)
|
color.Green("%d\n", result)
|
||||||
}
|
}
|
||||||
|
|
||||||
case len(statString) > 0:
|
case len(statString) > 0:
|
||||||
result, planeResult, err := statCheck(getStat(statString))
|
result, plainResult, err := statCheck(getStat(statString))
|
||||||
badCheck(statString, err)
|
badCheck(statString, err)
|
||||||
if advantage {
|
if advantage {
|
||||||
color.Yellow("Rolling %s check with advantage...", statString)
|
color.Yellow("Rolling %s check with advantage...", statString)
|
||||||
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
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)
|
color.Green("%d\n", result)
|
||||||
} else if disadvantage {
|
} else if disadvantage {
|
||||||
color.Yellow("Rolling %s check with disadvantage...", statString)
|
color.Yellow("Rolling %s check with disadvantage...", statString)
|
||||||
fmt.Printf("x: %d\ty: %d\n", X, Y)
|
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)
|
color.Red("%d\n", result)
|
||||||
} else {
|
} else {
|
||||||
color.Yellow("Rolling %s check...", statString)
|
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)
|
color.Green("%d\n", result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -240,12 +240,12 @@ func statCheck(stat Stat) (int, int, error) {
|
||||||
|
|
||||||
func savingThrow(stat Stat) (int, int, error) {
|
func savingThrow(stat Stat) (int, int, error) {
|
||||||
die := rollDice()
|
die := rollDice()
|
||||||
planeDie := die
|
plainDie := die
|
||||||
|
|
||||||
if stat.Proficient {
|
if stat.Proficient {
|
||||||
die += getProficiency()
|
die += getProficiency()
|
||||||
}
|
}
|
||||||
return die + getModifier(stat), planeDie, statErrorCheck()
|
return die + getModifier(stat), plainDie, statErrorCheck()
|
||||||
}
|
}
|
||||||
|
|
||||||
func skillCheck(skill Skill) (int, int, error) {
|
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 {
|
if char.Misc.ReliableTalent && skill.Proficient && die < 10 {
|
||||||
die = 10
|
die = 10
|
||||||
}
|
}
|
||||||
planeDie := die
|
plainDie := die
|
||||||
|
|
||||||
die += getModifier(getStat(skill.BaseStat))
|
die += getModifier(getStat(skill.BaseStat))
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ func skillCheck(skill Skill) (int, int, error) {
|
||||||
case !skill.Proficient && char.Misc.JackOfAllTrades:
|
case !skill.Proficient && char.Misc.JackOfAllTrades:
|
||||||
die += (getProficiency() / 2)
|
die += (getProficiency() / 2)
|
||||||
}
|
}
|
||||||
return die, planeDie, skillErrorCheck()
|
return die, plainDie, skillErrorCheck()
|
||||||
}
|
}
|
||||||
|
|
||||||
func printStatList(verbose bool) {
|
func printStatList(verbose bool) {
|
||||||
|
|
Loading…
Reference in a new issue