diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 19:10:21 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 19:10:21 +0200 |
| commit | 84bf4caed210b442f75e9e55d4c69b6ca9c6a5c9 (patch) | |
| tree | 0e71708613781f2c8a11d8dbc61025c3fd11a923 | |
| parent | 0a6ecf6af7dc8df0a2255ddb7c022cfad6452493 (diff) | |
feat(xp): add +1 in lose function xp part
| -rw-r--r-- | README.md | 2 | ||||
| -rw-r--r-- | xp/functions.go | 2 |
2 files changed, 2 insertions, 2 deletions
@@ -16,7 +16,7 @@ message (number of different rune) - $xp-vocal(x)=0.01 x^{1.3}+1$ where $x$ is the time spent in vocal (in second) - $level(x)=0.2 \sqrt{x}$ where $x$ is the xp - $level^{-1}(x)=(5x)^2$ where $x$ is the level -- $lose(x,y)= x^2\cdot 10^{-2+\ln(x/85)}\cdot\lfloor y/500 \rfloor$ where $x$ is the inactivity time (hour) and $y$ is the xp +- $lose(x,y)= x^2\cdot 10^{-2+\ln(x/85)}\cdot\lfloor y/500 +1 \rfloor$ where $x$ is the inactivity time (hour) and $y$ is the xp ## Technologies 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), )) } |
