Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
fix cooldown time with skymall perk (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
btwonion authored Aug 25, 2024
1 parent 566b9a4 commit 41f541c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion beta-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- add event forecast widget for dwarves, crystals and mineshafts

## Bug Fixes
none
- fix mining cooldown time with SkyMall perk on reduced cooldown

## Technical changes
- make constructor parameters of TableHudWidget to variables to allow resizable table widgets
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ import dev.nyon.skylper.extensions.regex
import dev.nyon.skylper.mcScope
import dev.nyon.skylper.minecraft
import dev.nyon.skylper.skyblock.data.api.HeartOfTheMountainApi
import dev.nyon.skylper.skyblock.data.api.SkyMallApi
import dev.nyon.skylper.skyblock.data.online.Cooldowns
import dev.nyon.skylper.skyblock.data.online.IslandGroups
import dev.nyon.skylper.skyblock.data.online.ToolGroups
import dev.nyon.skylper.skyblock.data.session.PlayerSessionData
import dev.nyon.skylper.skyblock.models.mining.SkyMallPerk
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.datetime.Clock
Expand Down Expand Up @@ -95,7 +97,9 @@ object MiningCooldown : Cooldown {
val abilityLevel = if (HeartOfTheMountainApi.data.peakOfTheMountainLevel == 0) 1 else 2
val cooldowns =
Cooldowns.cooldowns.mining[HeartOfTheMountainApi.data.pickaxeAbility ?: return null] ?: return null
return cooldowns[abilityLevel].seconds
val normalTime = cooldowns[abilityLevel].seconds
val skyMallPerkEnabled = SkyMallApi.currentPerk == SkyMallPerk.REDUCED_COOLDOWN
return if (skyMallPerkEnabled) normalTime * 0.8 else normalTime
}
}

Expand Down

0 comments on commit 41f541c

Please sign in to comment.