diff options
author | syeyoung <cyougn06@naver.com> | 2022-01-12 23:57:59 +0900 |
---|---|---|
committer | syeyoung <cyougn06@naver.com> | 2022-01-12 23:57:59 +0900 |
commit | 611ce01285265e2b2433b6676c678c6426e047bd (patch) | |
tree | 89f56846f8b2ea537f8fd240dcc367faafbf12cd /src/main/java | |
parent | 0e4e0e84296ad9dd4e992a03ca40588a6f6bcb84 (diff) | |
download | Skyblock-Dungeons-Guide-611ce01285265e2b2433b6676c678c6426e047bd.tar.gz Skyblock-Dungeons-Guide-611ce01285265e2b2433b6676c678c6426e047bd.tar.bz2 Skyblock-Dungeons-Guide-611ce01285265e2b2433b6676c678c6426e047bd.zip |
- Fix undisocvered room cnt getting reset to 0 on bossfight
- Miniboss not done is now 4 skill point penalty instead of 3
- Revamp skill score calculation so that it's a bit more read-able.
Diffstat (limited to 'src/main/java')
-rwxr-xr-x | src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java | 2 | ||||
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java | 48 |
2 files changed, 27 insertions, 23 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java index ac8bfb1e..b6089ebd 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java @@ -218,8 +218,8 @@ public class MapProcessor { private void processMap(byte[] mapData) { int height = (int)((128.0 - topLeftMapPoint.y) / (unitRoomDimension.height + doorDimension.height)); int width = (int) ((128.0 - topLeftMapPoint.x) / (unitRoomDimension.width + doorDimension.height)); - undiscoveredRoom = 0; if (MapUtils.getMapColorAt(mapData,0,0) != 0) return; + undiscoveredRoom = 0; for (int y = 0; y <= height; y++){ for (int x = 0; x <= width; x++) { Point mapPoint = roomPointToMapPoint(new Point(x,y)); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java index f10d7262..72aaabd6 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonScore.java @@ -196,7 +196,9 @@ public class FeatureDungeonScore extends TextHUDFeature { return 0; } public int getTotalRooms() { - return (int) (100 * (getCompleteRooms() / (double)getPercentage())); + int compRooms = getCompleteRooms(); + if (compRooms == 0) return 100; + return (int) (100 * (compRooms / (double)getPercentage())); } public int getUndiscoveredPuzzles() { int cnt = 0; @@ -221,33 +223,35 @@ public class FeatureDungeonScore extends TextHUDFeature { deaths = FeatureRegistry.DUNGEON_DEATHS.getTotalDeaths(); skill -= FeatureRegistry.DUNGEON_DEATHS.getTotalDeaths() * 2; int totalCompRooms= 0; - boolean bossroomFound = false; - boolean traproomFound = false; int roomCnt = 0; + int roomSkillPenalty = 0; +// boolean bossroomIncomplete = true; + boolean traproomIncomplete = context.isTrapRoomGen(); + int incompletePuzzles = getUndiscoveredPuzzles(); + for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { - if (dungeonRoom.getColor() == 74) bossroomFound = true; - if (dungeonRoom.getColor() == 62) traproomFound = true; +// if (dungeonRoom.getColor() == 74 && dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED) +// bossroomIncomplete = false; + if (dungeonRoom.getColor() == 62 && dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED) + traproomIncomplete = false; if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED) totalCompRooms += dungeonRoom.getUnitPoints().size(); - if (dungeonRoom.getColor() == 66 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) // INCOMPLETE PUZZLE ON MAP - skill -= 10; - if (dungeonRoom.getColor() == 74 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) // INCOMPLETE BOSSROOM YELLOW - skill += 1; - if (dungeonRoom.getColor() == 62 && dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED) // INCOMPLETE TRAP ROOM - skill += 1; - - skill += dungeonRoom.getCurrentState().getScoreModifier(); - + if (dungeonRoom.getColor() == 66 && (dungeonRoom.getCurrentState() == DungeonRoom.RoomState.DISCOVERED || dungeonRoom.getCurrentState() == DungeonRoom.RoomState.FAILED)) // INCOMPLETE PUZZLE ON MAP + incompletePuzzles++; roomCnt += dungeonRoom.getUnitPoints().size(); } - if (!bossroomFound) skill += 1; - if (!traproomFound && context.isTrapRoomGen()) skill += 1; - skill -= getUndiscoveredPuzzles() * 10; - if (context.getMapProcessor().getUndiscoveredRoom() == 0) { - skill -= Math.max(0, (roomCnt - totalCompRooms) * 4); - } else { - skill -= Math.max(0, (getTotalRooms() - totalCompRooms) * 4); - } + roomSkillPenalty += incompletePuzzles * 10; + if (context.getMapProcessor().getUndiscoveredRoom() != 0) + roomCnt = getTotalRooms(); + roomSkillPenalty += (roomCnt - totalCompRooms) * 4; +// if (bossroomIncomplete) roomSkillPenalty -=1; + if (traproomIncomplete) roomSkillPenalty -=1; + + + skill -= roomSkillPenalty; + + + skill = MathHelper.clamp_int(skill, 0, 100); } int explorer = 0; |