You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.0 KiB
Go
46 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"math"
|
|
)
|
|
|
|
|
|
func main() {
|
|
var (
|
|
gearAtk = flag.Int("gearAtk", 10, "gear attack rate")
|
|
maxLvl = flag.Int("maxLvl", 50, "max hero level")
|
|
startAtk = flag.Int("startAtk", 10, "max hero level")
|
|
)
|
|
flag.Parse()
|
|
|
|
effectiveStrength := 1
|
|
baseAtk := *startAtk
|
|
|
|
for i := 1; i <= *maxLvl; i++ {
|
|
|
|
if i%2 == 0 {
|
|
effectiveStrength++
|
|
}
|
|
if i%3 == 0 {
|
|
baseAtk++
|
|
}
|
|
//multb := 1 - float64(effectiveStrength*(1 - i/(i+1)))/(float64(effectiveStrength+100))
|
|
|
|
//mult1 := 1 + (1 - 0.15*math.Pow(float64(effectiveStrength), 0.1))
|
|
mult2 := 1 + math.Exp(-0.05*float64(effectiveStrength-1))
|
|
mult1 := 1.1 - 0.002*math.Log(float64(effectiveStrength))
|
|
effectiveAtk1 := int(math.Round(float64(baseAtk + *gearAtk) * mult1))
|
|
effectiveAtk2 := int(math.Round(float64(baseAtk + *gearAtk) * mult2))
|
|
|
|
fmt.Println(fmt.Sprintf("Atk1 %d Atk2 %d base %d gear %d Lvl %d Str %d Mult %.3f, %.3f", effectiveAtk1, effectiveAtk2, baseAtk, *gearAtk, i, effectiveStrength, mult1, mult2))
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|