diff options
author | Rime <81419447+Emirlol@users.noreply.github.com> | 2024-01-18 13:32:21 +0300 |
---|---|---|
committer | Rime <81419447+Emirlol@users.noreply.github.com> | 2024-01-21 09:37:49 +0300 |
commit | b765b3f2fe69c1e10a3eafec75c6bd17201b9196 (patch) | |
tree | 1138bdb0bda03d09bdad5e6510b562105424cd16 /src/main/java/de/hysky/skyblocker/skyblock/dungeon | |
parent | a074292c9ce56daa060c02f8abaf78857998fffd (diff) | |
download | Skyblocker-b765b3f2fe69c1e10a3eafec75c6bd17201b9196.tar.gz Skyblocker-b765b3f2fe69c1e10a3eafec75c6bd17201b9196.tar.bz2 Skyblocker-b765b3f2fe69c1e10a3eafec75c6bd17201b9196.zip |
Fix entrance floor score calculation
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/dungeon')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScore.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScore.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScore.java index 6059f9d5..fde255d7 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScore.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/DungeonScore.java @@ -53,6 +53,7 @@ public class DungeonScore { private static FloorRequirement floorRequirement; private static String currentFloor; + private static boolean isCurrentFloorEntrance; private static boolean floorHasMimics; private static boolean sent270; private static boolean sent300; @@ -123,6 +124,7 @@ public class DungeonScore { private static void reset() { floorRequirement = null; currentFloor = ""; + isCurrentFloorEntrance = false; floorHasMimics = false; sent270 = false; sent300 = false; @@ -145,12 +147,12 @@ public class DungeonScore { startingTime = System.currentTimeMillis(); floorRequirement = FloorRequirement.valueOf(currentFloor); floorHasMimics = MIMIC_FLOORS_PATTERN.matcher(currentFloor).matches(); + if (currentFloor.equals("E")) isCurrentFloorEntrance = true; } private static int calculateScore() { - int totalScore = calculateTimeScore() + calculateExploreScore() + calculateSkillScore() + calculateBonusScore(); - if (currentFloor.equals("E")) return (int) (totalScore * 0.7); - return totalScore; + if (isCurrentFloorEntrance) return Math.round(calculateTimeScore() * 0.7f) + Math.round(calculateExploreScore() * 0.7f) + Math.round(calculateSkillScore() * 0.7f) + Math.round(calculateBonusScore() * 0.7f); + return calculateTimeScore() + calculateExploreScore() + calculateSkillScore() + calculateBonusScore(); } private static int calculateSkillScore() { @@ -229,8 +231,8 @@ public class DungeonScore { //This is needed for calculating the score before going in the boss room & completing the blood room, so we have the result sooner //It might cause score to fluctuate when completing the blood room or entering the boss room as there's a slight delay between the room being completed (boolean set to true) and the scoreboard updating private static int getExtraCompletedRooms() { - if (!bloodRoomCompleted) return 2; - if (!DungeonManager.isInBoss()) return 1; + if (!bloodRoomCompleted) return isCurrentFloorEntrance ? 1 : 2; + if (!DungeonManager.isInBoss() && !isCurrentFloorEntrance) return 1; return 0; } |