Skip to content

Commit

Permalink
Fix daily join stack
Browse files Browse the repository at this point in the history
  • Loading branch information
Kieaer committed Apr 14, 2024
1 parent 603af54 commit b6092c7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/essentials/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1938,7 +1938,7 @@ object Event {

val score = if (winner == p.team()) {
if (state.rules.attackMode) {
time + (target.currentBuildAttackCount + erekirAttack) - (target.currentBuildDeconstructedCount + target.currentBuildDestroyedCount)
time + (target.currentBuildAttackCount + erekirAttack)
} else if (state.rules.pvp) {
time + erekirPvP + 5000
} else {
Expand Down
11 changes: 6 additions & 5 deletions src/main/kotlin/essentials/Trigger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import java.net.*
import java.nio.ByteBuffer
import java.time.LocalDate
import java.time.LocalDateTime
import java.time.ZoneOffset
import java.util.*
import java.util.concurrent.TimeUnit
import java.util.function.Consumer
Expand All @@ -44,14 +45,14 @@ object Trigger {
}

if (data.lastLoginDate != null) {
if ((LocalDate.now().toEpochDay() - data.lastLoginDate!!.toEpochDay()) == 1L) {
if ((LocalDate.now(ZoneOffset.UTC).toEpochDay() - data.lastLoginDate!!.toEpochDay()) == 1L) {
data.joinStacks++
when {
data.joinStacks % 3 == 0 -> data.expMultiplier = 1.2
data.joinStacks % 7 == 0 -> data.expMultiplier = 1.5
data.joinStacks % 30 == 0 -> data.expMultiplier = 2.5
data.joinStacks <= 3 -> data.expMultiplier = 1.5
data.joinStacks <= 7 -> data.expMultiplier = 2.5
data.joinStacks <= 15 -> data.expMultiplier = 5.0
}
} else {
} else if ((LocalDate.now(ZoneOffset.UTC).toEpochDay() - data.lastLoginDate!!.toEpochDay()) >= 2L) {
data.joinStacks = 0
}
}
Expand Down

0 comments on commit b6092c7

Please sign in to comment.