diff options
28 files changed, 1071 insertions, 1108 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/Storage.java b/src/main/java/at/hannibal2/skyhanni/config/Storage.java index 68726aa34..f853d4a8d 100644 --- a/src/main/java/at/hannibal2/skyhanni/config/Storage.java +++ b/src/main/java/at/hannibal2/skyhanni/config/Storage.java @@ -127,6 +127,9 @@ public class Storage { public String composterCurrentFuelItem = ""; @Expose + public int uniqueVisitors = 0; + + @Expose public VisitorDrops visitorDrops = new VisitorDrops(); public static class VisitorDrops { @@ -172,6 +175,9 @@ public class Storage { public static class Fortune { @Expose + public Map<FarmingItems, Boolean> outdatedItems = new HashMap<>(); + + @Expose public int anitaUpgrade = -1; @Expose diff --git a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt index a21b9e133..643ef46ff 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt @@ -85,18 +85,15 @@ class ChatManager { val last = lines.last() if (last.startsWith("§f§lCOMMON")) return true - if (last.startsWith("§f§lCOMMON")) return true if (last.startsWith("§a§lUNCOMMON")) return true if (last.startsWith("§9§lRARE")) return true if (last.startsWith("§5§lEPIC")) return true if (last.startsWith("§6§lLEGENDARY")) return true + if (last.startsWith("§d§lMYTHIC")) return true if (last.startsWith("§c§lSPECIAL")) return true // TODO confirm this format is correct if (last.startsWith("§c§lVERY SPECIAL")) return true - - if (last.startsWith("§d§lMYTHIC")) return true - return false } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt index 441453ded..b895c6511 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/CropAccessory.kt @@ -1,14 +1,14 @@ package at.hannibal2.skyhanni.features.garden -enum class CropAccessory(val internalName: String, private val affectedCrops: Set<CropType>, private val fortune: Double) { - NONE("NONE", emptySet(), 0.0), - CROPIE("CROPIE_TALISMAN", setOf(CropType.WHEAT, CropType.POTATO, CropType.CARROT), 10.0), +enum class CropAccessory(val internalName: String, private val affectedCrops: Set<CropType>, private val fortune: Double, val upgradeCost: Pair<String, Int>?) { + NONE("NONE", emptySet(), 0.0, null), + CROPIE("CROPIE_TALISMAN", setOf(CropType.WHEAT, CropType.POTATO, CropType.CARROT), 10.0, Pair("CROPIE", 256)), SQUASH( "SQUASH_RING", setOf(CropType.WHEAT, CropType.POTATO, CropType.CARROT, CropType.COCOA_BEANS, CropType.MELON, CropType.PUMPKIN), - 20.0 + 20.0, Pair("SQUASH", 128) ), - FERMENTO("FERMENTO_ARTIFACT", CropType.values().toSet(), 30.0), + FERMENTO("FERMENTO_ARTIFACT", CropType.values().toSet(), 30.0, Pair("CONDENSED_FERMENTO", 8)), ; fun getFortune(cropType: CropType): Double { diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt index 47d44e5c1..2da6f89b5 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/CaptureFarmingGear.kt @@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.data.ProfileStorageData import at.hannibal2.skyhanni.events.GardenToolChangeEvent import at.hannibal2.skyhanni.events.InventoryOpenEvent import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay import at.hannibal2.skyhanni.features.garden.GardenAPI import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType import at.hannibal2.skyhanni.utils.InventoryUtils @@ -12,20 +13,25 @@ import at.hannibal2.skyhanni.utils.ItemUtils.getLore import at.hannibal2.skyhanni.utils.LorenzUtils import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimal import at.hannibal2.skyhanni.utils.NumberUtil.romanToDecimalIfNeeded +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments import at.hannibal2.skyhanni.utils.StringUtils.matchMatcher import at.hannibal2.skyhanni.utils.StringUtils.removeColor import at.hannibal2.skyhanni.utils.TabListData import net.minecraft.client.Minecraft import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import kotlin.math.round class CaptureFarmingGear { private val farmingItems get() = GardenAPI.config?.fortune?.farmingItems + private val outdatedItems get() = GardenAPI.config?.fortune?.outdatedItems private val farmingLevelUpPattern = "SKILL LEVEL UP Farming .*➜(?<level>.*)".toPattern() private val fortuneUpgradePattern = "You claimed the Garden Farming Fortune (?<level>.*) upgrade!".toPattern() private val anitaBuffPattern = "You tiered up the Extra Farming Drops upgrade to [+](?<level>.*)%!".toPattern() private val anitaMenuPattern = "You have: [+](?<level>.*)%".toPattern() + private val lotusUpgradePattern = "Lotus (?<piece>.*) upgraded to [+].*☘!".toPattern() + private val petLevelUpPattern = "Your (?<pet>.*) leveled up to level .*!".toPattern() companion object { private val strengthPattern = " Strength: §r§c❁(?<strength>.*)".toPattern() @@ -45,7 +51,7 @@ class CaptureFarmingGear { val currentCrop = itemStack.getCropType() if (currentCrop == null) { - //todo generic tool as fallback item + //todo better fall back items //todo Daedalus axe } else { for (item in FarmingItems.values()) { @@ -83,6 +89,7 @@ class CaptureFarmingGear { if (!LorenzUtils.inSkyBlock) return val hidden = GardenAPI.config?.fortune ?: return val farmingItems = farmingItems ?: return + val outdatedItems = outdatedItems ?: return if (event.inventoryName == "Your Equipment and Stats") { for ((_, slot) in event.inventoryItems) { val split = slot.getInternalName().split("_") @@ -90,8 +97,13 @@ class CaptureFarmingGear { for (item in FarmingItems.values()) { if (item.name == split.last()) { farmingItems[item] = slot + outdatedItems[item] = false } } + FarmingFortuneDisplay.loadFortuneLineData(slot, 0.0) + val enchantments = slot.getEnchantments() ?: emptyMap() + val greenThumbLvl = (enchantments["green_thumb"] ?: continue) + GardenAPI.config?.uniqueVisitors = round(FarmingFortuneDisplay.greenThumbFortune / (greenThumbLvl * 0.05)).toInt() } } } @@ -109,18 +121,21 @@ class CaptureFarmingGear { if (split.first() == "ELEPHANT") { if (split.last().toInt() > highestElephantLvl) { farmingItems[FarmingItems.ELEPHANT] = item + outdatedItems[FarmingItems.ELEPHANT] = false highestElephantLvl = split.last().toInt() } } if (split.first() == "MOOSHROOM_COW") { if (split.last().toInt() > highestMooshroomLvl) { farmingItems[FarmingItems.MOOSHROOM_COW] = item + outdatedItems[FarmingItems.MOOSHROOM_COW] = false highestMooshroomLvl = split.last().toInt() } } if (split.first() == "RABBIT") { if (split.last().toInt() > highestRabbitLvl) { farmingItems[FarmingItems.RABBIT] = item + outdatedItems[FarmingItems.RABBIT] = false highestRabbitLvl = split.last().toInt() } } @@ -181,6 +196,7 @@ class CaptureFarmingGear { fun onChat(event: LorenzChatEvent) { if (!LorenzUtils.inSkyBlock) return val hidden = GardenAPI.config?.fortune ?: return + val outdatedItems = outdatedItems ?: return val msg = event.message.removeColor().trim() fortuneUpgradePattern.matchMatcher(msg) { ProfileStorageData.playerSpecific?.gardenCommunityUpgrade = group("level").romanToDecimal() @@ -191,6 +207,22 @@ class CaptureFarmingGear { anitaBuffPattern.matchMatcher(msg) { hidden.anitaUpgrade = group("level").toInt() / 2 } + lotusUpgradePattern.matchMatcher(msg) { + val piece = group("piece").uppercase() + for (item in FarmingItems.values()) { + if (item.name == piece) { + outdatedItems[item] = true + } + } + } + petLevelUpPattern.matchMatcher(msg) { + val pet = group("pet").uppercase() + for (item in FarmingItems.values()) { + if (item.name.contains(pet)) { + outdatedItems[item] = true + } + } + } if (msg == "Yum! You gain +5☘ Farming Fortune for 48 hours!") { hidden.cakeExpiring = System.currentTimeMillis() + 172800000 } diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt index 25636ae8f..874526ac8 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFGuideGUI.kt @@ -9,6 +9,7 @@ import net.minecraft.client.Minecraft import net.minecraft.client.gui.GuiScreen import net.minecraft.client.renderer.GlStateManager import net.minecraft.init.Blocks +import net.minecraft.init.Items import net.minecraft.item.ItemStack import org.lwjgl.input.Mouse import java.io.IOException @@ -26,20 +27,22 @@ open class FFGuideGUI : GuiScreen() { const val sizeY = 180 var selectedPage = FortuneGuidePage.OVERVIEW - var breakdownMode = true - var currentPet = 0 + var currentCrop: CropType? = null + //todo set this to what they have equip + var currentPet = FarmingItems.ELEPHANT var currentArmor = 0 var currentEquipment = 0 var mouseX = 0 var mouseY = 0 + var lastMouseScroll = 0 + var noMouseScrollFrames = 0 + var lastClickedHeight = 0 var tooltipToDisplay = mutableListOf<String>() fun isInGui() = Minecraft.getMinecraft().currentScreen is FFGuideGUI - var cakeBuffTime = -1L - fun FarmingItems.getItem(): ItemStack { val fortune = GardenAPI.config?.fortune ?: return getFallbackItem(this) @@ -57,20 +60,18 @@ open class FFGuideGUI : GuiScreen() { init { FFStats.loadFFData() + FortuneUpgrades.generateGenericUpgrades() + pages[FortuneGuidePage.OVERVIEW] = OverviewPage() - pages[FortuneGuidePage.WHEAT] = WheatPage() - pages[FortuneGuidePage.CARROT] = CarrotPage() - pages[FortuneGuidePage.POTATO] = PotatoPage() - pages[FortuneGuidePage.PUMPKIN] = PumpkinPage() - pages[FortuneGuidePage.SUGAR_CANE] = CanePage() - pages[FortuneGuidePage.MELON] = MelonPage() - pages[FortuneGuidePage.CACTUS] = CactusPage() - pages[FortuneGuidePage.COCOA_BEANS] = CocoaPage() - pages[FortuneGuidePage.MUSHROOM] = MushroomPage() - pages[FortuneGuidePage.NETHER_WART] = WartPage() - - GardenAPI.config?.fortune?.let { - cakeBuffTime = it.cakeExpiring + pages[FortuneGuidePage.CROP] = CropPage() + pages[FortuneGuidePage.UPGRADES] = UpgradePage() + + if (currentCrop != null) { + for (item in FarmingItems.values()) { + if (item.name == currentCrop?.name) { + FFStats.getCropStats(currentCrop!!, item.getItem()) + } + } } } @@ -88,40 +89,11 @@ open class FFGuideGUI : GuiScreen() { drawRect(guiLeft, guiTop, guiLeft + sizeX, guiTop + sizeY, 0x50000000) renderTabs() - if (breakdownMode) { - if (selectedPage != FortuneGuidePage.OVERVIEW) { - GuiRenderUtils.renderItemAndTip( - FarmingItems.ELEPHANT.getItem(), guiLeft + 152, guiTop + 160, mouseX, mouseY, - if (currentPet == 0) 0xFF00FF00.toInt() else 0xFF43464B.toInt() - ) - GuiRenderUtils.renderItemAndTip( - FarmingItems.MOOSHROOM_COW.getItem(), guiLeft + 172, guiTop + 160, mouseX, mouseY, - if (currentPet == 1) 0xFF00FF00.toInt() else 0xFF43464B.toInt() - ) - GuiRenderUtils.renderItemAndTip( - FarmingItems.RABBIT.getItem(), guiLeft + 192, guiTop + 160, mouseX, mouseY, - if (currentPet == 2) 0xFF00FF00.toInt() else 0xFF43464B.toInt() - ) - - GuiRenderUtils.renderItemAndTip( - FarmingItems.HELMET.getItem(), guiLeft + 162, guiTop + 80, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.CHESTPLATE.getItem(), guiLeft + 162, guiTop + 100, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.LEGGINGS.getItem(), guiLeft + 162, guiTop + 120, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.BOOTS.getItem(), guiLeft + 162, guiTop + 140, mouseX, mouseY) - - GuiRenderUtils.renderItemAndTip( - FarmingItems.NECKLACE.getItem(), guiLeft + 182, guiTop + 80, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.CLOAK.getItem(), guiLeft + 182, guiTop + 100, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.BELT.getItem(), guiLeft + 182, guiTop + 120, mouseX, mouseY) - GuiRenderUtils.renderItemAndTip( - FarmingItems.BRACELET.getItem(), guiLeft + 182, guiTop + 140, mouseX, mouseY) - - } else { + if (selectedPage == FortuneGuidePage.UPGRADES) { + // + } else { + GuiRenderUtils.drawStringCentered("§7SkyHanni", guiLeft + 325, guiTop + 170) + if (currentCrop == null) { GuiRenderUtils.renderItemAndTip( FarmingItems.HELMET.getItem(), guiLeft + 142, guiTop + 5, mouseX, mouseY, if (currentArmor == 1) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() @@ -158,20 +130,50 @@ open class FFGuideGUI : GuiScreen() { GuiRenderUtils.renderItemAndTip( FarmingItems.ELEPHANT.getItem(), guiLeft + 152, guiTop + 130, mouseX, mouseY, - if (currentPet == 0) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + if (currentPet == FarmingItems.ELEPHANT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() ) GuiRenderUtils.renderItemAndTip( FarmingItems.MOOSHROOM_COW.getItem(), guiLeft + 172, guiTop + 130, mouseX, mouseY, - if (currentPet == 1) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + if (currentPet == FarmingItems.MOOSHROOM_COW) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() ) GuiRenderUtils.renderItemAndTip( FarmingItems.RABBIT.getItem(), guiLeft + 192, guiTop + 130, mouseX, mouseY, - if (currentPet == 2) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + if (currentPet == FarmingItems.RABBIT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + ) + } else { + GuiRenderUtils.renderItemAndTip( + FarmingItems.ELEPHANT.getItem(), guiLeft + 152, guiTop + 160, mouseX, mouseY, + if (currentPet == FarmingItems.ELEPHANT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + ) + GuiRenderUtils.renderItemAndTip( + FarmingItems.MOOSHROOM_COW.getItem(), guiLeft + 172, guiTop + 160, mouseX, mouseY, + if (currentPet == FarmingItems.MOOSHROOM_COW) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() + ) + GuiRenderUtils.renderItemAndTip( + FarmingItems.RABBIT.getItem(), guiLeft + 192, guiTop + 160, mouseX, mouseY, + if (currentPet == FarmingItems.RABBIT) 0xFFB3FFB3.toInt() else 0xFF43464B.toInt() ) + + GuiRenderUtils.renderItemAndTip( + FarmingItems.HELMET.getItem(), guiLeft + 162, guiTop + 80, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.CHESTPLATE.getItem(), guiLeft + 162, guiTop + 100, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.LEGGINGS.getItem(), guiLeft + 162, guiTop + 120, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.BOOTS.getItem(), guiLeft + 162, guiTop + 140, mouseX, mouseY) + + GuiRenderUtils.renderItemAndTip( + FarmingItems.NECKLACE.getItem(), guiLeft + 182, guiTop + 80, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.CLOAK.getItem(), guiLeft + 182, guiTop + 100, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.BELT.getItem(), guiLeft + 182, guiTop + 120, mouseX, mouseY) + GuiRenderUtils.renderItemAndTip( + FarmingItems.BRACELET.getItem(), guiLeft + 182, guiTop + 140, mouseX, mouseY) } } - GuiRenderUtils.drawStringCentered("§7SkyHanni", guiLeft + 325, guiTop + 170) GuiRenderUtils.drawStringCentered("§cIn beta! Report issues and suggestions on the discord", guiLeft + sizeX / 2, guiTop + sizeY + 10) pages[selectedPage]?.drawPage(mouseX, mouseY, partialTicks) @@ -184,116 +186,202 @@ open class FFGuideGUI : GuiScreen() { } } - @Throws(IOException::class) - override fun mouseClicked(originalX: Int, originalY: Int, mouseButton: Int) { - super.mouseClicked(originalX, originalY, mouseButton) + override fun handleMouseInput() { + super.handleMouseInput() - for (page in FortuneGuidePage.values()) { - val x = guiLeft + (page.ordinal) * 30 + 15 - val y = guiTop - 28 + if (Mouse.getEventButtonState()) { + mouseClickEvent() + } + if (!Mouse.getEventButtonState()) { + if (Mouse.getEventDWheel() != 0) { + lastMouseScroll = Mouse.getEventDWheel() + noMouseScrollFrames = 0 + } + } + } - if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { - if (selectedPage != page) { - SoundUtils.playClickSound() - selectedPage = page + @Throws(IOException::class) + fun mouseClickEvent() { + var x = guiLeft + 15 + var y = guiTop - 28 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { + SoundUtils.playClickSound() + if (currentCrop != null) { + currentCrop = null + if (selectedPage != FortuneGuidePage.UPGRADES) { + selectedPage = FortuneGuidePage.OVERVIEW + } + } else { + if (selectedPage == FortuneGuidePage.UPGRADES) { + selectedPage = FortuneGuidePage.OVERVIEW + } else { + selectedPage = FortuneGuidePage.UPGRADES } } } - if (selectedPage == FortuneGuidePage.OVERVIEW) { - if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 152, guiTop + 130, 16, 16) && currentPet != 0) { - SoundUtils.playClickSound() - currentPet = 0 - FFStats.totalFF(FFStats.elephantFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 172, guiTop + 130, 16, 16) && currentPet != 1 - ) { - SoundUtils.playClickSound() - currentPet = 1 - FFStats.totalFF(FFStats.mooshroomFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 192, guiTop + 130, 16, 16) && currentPet != 2 - ) { - SoundUtils.playClickSound() - currentPet = 2 - FFStats.totalFF(FFStats.rabbitFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 142, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 1) 0 else 1 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 162, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 2) 0 else 2 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 182, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 3) 0 else 3 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 202, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentArmor = if (currentArmor == 4) 0 else 4 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 262, guiTop + 5, 16, 16)) { - SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 1) 0 else 1 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 282, guiTop + 5, 16, 16)) { + for (crop in CropType.values()) { + x += 30 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 2) 0 else 2 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 302, guiTop + 5, 16, 16)) { + if (currentCrop != crop) { + currentCrop = crop + if (selectedPage == FortuneGuidePage.OVERVIEW) { + selectedPage = FortuneGuidePage.CROP + } + for (item in FarmingItems.values()) { + if (item.name == crop.name) { + FFStats.getCropStats(crop, item.getItem()) + FortuneUpgrades.getCropSpecific(item.getItem()) + } + } + } else { + if (selectedPage == FortuneGuidePage.CROP) { + selectedPage = FortuneGuidePage.UPGRADES + for (item in FarmingItems.values()) { + if (item.name == crop.name) { + FortuneUpgrades.getCropSpecific(item.getItem()) + } + } + } else { + selectedPage = FortuneGuidePage.CROP + for (item in FarmingItems.values()) { + if (item.name == crop.name) { + FFStats.getCropStats(crop, item.getItem()) + } + } + } + } + } + } + + x = guiLeft - 28 + y = guiTop + 15 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 28, 25)) { + if (selectedPage != FortuneGuidePage.CROP && selectedPage != FortuneGuidePage.OVERVIEW) { SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 3) 0 else 3 - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 322, guiTop + 5, 16, 16)) { + selectedPage = if (currentCrop == null) { + FortuneGuidePage.OVERVIEW + } else { + FortuneGuidePage.CROP + } + } + } + y += 30 + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 28, 25)) { + if (selectedPage != FortuneGuidePage.UPGRADES) { + selectedPage = FortuneGuidePage.UPGRADES SoundUtils.playClickSound() - currentEquipment = if (currentEquipment == 4) 0 else 4 } + } + if (selectedPage != FortuneGuidePage.UPGRADES) { + if (currentCrop == null) { + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 152, guiTop + 130, + 16, 16) && currentPet != FarmingItems.ELEPHANT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.ELEPHANT + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 172, guiTop + 130, + 16, 16) && currentPet != FarmingItems.MOOSHROOM_COW) { + SoundUtils.playClickSound() + currentPet = FarmingItems.MOOSHROOM_COW + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 192, guiTop + 130, + 16, 16) && currentPet != FarmingItems.RABBIT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.RABBIT + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 142, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 1) 0 else 1 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 162, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 2) 0 else 2 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 182, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 3) 0 else 3 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 202, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentArmor = if (currentArmor == 4) 0 else 4 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 262, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 1) 0 else 1 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 282, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 2) 0 else 2 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 302, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 3) 0 else 3 + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 322, guiTop + 5, 16, 16)) { + SoundUtils.playClickSound() + currentEquipment = if (currentEquipment == 4) 0 else 4 + } + } else { + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 152, guiTop + 160, + 16, 16) && currentPet != FarmingItems.ELEPHANT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.ELEPHANT + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 172, guiTop + 160, + 16, 16) && currentPet != FarmingItems.MOOSHROOM_COW) { + SoundUtils.playClickSound() + currentPet = FarmingItems.MOOSHROOM_COW + FFStats.getTotalFF() + } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 192, guiTop + 160, + 16, 16) && currentPet != FarmingItems.RABBIT) { + SoundUtils.playClickSound() + currentPet = FarmingItems.RABBIT + FFStats.getTotalFF() + } + } } else { - if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 152, guiTop + 160, 16, 16) && currentPet != 0) { - SoundUtils.playClickSound() - currentPet = 0 - FFStats.totalFF(FFStats.elephantFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 172, guiTop + 160, 16, 16) && currentPet != 1 - ) { - SoundUtils.playClickSound() - currentPet = 1 - FFStats.totalFF(FFStats.mooshroomFF) - } else if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft + 192, guiTop + 160, 16, 16) && currentPet != 2 - ) { - SoundUtils.playClickSound() - currentPet = 2 - FFStats.totalFF(FFStats.rabbitFF) + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, guiLeft, guiTop, sizeX, sizeY)) { + lastClickedHeight = mouseY } } } private fun renderTabs() { - for (page in FortuneGuidePage.values()) { - val x = guiLeft + (page.ordinal) * 30 + 15 - val y = guiTop - 28 - drawRect(x, y, x + 25, y + 28, if (page == selectedPage) 0x50555555 else 0x50000000) - - if (page.crop != null) { - GuiRenderUtils.renderItemStack(page.crop.icon, x + 5, y + 5) - } else GuiRenderUtils.renderItemStack(ItemStack(Blocks.grass), x + 5, y + 5) + var x = guiLeft + 15 + var y = guiTop - 28 + drawRect(x, y, x + 25, y + 28, if (currentCrop == null) 0x50555555 else 0x50000000) + GuiRenderUtils.renderItemStack(ItemStack(Blocks.grass), x + 5, y + 5) + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { + tooltipToDisplay.add("§eOverview") + } - if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 25)) { - tooltipToDisplay.add(page.pageName) + for (crop in CropType.values()) { + x += 30 + drawRect(x, y, x + 25, y + 28, if (currentCrop == crop) 0x50555555 else 0x50000000) + GuiRenderUtils.renderItemStack(crop.icon, x + 5, y + 5) + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 25, 28)) { + tooltipToDisplay.add("§e${crop.cropName}") } } + + x = guiLeft - 28 + y = guiTop + 15 + + drawRect(x, y, x + 28, y + 25, if (selectedPage != FortuneGuidePage.UPGRADES) 0x50555555 else 0x50000000) + GuiRenderUtils.renderItemStack(ItemStack(Items.gold_ingot), x + 5, y + 5) + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 28, 25)) { + tooltipToDisplay.add("§eBreakdown") + } + y += 30 + drawRect(x, y, x + 28, y + 25, if (selectedPage == FortuneGuidePage.UPGRADES) 0x50555555 else 0x50000000) + GuiRenderUtils.renderItemStack(ItemStack(Items.map), x + 5, y + 5) + if (GuiRenderUtils.isPointInRect(mouseX, mouseY, x, y, 28, 25)) { + tooltipToDisplay.add("§eUpgrades") + } } - enum class FortuneGuidePage(val crop: CropType?) { - OVERVIEW(null), - WHEAT(CropType.WHEAT), - CARROT(CropType.CARROT), - POTATO(CropType.POTATO), - NETHER_WART(CropType.NETHER_WART), - PUMPKIN(CropType.PUMPKIN), - MELON(CropType.MELON), - COCOA_BEANS(CropType.COCOA_BEANS), - SUGAR_CANE(CropType.SUGAR_CANE), - CACTUS(CropType.CACTUS), - MUSHROOM(CropType.MUSHROOM), - ; - - val pageName = crop?.let { "§e" + crop.cropName } ?: "§eOverview" + enum class FortuneGuidePage { + OVERVIEW, + CROP, + UPGRADES } abstract class FFGuidePage { abstract fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) } } - diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt index 1d5638061..26a649aa1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFStats.kt @@ -3,9 +3,9 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide import at.hannibal2.skyhanni.data.CropAccessoryData import at.hannibal2.skyhanni.data.GardenCropUpgrades.Companion.getUpgradeLevel import at.hannibal2.skyhanni.data.ProfileStorageData +import at.hannibal2.skyhanni.features.garden.CropType import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay import at.hannibal2.skyhanni.features.garden.GardenAPI -import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount @@ -14,7 +14,16 @@ import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetLevel import net.minecraft.item.ItemStack object FFStats { + private val toolHasBountiful get() = GardenAPI.config?.toolWithBountiful + + private val mathCrops = listOf(CropType.WHEAT, CropType.CARROT, CropType.POTATO, CropType.SUGAR_CANE, CropType.NETHER_WART) + private val dicerCrops = listOf(CropType.PUMPKIN, CropType.MELON) + private val farmingBoots = arrayListOf("RANCHERS_BOOTS", "FARMER_BOOTS") + + var cakeExpireTime = 0L + + // todo maybe these could be maps val necklaceFF = mutableMapOf<FFTypes, Double>() val cloakFF = mutableMapOf<FFTypes, Double>() val beltFF = mutableMapOf<FFTypes, Double>() @@ -37,18 +46,11 @@ object FFStats { var totalBaseFF = mutableMapOf<FFTypes, Double>() - val wheatFF = mutableMapOf<FFTypes, Double>() - val carrotFF = mutableMapOf<FFTypes, Double>() - val potatoFF = mutableMapOf<FFTypes, Double>() - val caneFF = mutableMapOf<FFTypes, Double>() - val wartFF = mutableMapOf<FFTypes, Double>() - val pumpkinFF = mutableMapOf<FFTypes, Double>() - val melonFF = mutableMapOf<FFTypes, Double>() - val mushroomFF = mutableMapOf<FFTypes, Double>() - val cocoaFF = mutableMapOf<FFTypes, Double>() - val cactusFF = mutableMapOf<FFTypes, Double>() + val cropPage = mutableMapOf<FortuneStats, Pair<Double, Double>>() fun loadFFData() { + cakeExpireTime = GardenAPI.config?.fortune?.cakeExpiring ?: -1L + getEquipmentFFData(FarmingItems.NECKLACE.getItem(), necklaceFF) getEquipmentFFData(FarmingItems.CLOAK.getItem(), cloakFF) getEquipmentFFData(FarmingItems.BELT.getItem(), beltFF) @@ -76,23 +78,77 @@ object FFStats { getPetFFData(FarmingItems.RABBIT.getItem(), rabbitFF) getGenericFF(baseFF) - getToolFF(FarmingItems.WHEAT.getItem(), wheatFF) - getToolFF(FarmingItems.CARROT.getItem(), carrotFF) - getToolFF(FarmingItems.POTATO.getItem(), potatoFF) - getToolFF(FarmingItems.SUGAR_CANE.getItem(), caneFF) - getToolFF(FarmingItems.NETHER_WART.getItem(), wartFF) - getToolFF(FarmingItems.PUMPKIN.getItem(), pumpkinFF) - getToolFF(FarmingItems.MELON.getItem(), melonFF) - getToolFF(FarmingItems.MUSHROOM.getItem(), mushroomFF) - getToolFF(FarmingItems.COCOA_BEANS.getItem(), cocoaFF) - getToolFF(FarmingItems.CACTUS.getItem(), cactusFF) - - currentPetItem = FarmingItems.ELEPHANT.getItem().getPetItem().toString() - when (FFGuideGUI.currentPet) { - 0 -> totalFF(elephantFF) - 1 -> totalFF(mooshroomFF) - 2 -> totalFF(rabbitFF) + getTotalFF() + } + + fun getCropStats(crop: CropType, tool: ItemStack) { + cropPage.clear() + cropPage[FortuneStats.BASE] = Pair(totalBaseFF[FFTypes.TOTAL] ?: 100.0, 1250.0) + cropPage[FortuneStats.CROP_UPGRADE] = Pair((crop.getUpgradeLevel()?.toDouble() ?: 0.0) * 5.0, 45.0) + cropPage[FortuneStats.ACCESSORY] = Pair(CropAccessoryData.cropAccessory?.getFortune(crop) ?: 0.0, 30.0) + cropPage[FortuneStats.FFD] = Pair((tool.getFarmingForDummiesCount() ?: 0).toDouble(), 5.0) + cropPage[FortuneStats.TURBO] = Pair(FarmingFortuneDisplay.getTurboCropFortune(tool, crop), 25.0) + cropPage[FortuneStats.DEDICATION] = Pair(FarmingFortuneDisplay.getDedicationFortune(tool, crop), 92.0) + cropPage[FortuneStats.CULTIVATING] = Pair(FarmingFortuneDisplay.getCultivatingFortune(tool), 10.0) + + FarmingFortuneDisplay.loadFortuneLineData(tool, 0.0) + + when (crop) { + in mathCrops -> { + cropPage[FortuneStats.BASE_TOOL] = Pair(FarmingFortuneDisplay.getToolFortune(tool), 50.0) + cropPage[FortuneStats.COUNTER] = Pair(FarmingFortuneDisplay.getCounterFortune(tool), 96.0) + cropPage[FortuneStats.HARVESTING] = Pair(FarmingFortuneDisplay.getHarvestingFortune(tool), 75.0) + cropPage[FortuneStats.COLLECTION] = Pair(FarmingFortuneDisplay.getCollectionFortune(tool), 48.0) + if (toolHasBountiful?.get(crop) == true) { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 10.0) + } else { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 20.0) + } + } + in dicerCrops -> { + cropPage[FortuneStats.SUNDER] = Pair(FarmingFortuneDisplay.getSunderFortune(tool), 62.5) + if (toolHasBountiful?.get(crop) == true) { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 10.0) + } else { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 20.0) + } + } + CropType.MUSHROOM -> { + cropPage[FortuneStats.BASE_TOOL] = Pair(FarmingFortuneDisplay.getToolFortune(tool), 30.0) + cropPage[FortuneStats.HARVESTING] = Pair(FarmingFortuneDisplay.getHarvestingFortune(tool), 75.0) + if (toolHasBountiful?.get(crop) == true) { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 5.0) + } else { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 13.0) + } + } + CropType.COCOA_BEANS -> { + cropPage[FortuneStats.BASE_TOOL] = Pair(FarmingFortuneDisplay.getToolFortune(tool), 20.0) + cropPage[FortuneStats.SUNDER] = Pair(FarmingFortuneDisplay.getSunderFortune(tool), 62.5) + if (toolHasBountiful?.get(crop) == true) { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 7.0) + } else { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 16.0) + } + } + CropType.CACTUS -> { + cropPage[FortuneStats.HARVESTING] = Pair(FarmingFortuneDisplay.getHarvestingFortune(tool), 75.0) + if (toolHasBountiful?.get(crop) == true) { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 7.0) + } else { + cropPage[FortuneStats.REFORGE] = Pair(FarmingFortuneDisplay.reforgeFortune, 16.0) + } + } + else -> {} + } + + cropPage[FortuneStats.CROP_TOTAL] = Pair( + cropPage.toList().sumOf { it.second.first }, + cropPage.toList().sumOf { it.second.second }) + + if (tool.getInternalName().contains("DICER")){ + cropPage[FortuneStats.DICER] = Pair(33.0, 33.0) } } @@ -136,7 +192,7 @@ object FFStats { out[FFTypes.COMMUNITY_SHOP] = (ProfileStorageData.playerSpecific?.gardenCommunityUpgrade ?: -1).toDouble() * 4 out[FFTypes.PLOTS] = savedStats.plotsUnlocked.toDouble() * 3 out[FFTypes.ANITA] = savedStats.anitaUpgrade.toDouble() * 2 - if (savedStats.cakeExpiring - System.currentTimeMillis() > 0 || savedStats.cakeExpiring == -1L) { + if (cakeExpireTime - System.currentTimeMillis() > 0 || cakeExpireTime == -1L) { out[FFTypes.CAKE] = 5.0 } else { out[FFTypes.CAKE] = 0.0 @@ -144,46 +200,26 @@ object FFStats { out[FFTypes.TOTAL] = out.values.sum() } - private fun getToolFF(tool: ItemStack, out: MutableMap<FFTypes, Double>) { - out[FFTypes.TOTAL] = 0.0 - val crop = tool.getCropType() - - val accessoryFortune= crop?.let { - CropAccessoryData.cropAccessory?.getFortune(it) + fun getTotalFF() { + var petList = mutableMapOf<FFTypes, Double>() + when (FFGuideGUI.currentPet) { + FarmingItems.ELEPHANT -> { + petList = elephantFF + } + FarmingItems.MOOSHROOM_COW -> { + petList = mooshroomFF + } + FarmingItems.RABBIT -> { + petList = rabbitFF + } + else -> {} } + currentPetItem = FFGuideGUI.currentPet.getItem().getPetItem().toString() - out[FFTypes.CROP_UPGRADE] = (crop?.getUpgradeLevel()?.toDouble() ?: 0.0) * 5.0 - out[FFTypes.ACCESSORY] = accessoryFortune ?: 0.0 - - out[FFTypes.BASE] = FarmingFortuneDisplay.getToolFortune(tool) - out[FFTypes.COUNTER] = FarmingFortuneDisplay.getCounterFortune(tool) - out[FFTypes.COLLECTION] = FarmingFortuneDisplay.getCollectionFortune(tool) - out[FFTypes.TURBO] = FarmingFortuneDisplay.getTurboCropFortune(tool, crop) - out[FFTypes.DEDICATION] = FarmingFortuneDisplay.getDedicationFortune(tool, crop) - out[FFTypes.SUNDER] = FarmingFortuneDisplay.getSunderFortune(tool) - out[FFTypes.HARVESTING] = FarmingFortuneDisplay.getHarvestingFortune(tool) - out[FFTypes.CULTIVATING] = FarmingFortuneDisplay.getCultivatingFortune(tool) - out[FFTypes.FFD] = (tool.getFarmingForDummiesCount() ?: 0).toDouble() - - val enchantmentFortune = out[FFTypes.SUNDER]!! + out[FFTypes.HARVESTING]!! + out[FFTypes.CULTIVATING]!! - - FarmingFortuneDisplay.loadFortuneLineData(tool, enchantmentFortune) - - out[FFTypes.REFORGE] = FarmingFortuneDisplay.reforgeFortune - - out[FFTypes.TOTAL] = out.values.sum() - } - - fun totalFF(petList: MutableMap<FFTypes, Double>) { totalBaseFF = (baseFF.toList() + armorTotalFF.toList() + equipmentTotalFF.toList() + petList.toList()).groupBy({ it.first }, { it.second }).map { (key, values) -> key to values.sum() } .toMap() as MutableMap<FFTypes, Double> - currentPetItem = when (FFGuideGUI.currentPet) { - 0 -> FarmingItems.ELEPHANT.getItem().getPetItem().toString() - 1 -> FarmingItems.MOOSHROOM_COW.getItem().getPetItem().toString() - else -> FarmingItems.RABBIT.getItem().getPetItem().toString() - } } private fun getPetFF (pet: ItemStack): Double { @@ -193,7 +229,6 @@ object FFStats { return if (pet.getInternalName().contains("ELEPHANT;4")) { 1.8 * petLevel } else if (pet.getInternalName().contains("MOOSHROOM_COW;4")) { - println("doing cow calc: ${(10 + petLevel).toDouble() + strength / (40 - petLevel * .2)}ff") (10 + petLevel).toDouble() + strength / (40 - petLevel * .2) } else if (pet.getInternalName().contains("MOOSHROOM")) { (10 + petLevel).toDouble() diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt index b317199ec..02d8debc0 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FFTypes.kt @@ -2,6 +2,5 @@ package at.hannibal2.skyhanni.features.garden.fortuneguide enum class FFTypes { TOTAL, BASE, REFORGE, ABILITY, GREEN_THUMB, BASE_FF, ANITA, FARMING_LVL, COMMUNITY_SHOP, PLOTS, - CAKE, PET_ITEM, COUNTER, COLLECTION, TURBO, DEDICATION, SUNDER, HARVESTING, CULTIVATING, FFD, - CROP_UPGRADE, ACCESSORY + CAKE, PET_ITEM }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingReforges.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingReforges.kt new file mode 100644 index 000000000..6920c5e77 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingReforges.kt @@ -0,0 +1,31 @@ +package at.hannibal2.skyhanni.features.garden.fortuneguide + +enum class FarmingReforges( + val reforgeName: String, + val reforgeItem: String, + val common: Int, + val uncommon: Int, + val rare: Int, + val epic: Int, + val legendary: Int, + val mythic: Int +) { + BLESSED("Blessed", "BLESSED_FRUIT", 5, 7, 9, 13, 16, 20), + BOUNTIFUL("Bountiful", "GOLDEN_BALL", 1, 2, 3, 5, 7, 10), + BLOOMING("Blooming", "FLOWERING_BOUQUET", 1, 2, 3, 4, 5, 6), + ROOTED("Rooted", "BURROWING_SPORES", 4, 6, 8, 10, 12, 14), + BUSTLING("Bustling", "SKYMART_BROCHURE", 1, 2, 4, 6, 8, 10), + MOSSY("Mossy", "OVERGROWN_GRASS", 5, 10, 15, 20, 25, 30) +} + +operator fun FarmingReforges.get(index: Int, current: Double = 0.0): Double? { + return when (index) { + 0 -> common - current + 1 -> uncommon - current + 2 -> rare - current + 3 -> epic - current + 4 -> legendary - current + 5 -> mythic - current + else -> null + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingSets.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingSets.kt new file mode 100644 index 000000000..fb3c30123 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FarmingSets.kt @@ -0,0 +1,15 @@ +package at.hannibal2.skyhanni.features.garden.fortuneguide + +enum class FarmingSets( + val helmetIncrease: Double, + val chestplateIncrease: Double, + val leggingsIncrease: Double, + val bootsIncrease: Double +) { + MELON(15.0, 20.0, 20.0, 15.0), + CROPIE(15.0, 20.0, 20.0, 15.0), + SQUASH(15.0, 20.0, 20.0, 15.0), + FERMENTO(15.0, 20.0, 20.0, 15.0), + FARMER(0.0, 0.0, 0.0, 0.0), + RANCHERS(0.0, 0.0, 0.0, 0.0) +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt new file mode 100644 index 000000000..8fb09f648 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneStats.kt @@ -0,0 +1,19 @@ +package at.hannibal2.skyhanni.features.garden.fortuneguide + +enum class FortuneStats(val label: String, val tooltip: String) { + BASE("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n§2applied to every crop\n§eNot the same as tab FF"), + CROP_TOTAL("§6Crop Farming Fortune", "§7§2Farming fortune for this crop"), + ACCESSORY("§2Talisman Bonus", "§7§2Fortune from your talisman\n§2You get 10☘ per talisman tier"), + CROP_UPGRADE("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n§2You get 5☘ per level"), + BASE_TOOL("§2Base tool fortune","§7§2Crop specific fortune from your tool"), + REFORGE("§2Tool reforge", "§7§2Fortune from reforging your tool"), + FFD("§2Farming for Dummies", "§7§2Fortune for each applied book\n§2You get 1☘ per applied book"), + COUNTER("§2Logarithmic Counter", "§7§2Fortune from increasing crop counter\n§2You get 16☘ per digit - 4"), + COLLECTION("§2Collection Analyst", "§7§2Fortune from increasing crop collection\n§2You get 8☘ per digit - 4"), + HARVESTING("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n§2You get 12.5☘ per level"), + SUNDER("§2Sunder Enchantment", "§7§2Fortune for each enchantment level\n§2You get 12.5☘ per level"), + CULTIVATING("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n§2You get 1☘ per level"), + TURBO("§2Turbo-Crop Enchantment", "§7§2Fortune for each enchantment level\n§2You get 5☘ per level"), + DEDICATION("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n§2and crop milestone"), + DICER("§2Dicer Ability", "§7§2Theoretical fortune from the dicer ability\n§eIs very random! and not added to total ☘") +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt new file mode 100644 index 000000000..70ce14178 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrade.kt @@ -0,0 +1,11 @@ +package at.hannibal2.skyhanni.features.garden.fortuneguide + +data class FortuneUpgrade( + val description: String, + val costCopper: Int?, + val requiredItem: String, + val itemQuantity: Int, + val fortuneIncrease: Double, + var cost: Int? = null, + var costPerFF: Int? = null // also the same as time to repay +)
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt new file mode 100644 index 000000000..f6e220fa0 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/FortuneUpgrades.kt @@ -0,0 +1,233 @@ +package at.hannibal2.skyhanni.features.garden.fortuneguide + +import at.hannibal2.skyhanni.data.CropAccessoryData +import at.hannibal2.skyhanni.data.GardenCropMilestones +import at.hannibal2.skyhanni.data.GardenCropMilestones.Companion.getCounter +import at.hannibal2.skyhanni.features.garden.CropAccessory +import at.hannibal2.skyhanni.features.garden.CropType +import at.hannibal2.skyhanni.features.garden.CropType.Companion.getTurboCrop +import at.hannibal2.skyhanni.features.garden.FarmingFortuneDisplay +import at.hannibal2.skyhanni.features.garden.GardenAPI +import at.hannibal2.skyhanni.features.garden.GardenAPI.getCropType +import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.currentPet +import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem +import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName +import at.hannibal2.skyhanni.utils.ItemUtils.getItemRarity +import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.NumberUtil.addSuffix +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getEnchantments +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getFarmingForDummiesCount +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getReforgeName +import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.isRecombobulated +import net.minecraft.item.ItemStack + +object FortuneUpgrades { + private val equipment = listOf(FarmingItems.NECKLACE, FarmingItems.CLOAK, FarmingItems.BELT, FarmingItems.BRACELET) + private val armor = listOf(FarmingItems.HELMET, FarmingItems.CHESTPLATE, FarmingItems.LEGGINGS, FarmingItems.BOOTS) + private val axeCrops = listOf(CropType.MELON, CropType.PUMPKIN, CropType.COCOA_BEANS) + + val genericUpgrades = mutableListOf<FortuneUpgrade>() + val cropSpecificUpgrades = mutableListOf<FortuneUpgrade>() + + fun generateGenericUpgrades() { + val hidden = GardenAPI.config?.fortune ?: return + genericUpgrades.clear() + + if (hidden.plotsUnlocked != -1 && hidden.plotsUnlocked != 24) { + genericUpgrades.add(FortuneUpgrade("§7Unlock your ${(hidden.plotsUnlocked + 1).addSuffix()} §7plot", + null, "COMPOST", compostNeeded[hidden.plotsUnlocked], 3.0)) + } + if (hidden.anitaUpgrade != -1 && hidden.anitaUpgrade != 15) { + genericUpgrades.add(FortuneUpgrade("§7Upgrade Anita bonus to level ${hidden.anitaUpgrade + 1}", + null, "JACOBS_TICKET", anitaTicketsNeeded[hidden.anitaUpgrade], 3.0)) + } + + getEquipmentUpgrades() + getPetUpgrades() + getArmorUpgrades() + getTalismanUpgrade() + + genericUpgrades.populateAndSort(0) + } + + //todo fix NEU price data not being loaded if run too early + private fun MutableList<FortuneUpgrade>.populateAndSort(style: Int) { + this.map { upgrade -> + val cost = (NEUItems.getPrice(upgrade.requiredItem) * (upgrade.itemQuantity)).toInt() + upgrade.cost = cost + upgrade.costPerFF = (cost / upgrade.fortuneIncrease).toInt() + } + when (style) { // sorting later + 0 -> this.sortBy { it.costPerFF } + 1 -> this.sortByDescending { it.costPerFF } + 2 -> this.sortBy { it.cost } + 3 -> this.sortByDescending { it.cost } + 4 -> this.sortBy { it.fortuneIncrease } + 5 -> this.sortByDescending { it.fortuneIncrease } + else -> {} + } + } + + private fun getTalismanUpgrade() { + val currentTalismanTier = CropAccessoryData.cropAccessory?.ordinal ?: return + if (currentTalismanTier < 3) { + val nextTalisman = CropAccessory.values()[currentTalismanTier + 1] + genericUpgrades.add(FortuneUpgrade("§7Upgrade your talisman to ${nextTalisman.internalName.replace("_", " ").lowercase()}", + null, nextTalisman.upgradeCost?.first!!, nextTalisman.upgradeCost.second, 10.0)) + } + } + + private fun getEquipmentUpgrades() { + val visitors = GardenAPI.config?.uniqueVisitors?.toDouble() ?: 0.0 + for (piece in equipment) { + val item = piece.getItem() + //todo tell them to purchase the missing item + if (!item.getInternalName().contains("LOTUS")) return + val enchantments = item.getEnchantments() ?: emptyMap() + val greenThumbLvl = enchantments["green_thumb"] ?: 0 + if (greenThumbLvl != 5 && visitors != 0.0) { + genericUpgrades.add(FortuneUpgrade("§7Enchant your ${item.displayName} §7with Green Thumb ${greenThumbLvl + 1}", + 1500, "GREEN_THUMB;1", getNeededBooks(greenThumbLvl), visitors * 0.05)) + } + recombobulateItem(item, genericUpgrades) + when (item.getReforgeName()) { + "rooted" -> {} + "blooming" -> { + reforgeItem(item, FarmingReforges.ROOTED, genericUpgrades) + } + else -> { + reforgeItem(item, FarmingReforges.BLOOMING, genericUpgrades) + } + } + } + } + //todo adding armor tier upgrades later + + private fun getArmorUpgrades() { + for (piece in armor) { + val item = piece.getItem() + //todo skip if it doesnt exist -> tell them to buy it later + + recombobulateItem(item, genericUpgrades) + when (item.getReforgeName()) { + "mossy" -> {} + "bustling" -> { + reforgeItem(item, FarmingReforges.MOSSY, genericUpgrades) + } + else -> { + reforgeItem(item, FarmingReforges.BUSTLING, genericUpgrades, 100) + } + } + } + } + + //todo needs to be called when switching pets + private fun getPetUpgrades() { + if (currentPet.getItem().getInternalName().contains(";")) { + when (FFStats.currentPetItem) { + "GREEN_BANDANA" -> {} + "YELLOW_BANDANA" -> { + //todo once auction stuff is done + } + else -> { + //give pet yellow bandana + } + } + } + } + + fun getCropSpecific(tool: ItemStack) { + cropSpecificUpgrades.clear() + cropSpecificUpgrades.addAll(genericUpgrades) + // todo tell them to get the tool if it is missing + val crop = tool.getCropType() ?: return + val enchantments = tool.getEnchantments() ?: emptyMap() + val turboCropLvl = enchantments[crop.getTurboCrop()] ?: 0 + val dedicationLvl = enchantments["dedication"] ?: 0 + val cultivatingLvl = enchantments["cultivating"] ?: 0 + val farmingForDummiesCount = tool.getFarmingForDummiesCount() ?: 0 + if (crop in axeCrops) { + val sunderLvl = enchantments["sunder"] ?: 0 + if (sunderLvl != 5) { + cropSpecificUpgrades.add(FortuneUpgrade("§7Enchant your ${tool.displayName} §7with Sunder ${sunderLvl + 1}", + 10, "SUNDER;1", getNeededBooks(sunderLvl), 12.5)) + } + } else { + val harvestingLvl = enchantments["harvesting"] ?: 0 + if (harvestingLvl == 5) { + cropSpecificUpgrades.add(FortuneUpgrade("§7Enchant your ${tool.displayName} §7with Harvesting ${harvestingLvl + 1}", + 10, "HARVESTING;6", 1, 12.5)) + } + } + if (farmingForDummiesCount != 5) { + cropSpecificUpgrades.add(FortuneUpgrade("§7Add a Farming for Dummies to your ${tool.displayName}", + null, "FARMING_FOR_DUMMIES", 1, 1.0)) + } + val cropMilestone = GardenCropMilestones.getTierForCrops(crop.getCounter()) + if (dedicationLvl != 4 && cropMilestone > 0) { + val dedicationMultiplier = listOf(0.5, 0.75, 1.0, 2.0)[dedicationLvl] + val dedicationIncrease = dedicationMultiplier * cropMilestone - FarmingFortuneDisplay.getDedicationFortune(tool, crop) + if (dedicationLvl == 3) { + cropSpecificUpgrades.add(FortuneUpgrade("§7Enchant your ${tool.displayName} §7with Dedication ${dedicationLvl + 1}", + null, "DEDICATION;4", 1, dedicationIncrease)) + } else { + cropSpecificUpgrades.add(FortuneUpgrade("§7Enchant your ${tool.displayName} §7with Dedication ${dedicationLvl + 1}", + 250, "DEDICATION;1", getNeededBooks(dedicationLvl), dedicationIncrease)) + } + } + if (cultivatingLvl == 0) { + cropSpecificUpgrades.add(FortuneUpgrade("§7Enchant your ${tool.displayName} §7with Cultivating", + null, "CULTIVATING;1", 1, 6.0)) + } + if (turboCropLvl != 5) { + cropSpecificUpgrades.add(FortuneUpgrade("§7Enchant your ${tool.displayName} §7with ${crop.getTurboCrop().replace("_", " ")} ${turboCropLvl + 1}", + null, "${crop.getTurboCrop().uppercase()};1", getNeededBooks(turboCropLvl), 5.0)) + } + recombobulateItem(tool, cropSpecificUpgrades) + when (tool.getReforgeName()) { + "blessed" -> {} + "bountiful" -> {} + else -> { + reforgeItem(tool, FarmingReforges.BLESSED, cropSpecificUpgrades) + } + } + cropSpecificUpgrades.populateAndSort(0) + } + + private fun recombobulateItem(item: ItemStack, list: MutableList<FortuneUpgrade>) { + if (item.isRecombobulated()) return + val reforge = item.getReforgeName()?.let { FarmingReforges.valueOf(it.uppercase()) } ?: return + + FarmingFortuneDisplay.loadFortuneLineData(item, 0.0) + val increase = reforge[item.getItemRarity() + 1, FarmingFortuneDisplay.reforgeFortune] ?: return + list.add(FortuneUpgrade("§7Recombobulate your ${item.displayName}", + null, "RECOMBOBULATOR_3000", 1, increase)) + } + + private fun reforgeItem(item: ItemStack, reforge: FarmingReforges, list: MutableList<FortuneUpgrade>,copperPrice: Int? = null) { + FarmingFortuneDisplay.loadFortuneLineData(item, 0.0) + + val increase = reforge[item.getItemRarity(), FarmingFortuneDisplay.reforgeFortune] ?: return + list.add(FortuneUpgrade("§7Reforge your ${item.displayName} §7to ${reforge.reforgeName}", + copperPrice, reforge.reforgeItem, 1, increase)) + } + + private fun getNeededBooks(currentLvl: Int): Int { + return when (currentLvl) { + 0 -> 1 + 1 -> 1 + 2 -> 2 + 3 -> 4 + else -> 8 + } + } + + private val cropUpgrades = listOf(5, 10, 20, 50, 100, 500, 1000, 5000, 10000) + + // If they unlock in a weird order e.g. getting a corner before a cheaper one won't work properly + private val compostNeeded = listOf(1, 2, 4, 8, 16, 24, 32, 48, 64, 96, 128, 160, 160, + 320, 320, 480, 480, 640, 800, 1120, 1280, 1600, 1920, 2400) + + // no support for people with 5% discount + private val anitaTicketsNeeded = listOf(0, 50, 50, 100, 100, 150, 150, 200, 200, 250, 300, 350, 400, 450, 1000) +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/TODO list b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/TODO list index 65a9d7385..a34e366d7 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/TODO list +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/TODO list @@ -1,16 +1,58 @@ -todo list for this display +V2 Plans -Deal with pets leveling up +Guide for cheapest upgrades: + - Anita buff + - Garden plots + - Pet Item + - Equipment + - Green thumb + - Reforges + - Recombs + - Armor + - Reforges + - Recombs + - Talisman + - Tools + - Farming for dummies + - Harvesting 6 + - Reforge + - Recomb + - Sunder + - Dedication + - Crop upgrade + - Turbo crop -Change lore on equipment to reflect visitors served +Big warning for missing data (pets, armor, equipment) (if it has to generate a fallback item) +Big warnign for misisng skill level, anita, plots +Indicator when some of your gear is outdated + - Little sign telling you + - Line in the tooltip of the item +Changing lore on items inside the menu to reflect changes + - Changing the amount of visitors served to reflect the real amount + - Changing the pet level to reflect the pets actual level + +Max value on bars will update depending on chosen pet + - Will be visible on all pages + +If you have show as drop multiplier off -100ff +When opening the menu it will open to the tool you are currently holding +It will also auto select the current pet you have out if that is a farming pet + +Add colours to the text + +Maybe: +Clicking on the already selected crop up top will cycle between overview and upgrades + +Later on: GUI: Add a border around the edge of the display Make this adjust based on the selected page !!!! -Buges: +Bugs: Major: +Sometimes the greenthumb visitor counter breaks? Sometimes the ff breakdown for equipment and armor does not work in the gui? - fixes by holding shift over an item in the inventory then going back into the gui If they sell their equipment or pets, they will be saved until a new one is bought and their stats counted : fix, don't liquidize your stuff lol @@ -21,6 +63,4 @@ Taking off or putting equipment on inside the menu won't update it until you reo !!!! Add: -Daedalus axe for mushroom and cocoa?? -Save selected pet to config - - use the already saved one
\ No newline at end of file +Daedalus axe for mushroom
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CactusPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CactusPage.kt deleted file mode 100644 index 3648e21d4..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CactusPage.kt +++ /dev/null @@ -1,61 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils - - -class CactusPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.CACTUS.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.cactusFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Cactus Farming Fortune", "§7§2Farming fortune for cacti", - totalCropFF, 1548, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.cactusFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.cactusFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.cactusFF[FFTypes.REFORGE] ?: 0, 16, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.cactusFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.cactusFF[FFTypes.HARVESTING] ?: 0, 75, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.cactusFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Cacti Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.cactusFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.cactusFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CanePage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CanePage.kt deleted file mode 100644 index e8d3df75d..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CanePage.kt +++ /dev/null @@ -1,74 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils - - -class CanePage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.SUGAR_CANE.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - -//todo update dynamically - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.caneFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Cane Farming Fortune", "§7§2Farming fortune for cane", - totalCropFF, 1746, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.caneFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.caneFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Base tool fortune", "§7§2Depends on your tools tier", - FFStats.caneFF[FFTypes.BASE] ?: 0, 50, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) -//todo change based on reforge - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.caneFF[FFTypes.REFORGE] ?: 0, 20, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.caneFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Logarithmic Counter", "§7§2Fortune from increasing crop counter\n" + - "§2You get 16☘ per digit - 4", FFStats.caneFF[FFTypes.COUNTER] ?: 0, 96, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Collection Analyst", "§7§2Fortune from increasing crop collection\n" + - "§2You get 8☘ per digit - 4", FFStats.caneFF[FFTypes.COLLECTION] ?: 0, 48, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.caneFF[FFTypes.HARVESTING] ?: 0, 75, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.caneFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Cane Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.caneFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.caneFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CarrotPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CarrotPage.kt deleted file mode 100644 index bd2204d4f..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CarrotPage.kt +++ /dev/null @@ -1,76 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils - - -class CarrotPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.CARROT.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - - //todo add rift thing at some point - -//todo update dynamically - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.carrotFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Carrot Farming Fortune", "§7§2Farming fortune for carrot", - totalCropFF, 1746, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.carrotFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.carrotFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Base tool fortune", "§7§2Depends on your tools tier", - FFStats.carrotFF[FFTypes.BASE] ?: 0, 50, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) -//todo change based on reforge - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.carrotFF[FFTypes.REFORGE] ?: 0, 20, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.carrotFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Logarithmic Counter", "§7§2Fortune from increasing crop counter\n" + - "§2You get 16☘ per digit - 4", FFStats.carrotFF[FFTypes.COUNTER] ?: 0, 96, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Collection Analyst", "§7§2Fortune from increasing crop collection\n" + - "§2You get 8☘ per digit - 4", FFStats.carrotFF[FFTypes.COLLECTION] ?: 0, 48, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.carrotFF[FFTypes.HARVESTING] ?: 0, 75, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.carrotFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Carrot Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.carrotFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.carrotFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CocoaPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CocoaPage.kt deleted file mode 100644 index f8dd977d0..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CocoaPage.kt +++ /dev/null @@ -1,64 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils - -class CocoaPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.COCOA_BEANS.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.cocoaFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Cocoa Farming Fortune", "§7§2Farming fortune for cocoa beans", - totalCropFF, 1555.5, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.cocoaFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.cocoaFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.cocoaFF[FFTypes.REFORGE] ?: 0, 16, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.cocoaFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Base tool fortune", "§7§2You get 20☘ for using the cocoa chopper", - FFStats.cocoaFF[FFTypes.BASE] ?: 0, 20, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Sunder Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.cocoaFF[FFTypes.SUNDER] ?: 0, 62.5, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.cocoaFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Cocoa Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.cocoaFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.cocoaFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt new file mode 100644 index 000000000..fdaf6ea8e --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/CropPage.kt @@ -0,0 +1,40 @@ +package at.hannibal2.skyhanni.features.garden.fortuneguide.pages +import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI +import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem +import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats +import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems +import at.hannibal2.skyhanni.features.garden.fortuneguide.FortuneStats +import at.hannibal2.skyhanni.utils.GuiRenderUtils +import at.hannibal2.skyhanni.utils.StringUtils.firstLetterUppercase + +class CropPage: FFGuideGUI.FFGuidePage() { + + override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { + for (item in FarmingItems.values()) { + if (item.name == FFGuideGUI.currentCrop?.name) { + GuiRenderUtils.renderItemAndTip(item.getItem(), FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) + } + } + + var x: Int + var y = FFGuideGUI.guiTop - 20 + var i = 0 + FFStats.cropPage.forEach { (key, value) -> + if (key == FortuneStats.CROP_TOTAL) { + val newLine = key.label.replace("Crop", FFGuideGUI.currentCrop?.name?.replace("_", " ")?.firstLetterUppercase()!!) + GuiRenderUtils.drawFarmingBar(newLine, key.tooltip, value.first, value.second, FFGuideGUI.guiLeft + 135, + FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + } else { + if (i % 2 == 0) { + x = FFGuideGUI.guiLeft + 15 + y += 25 + } else { + x = FFGuideGUI.guiLeft + 255 + } + i ++ + GuiRenderUtils.drawFarmingBar(key.label, key.tooltip, value.first, value.second, x, y, + 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + } + } + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/MelonPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/MelonPage.kt deleted file mode 100644 index 8c1d0a940..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/MelonPage.kt +++ /dev/null @@ -1,66 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName - - -class MelonPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.MELON.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.melonFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Melon Farming Fortune", "§7§2Farming fortune for melon", - totalCropFF, 1539.5, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.melonFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.melonFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.melonFF[FFTypes.REFORGE] ?: 0, 20, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.melonFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Sunder Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.melonFF[FFTypes.SUNDER] ?: 0, 62.5, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.melonFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Melon Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.melonFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.melonFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Tool Ability", "§7§2Theoretical fortune from dicer ability\n§2Is very random!", - if (FarmingItems.MELON.getItem().getInternalName().contains("DICER")) 33 else 0, 33, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/MushroomPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/MushroomPage.kt deleted file mode 100644 index 085f0c1f9..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/MushroomPage.kt +++ /dev/null @@ -1,72 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils -import at.hannibal2.skyhanni.utils.SkyBlockItemModifierUtils.getPetLevel - -//todo Daedalus axe -class MushroomPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.MUSHROOM.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.mushroomFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Mushroom Farming Fortune", "§7§2Farming fortune for mushroom", - totalCropFF, 1575, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.mushroomFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.mushroomFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.mushroomFF[FFTypes.REFORGE] ?: 0, 13, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.mushroomFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - if (FFGuideGUI.currentPet == 1) { - GuiRenderUtils.drawFarmingBar("§2Mooshroom Cow Pet", "§7§2The bonus mushrooms that the cow drops\n" - + "§2You get 1 mushroom per crop broken", FarmingItems.MOOSHROOM_COW.getItem().getPetLevel(), - 100, FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } - - GuiRenderUtils.drawFarmingBar("§2Base tool fortune", "§7§2You get 30☘ for farming the right mushroom", - FFStats.mushroomFF[FFTypes.BASE] ?: 0, 30, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.mushroomFF[FFTypes.HARVESTING] ?: 0, 75, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.mushroomFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Mushroom Enchant", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.mushroomFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.mushroomFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt index 42660970f..fcf0096a1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/OverviewPage.kt @@ -15,194 +15,183 @@ class OverviewPage: FFGuideGUI.FFGuidePage() { private var armorFF = mutableMapOf<FFTypes, Double>() override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - //todo migrate to stats page - val timeUntilCakes = TimeUtils.formatDuration(FFGuideGUI.cakeBuffTime - System.currentTimeMillis()) - - //todo change based on pet - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.drawFarmingBar("§6Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - var line = if (FFStats.baseFF[FFTypes.ANITA]!! < 0.0) "§cAnita buff not saved\n§eVisit Anita to set it!" - else "§7§2Fortune for levelling your Anita extra crops\n§2You get 2☘ per buff level" - GuiRenderUtils.drawFarmingBar("§2Anita Buff", line, FFStats.baseFF[FFTypes.ANITA] ?: 0.0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (FFStats.baseFF[FFTypes.FARMING_LVL]!! < 0.0) "§cFarming level not saved\n§eOpen /skills to set it!" - else "§7§2Fortune for levelling your farming skill\n§2You get 4☘ per farming level" - GuiRenderUtils.drawFarmingBar("§2Farming Level", line, FFStats.baseFF[FFTypes.FARMING_LVL] ?: 0.0, 240, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (FFStats.baseFF[FFTypes.COMMUNITY_SHOP]!! < 0.0) "§cCommunity upgrade level not saved\n§eVisit Elizabeth to set it!" - else "§7§2Fortune for community shop upgrades\n§2You get 4☘ per upgrade tier" - GuiRenderUtils.drawFarmingBar("§2Community upgrades", line, FFStats.baseFF[FFTypes.COMMUNITY_SHOP] ?: 0.0, - 40, FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (FFStats.baseFF[FFTypes.PLOTS]!! < 0.0) "§cUnlocked plot count not saved\n§eOpen /desk and view your plots to set it!" - else "§7§2Fortune for unlocking garden plots\n§2You get 3☘ per plot unlocked" - GuiRenderUtils.drawFarmingBar("§2Garden Plots", line, FFStats.baseFF[FFTypes.PLOTS] ?: 0.0, 72, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = when (FFGuideGUI.cakeBuffTime) { - -1L -> "§eYou have not eaten a cake since\n§edownloading this update, assuming the\n§ebuff is active!" - else -> "§7§2Fortune for eating cake\n§2You get 5☘ for eating cake\n§2Time until cake buff runs out: $timeUntilCakes" - } - if (FFGuideGUI.cakeBuffTime - System.currentTimeMillis() < 0 && FFGuideGUI.cakeBuffTime != -1L) { - line = "§cYour cake buff has run out\nGo eat some cake!" - } - GuiRenderUtils.drawFarmingBar("§2Cake Buff", line, FFStats.baseFF[FFTypes.CAKE] ?: 0.0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - val armorItem = when (currentArmor) { - 1 -> FarmingItems.HELMET - 2 -> FarmingItems.CHESTPLATE - 3 -> FarmingItems.LEGGINGS - else -> FarmingItems.BOOTS - } + val timeUntilCakes = TimeUtils.formatDuration(FFStats.cakeExpireTime - System.currentTimeMillis()) + + //todo change based on pet and based on setting + GuiRenderUtils.drawFarmingBar("§6Universal Farming Fortune", "§7§2Farming fortune in that is\n" + + "§2applied to every crop\n§eNot the same as tab FF", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + var line = if (FFStats.baseFF[FFTypes.ANITA]!! < 0.0) "§cAnita buff not saved\n§eVisit Anita to set it!" + else "§7§2Fortune for levelling your Anita extra crops\n§2You get 2☘ per buff level" + GuiRenderUtils.drawFarmingBar("§2Anita Buff", line, FFStats.baseFF[FFTypes.ANITA] ?: 0.0, 30, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (FFStats.baseFF[FFTypes.FARMING_LVL]!! < 0.0) "§cFarming level not saved\n§eOpen /skills to set it!" + else "§7§2Fortune for levelling your farming skill\n§2You get 4☘ per farming level" + GuiRenderUtils.drawFarmingBar("§2Farming Level", line, FFStats.baseFF[FFTypes.FARMING_LVL] ?: 0.0, 240, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (FFStats.baseFF[FFTypes.COMMUNITY_SHOP]!! < 0.0) "§cCommunity upgrade level not saved\n§eVisit Elizabeth to set it!" + else "§7§2Fortune for community shop upgrades\n§2You get 4☘ per upgrade tier" + GuiRenderUtils.drawFarmingBar("§2Community upgrades", line, FFStats.baseFF[FFTypes.COMMUNITY_SHOP] ?: 0.0, + 40, FFGuideGUI.guiLeft + 15, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (FFStats.baseFF[FFTypes.PLOTS]!! < 0.0) "§cUnlocked plot count not saved\n§eOpen /desk and view your plots to set it!" + else "§7§2Fortune for unlocking garden plots\n§2You get 3☘ per plot unlocked" + GuiRenderUtils.drawFarmingBar("§2Garden Plots", line, FFStats.baseFF[FFTypes.PLOTS] ?: 0.0, 72, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = when (FFStats.cakeExpireTime) { + -1L -> "§eYou have not eaten a cake since\n§edownloading this update, assuming the\n§ebuff is active!" + else -> "§7§2Fortune for eating cake\n§2You get 5☘ for eating cake\n§2Time until cake buff runs out: $timeUntilCakes" + } + if (FFStats.cakeExpireTime - System.currentTimeMillis() < 0 && FFStats.cakeExpireTime != -1L) { + line = "§cYour cake buff has run out\nGo eat some cake!" + } + GuiRenderUtils.drawFarmingBar("§2Cake Buff", line, FFStats.baseFF[FFTypes.CAKE] ?: 0.0, 5, FFGuideGUI.guiLeft + 15, + FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + val armorItem = when (currentArmor) { + 1 -> FarmingItems.HELMET + 2 -> FarmingItems.CHESTPLATE + 3 -> FarmingItems.LEGGINGS + else -> FarmingItems.BOOTS + } - armorFF = when (currentArmor) { - 1 -> FFStats.helmetFF - 2 -> FFStats.chestplateFF - 3 -> FFStats.leggingsFF - 4 -> FFStats.bootsFF - else -> FFStats.armorTotalFF - } + armorFF = when (currentArmor) { + 1 -> FFStats.helmetFF + 2 -> FFStats.chestplateFF + 3 -> FFStats.leggingsFF + 4 -> FFStats.bootsFF + else -> FFStats.armorTotalFF + } - line = if (currentArmor == 0) "§7§2Total fortune from your armor\n§2Select a piece for more info" - else "§7§2Total fortune from your\n${armorItem.getItem().displayName}" - var value = if (currentArmor == 0) { - 325 - } else if (FFStats.usingSpeedBoots) { - when (currentArmor) { - 1 -> 76.67 - 2 -> 81.67 - 3 -> 81.67 - else -> 85 - } - } else { - when (currentArmor) { - 1 -> 78.75 - 2 -> 83.75 - 3 -> 83.75 - else -> 78.75 - } + line = if (currentArmor == 0) "§7§2Total fortune from your armor\n§2Select a piece for more info" + else "§7§2Total fortune from your\n${armorItem.getItem().displayName}" + var value = if (currentArmor == 0) { + 325 + } else if (FFStats.usingSpeedBoots) { + when (currentArmor) { + 1 -> 76.67 + 2, 3 -> 81.67 + else -> 85 } - GuiRenderUtils.drawFarmingBar("§2Total Armor Fortune", line, armorFF[FFTypes.TOTAL] ?: 0, value, - FFGuideGUI.guiLeft + 135, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (currentArmor == 0) "§7§2The base fortune from your armor\n§2Select a piece for more info" - else "§7§2Base fortune from your\n${armorItem.getItem().displayName}" - value = if (currentArmor == 0) { - if (FFStats.usingSpeedBoots) 160 else 130 - } else if (currentArmor == 1) 30 - else if (currentArmor == 2) 35 - else if (currentArmor == 3) 35 - else { - if (FFStats.usingSpeedBoots) 60 else 30 + } else { + when (currentArmor) { + 1 -> 78.75 + 2, 3 -> 83.75 + else -> 78.75 } - GuiRenderUtils.drawFarmingBar("§2Base Armor Fortune", line, armorFF[FFTypes.BASE] ?: 0, - value, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (currentArmor == 0) "§7§2The fortune from your armor's ability\n§2Select a piece for more info" - else "§7§2Ability fortune from your\n${armorItem.getItem().displayName}" - value = if (FFStats.usingSpeedBoots) { - when (currentArmor) { - 0 -> 50 - 1 -> 16.67 - 2 -> 16.67 - 3 -> 16.67 - else -> 0 - } - } else { - when (currentArmor) { - 0 -> 75 - 1 -> 18.75 - 2 -> 18.75 - 3 -> 18.75 - else -> 18.75 - } + } + GuiRenderUtils.drawFarmingBar("§2Total Armor Fortune", line, armorFF[FFTypes.TOTAL] ?: 0, value, + FFGuideGUI.guiLeft + 135, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (currentArmor == 0) "§7§2The base fortune from your armor\n§2Select a piece for more info" + else "§7§2Base fortune from your\n${armorItem.getItem().displayName}" + value = if (currentArmor == 0) { + if (FFStats.usingSpeedBoots) 160 else 130 + } else if (currentArmor == 1) 30 + else if (currentArmor == 2) 35 + else if (currentArmor == 3) 35 + else { + if (FFStats.usingSpeedBoots) 60 else 30 + } + GuiRenderUtils.drawFarmingBar("§2Base Armor Fortune", line, armorFF[FFTypes.BASE] ?: 0, + value, FFGuideGUI.guiLeft + 135, + FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (currentArmor == 0) "§7§2The fortune from your armor's ability\n§2Select a piece for more info" + else "§7§2Ability fortune from your\n${armorItem.getItem().displayName}" + value = if (FFStats.usingSpeedBoots) { + when (currentArmor) { + 0 -> 50 + else -> 16.67 } - - GuiRenderUtils.drawFarmingBar("§2Armor Ability", line, armorFF[FFTypes.ABILITY] ?: 0, - value, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (currentArmor == 0) "§7§2The fortune from your armor's reforge\n§2Select a piece for more info" - else "§7§2Total fortune from your\n${armorItem.getItem().displayName}" - value = if (currentArmor == 0) { - if (FFStats.usingSpeedBoots) 115 else 120 - } else if (currentArmor == 4) { - if (FFStats.usingSpeedBoots) 25 else 30 - } else 30 - GuiRenderUtils.drawFarmingBar("§2Armor Reforge", line, armorFF[FFTypes.REFORGE] ?: 0, - value, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - val currentPet = when (FFGuideGUI.currentPet) { - 0 -> FFStats.elephantFF - 1 -> FFStats.mooshroomFF - else -> FFStats.rabbitFF + } else { + when (currentArmor) { + 0 -> 75 + else -> 18.75 } + } - GuiRenderUtils.drawFarmingBar("§2Total Pet Fortune", "§7§2The total fortune from your pet and its item", - currentPet[FFTypes.TOTAL] ?: 0, 240, FFGuideGUI.guiLeft + 105, - FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + GuiRenderUtils.drawFarmingBar("§2Armor Ability", line, armorFF[FFTypes.ABILITY] ?: 0, + value, FFGuideGUI.guiLeft + 135, + FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (currentArmor == 0) "§7§2The fortune from your armor's reforge\n§2Select a piece for more info" + else "§7§2Total fortune from your\n${armorItem.getItem().displayName}" + value = if (currentArmor == 0) { + if (FFStats.usingSpeedBoots) 115 else 120 + } else if (currentArmor == 4) { + if (FFStats.usingSpeedBoots) 25 else 30 + } else 30 + GuiRenderUtils.drawFarmingBar("§2Armor Reforge", line, armorFF[FFTypes.REFORGE] ?: 0, + value, FFGuideGUI.guiLeft + 135, + FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + val currentPet = when (FFGuideGUI.currentPet) { + FarmingItems.ELEPHANT -> FFStats.elephantFF + FarmingItems.MOOSHROOM_COW -> FFStats.mooshroomFF + else -> FFStats.rabbitFF + } - line = when (FFStats.currentPetItem) { - "GREEN_BANDANA" -> "§7§2The fortune from your pet's item\n§2Grants 4☘ per garden level" - "YELLOW_BANDANA" -> "§7§2The fortune from your pet's item" - "MINOS_RELIC" -> "§cGreen Bandana is better than relic!" - else -> "No fortune boosting pet item" - } - GuiRenderUtils.drawFarmingBar("§2Pet Item", line, currentPet[FFTypes.PET_ITEM] ?: 0, 60, FFGuideGUI.guiLeft + 185, - FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - val equipmentItem = when (currentEquipment) { - 1 -> FarmingItems.NECKLACE - 2 -> FarmingItems.CLOAK - 3 -> FarmingItems.BELT - else -> FarmingItems.BRACELET - } + GuiRenderUtils.drawFarmingBar("§2Total Pet Fortune", "§7§2The total fortune from your pet and its item", + currentPet[FFTypes.TOTAL] ?: 0, 240, FFGuideGUI.guiLeft + 105, + FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - equipmentFF = when (currentEquipment) { - 1 -> FFStats.necklaceFF - 2 -> FFStats.cloakFF - 3 -> FFStats.beltFF - 4 -> FFStats.braceletFF - else -> FFStats.equipmentTotalFF - } + line = when (FFStats.currentPetItem) { + "GREEN_BANDANA" -> "§7§2The fortune from your pet's item\n§2Grants 4☘ per garden level" + "YELLOW_BANDANA" -> "§7§2The fortune from your pet's item" + "MINOS_RELIC" -> "§cGreen Bandana is better for fortune than minos relic!" + else -> "No fortune boosting pet item" + } + GuiRenderUtils.drawFarmingBar("§2Pet Item", line, currentPet[FFTypes.PET_ITEM] ?: 0, 60, FFGuideGUI.guiLeft + 185, + FFGuideGUI.guiTop + 155, 70, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + val equipmentItem = when (currentEquipment) { + 1 -> FarmingItems.NECKLACE + 2 -> FarmingItems.CLOAK + 3 -> FarmingItems.BELT + else -> FarmingItems.BRACELET + } - line = if (currentEquipment == 0) "§7§2Total fortune from all your equipment\n§2Select a piece for more info" - else "§7§2Total fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2Total Equipment Fortune", line, equipmentFF[FFTypes.TOTAL] ?: 0, - if (currentEquipment == 0) 198 else 49.5, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (currentEquipment == 0) "§7§2The base fortune from all your equipment\n§2Select a piece for more info" - else "§7§2Total base fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2Equipment Base Fortune", line, equipmentFF[FFTypes.BASE] ?: 0, - if (currentEquipment == 0) 20 else 5, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's abilities\n§2Select a piece for more info" - else "§7§2Total ability fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2Equipment Ability", line, equipmentFF[FFTypes.ABILITY] ?: 0, - if (currentEquipment == 0) 60 else 15, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's reforges\n§2Select a piece for more info" - else "§7§2Total reforge fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2Equipment Reforge", line, equipmentFF[FFTypes.REFORGE] ?: 0, - if (currentEquipment == 0) 40 else 10, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's enchantments\n§2Select a piece for more info" - else "§7§2Total enchantment fortune from your\n${equipmentItem.getItem().displayName}" - GuiRenderUtils.drawFarmingBar("§2Equipment Enchantment", line, equipmentFF[FFTypes.GREEN_THUMB] ?: 0, - if (currentEquipment == 0) 78 else 19.5, - FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + equipmentFF = when (currentEquipment) { + 1 -> FFStats.necklaceFF + 2 -> FFStats.cloakFF + 3 -> FFStats.beltFF + 4 -> FFStats.braceletFF + else -> FFStats.equipmentTotalFF } + + line = if (currentEquipment == 0) "§7§2Total fortune from all your equipment\n§2Select a piece for more info" + else "§7§2Total fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar("§2Total Equipment Fortune", line, equipmentFF[FFTypes.TOTAL] ?: 0, + if (currentEquipment == 0) 198 else 49.5, + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (currentEquipment == 0) "§7§2The base fortune from all your equipment\n§2Select a piece for more info" + else "§7§2Total base fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar("§2Equipment Base Fortune", line, equipmentFF[FFTypes.BASE] ?: 0, + if (currentEquipment == 0) 20 else 5, + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's abilities\n§2Select a piece for more info" + else "§7§2Total ability fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar("§2Equipment Ability", line, equipmentFF[FFTypes.ABILITY] ?: 0, + if (currentEquipment == 0) 60 else 15, + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's reforges\n§2Select a piece for more info" + else "§7§2Total reforge fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar("§2Equipment Reforge", line, equipmentFF[FFTypes.REFORGE] ?: 0, + if (currentEquipment == 0) 40 else 10, + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) + + line = if (currentEquipment == 0) "§7§2The fortune from all of your equipment's enchantments\n§2Select a piece for more info" + else "§7§2Total enchantment fortune from your\n${equipmentItem.getItem().displayName}" + GuiRenderUtils.drawFarmingBar("§2Equipment Enchantment", line, equipmentFF[FFTypes.GREEN_THUMB] ?: 0, + if (currentEquipment == 0) 78 else 19.5, + FFGuideGUI.guiLeft + 255, FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) } }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/PotatoPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/PotatoPage.kt deleted file mode 100644 index b78b7170f..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/PotatoPage.kt +++ /dev/null @@ -1,74 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils - - -class PotatoPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.POTATO.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - -//todo update dynamically - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.potatoFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Potato Farming Fortune", "§7§2Farming fortune for potato", - totalCropFF, 1746, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.potatoFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.potatoFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Base tool fortune", "§7§2Depends on your tools tier", - FFStats.potatoFF[FFTypes.BASE] ?: 0, 50, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) -//todo change based on reforge - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.potatoFF[FFTypes.REFORGE] ?: 0, 20, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.potatoFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Logarithmic Counter", "§7§2Fortune from increasing crop counter\n" + - "§2You get 16☘ per digit - 4", FFStats.potatoFF[FFTypes.COUNTER] ?: 0, 96, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Collection Analyst", "§7§2Fortune from increasing crop collection\n" + - "§2You get 8☘ per digit - 4", FFStats.potatoFF[FFTypes.COLLECTION] ?: 0, 48, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.potatoFF[FFTypes.HARVESTING] ?: 0, 75, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.potatoFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Potato Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.potatoFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.potatoFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/PumpkinPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/PumpkinPage.kt deleted file mode 100644 index e4721ba68..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/PumpkinPage.kt +++ /dev/null @@ -1,66 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils -import at.hannibal2.skyhanni.utils.ItemUtils.getInternalName - - -class PumpkinPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.PUMPKIN.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.pumpkinFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Pumpkin Farming Fortune", "§7§2Farming fortune for pumpkin", - totalCropFF, 1539.5, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.pumpkinFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.pumpkinFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.pumpkinFF[FFTypes.REFORGE] ?: 0, 20, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.pumpkinFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Sunder Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.pumpkinFF[FFTypes.SUNDER] ?: 0, 62.5, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.pumpkinFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Pumpkin Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.pumpkinFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.pumpkinFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Tool Ability", "§7§2Theoretical fortune from dicer ability\n§2Is very random!", - if (FarmingItems.PUMPKIN.getItem().getInternalName().contains("DICER")) 33 else 0, 33, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt new file mode 100644 index 000000000..36f67eab6 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/UpgradePage.kt @@ -0,0 +1,78 @@ +package at.hannibal2.skyhanni.features.garden.fortuneguide.pages + +import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI +import at.hannibal2.skyhanni.features.garden.fortuneguide.FortuneUpgrades +import at.hannibal2.skyhanni.utils.GuiRenderUtils +import at.hannibal2.skyhanni.utils.ItemUtils.nameWithEnchantment +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.NEUItems +import at.hannibal2.skyhanni.utils.NumberUtil +import at.hannibal2.skyhanni.utils.StringUtils.removeColor +import net.minecraft.client.renderer.GlStateManager +import net.minecraft.util.MathHelper +import java.text.DecimalFormat + +class UpgradePage: FFGuideGUI.FFGuidePage() { + private var pageScroll = 0 + private var scrollVelocity = 0.0 + private val maxNoInputFrames = 100 + private var listLength = 0 + + override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { + val adjustedY = FFGuideGUI.guiTop + 20 + pageScroll + val inverseScale = 1 / 0.75f + + GlStateManager.scale(0.75f, 0.75f, 1f) + GuiRenderUtils.drawString("Upgrade", (FFGuideGUI.guiLeft + 45) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) + GuiRenderUtils.drawString("FF increase", (FFGuideGUI.guiLeft + 240) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) + GuiRenderUtils.drawString("Cost/FF", (FFGuideGUI.guiLeft + 290) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) + GuiRenderUtils.drawString("Total", (FFGuideGUI.guiLeft + 330) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) + GuiRenderUtils.drawString("Item", (FFGuideGUI.guiLeft + 190) * inverseScale, (FFGuideGUI.guiTop + 5) * inverseScale) + + val upgradeList = if (FFGuideGUI.currentCrop == null) FortuneUpgrades.genericUpgrades else FortuneUpgrades.cropSpecificUpgrades + listLength = upgradeList.size + for ((index, upgrade) in upgradeList.withIndex()) { + if (adjustedY + 25 * index < FFGuideGUI.guiTop + 20) continue + if (adjustedY + 25 * index > FFGuideGUI.guiTop + 160) continue + val upgradeItem = upgrade.requiredItem.let { NEUItems.getItemStack(it) } + var formattedUpgrade = upgradeItem.nameWithEnchantment ?: return + if (adjustedY + 25 * index - 5 < FFGuideGUI.lastClickedHeight && FFGuideGUI.lastClickedHeight < adjustedY + 25 * index + 10) { + FFGuideGUI.lastClickedHeight = 0 + if (!NEUItems.neuHasFocus() && !LorenzUtils.noTradeMode) { + LorenzUtils.sendCommandToServer("bz ${formattedUpgrade.removeColor()}") + } + } + if (upgrade.itemQuantity != 1) { + formattedUpgrade = "$formattedUpgrade §fx${upgrade.itemQuantity}" + } + GuiRenderUtils.drawTwoLineString(upgrade.description, (FFGuideGUI.guiLeft + 15) * inverseScale, (adjustedY + 25 * index) * inverseScale) + GuiRenderUtils.drawString("§a${DecimalFormat("0.##").format(upgrade.fortuneIncrease)}", (FFGuideGUI.guiLeft + 270) * inverseScale, (adjustedY + 25 * index) * inverseScale) + GuiRenderUtils.drawString("§6" + upgrade.costPerFF?.let { NumberUtil.format(it) }, (FFGuideGUI.guiLeft + 300) * inverseScale, (adjustedY + 25 * index) * inverseScale) + GuiRenderUtils.drawString(("§6" + upgrade.cost?.let { NumberUtil.format(it) }), (FFGuideGUI.guiLeft + 335) * inverseScale, (adjustedY + 25 * index) * inverseScale) + GuiRenderUtils.drawString(formattedUpgrade, (FFGuideGUI.guiLeft + 180) * inverseScale, (adjustedY + 25 * index) * inverseScale) + GuiRenderUtils.renderItemAndTip(upgradeItem, (FFGuideGUI.guiLeft + 155) * inverseScale, (adjustedY + 25 * index - 5) * inverseScale, + mouseX * inverseScale, mouseY * inverseScale, 0x00FFFFFF) + } + GlStateManager.scale(inverseScale, inverseScale, 1f) + scrollScreen() + } + + private fun scrollScreen() { + scrollVelocity += FFGuideGUI.lastMouseScroll / 48.0 + scrollVelocity *= 0.95 + pageScroll += scrollVelocity.toInt() + FFGuideGUI.lastMouseScroll / 24 + + FFGuideGUI.noMouseScrollFrames++ + + if (FFGuideGUI.noMouseScrollFrames >= maxNoInputFrames) { + scrollVelocity *= 0.75 + } + + if (pageScroll > 0) { + pageScroll = 0 + } + + pageScroll = MathHelper.clamp_int(pageScroll, -(listLength * 15 - 15), 0) + FFGuideGUI.lastMouseScroll = 0 + } +}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/WartPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/WartPage.kt deleted file mode 100644 index 1a14a0768..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/WartPage.kt +++ /dev/null @@ -1,74 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils - - -class WartPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.NETHER_WART.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - -//todo update dynamically - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.wartFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Wart Farming Fortune", "§7§2Farming fortune for nether wart", - totalCropFF, 1746, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.wartFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.wartFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Base tool fortune", "§7§2Depends on your tools tier", - FFStats.wartFF[FFTypes.BASE] ?: 0, 50, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) -//todo change based on reforge - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.wartFF[FFTypes.REFORGE] ?: 0, 20, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.wartFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Logarithmic Counter", "§7§2Fortune from increasing crop counter\n" + - "§2You get 16☘ per digit - 4", FFStats.wartFF[FFTypes.COUNTER] ?: 0, 96, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Collection Analyst", "§7§2Fortune from increasing crop collection\n" + - "§2You get 8☘ per digit - 4", FFStats.wartFF[FFTypes.COLLECTION] ?: 0, 48, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.wartFF[FFTypes.HARVESTING] ?: 0, 75, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.wartFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Warts Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.wartFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.wartFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/WheatPage.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/WheatPage.kt deleted file mode 100644 index 55c64525d..000000000 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/fortuneguide/pages/WheatPage.kt +++ /dev/null @@ -1,74 +0,0 @@ -package at.hannibal2.skyhanni.features.garden.fortuneguide.pages - -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI.Companion.getItem -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFStats -import at.hannibal2.skyhanni.features.garden.fortuneguide.FFTypes -import at.hannibal2.skyhanni.features.garden.fortuneguide.FarmingItems -import at.hannibal2.skyhanni.utils.GuiRenderUtils - - -class WheatPage: FFGuideGUI.FFGuidePage() { - override fun drawPage(mouseX: Int, mouseY: Int, partialTicks: Float) { - if (FFGuideGUI.breakdownMode) { - GuiRenderUtils.renderItemAndTip(FarmingItems.WHEAT.getItem(), - FFGuideGUI.guiLeft + 172, FFGuideGUI.guiTop + 60, mouseX, mouseY) - -//todo update dynamically - val totalCropFF = FFStats.totalBaseFF[FFTypes.TOTAL]!! + FFStats.wheatFF[FFTypes.TOTAL]!! - GuiRenderUtils.drawFarmingBar("§6Wheat Farming Fortune", "§7§2Farming fortune for wheat", - totalCropFF, 1746, FFGuideGUI.guiLeft + 135, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Universal Farming Fortune", "§7§2Farming fortune in that is\n" + - "§2applied to every crop", FFStats.totalBaseFF[FFTypes.TOTAL] ?: 0, 1250, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Talisman Bonus", "§7§2Fortune from your talisman\n" + - "§2You get 10☘ per talisman tier", FFStats.wheatFF[FFTypes.ACCESSORY] ?: 0, 30, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Crop Upgrade", "§7§2Fortune from Desk crop upgrades\n" + - "§2You get 5☘ per level", FFStats.wheatFF[FFTypes.CROP_UPGRADE] ?: 0, 45, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Base tool fortune", "§7§2Depends on your tools tier", - FFStats.wheatFF[FFTypes.BASE] ?: 0, 50, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) -//todo change based on reforge - GuiRenderUtils.drawFarmingBar("§2Tool reforge", "§7§2Fortune from reforging your tool", - FFStats.wheatFF[FFTypes.REFORGE] ?: 0, 20, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Farming for Dummies", "§7§2Fortune for each applied book\n" + - "§2You get 1☘ per applied book", FFStats.wheatFF[FFTypes.FFD] ?: 0, 5, FFGuideGUI.guiLeft + 15, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Logarithmic Counter", "§7§2Fortune from increasing crop counter\n" + - "§2You get 16☘ per digit - 4", FFStats.wheatFF[FFTypes.COUNTER] ?: 0, 96, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 5, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Collection Analyst", "§7§2Fortune from increasing crop collection\n" + - "§2You get 8☘ per digit - 4", FFStats.wheatFF[FFTypes.COLLECTION] ?: 0, 48, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 30, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Harvesting Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 12.5☘ per level", FFStats.wheatFF[FFTypes.HARVESTING] ?: 0, 75, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 55, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Cultivating Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 1☘ per level", FFStats.wheatFF[FFTypes.CULTIVATING] ?: 0, 10, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 80, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Turbo-Wheat Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2You get 5☘ per level", FFStats.wheatFF[FFTypes.TURBO] ?: 0, 25, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 105, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - - GuiRenderUtils.drawFarmingBar("§2Dedication Enchantment", "§7§2Fortune for each enchantment level\n" + - "§2and crop milestone", FFStats.wheatFF[FFTypes.DEDICATION] ?: 0, 92, FFGuideGUI.guiLeft + 255, - FFGuideGUI.guiTop + 130, 90, mouseX, mouseY, FFGuideGUI.tooltipToDisplay) - } else { - return - } - } -}
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt index a4dbede9d..6d9a4f94f 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/GuiRenderUtils.kt @@ -1,7 +1,6 @@ package at.hannibal2.skyhanni.utils import at.hannibal2.skyhanni.features.garden.fortuneguide.FFGuideGUI -import at.hannibal2.skyhanni.utils.LorenzUtils.round import net.minecraft.client.Minecraft import net.minecraft.client.gui.FontRenderer import net.minecraft.client.gui.GuiScreen @@ -31,6 +30,39 @@ object GuiRenderUtils { Minecraft.getMinecraft().fontRendererObj.drawString(str, x, y, 0xffffff, true) } + fun drawString(str: String, x: Int, y: Int) { + Minecraft.getMinecraft().fontRendererObj.drawString(str, x.toFloat(), y.toFloat(), 0xffffff, true) + } + + fun drawTwoLineString(str: String, x: Float, y: Float) { + val desiredSplitIndex = str.length / 2 + var splitIndex = -1 + var lastColorCode = "" + + for (i in desiredSplitIndex downTo 0) { + if (str[i] == ' ') { + splitIndex = i + break + } + } + + if (splitIndex == -1) { + splitIndex = desiredSplitIndex + } + for (i in 0 until desiredSplitIndex) { + if (str[i] == '§' && i + 1 < str.length) { + lastColorCode = str.substring(i, i + 2) + } + } + + val firstString = str.substring(0, splitIndex).trim() + val secondString = lastColorCode + str.substring(splitIndex).trim() + + Minecraft.getMinecraft().fontRendererObj.drawString(firstString, x, y - 5, 0xffffff, true) + Minecraft.getMinecraft().fontRendererObj.drawString(secondString, x, y + 5, 0xffffff, true) + + } + fun drawStringCentered(str: String?, x: Int, y: Int) { drawStringCentered( str, @@ -141,6 +173,10 @@ object GuiRenderUtils { } } + fun renderItemAndTip(item: ItemStack?, x: Float, y: Float, mouseX: Float, mouseY: Float, color: Int = 0xFF43464B.toInt()) { + renderItemAndTip(item, x.toInt(), y.toInt(), mouseX.toInt(), mouseY.toInt(), color) + } + // assuming 70% font size fun drawFarmingBar( label: String, @@ -167,17 +203,17 @@ object GuiRenderUtils { } val filledWidth = (width * barProgress).toInt() - val current = DecimalFormat("0.##").format(currentVal.round(2)) + val current = DecimalFormat("0.##").format(currentVal) val progressPercentage = (barProgress * 10000).roundToInt() / 100 val inverseScale = 1 / textScale val textWidth: Int = Minecraft.getMinecraft().fontRendererObj.getStringWidth("$progressPercentage%") val barColor = barColorGradient(barProgress) - GlStateManager.scale(textScale, textScale, textScale) + GlStateManager.scale(textScale, textScale, 1f) drawString(label, xPos * inverseScale, yPos * inverseScale) - drawString("§2$current / $maxValue☘", xPos * inverseScale, (yPos + 8) * inverseScale) + drawString("§2$current / ${DecimalFormat("0.#").format(maxValue)}☘", xPos * inverseScale, (yPos + 8) * inverseScale) drawString("§2$progressPercentage%", (xPos + width - textWidth * textScale) * inverseScale, (yPos + 8) * inverseScale) - GlStateManager.scale(inverseScale, inverseScale, inverseScale) + GlStateManager.scale(inverseScale, inverseScale, 1f) GuiScreen.drawRect(xPos, yPos + 16, xPos + width, yPos + 20, 0xFF43464B.toInt()) GuiScreen.drawRect(xPos + 1, yPos + 17, xPos + width - 1, yPos + 19, barColor.darkenColor()) @@ -204,5 +240,4 @@ object GuiRenderUtils { val color = Color(this) return Color(color.red / 5, color.green / 5, color.blue / 5).rgb } - }
\ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt index f36f9a60c..e9adfe055 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt @@ -135,6 +135,22 @@ object ItemUtils { .getTagList("textures", Constants.NBT.TAG_COMPOUND).getCompoundTagAt(0).getString("Value") } + fun ItemStack.getItemRarity(): Int { + //todo make into an enum in future + return when (this.getLore().lastOrNull()?.take(4)) { + "§f§l" -> 0 // common + "§a§l" -> 1 // uncommon + "§9§l" -> 2 // rare + "§5§l" -> 3 // epic + "§6§l" -> 4 // legendary + "§d§l" -> 5 // mythic + "§b§l" -> 6 // divine + "§4§l" -> 7 // supreme + "§c§l" -> 8 // special/very special + else -> -1 // unknown + } + } + //extra method for shorter name and kotlin nullability logic var ItemStack.name: String? get() = this.displayName |