From 26b2c0d7268598d1d21d1a9f2dd860497d7e1297 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 24 Jan 2023 02:59:44 +0100 Subject: Hide mini boss quest the same logic as miniboss --- .../dailyquest/DailyQuestHelper.kt | 13 ++++++------ .../miniboss/DailyMiniBossHelper.kt | 24 +++++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) (limited to 'src') 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 getQuest() = quests.filterIsInstance().firstOrNull() + inline fun getQuest() = quests.filterIsInstance().firstOrNull() private fun checkInventoryForFetchItem() { val fetchQuest = getQuest() ?: 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() + if (bossQuest != null) { + if (bossQuest.miniBoss == miniBoss) { + if (bossQuest.state == QuestState.ACCEPTED) { + return true + } } } + + return false } private fun finished(miniBoss: CrimsonMiniBoss) { -- cgit