aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbowser0000 <bowser0000@gmail.com>2021-12-26 20:01:26 -0500
committerbowser0000 <bowser0000@gmail.com>2021-12-26 20:01:26 -0500
commitde442e9110e8eb1bde9ebc4448d2634dfc4a7b9d (patch)
treeb94aade8e2947e3e6be487e4207a5724403c3fa8
parentaaba0391a06ac4546d7ec5ce684534c35d9cbc82 (diff)
downloadSkyblockMod-de442e9110e8eb1bde9ebc4448d2634dfc4a7b9d.tar.gz
SkyblockMod-de442e9110e8eb1bde9ebc4448d2634dfc4a7b9d.tar.bz2
SkyblockMod-de442e9110e8eb1bde9ebc4448d2634dfc4a7b9d.zip
Fix issues with dungeon score display
-rw-r--r--src/main/java/me/Danker/features/DungeonScore.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/me/Danker/features/DungeonScore.java b/src/main/java/me/Danker/features/DungeonScore.java
index a2bc6e3..2b6b287 100644
--- a/src/main/java/me/Danker/features/DungeonScore.java
+++ b/src/main/java/me/Danker/features/DungeonScore.java
@@ -26,6 +26,7 @@ import java.util.List;
public class DungeonScore {
int failedPuzzles;
+ int deaths;
int skillScore;
String secrets;
int exploreScore;
@@ -45,7 +46,7 @@ public class DungeonScore {
if (message.contains(":")) return;
if (message.contains(" and became a ghost.")) {
- skillScore = MathHelper.clamp_int(skillScore - 2, 0, 100);
+ deaths++;
}
}
@@ -85,6 +86,7 @@ public class DungeonScore {
double roomScore = 0;
double secretScore = 0;
+ if (Minecraft.getMinecraft().getNetHandler() == null) return;
Collection<NetworkPlayerInfo> players = Minecraft.getMinecraft().getNetHandler().getPlayerInfoMap();
for (NetworkPlayerInfo player : players) {
if (player == null || player.getDisplayName() == null) continue;
@@ -168,7 +170,7 @@ public class DungeonScore {
roomScore = completedRooms / openedRooms;
}
- skillScore = 100 - 14 * (failedPuzzles + missingPuzzles);
+ skillScore = MathHelper.clamp_int(100 - 14 * (failedPuzzles + missingPuzzles) - 2 * deaths, 0, 100);
exploreScore = (int) (60 * roomScore + 40 * MathHelper.clamp_double(secretScore, 0, 1));
}
}
@@ -214,6 +216,7 @@ public class DungeonScore {
@SubscribeEvent
public void onWorldChange(WorldEvent.Load event) {
failedPuzzles = 0;
+ deaths = 0;
skillScore = 100;
secrets = "";
exploreScore = 0;