diff options
author | CalMWolfs <94038482+CalMWolfs@users.noreply.github.com> | 2024-05-26 22:07:33 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-26 14:07:33 +0200 |
commit | 05d2284401868ba66a916dc75a9ed891ec1d4dc9 (patch) | |
tree | d0fd31b75865e534d57df84a787c412594740aae /src/main/java/at | |
parent | dcdeca7bca6956c127b202f832be3e76daa19197 (diff) | |
download | skyhanni-05d2284401868ba66a916dc75a9ed891ec1d4dc9.tar.gz skyhanni-05d2284401868ba66a916dc75a9ed891ec1d4dc9.tar.bz2 skyhanni-05d2284401868ba66a916dc75a9ed891ec1d4dc9.zip |
Fix: hoppity stuff (#1860)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
7 files changed, 42 insertions, 13 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java index 33ad237db..91484305e 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/storage/ProfileSpecificStorage.java @@ -93,6 +93,9 @@ public class ProfileSpecificStorage { public int maxTimeTowerUses = 3; @Expose + public boolean hasMuRabbit = false; + + @Expose public long bestUpgradeAvailableAt = 0; @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/HoppityEggLocationsJson.kt b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/HoppityEggLocationsJson.kt index 7e12607d2..e4162b82b 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/HoppityEggLocationsJson.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/HoppityEggLocationsJson.kt @@ -20,4 +20,5 @@ data class HoppityEggLocationsJson( @Expose val shrineIndex: Int, @Expose val coachRabbitIndex: Int, @Expose val maxRabbits: Int, + @Expose val maxPrestige: Int, ) diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt index e0ce6bc6f..a078ea9d2 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/event/hoppity/HoppityCollectionStats.kt @@ -11,6 +11,7 @@ import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.LorenzUtils.round import at.hannibal2.skyhanni.utils.NEUInternalName import at.hannibal2.skyhanni.utils.NEUInternalName.Companion.asInternalName +import at.hannibal2.skyhanni.utils.NumberUtil.addSeparators import at.hannibal2.skyhanni.utils.NumberUtil.formatInt import at.hannibal2.skyhanni.utils.RegexUtils.matchMatcher import at.hannibal2.skyhanni.utils.RegexUtils.matches @@ -115,6 +116,7 @@ object HoppityCollectionStats { val filtered = loggedRabbits.filter { it.value.rarity == rarity } val isTotal = rarity == RabbitCollectionRarity.TOTAL + if (filtered.isEmpty() && !isTotal) continue val title = "${rarity.displayName} Rabbits" val amountFound = filtered.filter { it.value.found }.size @@ -144,7 +146,7 @@ object HoppityCollectionStats { add("§7Duplicate Rabbits: §a$displayDuplicates") add("§7Total Rabbits Found: §a${displayFound + displayDuplicates}") add("") - add("§7Chocolate Per Second: §a$displayChocolatePerSecond") + add("§7Chocolate Per Second: §a${displayChocolatePerSecond.addSeparators()}") add("§7Chocolate Multiplier: §a${displayChocolateMultiplier.round(3)}") } table.add( @@ -191,9 +193,20 @@ object HoppityCollectionStats { ChocolateFactoryAPI.profileStorage?.timeTowerCooldown = 7 } + if (itemName == "§dMu" && found) { + ChocolateFactoryAPI.profileStorage?.hasMuRabbit = true + } + val duplicates = duplicatesFound.coerceAtLeast(0) loggedRabbits[itemName] = RabbitCollectionInfo(rarity, found, duplicates) } + // For getting data for neu pv +// val rarityToRabbit = mutableMapOf<RabbitCollectionRarity, MutableList<String>>() +// loggedRabbits.forEach { (name, info) -> +// val formattedName = name.removeColor().lowercase().replace(" ", "_").replace("-", "_") +// rarityToRabbit.getOrPut(info.rarity) { mutableListOf() }.add("\"$formattedName\"") +// } +// println(rarityToRabbit) return totalAmount } @@ -218,6 +231,7 @@ object HoppityCollectionStats { EPIC("§5Epic", 10, 0.005, "STAINED_GLASS-10".asInternalName()), LEGENDARY("§6Legendary", 0, 0.02, "STAINED_GLASS-1".asInternalName()), MYTHIC("§dMythic", 0, 0.0, "STAINED_GLASS-6".asInternalName()), + DIVINE("§bDivine", 0, 0.025, "STAINED_GLASS-3".asInternalName()), TOTAL("§cTotal", 0, 0.0, "STAINED_GLASS-14".asInternalName()), ; diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt index 0570ad821..fa532dab6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt @@ -52,6 +52,7 @@ object ChocolateFactoryAPI { var shrineIndex = 41 var coachRabbitIndex = 42 var maxRabbits = 395 + private var maxPrestige = 5 var inChocolateFactory = false var chocolateFactoryPaused = false @@ -106,6 +107,7 @@ object ChocolateFactoryAPI { shrineIndex = data.shrineIndex coachRabbitIndex = data.coachRabbitIndex maxRabbits = data.maxRabbits + maxPrestige = data.maxPrestige ChocolateFactoryUpgrade.updateIgnoredSlots() } @@ -145,13 +147,16 @@ object ChocolateFactoryAPI { fun isHoppityEvent() = SkyblockSeason.getCurrentSeason() == SkyblockSeason.SPRING + fun isMaxPrestige() = currentPrestige >= maxPrestige + fun timeUntilNeed(goal: Long): Duration { var needed = goal val profileStorage = profileStorage ?: return Duration.ZERO val baseMultiplier = profileStorage.rawChocolateMultiplier val rawChocolatePerSecond = profileStorage.rawChocPerSecond - val timeTowerMultiplier = baseMultiplier + profileStorage.timeTowerLevel * 0.1 + var timeTowerMultiplier = baseMultiplier + profileStorage.timeTowerLevel * 0.1 + if (profileStorage.hasMuRabbit) timeTowerMultiplier += 0.7 if (rawChocolatePerSecond == 0) return Duration.INFINITE diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt index 18563396c..3204efbf9 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryDataLoader.kt @@ -50,9 +50,14 @@ object ChocolateFactoryDataLoader { "chocolate.multiplier", "§7Total Multiplier: §6(?<amount>[\\d.]+)x" ) + + /** + * REGEX-TEST: §7You are §8#§b114 + * REGEX-TEST: §7§7You are §8#§b5,139 §7in all-time Chocolate. + */ private val leaderboardPlacePattern by ChocolateFactoryAPI.patternGroup.pattern( "leaderboard.place", - "§7You are §8#§b(?<position>[\\d,]+)" + "(?:§.)+You are §8#§b(?<position>[\\d,]+)(?: §7in all-time Chocolate\\.)?" ) private val leaderboardPercentilePattern by ChocolateFactoryAPI.patternGroup.pattern( "leaderboard.percentile", diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt index 04bf1b595..51b2fa2b3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt @@ -166,9 +166,9 @@ object ChocolateFactoryStats { TIME_TOWER_FULL( "§eTime Tower Full Charges: §b5h 13m 59s\n§bHappens at: Monday, May 13 5:32 AM", { ChocolateFactoryTimeTowerManager.currentCharges() != -1 || ChocolateFactoryTimeTowerManager.timeTowerFull() }), - TIME_TO_PRESTIGE("§eTime To Prestige: §b1d 13h 59m 4s", { ChocolateFactoryAPI.currentPrestige != 5 }), + TIME_TO_PRESTIGE("§eTime To Prestige: §b1d 13h 59m 4s", { !ChocolateFactoryAPI.isMaxPrestige() }), RAW_PER_SECOND("§eRaw Per Second: §62,136"), - CHOCOLATE_UNTIL_PRESTIGE("§eChocolate To Prestige: §65,851", { ChocolateFactoryAPI.currentPrestige != 5 }), + CHOCOLATE_UNTIL_PRESTIGE("§eChocolate To Prestige: §65,851", { !ChocolateFactoryAPI.isMaxPrestige() }), TIME_TO_BEST_UPGRADE( "§eBest Upgrade: §b 59m 4s", { ChocolateFactoryAPI.profileStorage?.bestUpgradeCost != 0L }), diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgrade.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgrade.kt index 057dd4ae7..850c595d6 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgrade.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryUpgrade.kt @@ -41,14 +41,15 @@ data class ChocolateFactoryUpgrade( isMaxed -> "§a✔" isRabbit -> when (level) { - in (0..9) -> "$level" - in (10..74) -> "§a$level" - in (75..124) -> "§9$level" - in (125..174) -> "§5$level" - in (175..199) -> "§6$level" - 200 -> "§d$level" - else -> "§c$level" - } + in (0..9) -> "" + in (10..74) -> "§a" + in (75..124) -> "§9" + in (125..174) -> "§5" + in (175..199) -> "§6" + in (200..219) -> "§d" + in (220..225) -> "§b" + else -> "§c" + } + level else -> "$level" } |