diff options
| author | William Hergès <anhgelus.morhtuuzh@proton.me> | 2024-04-16 15:46:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-16 15:46:52 +0200 |
| commit | 6b595b8b11e9ac05302ee15ab7734e49b89594e5 (patch) | |
| tree | 1bcea973dbec09ca70f0c20eaa41c29ded00d62f /xp/functions.go | |
| parent | ff711c918d196e60c60ad598f70d4efb89795a95 (diff) | |
| parent | b4e72dcae10265bbc1595f2e520b1407cf8e250d (diff) | |
Merge pull request #1 from anhgelus/feat/xp-reducer
[Feat] Add XP reducer
Diffstat (limited to 'xp/functions.go')
| -rw-r--r-- | xp/functions.go | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/xp/functions.go b/xp/functions.go index 196c3d3..7ab57f2 100644 --- a/xp/functions.go +++ b/xp/functions.go @@ -1,6 +1,9 @@ package xp -import "math" +import ( + "github.com/anhgelus/gokord" + "math" +) func XPMessage(length uint, diversity uint) uint { return uint(math.Floor( @@ -27,7 +30,12 @@ func XPForLevel(level uint) uint { } func Lose(time uint, xp uint) uint { + if gokord.Debug { + return uint(math.Floor( + math.Pow(float64(time), 3) * math.Pow(10, -2+math.Log(float64(time))) * math.Floor(float64(xp/500)+1), + )) // a little bit faster to lose xp + } return uint(math.Floor( - math.Pow(float64(time), 2) * math.Pow(10, -2+math.Log(float64(time/85))) * math.Floor(float64(xp/500)), + math.Pow(float64(time), 2) * math.Pow(10, -2+math.Log(float64(time/85))) * math.Floor(float64(xp/500)+1), )) } |
