Compare commits
No commits in common. 'f593691e45bbfb44f933dcb0bca6dbe246937f6c' and '9a801d95572d449ca99245091c6e1d86a82e756a' have entirely different histories.
f593691e45
...
9a801d9557
@ -1,45 +0,0 @@
|
|||||||
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))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package constants
|
|
||||||
|
|
||||||
const (
|
|
||||||
OfflineAutoPotionChance = 0.10
|
|
||||||
OfflineAutoPotionHPThresh = 0.60
|
|
||||||
|
|
||||||
// CombatSimMaxStepsDefault is the iteration cap when CombatSimOptions.MaxSteps <= 0 (offline, tests).
|
|
||||||
CombatSimMaxStepsDefault = 200_000
|
|
||||||
// CombatSimMaxStepsLong is used by balance CLIs and admin combat sim so long fights (DoT/regen) are not cut off early.
|
|
||||||
CombatSimMaxStepsLong = 3_000_000
|
|
||||||
)
|
|
||||||
@ -1,35 +0,0 @@
|
|||||||
package hero
|
|
||||||
|
|
||||||
import (
|
|
||||||
"math/rand"
|
|
||||||
|
|
||||||
"github.com/denisovdennis/autohero/internal/constants"
|
|
||||||
"github.com/denisovdennis/autohero/internal/model"
|
|
||||||
"github.com/denisovdennis/autohero/internal/tuning"
|
|
||||||
)
|
|
||||||
|
|
||||||
func UsePotionOnHero(hero *model.Hero, force bool) int {
|
|
||||||
if force != true {
|
|
||||||
if hero == nil || hero.Potions <= 0 || hero.HP <= 0 {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
hpThresh := int(float64(hero.MaxHP) * constants.OfflineAutoPotionHPThresh)
|
|
||||||
if hero.HP >= hpThresh {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
if rand.Float64() >= (1.0 - (1.0 - float64(hero.HP / hpThresh))) / 1.2 + constants.OfflineAutoPotionChance {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
hero.Potions--
|
|
||||||
healAmount := int(float64(hero.MaxHP) * tuning.Get().PotionHealPercent)
|
|
||||||
if healAmount < 1 {
|
|
||||||
healAmount = 1
|
|
||||||
}
|
|
||||||
hero.HP += healAmount
|
|
||||||
if hero.HP > hero.MaxHP {
|
|
||||||
hero.HP = hero.MaxHP
|
|
||||||
}
|
|
||||||
return healAmount;
|
|
||||||
}
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
package tuning
|
|
||||||
|
|
||||||
import "math"
|
|
||||||
|
|
||||||
func GetMultiplierByStrength(str int) float64 {
|
|
||||||
return 1.1 - 0.002 * math.Log(float64(str))
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue