diff options
| author | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 18:47:52 +0200 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus.morhtuuzh@proton.me> | 2024-04-15 18:47:52 +0200 |
| commit | 2aaeb2115b25952b71113a683b466c00cb92e690 (patch) | |
| tree | 6d95b74f7d7e7efcccba5b46200d4c3e161263f3 /xp/level.go | |
| parent | c1e4653a5c7ae34dd23d442f67a171eff466aad3 (diff) | |
feat(xp): basic reducer
Diffstat (limited to 'xp/level.go')
| -rw-r--r-- | xp/level.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xp/level.go b/xp/level.go index 671bf2e..574a127 100644 --- a/xp/level.go +++ b/xp/level.go @@ -42,3 +42,10 @@ func onNewLevel(s *discordgo.Session, m *discordgo.Member, level uint) { } } } + +func onLastEventUpdate(c *Copaing) { + h := c.HourSinceLastEvent() + c.XP -= Lose(h, c.XP) + c.Save() + c.SetLastEvent() +} |
