diff options
author | syeyoung <cyong06@naver.com> | 2021-01-17 19:01:05 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-17 19:01:05 +0900 |
commit | fdad2b277f72cb777501901d326200f82c30f21f (patch) | |
tree | 6448461eb63bee7cbad6884c99e6f979a0acc553 /src/main/java/kr/syeyoung/dungeonsguide/features | |
parent | a976ac4cfb25514d4e56310e044e64adf2f285de (diff) | |
download | Skyblock-Dungeons-Guide-fdad2b277f72cb777501901d326200f82c30f21f.tar.gz Skyblock-Dungeons-Guide-fdad2b277f72cb777501901d326200f82c30f21f.tar.bz2 Skyblock-Dungeons-Guide-fdad2b277f72cb777501901d326200f82c30f21f.zip |
a bit better score calculation
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java index 2dde882f..a382d27a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java @@ -84,12 +84,25 @@ public class FeatureDungeonScore extends GuiFeature { for (NetworkPlayerInfo networkPlayerInfoIn : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) { String name = networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName()); if (name.startsWith("§r Completed Rooms: §r")) { - String milestone = TextUtils.stripColor(name).substring(21); + String milestone = TextUtils.stripColor(name).substring(18); return Integer.parseInt(milestone); } } return 0; } + public int getTotalRooms() { + return (int) (100 * (getCompleteRooms() / (double)getPercentage())); + } + public int getUndiscoveredPuzzles() { + int cnt = 0; + for (NetworkPlayerInfo networkPlayerInfoIn : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) { + String name = networkPlayerInfoIn.getDisplayName() != null ? networkPlayerInfoIn.getDisplayName().getFormattedText() : ScorePlayerTeam.formatPlayerName(networkPlayerInfoIn.getPlayerTeam(), networkPlayerInfoIn.getGameProfile().getName()); + if (name.startsWith("§r ???: ")) { + cnt ++; + } + } + return cnt; + } public ScoreCalculation calculateScore() { if (!skyblockStatus.isOnDungeon()) return null; @@ -97,14 +110,26 @@ public class FeatureDungeonScore extends GuiFeature { if (context == null) return null; if (!context.getMapProcessor().isInitialized()) return null; - int skill = getPercentage(); + int skill = 100; int deaths = 0; { deaths = FeatureRegistry.DUNGEON_DEATHS.getTotalDeaths(); skill -= FeatureRegistry.DUNGEON_DEATHS.getTotalDeaths() * 2; + int totalCompRooms= 0; + boolean bossroomFound = false; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { + if (dungeonRoom.getColor() == 74) bossroomFound = true; + if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED) + totalCompRooms += dungeonRoom.getUnitPoints().size(); + if (dungeonRoom.getColor() == 66 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) + skill -= 10; + if (dungeonRoom.getColor() == 74 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) + skill += 1; skill += dungeonRoom.getCurrentState().getScoreModifier(); } + if (!bossroomFound) skill += 1; + skill -= getUndiscoveredPuzzles() * 10; + skill -= (getTotalRooms() - totalCompRooms) * 4; } int explorer = 0; boolean fullyCleared = false; |