aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at
diff options
context:
space:
mode:
authorPhoebe <77941535+catgirlseraid@users.noreply.github.com>2024-07-28 21:43:46 +1200
committerGitHub <noreply@github.com>2024-07-28 11:43:46 +0200
commitb75c249c2b5f6a319c076b6dfbb4ae9003814fe1 (patch)
tree3035769ec849978ee682a4a511cf754841df6a6b /src/main/java/at
parent1358d63788305f6d2692de4528c533a53e05cc49 (diff)
downloadskyhanni-b75c249c2b5f6a319c076b6dfbb4ae9003814fe1.tar.gz
skyhanni-b75c249c2b5f6a319c076b6dfbb4ae9003814fe1.tar.bz2
skyhanni-b75c249c2b5f6a319c076b6dfbb4ae9003814fe1.zip
Chocolate Factory Milestones instead of maxed prestige not showing (#2226)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/jsonobjects/repo/HoppityEggLocationsJson.kt1
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryAPI.kt2
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/inventory/chocolatefactory/ChocolateFactoryStats.kt61
3 files changed, 42 insertions, 22 deletions
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 d83d66249..5e601ed32 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
@@ -21,6 +21,7 @@ data class HoppityEggLocationsJson(
@Expose val coachRabbitIndex: Int,
@Expose val maxRabbits: Int,
@Expose val maxPrestige: Int,
+ @Expose val maxMilestoneChocolate: Long,
@Expose val apiEggLocations: Map<IslandType, Map<String, LorenzVec>>,
@Expose val specialRabbits: List<String>,
)
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 f1cb4be05..36e8a206a 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
@@ -56,6 +56,7 @@ object ChocolateFactoryAPI {
var shrineIndex = 41
var coachRabbitIndex = 42
var maxRabbits = 395
+ var maxMilestoneChocolate = 700_000_000_000L
private var maxPrestige = 5
var inChocolateFactory = false
@@ -117,6 +118,7 @@ object ChocolateFactoryAPI {
coachRabbitIndex = data.coachRabbitIndex
maxRabbits = data.maxRabbits
maxPrestige = data.maxPrestige
+ maxMilestoneChocolate = data.maxMilestoneChocolate
specialRabbitTextures = data.specialRabbits
ChocolateFactoryUpgrade.updateIgnoredSlots()
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 4491a1423..cc193f2ef 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
@@ -73,7 +73,7 @@ object ChocolateFactoryStats {
val upgradeAvailableAt = ChocolateAmount.CURRENT.formattedTimeUntilGoal(profileStorage.bestUpgradeCost)
- val map = buildMap {
+ val map = buildMap<ChocolateFactoryStat, String> {
put(ChocolateFactoryStat.HEADER, "§6§lChocolate Factory ${ChocolateFactoryAPI.currentPrestige.toRoman()}")
put(ChocolateFactoryStat.CURRENT, "§eCurrent Chocolate: §6${ChocolateAmount.CURRENT.formatted}")
@@ -104,32 +104,47 @@ object ChocolateFactoryStats {
} else {
"§eFull Tower Charges: §b${timeTowerFull.timeUntil().format()}\n" +
"§eHappens at: §b${timeTowerFull.formattedDate("EEEE, MMM d h:mm a")}"
- }
-
+ },
)
put(ChocolateFactoryStat.TIME_TO_PRESTIGE, "§eTime To Prestige: $prestigeEstimate")
put(
ChocolateFactoryStat.RAW_PER_SECOND,
- "§eRaw Per Second: §6${profileStorage.rawChocPerSecond.addSeparators()}"
- )
- put(
- ChocolateFactoryStat.CHOCOLATE_UNTIL_PRESTIGE,
- "§eChocolate To Prestige: $chocolateUntilPrestige"
+ "§eRaw Per Second: §6${profileStorage.rawChocPerSecond.addSeparators()}",
)
+
+ if (ChocolateFactoryAPI.isMaxPrestige()) {
+ val chocolateUntilMaxMilestone = ChocolateFactoryAPI.maxMilestoneChocolate
+ val amountUntilMaxMilestone = chocolateUntilMaxMilestone - ChocolateAmount.ALL_TIME.chocolate()
+ val maxMilestoneEstimate = ChocolateAmount.ALL_TIME.formattedTimeUntilGoal(chocolateUntilMaxMilestone)
+
+ if (amountUntilMaxMilestone >= 0) {
+ put(ChocolateFactoryStat.TIME_TO_PRESTIGE, "§eTime To Max Milestone: $maxMilestoneEstimate")
+ put(
+ ChocolateFactoryStat.CHOCOLATE_UNTIL_PRESTIGE,
+ "§eChocolate To Max Milestone: §6${amountUntilMaxMilestone.addSeparators()}",
+ )
+ }
+ } else {
+ put(ChocolateFactoryStat.TIME_TO_PRESTIGE, "§eTime To Prestige: $prestigeEstimate")
+ put(ChocolateFactoryStat.CHOCOLATE_UNTIL_PRESTIGE, "§eChocolate To Prestige: §6$chocolateUntilPrestige")
+ }
+
put(ChocolateFactoryStat.TIME_TO_BEST_UPGRADE, "§eBest Upgrade: $upgradeAvailableAt")
}
val text = config.statsDisplayList.filter { it.shouldDisplay() }.flatMap { map[it]?.split("\n") ?: listOf() }
- display = listOf(Renderable.clickAndHover(
- Renderable.verticalContainer(text.map(Renderable::string)),
- tips = listOf("§bCopy to Clipboard!"),
- onClick = {
- val list = text.toMutableList()
- list.add(0, "${LorenzUtils.getPlayerName()}'s Chocolate Factory Stats")
-
- ClipboardUtils.copyToClipboard(list.joinToString("\n") { it.removeColor() })
- }
- ))
+ display = listOf(
+ Renderable.clickAndHover(
+ Renderable.verticalContainer(text.map(Renderable::string)),
+ tips = listOf("§bCopy to Clipboard!"),
+ onClick = {
+ val list = text.toMutableList()
+ list.add(0, "${LorenzUtils.getPlayerName()}'s Chocolate Factory Stats")
+
+ ClipboardUtils.copyToClipboard(list.joinToString("\n") { it.removeColor() })
+ },
+ ),
+ )
}
@SubscribeEvent
@@ -167,13 +182,15 @@ object ChocolateFactoryStats {
TIME_TOWER("§eTime Tower: §62/3 Charges", { ChocolateFactoryTimeTowerManager.currentCharges() != -1 }),
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.isMaxPrestige() }),
+ { ChocolateFactoryTimeTowerManager.currentCharges() != -1 || ChocolateFactoryTimeTowerManager.timeTowerFull() },
+ ),
+ TIME_TO_PRESTIGE("§eTime To Prestige: §b1d 13h 59m 4s"),
RAW_PER_SECOND("§eRaw Per Second: §62,136"),
- CHOCOLATE_UNTIL_PRESTIGE("§eChocolate To Prestige: §65,851", { !ChocolateFactoryAPI.isMaxPrestige() }),
+ CHOCOLATE_UNTIL_PRESTIGE("§eChocolate To Prestige: §65,851"),
TIME_TO_BEST_UPGRADE(
"§eBest Upgrade: §b 59m 4s",
- { ChocolateFactoryAPI.profileStorage?.bestUpgradeCost != 0L }),
+ { ChocolateFactoryAPI.profileStorage?.bestUpgradeCost != 0L },
+ ),
;
override fun toString(): String {