diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java | 25 |
1 files changed, 24 insertions, 1 deletions
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; } |