diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java | 26 | ||||
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/location/CrimsonIsleHandler.java | 56 |
2 files changed, 69 insertions, 13 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java index 586023a..bf5dfdc 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/handlers/SlayerHandler.java @@ -69,15 +69,15 @@ public class SlayerHandler { String line = event.scores.get(i); if (line.contains("Slayer Quest") && event.scores.size() > 3) { String slayer = event.scores.get(i - 1).toLowerCase(); - slayerTypes selectedSlayer = slayerTypes.NONE; + SlayerHandler.slayerTypes selectedSlayer = SlayerHandler.slayerTypes.NONE; for (slayerTypes types : slayerTypes.values()) { if (slayer.contains(types.displayName.toLowerCase(Locale.ENGLISH))) { selectedSlayer = types; break; } } - currentSlayer = selectedSlayer; - slayerTier = Utils.whatRomanNumeral(slayer.replace(selectedSlayer.getDisplayName().toLowerCase(), "").replace(" ", "")); + SlayerHandler.currentSlayer = selectedSlayer; + SlayerHandler.slayerTier = Utils.whatRomanNumeral(slayer.replace(selectedSlayer.getDisplayName().toLowerCase(), "").replace(" ", "")); break; } } @@ -97,8 +97,8 @@ public class SlayerHandler { Matcher killMatcher = KILLS_REGEX.matcher(line); if (killMatcher.find()) { - bossSlain = false; - isKillingBoss = false; + SlayerHandler.bossSlain = false; + SlayerHandler.isKillingBoss = false; try { progress = Integer.parseInt(killMatcher.group(1)); } catch (Exception ignored) {} @@ -106,15 +106,15 @@ public class SlayerHandler { maxKills = Integer.parseInt(killMatcher.group(2)); } catch (Exception ignored) {} } else if (line.contains("slay the boss")) { - bossSlain = false; - isKillingBoss = true; - maxKills = 0; - progress = 0; + SlayerHandler.bossSlain = false; + SlayerHandler.isKillingBoss = true; + SlayerHandler.maxKills = 0; + SlayerHandler.progress = 0; } else if (line.contains("boss slain")) { - isKillingBoss = false; - maxKills = 0; - progress = 0; - bossSlain = true; + SlayerHandler.isKillingBoss = false; + SlayerHandler.maxKills = 0; + SlayerHandler.progress = 0; + SlayerHandler.bossSlain = true; } } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/location/CrimsonIsleHandler.java b/src/main/java/com/thatgravyboat/skyblockhud/location/CrimsonIsleHandler.java new file mode 100644 index 0000000..ab10420 --- /dev/null +++ b/src/main/java/com/thatgravyboat/skyblockhud/location/CrimsonIsleHandler.java @@ -0,0 +1,56 @@ +package com.thatgravyboat.skyblockhud.location; + +public class CrimsonIsleHandler { + + public enum bosses { + BLADESOUL("Bladesoul", 50000000), + MAGMABOSS("Old Dragon", 200000000), + MAGEOUTLAW("Wise Dragon", 70000000), + BARBARIANDUKEX("Unstable Dragon", 70000000), + ASHFANG("Young Dragon", 50000000), + // KUUDRABASIC("Strong Dragon", 9000000), + // KUUDRAHOT("Superior Dragon", 12000000), + // KUUDRABURNING("Superior Dragon", 12000000), + // KUUDRAFIERY("Superior Dragon", 12000000), + // KUUDRAINFERNAL("Superior Dragon", 12000000), + NOBOSS("", 0); + + private final String displayName; + private final int maxHealth; + + bosses(String displayName, int maxHealth) { + this.displayName = displayName; + this.maxHealth = maxHealth; + } + + public String getDisplayName() { + return this.displayName; + } + + public int getMaxHealth() { + return this.maxHealth; + } + + public static bosses findBoss(String input) { + if (input.contains(" ")) { + try { + return bosses.valueOf(input.toLowerCase().replace(" ", "").toUpperCase()); + } catch (IllegalArgumentException ignored) { + return NOBOSS; + } + } else { + try { + return bosses.valueOf(input); + } catch (IllegalArgumentException ignored) { + return NOBOSS; + } + } + } + } + + private static bosses currentBoss = bosses.NOBOSS; + + public static void setCurrentBoss(bosses boss) { + currentBoss = boss; + } +} |