diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java | 10 | ||||
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java | 21 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java b/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java index 5c868c9..3df9048 100644 --- a/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java +++ b/src/main/java/de/cowtipper/cowlection/handler/DungeonCache.java @@ -20,6 +20,7 @@ public class DungeonCache { private boolean isInDungeon; private int elapsedMinutes; + private int classMilestone; private long lastScoreboardCheck; public DungeonCache(Cowlection main) { @@ -106,6 +107,10 @@ public class DungeonCache { failedPuzzles.add(text); } + public void setClassMilestone(int classMilestone) { + this.classMilestone = classMilestone; + } + public boolean addDestroyedCrypt(UUID uuid) { return destroyedCrypts.add(uuid); } @@ -131,6 +136,10 @@ public class DungeonCache { return failedPuzzles.size(); } + public int getClassMilestone() { + return classMilestone; + } + public int getDestroyedCrypts() { return destroyedCrypts.size(); } @@ -145,5 +154,6 @@ public class DungeonCache { failedPuzzles.clear(); destroyedCrypts.clear(); elapsedMinutes = 0; + classMilestone = 0; } } diff --git a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java index 7ac627d..3ead9cc 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/DungeonsListener.java @@ -80,6 +80,14 @@ public class DungeonsListener { * </ul> */ private final Pattern DUNGEON_DEATH_PATTERN = Pattern.compile("^ ☠ (\\w+) (?:.*?) and became a ghost\\.$"); + /** + * Class milestones: + * <ul> + * <li>Archer Milestone ❶: You have dealt 60000 Ranged Damage so far! 00m17s</li> + * <li>Tank Milestone ❼: You have tanked and dealt 2000000 Total Damage so far! 14m33s</li> + * </ul> + */ + private final Pattern DUNGEON_CLASS_MILESTONE_PATTERN = Pattern.compile("^[A-Za-z]+ Milestone (.): "); private String activeDungeonClass; @@ -403,6 +411,17 @@ public class DungeonsListener { } else if (text.startsWith("PUZZLE FAIL!")) { // Skill: failed puzzle main.getDungeonCache().addFailedPuzzle(text); + } else { + Matcher dungeonClassMilestoneMatcher = DUNGEON_CLASS_MILESTONE_PATTERN.matcher(text); + if (dungeonClassMilestoneMatcher.find()) { + // class milestone reached + int classMilestoneSymbol = dungeonClassMilestoneMatcher.group(1).charAt(0); + // 1 ❶ = 10102 + // 9 ❾ = 10110 + if (classMilestoneSymbol >= /* 1 */ 10102 && classMilestoneSymbol <= /* 10 */ 10111) { + main.getDungeonCache().setClassMilestone(classMilestoneSymbol - 10101); + } + } } } } @@ -435,6 +454,7 @@ public class DungeonsListener { int maxSkillScore = dungeonCache.getMaxSkillScore(); int totalDeaths = dungeonCache.getTotalDeaths(); int failedPuzzles = dungeonCache.getFailedPuzzles(); + int classMilestone = dungeonCache.getClassMilestone(); int destroyedCrypts = dungeonCache.getDestroyedCrypts(); int elapsedMinutes = dungeonCache.getElapsedMinutes(); @@ -445,6 +465,7 @@ public class DungeonsListener { if (failedPuzzles > 0 || isConfigGui) { dungeonPerformanceEntries.add(" Failed Puzzles: " + EnumChatFormatting.RED + failedPuzzles); } + dungeonPerformanceEntries.add("Class Milestone: " + (classMilestone < 3 ? EnumChatFormatting.RED : EnumChatFormatting.GREEN) + classMilestone); dungeonPerformanceEntries.add("Destroyed Crypts: " + (destroyedCrypts >= 5 ? EnumChatFormatting.GREEN : EnumChatFormatting.YELLOW) + destroyedCrypts + " / 5"); EnumChatFormatting color = EnumChatFormatting.GREEN; if (elapsedMinutes > 20) { |