From 84bf4caed210b442f75e9e55d4c69b6ca9c6a5c9 Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 15 Apr 2024 19:10:21 +0200 Subject: feat(xp): add +1 in lose function xp part --- xp/functions.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xp/functions.go') diff --git a/xp/functions.go b/xp/functions.go index 196c3d3..63c7fb7 100644 --- a/xp/functions.go +++ b/xp/functions.go @@ -28,6 +28,6 @@ func XPForLevel(level uint) uint { func Lose(time uint, xp uint) uint { 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), )) } -- cgit v1.2.3 From 9f9c27f42298d51a356743724095a6dd79196dfe Mon Sep 17 00:00:00 2001 From: Anhgelus Morhtuuzh Date: Mon, 15 Apr 2024 19:15:37 +0200 Subject: feat(debug): adapt xp functions while debug is enabled --- xp/functions.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'xp/functions.go') diff --git a/xp/functions.go b/xp/functions.go index 63c7fb7..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,6 +30,11 @@ 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)+1), )) -- cgit v1.2.3