diff --git a/src/main/java/me/Danker/config/ModConfig.java b/src/main/java/me/Danker/config/ModConfig.java index a8f2ce3c..cd9a59e0 100644 --- a/src/main/java/me/Danker/config/ModConfig.java +++ b/src/main/java/me/Danker/config/ModConfig.java @@ -1641,6 +1641,18 @@ public static int toDisplay(String value) { ) public static int dungeonBossVolume = 50; + @CfgName( + name = "Phase1Volume", + category = "music" + ) + @Slider( + name = "F7 Phase 1 Music Volume", + min = 0, max = 100, + category = "Music", + subcategory = "Music" + ) + public static int phase1Volume = 50; + @CfgName( name = "Phase2Volume", category = "music" diff --git a/src/main/java/me/Danker/features/CustomMusic.java b/src/main/java/me/Danker/features/CustomMusic.java index 02bf0aff..7a5a6c54 100644 --- a/src/main/java/me/Danker/features/CustomMusic.java +++ b/src/main/java/me/Danker/features/CustomMusic.java @@ -32,6 +32,7 @@ public class CustomMusic { public static Song dungeonboss; public static Song bloodroom; public static Song dungeon; + public static Song phase1; public static Song phase2; public static Song phase3; public static Song phase4; @@ -53,6 +54,10 @@ public class CustomMusic { static int curPhase = 0; + // Once the lightning strikes, the music in the blood room should stop playing. + // We start waiting for it when the Watcher says his last line. + static boolean awaitingLightning = false; + @SubscribeEvent public void onWorldChange(WorldEvent.Load event) { reset(); @@ -78,8 +83,13 @@ public void onTick(TickEvent.ClientTickEvent event) throws UnsupportedAudioFileE secondLine.contains("- Healthy") || // F3 firstLine.contains("30,344") || // F4 firstLine.contains("livid") || // F5 - firstLine.contains("sadan") || // F6 - firstLine.contains("maxor") || // F7 + firstLine.contains("sadan")) { // F6 + + if (ModConfig.dungeonBossMusic && curPhase != -1) { + dungeonboss.start(); + } + + } else if (firstLine.contains("maxor") || // F7 firstLine.contains("f7")) { if (ModConfig.dungeonBossMusic) { @@ -98,8 +108,9 @@ public void onTick(TickEvent.ClientTickEvent event) throws UnsupportedAudioFileE case 5: phase5.start(); break; + case 1: default: - dungeonboss.start(); + phase1.start(); } } } @@ -166,7 +177,10 @@ public void onChat(ClientChatReceivedEvent event) throws UnsupportedAudioFileExc if (Utils.isInDungeons()) { if (ModConfig.dungeonBossMusic) { - if (phase2.hasSongs() && message.startsWith("[BOSS] Storm: Pathetic Maxor")) { + if (phase1.hasSongs() && message.startsWith("[BOSS] Maxor: WELL WELL WELL")) { // he says more but apostrophes are annoying to deal with sometimes + phase1.start(); + curPhase = 1; + } else if (phase2.hasSongs() && message.startsWith("[BOSS] Storm: Pathetic Maxor")) { phase2.start(); curPhase = 2; } else if (phase3.hasSongs() && message.startsWith("[BOSS] Goldor: Who dares trespass into my domain?")) { @@ -181,6 +195,12 @@ public void onChat(ClientChatReceivedEvent event) throws UnsupportedAudioFileExc } } + if (ModConfig.bloodRoomMusic) { + if (message.startsWith("[BOSS] The Watcher: You have proven yourself. You may pass")) { + awaitingLightning = true; + } + } + if (message.contains(":")) return; if (message.contains("EXTRA STATS ")) { @@ -188,6 +208,7 @@ public void onChat(ClientChatReceivedEvent event) throws UnsupportedAudioFileExc dungeonboss.stop(); bloodroom.stop(); dungeon.stop(); + phase1.stop(); phase2.stop(); phase3.stop(); phase4.stop(); @@ -204,6 +225,13 @@ public void onSound(PlaySoundEvent event) { if (ModConfig.disableHypixelMusic && cancelNotes && event.name.startsWith("note.")) { event.result = null; } + + // If we're awaiting the lightning, we should stop the music. + // This could be a false positive due to stormy mobs, but it wouldn't make much of a difference. + if (awaitingLightning && event.name.equals("ambient.weather.thunder")) { + awaitingLightning = false; + if (bloodroom != null) bloodroom.stop(); + } } @SubscribeEvent @@ -221,6 +249,7 @@ public static void init(String configDirectory) { dungeonboss = new Song(directory, "dungeonboss", ModConfig.dungeonBossVolume); bloodroom = new Song(directory, "bloodroom", ModConfig.bloodRoomVolume); dungeon = new Song(directory, "dungeon", ModConfig.dungeonVolume); + phase1 = new Song(directory, "phaseone", ModConfig.phase1Volume); phase2 = new Song(directory, "phasetwo", ModConfig.phase2Volume); phase3 = new Song(directory, "phasethree", ModConfig.phase3Volume); phase4 = new Song(directory, "phasefour", ModConfig.phase4Volume); @@ -245,6 +274,7 @@ public static void reset() { if (dungeonboss != null) dungeonboss.stop(); if (bloodroom != null) bloodroom.stop(); if (dungeon != null) dungeon.stop(); + if (phase1 != null) phase1.stop(); if (phase2 != null) phase2.stop(); if (phase3 != null) phase3.stop(); if (phase4 != null) phase4.stop();