feat(debug): adapt xp functions while debug is enabled
This commit is contained in:
parent
84bf4caed2
commit
9f9c27f422
2 changed files with 13 additions and 1 deletions
|
@ -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),
|
||||
))
|
||||
|
|
|
@ -9,6 +9,7 @@ import (
|
|||
"github.com/bwmarrin/discordgo"
|
||||
"github.com/redis/go-redis/v9"
|
||||
"gorm.io/gorm"
|
||||
"math"
|
||||
"strconv"
|
||||
"time"
|
||||
)
|
||||
|
@ -98,6 +99,9 @@ func (c *Copaing) HourSinceLastEvent() uint {
|
|||
)
|
||||
return 0
|
||||
}
|
||||
if gokord.Debug {
|
||||
return uint(math.Floor(float64(t-int64(last)) / 60)) // not hours of unix, is minutes of unix
|
||||
}
|
||||
return utils.HoursOfUnix(t - int64(last))
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue