summaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt34
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt39
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt (renamed from src/main/java/at/hannibal2/skyhanni/features/minion/MinionCraftHelper.kt)12
3 files changed, 59 insertions, 26 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt
index f1c87bf15..824fd7942 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoCardDisplay.kt
@@ -27,6 +27,11 @@ class BingoCardDisplay {
private var tick = 0
private val display = mutableListOf<String>()
+ private val config get() = SkyHanniMod.feature.bingo
+
+ init {
+ update()
+ }
companion object {
val personalGoals = mutableListOf<PersonalGoal>()
@@ -48,6 +53,7 @@ class BingoCardDisplay {
@SubscribeEvent
fun onTick(event: TickEvent.ClientTickEvent) {
if (!LorenzUtils.isBingoProfile) return
+ if (!config.cardDisplay) return
if (event.phase != TickEvent.Phase.START) return
tick++
@@ -117,13 +123,17 @@ class BingoCardDisplay {
display.clear()
display.add("Community Goals")
- communityGoals.mapTo(display) { " " + it.description + if (it.done) " §aDONE" else "" }
-
- val todo = personalGoals.filter { !it.done }
- val done = MAX_PERSONAL_GOALS - todo.size
- display.add(" ")
- display.add("Personal Goals: ($done/$MAX_PERSONAL_GOALS done)")
- todo.mapTo(display) { " " + it.description }
+ if (communityGoals.isEmpty()) {
+ display.add("§7Open the §e/bingo §7card.")
+ } else {
+ communityGoals.mapTo(display) { " " + it.description + if (it.done) " §aDONE" else "" }
+
+ val todo = personalGoals.filter { !it.done }
+ val done = MAX_PERSONAL_GOALS - todo.size
+ display.add(" ")
+ display.add("Personal Goals: ($done/$MAX_PERSONAL_GOALS done)")
+ todo.mapTo(display) { " " + it.description }
+ }
}
private var lastSneak = false
@@ -132,7 +142,7 @@ class BingoCardDisplay {
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) {
if (!LorenzUtils.isBingoProfile) return
- if (!SkyHanniMod.feature.bingo.bingoCard) return
+ if (!config.cardDisplay) return
val stack = Minecraft.getMinecraft().thePlayer.heldItem //TODO into ItemUtils or InventoryUtils
if (ItemUtils.isSkyBlockMenuItem(stack)) {
@@ -147,18 +157,22 @@ class BingoCardDisplay {
}
}
}
+ if (!config.stepHelper && displayMode == 1) {
+ displayMode = 0
+ }
if (displayMode == 0) {
if (Minecraft.getMinecraft().currentScreen !is GuiChat) {
- SkyHanniMod.feature.bingo.bingoCardPos.renderStrings(display)
+ config.bingoCardPos.renderStrings(display)
}
} else if (displayMode == 1) {
- SkyHanniMod.feature.bingo.bingoCardPos.renderStrings(BingoNextStepHelper.currentHelp)
+ config.bingoCardPos.renderStrings(BingoNextStepHelper.currentHelp)
}
}
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
if (!LorenzUtils.isBingoProfile) return
+ if (!config.cardDisplay) return
val message = event.message
//§6§lBINGO GOAL COMPLETE! §r§eRaw Salmon Collector
diff --git a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt
index b0ec44f02..91b5b9bd6 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/BingoNextStepHelper.kt
@@ -1,5 +1,6 @@
package at.hannibal2.skyhanni.features.bingo
+import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.data.SkillExperience
import at.hannibal2.skyhanni.events.LorenzChatEvent
@@ -20,6 +21,8 @@ class BingoNextStepHelper {
private val itemIslandRequired = mutableMapOf<String, IslandVisitStep>()
private val itemRequired = mutableMapOf<String, NextStep>()
private val islands = mutableMapOf<IslandType, IslandVisitStep>()
+ private val collectionPattern = Pattern.compile("Reach ([0-9]+(?:,\\d+)*) (.*) Collection\\.")
+ private val crystalPattern = Pattern.compile("Obtain a (\\w+) Crystal in the Crystal Hollows\\.")
companion object {
private val finalSteps = mutableListOf<NextStep>()
@@ -39,7 +42,12 @@ class BingoNextStepHelper {
}
currentHelp.clear()
- currentHelp.add("Bingo Helper:")
+ currentHelp.add("Bingo Step Helper:")
+
+ if (currentSteps.isEmpty()) {
+ currentHelp.add("§7Open the §e/bingo §7card.")
+ }
+
for (currentStep in currentSteps) {
val text = getName(currentStep)
currentHelp.add(" §7$text")
@@ -92,6 +100,7 @@ class BingoNextStepHelper {
@SubscribeEvent
fun onTick(event: TickEvent.ClientTickEvent) {
if (!LorenzUtils.isBingoProfile) return
+ if (!SkyHanniMod.feature.bingo.cardDisplay) return
if (event.phase != TickEvent.Phase.START) return
tick++
@@ -106,7 +115,8 @@ class BingoNextStepHelper {
@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
- if (!LorenzUtils.inSkyBlock) return
+ if (!LorenzUtils.isBingoProfile) return
+ if (!SkyHanniMod.feature.bingo.cardDisplay) return
//TODO add thys message
// if (event.message == "thys message") {
@@ -148,7 +158,9 @@ class BingoNextStepHelper {
done = true
updateResult()
if (!silent) {
- LorenzUtils.chat("§e[SkyHanni] A bingo goal step is done! ($displayName)")
+ if (SkyHanniMod.feature.bingo.stepHelper) {
+ LorenzUtils.chat("§e[SkyHanni] A bingo goal step is done! ($displayName)")
+ }
}
}
@@ -177,11 +189,10 @@ class BingoNextStepHelper {
for (goal in personalGoals) {
val description = goal.description.removeColor()
- val pattern = Pattern.compile("Reach ([0-9]+(?:,\\d+)*) (.*) Collection\\.")
- val matcher = pattern.matcher(description)
- if (matcher.matches()) {
- val amount = matcher.group(1).replace(",", "").toInt()
- val name = matcher.group(2)
+ val collectionMatcher = collectionPattern.matcher(description)
+ if (collectionMatcher.matches()) {
+ val amount = collectionMatcher.group(1).replace(",", "").toInt()
+ val name = collectionMatcher.group(2)
val collectionStep = CollectionStep(name, amount).apply { finalSteps.add(this) }
createItemIslandRequirement(name, collectionStep)
@@ -201,7 +212,12 @@ class BingoNextStepHelper {
"Jacob's Ticket",
32,
mapOf("Jacob's Ticket" to 1)
- ).apply { this requires IslandType.HUB.getStep() }.addItemRequirements()
+ ).apply { this requires IslandType.GARDEN.getStep() }.addItemRequirements()
+ }
+ val crystalMatcher = crystalPattern.matcher(description)
+ if (crystalMatcher.matches()) {
+ val crystal = crystalMatcher.group(1)
+ ChatMessageStep("Obtain a $crystal Crystal").apply { finalSteps.add(this) } requires IslandType.CRYSTAL_HOLLOWS.getStep()
}
println("No help for goal: '$description'")
@@ -269,11 +285,14 @@ class BingoNextStepHelper {
IslandType.DWARVEN_MINES.getStep() requires SkillLevelStep("Mining", 12)
IslandType.CRYSTAL_HOLLOWS.getStep() requires IslandType.DWARVEN_MINES.getStep()
+ // TODO add skyblock level requirement
+// IslandType.GARDEN.getStep() requires SkyBlockLevelStep(6)
+ IslandType.GARDEN.getStep() requires IslandType.HUB.getStep()
+
val farmingContest = ChatMessageStep("Farming Contest")
farmingContest requires SkillLevelStep("Farming", 10)
itemRequired["Jacob's Ticket"] = farmingContest
-
// enchantedCharcoal(7)
// compactor(7)
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCraftHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt
index 52b38e742..c0ae5d6fa 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionCraftHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/bingo/MinionCraftHelper.kt
@@ -1,4 +1,4 @@
-package at.hannibal2.skyhanni.features.minion
+package at.hannibal2.skyhanni.features.bingo
import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.SendTitleHelper
@@ -44,8 +44,8 @@ class MinionCraftHelper {
@SubscribeEvent
fun onTick(event: TickEvent.ClientTickEvent) {
if (event.phase != TickEvent.Phase.START) return
- if (!LorenzUtils.inSkyBlock) return
- if (!SkyHanniMod.feature.minions.minionCraftHelperEnabled) return
+ if (!LorenzUtils.isBingoProfile) return
+ if (!SkyHanniMod.feature.bingo.minionCraftHelperEnabled) return
tick++
@@ -207,10 +207,10 @@ class MinionCraftHelper {
@SubscribeEvent
fun onRenderOverlay(event: GuiRenderEvent.GameOverlayRenderEvent) {
- if (!LorenzUtils.inSkyBlock) return
- if (!SkyHanniMod.feature.minions.minionCraftHelperEnabled) return
+ if (!LorenzUtils.isBingoProfile) return
+ if (!SkyHanniMod.feature.bingo.minionCraftHelperEnabled) return
- SkyHanniMod.feature.minions.minionCraftHelperPos.renderStrings(display, center = true)
+ SkyHanniMod.feature.bingo.minionCraftHelperPos.renderStrings(display, center = true)
}
private fun getRecipes(minionId: String): List<NeuRecipe> {