diff options
-rw-r--r-- | Update Notes/2.1.1.md | 1 | ||||
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java | 25 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Update Notes/2.1.1.md b/Update Notes/2.1.1.md index 52f0f7f4..308d484e 100644 --- a/Update Notes/2.1.1.md +++ b/Update Notes/2.1.1.md @@ -50,3 +50,4 @@ - Added searchbar to Kills/Deaths section in pv - Cobble8 - Added Ender Node Highlighter, Endermite Nest Alert - GodOfPro - Added CTRL + F support to searchbar and config menu - Lulonaut + - Fixed Slayer Overlay to now take Aatrox's +25% Slayer XP buff into account - Taoshi diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java index 72879bf9..95447398 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java @@ -47,11 +47,13 @@ public class SlayerOverlay extends TextOverlay { private static String slayerEXP = "0"; private static int slayerIntXP; + private static int differenceFromLastXP = 0; private static int untilNextSlayerLevel; private static int xpToLevelUp; private static boolean useSmallXpNext = true; private static long agvSlayerTime = 0; private static boolean isSlayerNine = false; + private static boolean slayerXPBuffActive = false; private static int xpPerBoss = 0; private static int bossesUntilNextLevel = 0; private final HashSet<String> revenantLocations = new HashSet<>(Arrays.asList("Graveyard", "Coal Mine")); @@ -121,6 +123,22 @@ public class SlayerOverlay extends TextOverlay { isSlayerNine = true; } else if (!slayerXp.equals("0")) { slayerEXP = slayerXp.replace(",", ""); + + differenceFromLastXP = slayerIntXP - Integer.parseInt(slayerEXP); + if (differenceFromLastXP != 0) { + switch (differenceFromLastXP) { + case 1875: + case 625: + case 125: + case 31: + case 6: + slayerXPBuffActive = true; + break; + default: + slayerXPBuffActive = false; + } + } + slayerIntXP = Integer.parseInt(slayerEXP); isSlayerNine = false; } else { @@ -197,9 +215,14 @@ public class SlayerOverlay extends TextOverlay { } else { xpPerBoss = 0; } + + if (slayerXPBuffActive) { + xpPerBoss *= 1.25; + } + untilNextSlayerLevel = xpToLevelUp - slayerIntXP; if (xpPerBoss != 0 && untilNextSlayerLevel != 0 && xpToLevelUp != 0) { - bossesUntilNextLevel = (xpToLevelUp - untilNextSlayerLevel) / xpPerBoss; + bossesUntilNextLevel = (int) Math.ceil((xpToLevelUp - untilNextSlayerLevel) / xpPerBoss); } else { bossesUntilNextLevel = 0; } |