Skip to content

Commit

Permalink
emergency PR for easter egg hunt
Browse files Browse the repository at this point in the history
  • Loading branch information
RayDeeUx committed Mar 16, 2024
1 parent 951bb6a commit 4848126
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 0 deletions.
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.EggWaypoints
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(EggWaypoints())
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,4 @@
package at.hannibal2.skyhanni.features.event.lobby.waypoints

class SeasonalWaypoints {
}
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 Egg(val eggName: String, val waypoint: LorenzVec) {
EGG_1("#1", LorenzVec(-47, 94, -3)),
EGG_2("#2", LorenzVec(-20, 86, -70)),
EGG_3("#3", LorenzVec(24, 62, -38)),
EGG_4("#4", LorenzVec(-38, 56, 195)),
EGG_5("#5", LorenzVec(-67, 82, 98)),
EGG_6("#6", LorenzVec(-91, 61, 140)),
EGG_7("#7", LorenzVec(103, 56, 194)),
EGG_8("#8", LorenzVec(81, 68, 108)),
EGG_9("#9", LorenzVec(10, 65, 58)),
EGG_10("#10", LorenzVec(9, 53, 249)),
EGG_11("#11", LorenzVec(216, 51, 93)),
EGG_12("#12", LorenzVec(113, 45, 161)),
EGG_13("#13", LorenzVec(133, 51, -8)),
EGG_14("#14", LorenzVec(141, 73, 3)),
EGG_15("#15", LorenzVec(107, 68, -9)),
EGG_16("#16", LorenzVec(167, 60, -42)),
EGG_17("#17", LorenzVec(58, 65, -2)),
EGG_18("#18", LorenzVec(118, 51, -85)), // 158, 68, -81 entrance
EGG_19("#19", LorenzVec(197, 60, 17)),
EGG_20("#20", LorenzVec(-136, 85, -16)),
EGG_21("#21", LorenzVec(-161, 57, -97)),
EGG_22("#22", LorenzVec(-138, 74, -133)),
EGG_23("#23", LorenzVec(-5, 77, -176)),
EGG_24("#24", LorenzVec(67, 60, -170)),
EGG_25("#25", LorenzVec(-177, 58, 70)),
EGG_26("#26", LorenzVec(-141, 102, -15)),
EGG_27("#27", LorenzVec(9, 32, 3)), // 11, 62, 0 entrance
EGG_28("#28", LorenzVec(150, 28, 19)),
EGG_29("#29", LorenzVec(47, 37, 52)),
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,35 @@
package at.hannibal2.skyhanni.features.event.lobby.waypoints.easter

import at.hannibal2.skyhanni.utils.LorenzVec

enum class EggEntrances(
val eggEntranceName: String,
val waypoint: LorenzVec,
vararg val egg: Egg,
) {

EGG_ENTER_12_13_1_28_1("#12, #13, #28 (tunnel)", LorenzVec(126, 52, 175), Egg.EGG_12, Egg.EGG_13, Egg.EGG_28),
EGG_ENTER_13_2("#13 (keep going, stay on your left [<--])", LorenzVec(144, 30, 19), Egg.EGG_13),
EGG_ENTER_13_3("#13 (enter here)", LorenzVec(107, 42, -47), Egg.EGG_13),
EGG_ENTER_13_4("#13 (straight ahead, don't take the stairs)", LorenzVec(105, 49, -34), Egg.EGG_13),
EGG_ENTER_14_1("#14 (enter here)", LorenzVec(159, 68, -25), Egg.EGG_14),
EGG_ENTER_14_2("#14 (right turn [-->] here)", LorenzVec(153, 68, -8), Egg.EGG_14),
EGG_ENTER_14_3("#14 (left turn [<--] here)", LorenzVec(143, 68, -8), Egg.EGG_14),
EGG_ENTER_18_1("#18 (down this well)", LorenzVec(158, 67, -82), Egg.EGG_18),
EGG_ENTER_18_2("#18 (through this painting)", LorenzVec(142, 56, -82), Egg.EGG_18),
EGG_ENTER_21("#21 (through the waterfall)", LorenzVec(-137, 64, -82), Egg.EGG_21),
EGG_ENTER_28_2("#13, #28 (right turn [-->] here)", LorenzVec(94, 35, 145), Egg.EGG_28),
EGG_ENTER_28_3("#13, #28 (straight ahead, stay on your right [-->])", LorenzVec(92, 21, 107), Egg.EGG_28),
EGG_ENTER_29_2("#29 (straight ahead, stay on your right [-->])", LorenzVec(16, 32, 2), Egg.EGG_29),
EGG_ENTER_29_3("#29 (enter here)", LorenzVec(54, 22, 60), Egg.EGG_29),
EGG_ENTER_29_4("#29 (up stairs, make left turn [<--])", LorenzVec(25, 25, 51), Egg.EGG_29),
EGG_ENTER_29_5("#29 (up stairs, make left turn [<--] again)", LorenzVec(17, 32, 66), Egg.EGG_29),
EGG_ENTER_29_6("#29 (left turn [<--] here)", LorenzVec(35, 37, 66), Egg.EGG_29),
EGG_ENTER_29_7("#29 (past this door)", LorenzVec(39, 37, 48), Egg.EGG_29),
EGG_ENTER_30_1("#30 (1st digit, SNEAK + RCLICK)", LorenzVec(143, 65, -30), Egg.EGG_30),
EGG_ENTER_30_2("#30 (3rd digit, open chest)", LorenzVec(205, 34, -157), Egg.EGG_30),
EGG_ENTER_27_29_1_30_3("#27, #29, #30 (inside this well)", LorenzVec(10, 63, 0), Egg.EGG_27, Egg.EGG_29, Egg.EGG_30),
EGG_ENTER_30_4("#30 (left turn [<--] here)", LorenzVec(-28, 42, 14), Egg.EGG_30),
EGG_ENTER_30_5("#30 Vault (brute force 2nd digit)", LorenzVec(-35, 25, 63), Egg.EGG_30),
}

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 EggWaypoints {

private val config get() = SkyHanniMod.feature.event.lobbyWaypoints.easterEgg
private var closest: Egg? = 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 = Egg.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 = Egg.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 Egg.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.egg.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 Egg.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
}
}

0 comments on commit 4848126

Please sign in to comment.