aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
authorDavid Cole <40234707+DavidArthurCole@users.noreply.github.com>2024-06-23 07:45:28 -0400
committerGitHub <noreply@github.com>2024-06-23 13:45:28 +0200
commit7ff28af498fdba6e5a2a1150c3e2620c613c2c48 (patch)
tree84082f6f1233d119f5e8b06b3f52037c120ef8db /src/main/java/at/hannibal2/skyhanni/features
parent8b51cb356a7e03f28a2cf41442d0c7e02f760607 (diff)
downloadskyhanni-7ff28af498fdba6e5a2a1150c3e2620c613c2c48.tar.gz
skyhanni-7ff28af498fdba6e5a2a1150c3e2620c613c2c48.tar.bz2
skyhanni-7ff28af498fdba6e5a2a1150c3e2620c613c2c48.zip
Feature & Fix: Powder Tracker Hard Stone & Goblin Eggs (#2138)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
index a936f9636..f302b669b 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/powdertracker/PowderTracker.kt
@@ -57,6 +57,14 @@ object PowderTracker {
"§e§lPASSIVE EVENT §b§l2X POWDER §e§lRUNNING FOR §a§l(?<time>.*)§r"
)
+ /**
+ * REGEX-TEST: §b§lCOMPACT! §r§fYou found an §r§aEnchanted Hard Stone§r§f!
+ */
+ private val compactedPattern by patternGroup.pattern(
+ "compacted",
+ "§b§lCOMPACT! §r§fYou found an §r§aEnchanted Hard Stone§r§f!",
+ )
+
private var lastChestPicked = SimpleTimeMark.farPast()
private var isGrinding = false
private val gemstoneInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
@@ -64,6 +72,7 @@ object PowderTracker {
private val diamondEssenceInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
private val goldEssenceInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
private val chestInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
+ private val hardStoneInfo = ResourceInfo(0L, 0L, 0, 0.0, mutableListOf())
private var doublePowder = false
private var powderTimer = ""
private val gemstones = listOf(
@@ -87,6 +96,7 @@ object PowderTracker {
calculateResourceHour(diamondEssenceInfo)
calculateResourceHour(goldEssenceInfo)
calculateResourceHour(chestInfo)
+ calculateResourceHour(hardStoneInfo)
doublePowder = powderBossBarPattern.matcher(BossbarData.getBossbar()).find()
powderBossBarPattern.matchMatcher(BossbarData.getBossbar()) {
@@ -109,12 +119,16 @@ object PowderTracker {
override fun reset() {
rewards.clear()
totalChestPicked = 0
+ totalHardStoneCompacted = 0
}
@Expose
var totalChestPicked = 0
@Expose
+ var totalHardStoneCompacted = 0
+
+ @Expose
var rewards: MutableMap<PowderChestReward, Long> = mutableMapOf()
}
@@ -153,6 +167,12 @@ object PowderTracker {
powderStartedPattern.matchMatcher(msg) { doublePowder = true }
powderEndedPattern.matchMatcher(msg) { doublePowder = false }
+ compactedPattern.matchMatcher(msg) {
+ tracker.modify {
+ it.totalHardStoneCompacted += 1
+ }
+ }
+
for (reward in PowderChestReward.entries) {
reward.chatPattern.matchMatcher(msg) {
tracker.modify {
@@ -192,6 +212,9 @@ object PowderTracker {
chestInfo.perHour = 0.0
chestInfo.stoppedChecks = 0
chestInfo.perMin.clear()
+ hardStoneInfo.perHour = 0.0
+ hardStoneInfo.stoppedChecks = 0
+ hardStoneInfo.perMin.clear()
doublePowder = false
tracker.update()
}
@@ -240,6 +263,7 @@ object PowderTracker {
calculate(data, diamondEssenceInfo, PowderChestReward.DIAMOND_ESSENCE)
calculate(data, goldEssenceInfo, PowderChestReward.GOLD_ESSENCE)
calculateChest(data)
+ calculateHardStone(data)
val chestPerHour = format(chestInfo.perHour)
addAsSingletonList("§d${data.totalChestPicked.addSeparators()} Total Chests Picked §7($chestPerHour/h)")
@@ -252,11 +276,10 @@ object PowderTracker {
addAsSingletonList("")
addPerHour(rewards, entries[46], diamondEssenceInfo)
addPerHour(rewards, entries[47], goldEssenceInfo)
-
-
addAsSingletonList("")
-
-
+ val hardStonePerHour = format(hardStoneInfo.perHour)
+ addAsSingletonList("§b${data.totalHardStoneCompacted.addSeparators()} §fHard Stone §bCompacted §7($hardStonePerHour/h)")
+ addAsSingletonList("")
for ((gem, color) in gemstones) {
var totalGemstone = 0L
@@ -289,7 +312,7 @@ object PowderTracker {
val redEgg = rewards.getOrDefault(PowderChestReward.RED_GOBLIN_EGG, 0)
val yellowEgg = rewards.getOrDefault(PowderChestReward.YELLOW_GOBLIN_EGG, 0)
val blueEgg = rewards.getOrDefault(PowderChestReward.BLUE_GOBLIN_EGG, 0)
- addAsSingletonList("§9$goblinEgg§7-§a$greenEgg§7-§c$redEgg§f-§e$yellowEgg§f-§3$blueEgg §fGoblin Egg")
+ addAsSingletonList("§3$blueEgg§7-§c$redEgg§7-§e$yellowEgg§f-§a$greenEgg§f-§9$goblinEgg §fGoblin Egg")
for (reward in entries.subList(37, 46)) {
val count = rewards.getOrDefault(reward, 0).addSeparators()
@@ -341,6 +364,10 @@ object PowderTracker {
chestInfo.estimated = data.totalChestPicked.toLong()
}
+ private fun calculateHardStone(data: Data) {
+ hardStoneInfo.estimated = data.totalHardStoneCompacted.toLong()
+ }
+
private fun convert(roughCount: Long): Gem {
val flawlessRatio = 512000
val fineRatio = 6400