aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-24 02:59:44 +0100
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2023-01-24 02:59:44 +0100
commit26b2c0d7268598d1d21d1a9f2dd860497d7e1297 (patch)
tree59ab01409e8e86e26de3c7293520c0d000dfc486 /src
parent26a964ec4f4008a7a89aba3936fe74fafb5966b5 (diff)
downloadskyhanni-26b2c0d7268598d1d21d1a9f2dd860497d7e1297.tar.gz
skyhanni-26b2c0d7268598d1d21d1a9f2dd860497d7e1297.tar.bz2
skyhanni-26b2c0d7268598d1d21d1a9f2dd860497d7e1297.zip
Hide mini boss quest the same logic as miniboss
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt13
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt24
2 files changed, 26 insertions, 11 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
index d31f29396..949963414 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/dailyquest/DailyQuestHelper.kt
@@ -158,7 +158,7 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) {
}
}
- private inline fun <reified T : Quest> getQuest() = quests.filterIsInstance<T>().firstOrNull()
+ inline fun <reified T : Quest> getQuest() = quests.filterIsInstance<T>().firstOrNull()
private fun checkInventoryForFetchItem() {
val fetchQuest = getQuest<FetchQuest>() ?: return
@@ -214,11 +214,12 @@ class DailyQuestHelper(val reputationHelper: CrimsonIsleReputationHelper) {
if (!SkyHanniMod.feature.misc.crimsonIsleReputationLocation) return
for (quest in quests) {
- if (quest.state == QuestState.ACCEPTED) {
- val location = quest.location ?: continue
- event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
- event.drawDynamicText(location, quest.displayName, 1.5)
- }
+ if (quest is MiniBossQuest) continue
+ if (quest.state != QuestState.ACCEPTED) continue
+ val location = quest.location ?: continue
+
+ event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
+ event.drawDynamicText(location, quest.displayName, 1.5)
}
}
diff --git a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
index a43c10758..2b4ee6eea 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/nether/reputationhelper/miniboss/DailyMiniBossHelper.kt
@@ -6,6 +6,8 @@ import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager
import at.hannibal2.skyhanni.features.nether.reputationhelper.CrimsonIsleReputationHelper
+import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.MiniBossQuest
+import at.hannibal2.skyhanni.features.nether.reputationhelper.dailyquest.quest.QuestState
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LorenzColor
@@ -44,14 +46,26 @@ class DailyMiniBossHelper(private val reputationHelper: CrimsonIsleReputationHel
val playerLocation = LocationUtils.playerLocation()
for (miniBoss in miniBosses) {
- if (!miniBoss.doneToday) {
- val location = miniBoss.location ?: continue
- if (DamageIndicatorManager.getNearestDistanceTo(location) < 40 && playerLocation.distance(location) < 40) continue
+ if (miniBoss.doneToday && !needMiniBossQuest(miniBoss)) continue
+ val location = miniBoss.location ?: continue
+ if (DamageIndicatorManager.getNearestDistanceTo(location) < 40 && playerLocation.distance(location) < 40) continue
- event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
- event.drawDynamicText(location, miniBoss.displayName, 1.5)
+ event.drawWaypointFilled(location, LorenzColor.WHITE.toColor())
+ event.drawDynamicText(location, miniBoss.displayName, 1.5)
+ }
+ }
+
+ private fun needMiniBossQuest(miniBoss: CrimsonMiniBoss): Boolean {
+ val bossQuest = reputationHelper.questHelper.getQuest<MiniBossQuest>()
+ if (bossQuest != null) {
+ if (bossQuest.miniBoss == miniBoss) {
+ if (bossQuest.state == QuestState.ACCEPTED) {
+ return true
+ }
}
}
+
+ return false
}
private fun finished(miniBoss: CrimsonMiniBoss) {