diff options
author | syeyoung <cyong06@naver.com> | 2021-01-17 15:55:59 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-01-17 15:55:59 +0900 |
commit | a976ac4cfb25514d4e56310e044e64adf2f285de (patch) | |
tree | e099c924901b62e2156c7832756b29ba9d92b18a /src/main/java/kr/syeyoung/dungeonsguide/features | |
parent | 7c45bc056f404eb743bd97bf2c3c5900cde27083 (diff) | |
download | Skyblock-Dungeons-Guide-a976ac4cfb25514d4e56310e044e64adf2f285de.tar.gz Skyblock-Dungeons-Guide-a976ac4cfb25514d4e56310e044e64adf2f285de.tar.bz2 Skyblock-Dungeons-Guide-a976ac4cfb25514d4e56310e044e64adf2f285de.zip |
score calculation a bit better and bossfights
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java | 28 |
1 files changed, 21 insertions, 7 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 788f3207..2dde882f 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/FeatureDungeonScore.java @@ -7,10 +7,14 @@ import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.features.FeatureParameter; import kr.syeyoung.dungeonsguide.features.FeatureRegistry; import kr.syeyoung.dungeonsguide.features.GuiFeature; +import kr.syeyoung.dungeonsguide.utils.TextUtils; import lombok.AllArgsConstructor; import lombok.Data; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.scoreboard.ScorePlayerTeam; import net.minecraft.util.MathHelper; import org.lwjgl.opengl.GL11; @@ -73,13 +77,27 @@ public class FeatureDungeonScore extends GuiFeature { private int deaths; } + public int getPercentage() { + return skyblockStatus.getPercentage(); + } + public int getCompleteRooms() { + 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); + return Integer.parseInt(milestone); + } + } + return 0; + } + public ScoreCalculation calculateScore() { if (!skyblockStatus.isOnDungeon()) return null; DungeonContext context = skyblockStatus.getContext(); if (context == null) return null; if (!context.getMapProcessor().isInitialized()) return null; - int skill = 100; + int skill = getPercentage(); int deaths = 0; { deaths = FeatureRegistry.DUNGEON_DEATHS.getTotalDeaths(); @@ -94,17 +112,13 @@ public class FeatureDungeonScore extends GuiFeature { int totalSecrets = 0; int secrets = 0; { - int clearedRooms = 0; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { - if (!(dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED)) { - clearedRooms ++; - } if (dungeonRoom.getTotalSecrets() != -1) totalSecrets += dungeonRoom.getTotalSecrets(); else totalSecretsKnown = false; } - fullyCleared = clearedRooms == context.getDungeonRoomList().size() && context.getMapProcessor().getUndiscoveredRoom() == 0; - explorer += MathHelper.clamp_int((int) Math.floor(60 * (clearedRooms / ((double)context.getDungeonRoomList().size() + context.getMapProcessor().getUndiscoveredRoom()))), 0, 60); + fullyCleared = getPercentage() == context.getDungeonRoomList().size() && context.getMapProcessor().getUndiscoveredRoom() == 0; + explorer += MathHelper.clamp_int((int) Math.floor(6.0 / 10.0 * getPercentage()), 0, 60); explorer += MathHelper.clamp_int((int) Math.floor(40 * ((secrets = FeatureRegistry.DUNGEON_SECRETS.getSecretsFound()) / (double)totalSecrets)),0,40); } int time = 0; |