Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Easter Egg Hunt Waypoints #1193

Merged
merged 4 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/main/java/at/hannibal2/skyhanni/SkyHanniMod.kt
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ import at.hannibal2.skyhanni.features.event.diana.SoopyGuessBurrow
import at.hannibal2.skyhanni.features.event.jerry.HighlightJerries
import at.hannibal2.skyhanni.features.event.jerry.frozentreasure.FrozenTreasureTracker
import at.hannibal2.skyhanni.features.event.lobby.waypoints.christmas.PresentWaypoints
import at.hannibal2.skyhanni.features.event.lobby.waypoints.easter.EasterEggWaypoints
import at.hannibal2.skyhanni.features.event.lobby.waypoints.halloween.BasketWaypoints
import at.hannibal2.skyhanni.features.event.spook.TheGreatSpook
import at.hannibal2.skyhanni.features.event.winter.JyrreTimer
Expand Down Expand Up @@ -608,6 +609,7 @@ class SkyHanniMod {
loadModule(TiaRelayHelper())
loadModule(TiaRelayWaypoints())
loadModule(BasketWaypoints())
loadModule(EasterEggWaypoints())
loadModule(BingoCardDisplay())
loadModule(BingoNextStepHelper())
loadModule(MinionCraftHelper())
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package at.hannibal2.skyhanni.config.features.event.waypoints;

import at.hannibal2.skyhanni.config.FeatureToggle;
import com.google.gson.annotations.Expose;
import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean;
import io.github.moulberry.moulconfig.annotations.ConfigOption;

public class EasterEggConfig {

@Expose
@ConfigOption(name = "Egg Waypoints", desc = "Show all Easter Egg waypoints.\nShoutout to §bSorkoPiko §7for the coordinates.\n(AS OF 2024)")
@ConfigEditorBoolean
@FeatureToggle
public boolean allWaypoints = false;

@Expose
@ConfigOption(name = "Entrance Waypoints", desc = "Show helper waypoints to Baskets #18, #27, and #30. Coordinates by §bSorkoPiko§7 and §bErymanthus§7.")
@ConfigEditorBoolean
public boolean allEntranceWaypoints = false;

@Expose
@ConfigOption(name = "Only Closest", desc = "Only show the closest waypoint.")
@ConfigEditorBoolean
public boolean onlyClosest = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@

public class LobbyWaypointsConfig {

@Expose
@ConfigOption(name = "Easter Egg Waypoints", desc = "")
@Accordion
public EasterEggConfig easterEgg = new EasterEggConfig();

@Expose
@ConfigOption(name = "Halloween Basket Waypoints", desc = "")
@Accordion
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package at.hannibal2.skyhanni.features.event.lobby.waypoints.easter

import at.hannibal2.skyhanni.utils.LorenzVec

enum class EasterEgg(val eggName: String, val waypoint: LorenzVec) {
EASTER_EGG_1("#1", LorenzVec(-47, 94, -3)),
EASTER_EGG_2("#2", LorenzVec(-20, 86, -70)),
EASTER_EGG_3("#3", LorenzVec(24, 62, -38)),
EASTER_EGG_4("#4", LorenzVec(-38, 56, 195)),
EASTER_EGG_5("#5", LorenzVec(-67, 82, 98)),
EASTER_EGG_6("#6", LorenzVec(-91, 61, 140)),
EASTER_EGG_7("#7", LorenzVec(103, 56, 194)),
EASTER_EGG_8("#8", LorenzVec(81, 68, 108)),
EASTER_EGG_9("#9", LorenzVec(10, 65, 58)),
EASTER_EGG_10("#10", LorenzVec(9, 53, 249)),
EASTER_EGG_11("#11", LorenzVec(216, 51, 93)),
EASTER_EGG_12("#12", LorenzVec(113, 45, 161)),
EASTER_EGG_13("#13", LorenzVec(133, 51, -8)),
EASTER_EGG_14("#14", LorenzVec(141, 73, 3)),
EASTER_EGG_15("#15", LorenzVec(107, 68, -9)),
EASTER_EGG_16("#16", LorenzVec(167, 60, -42)),
EASTER_EGG_17("#17", LorenzVec(58, 65, -2)),
EASTER_EGG_18("#18", LorenzVec(118, 51, -85)), // 158, 68, -81 entrance
EASTER_EGG_19("#19", LorenzVec(197, 60, 17)),
EASTER_EGG_20("#20", LorenzVec(-136, 85, -16)),
EASTER_EGG_21("#21", LorenzVec(-161, 57, -97)),
EASTER_EGG_22("#22", LorenzVec(-138, 74, -133)),
EASTER_EGG_23("#23", LorenzVec(-5, 77, -176)),
EASTER_EGG_24("#24", LorenzVec(67, 60, -170)),
EASTER_EGG_25("#25", LorenzVec(-177, 58, 70)),
EASTER_EGG_26("#26", LorenzVec(-141, 102, -15)),
EASTER_EGG_27("#27", LorenzVec(9, 32, 3)), // 11, 62, 0 entrance
EASTER_EGG_28("#28", LorenzVec(150, 28, 19)),
EASTER_EGG_29("#29", LorenzVec(47, 37, 52)),
EASTER_EGG_30("#30 (get your code first!)", LorenzVec(-28, 11, 123)),
;

var found = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
package at.hannibal2.skyhanni.features.event.lobby.waypoints.easter

import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.HypixelData
import at.hannibal2.skyhanni.data.ScoreboardData
import at.hannibal2.skyhanni.events.LorenzChatEvent
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.events.LorenzTickEvent
import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled
import at.hannibal2.skyhanni.utils.LocationUtils.distanceSqToPlayer
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
import at.hannibal2.skyhanni.utils.RenderUtils.drawDynamicText
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent

class EasterEggWaypoints {

private val config get() = SkyHanniMod.feature.event.lobbyWaypoints.easterEgg
private var closest: EasterEgg? = null
private var isEgg: Boolean = false

@SubscribeEvent
fun onChat(event: LorenzChatEvent) {
if (!config.allWaypoints && !config.allEntranceWaypoints) return
if (!isEgg) return

if (!HypixelData.hypixelLive) return
if (LorenzUtils.inSkyBlock) return

val message = event.message
if (message.startsWith("§a§lYou found an Easter Egg! §r") || message == "§aYou have received the §bsuper reward§a!" || message == "§cYou already found this egg!") {
val egg = EasterEgg.entries.minByOrNull { it.waypoint.distanceSqToPlayer() }!!
egg.found = true
if (closest == egg) {
closest = null
}
}
}

@SubscribeEvent
fun onTick(event: LorenzTickEvent) {
if (!config.allWaypoints && !config.allEntranceWaypoints) return
if (!HypixelData.hypixelLive) return // don't show outside live hypixel network (it's disabled on alpha)
if (LorenzUtils.inSkyBlock) return

if (event.repeatSeconds(1)) {
isEgg = checkScoreboardEasterSpecific()
}

if (isEgg) {
if (config.onlyClosest) {
if (closest == null) {
val notFoundEggs = EasterEgg.entries.filter { !it.found }
if (notFoundEggs.isEmpty()) return
closest = notFoundEggs.minByOrNull { it.waypoint.distanceSqToPlayer() }!!
}
}
}
}

@SubscribeEvent
fun onRenderWorld(event: LorenzRenderWorldEvent) {
if (!HypixelData.hypixelLive) return // don't show outside live hypixel network (it's disabled on alpha)
if (LorenzUtils.inSkyBlock) return
if (!isEgg) return

if (config.allWaypoints) {
for (egg in EasterEgg.entries) {
if (!egg.shouldShow()) continue
event.drawWaypointFilled(egg.waypoint, LorenzColor.AQUA.toColor())
event.drawDynamicText(egg.waypoint, "§3" + egg.eggName, 1.5)
}
}

if (config.allEntranceWaypoints) {
for (eggEntrance in EggEntrances.entries) {
if (!eggEntrance.easterEgg.any { it.shouldShow() }) continue
event.drawWaypointFilled(eggEntrance.waypoint, LorenzColor.YELLOW.toColor())
event.drawDynamicText(eggEntrance.waypoint, "§e" + eggEntrance.eggEntranceName, 1.5)
}
return
}

if (LorenzUtils.skyBlockArea == "?") return
}

private fun EasterEgg.shouldShow(): Boolean {
if (found) {
return false
}

return if (config.onlyClosest) closest == this else true
}

// TODO use regex with the help of knowing the original lore. Will most likely need to wait until next egg event

/*
Title:
§e§lHYPIXEL

'§703/14/24 §8L30A'
' '
'Rank: §bMVP§d+§b'
'Achievements: §e5,370'
'Hypixel Level: 140'
' '
'Lobby: §a5'
'Players: §a32,791'
' '
'§bEaster 2024'
'Event Level: §31'
'Easter Eggs: §a0/§a30'
' '
'§ewww.hypixel.net'
*/
private fun checkScoreboardEasterSpecific(): Boolean {
val a = ScoreboardData.sidebarLinesFormatted.any { it.contains("Hypixel Level") }
val b = ScoreboardData.sidebarLinesFormatted.any { it.contains("Easter") }
val c = ScoreboardData.sidebarLinesFormatted.any { it.contains("Easter Eggs") }
return a && b && c
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package at.hannibal2.skyhanni.features.event.lobby.waypoints.easter

import at.hannibal2.skyhanni.utils.LorenzVec

enum class EggEntrances(
RayDeeUx marked this conversation as resolved.
Show resolved Hide resolved
val eggEntranceName: String,
val waypoint: LorenzVec,
vararg val easterEgg: EasterEgg,
) {

EASTER_EGG_ENTER_12_13_1_28_1("#12, #13, #28 (tunnel)", LorenzVec(126, 52, 175), EasterEgg.EASTER_EGG_12, EasterEgg.EASTER_EGG_13, EasterEgg.EASTER_EGG_28),
EASTER_EGG_ENTER_13_2("#13 (keep going, stay on your left [<--])", LorenzVec(144, 30, 19), EasterEgg.EASTER_EGG_13),
EASTER_EGG_ENTER_13_3("#13 (enter here)", LorenzVec(107, 42, -47), EasterEgg.EASTER_EGG_13),
EASTER_EGG_ENTER_13_4("#13 (straight ahead, don't take the stairs)", LorenzVec(105, 49, -34), EasterEgg.EASTER_EGG_13),
EASTER_EGG_ENTER_14_1("#14 (enter here)", LorenzVec(159, 68, -25), EasterEgg.EASTER_EGG_14),
EASTER_EGG_ENTER_14_2("#14 (right turn [-->] here)", LorenzVec(153, 68, -8), EasterEgg.EASTER_EGG_14),
EASTER_EGG_ENTER_14_3("#14 (left turn [<--] here)", LorenzVec(143, 68, -8), EasterEgg.EASTER_EGG_14),
EASTER_EGG_ENTER_18_1("#18 (down this well)", LorenzVec(158, 67, -82), EasterEgg.EASTER_EGG_18),
EASTER_EGG_ENTER_18_2("#18 (through this painting)", LorenzVec(142, 56, -82), EasterEgg.EASTER_EGG_18),
EASTER_EGG_ENTER_21("#21 (through the waterfall)", LorenzVec(-137, 64, -82), EasterEgg.EASTER_EGG_21),
EASTER_EGG_ENTER_28_2("#13, #28 (right turn [-->] here)", LorenzVec(94, 35, 145), EasterEgg.EASTER_EGG_28),
EASTER_EGG_ENTER_28_3("#13, #28 (straight ahead, stay on your right [-->])", LorenzVec(92, 21, 107), EasterEgg.EASTER_EGG_28),
EASTER_EGG_ENTER_29_2("#29 (straight ahead, stay on your right [-->])", LorenzVec(16, 32, 2), EasterEgg.EASTER_EGG_29),
EASTER_EGG_ENTER_29_3("#29 (enter here)", LorenzVec(54, 22, 60), EasterEgg.EASTER_EGG_29),
EASTER_EGG_ENTER_29_4("#29 (up stairs, make left turn [<--])", LorenzVec(25, 25, 51), EasterEgg.EASTER_EGG_29),
EASTER_EGG_ENTER_29_5("#29 (up stairs, make left turn [<--] again)", LorenzVec(17, 32, 66), EasterEgg.EASTER_EGG_29),
EASTER_EGG_ENTER_29_6("#29 (left turn [<--] here)", LorenzVec(35, 37, 66), EasterEgg.EASTER_EGG_29),
EASTER_EGG_ENTER_29_7("#29 (past this door)", LorenzVec(39, 37, 48), EasterEgg.EASTER_EGG_29),
EASTER_EGG_ENTER_30_1("#30 (1st digit, SNEAK + RCLICK)", LorenzVec(143, 65, -30), EasterEgg.EASTER_EGG_30),
EASTER_EGG_ENTER_30_2("#30 (3rd digit, open chest)", LorenzVec(205, 34, -157), EasterEgg.EASTER_EGG_30),
EASTER_EGG_ENTER_27_29_1_30_3("#27, #29, #30 (inside this well)", LorenzVec(10, 63, 0), EasterEgg.EASTER_EGG_27, EasterEgg.EASTER_EGG_29, EasterEgg.EASTER_EGG_30),
EASTER_EGG_ENTER_30_4("#30 (left turn [<--] here)", LorenzVec(-28, 42, 14), EasterEgg.EASTER_EGG_30),
EASTER_EGG_ENTER_30_5("#30 Vault (brute force 2nd digit)", LorenzVec(-35, 25, 63), EasterEgg.EASTER_EGG_30),
}

Loading