diff options
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | README.md | 2 | ||||
-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 |
4 files changed, 37 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 295fe85..01771d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [1.8.9-xxx] - unreleased +### Added +- Dungeon performance tracker: added Class Milestones + ## [1.8.9-0.10.0] - 31.07.2020 ### Added - Best friends online check: @@ -172,6 +176,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). *Note:* The 'best friends' list is currently available via <kbd>ESC</kbd> > Mod Options > Cowlection > Config > bestFriends. +[1.8.9-xxx]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.10.0...master [1.8.9-0.10.0]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.9.0...v1.8.9-0.10.0 [1.8.9-0.9.0]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.8.1...v1.8.9-0.9.0 [1.8.9-0.8.1]: https://github.com/cow-mc/Cowlection/compare/v1.8.9-0.8.0...v1.8.9-0.8.1 @@ -26,7 +26,7 @@ It is a collection of different features mainly focused on Hypixel SkyBlock. | Stalk SkyBlock stats of a player | `/moo stalkskyblock` | | Analyze minions on a private island | `/moo analyzeIsland` | | Dungeon interfaces enhancements (normalize dungeon item stats, improved party finder) | Hold <kbd>shift</kbd> while viewing a dungeon item tooltip | -| Dungeon performance overlay: Skill score calculation, destroyed crypts tracker, and elapsed time indicator | automatically; or with `/moo dungeon`; Overlay can be edited with `/moo dungeonGui` | +| Dungeon performance tracker: Skill score calculation, class milestone tracker, destroyed crypts tracker, and elapsed time indicator | automatically; or with `/moo dungeon`; Overlay can be edited with `/moo dungeonGui` | ## Download You can download the compiled .jar files from the [release section](https://github.com/cow-mc/Cowlection/releases). 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) { |