diff options
author | syeyoung <cyougn06@naver.com> | 2021-12-19 02:29:11 +0900 |
---|---|---|
committer | syeyoung <cyougn06@naver.com> | 2021-12-19 02:29:11 +0900 |
commit | 5fd8d7844b5a77f2a85c9a92aaea967dd2a8932d (patch) | |
tree | c12e07dc3dbc21516e44127b3be14b16203274c2 /src/main/java/kr/syeyoung/dungeonsguide/features | |
parent | 7b7d13ede25aa3022cfbd03763ca9ee82ca12656 (diff) | |
download | Skyblock-Dungeons-Guide-5fd8d7844b5a77f2a85c9a92aaea967dd2a8932d.tar.gz Skyblock-Dungeons-Guide-5fd8d7844b5a77f2a85c9a92aaea967dd2a8932d.tar.bz2 Skyblock-Dungeons-Guide-5fd8d7844b5a77f2a85c9a92aaea967dd2a8932d.zip |
- Collect Score
- New Score Update
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features')
7 files changed, 70 insertions, 33 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java index bb04bba9..16201dcb 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/FeatureRegistry.java @@ -182,6 +182,8 @@ public class FeatureRegistry { public static final FeaturePenguins ETC_PENGUIN = register(new FeaturePenguins()); + public static final FeatureCollectScore ETC_COLLECT_SCORE = register(new FeatureCollectScore()); + diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java index 2ff3ec28..2a2b1a39 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/advanced/FeatureDebuggableMap.java @@ -55,12 +55,14 @@ public class FeatureDebuggableMap extends GuiFeature { SkyblockStatus skyblockStatus = DungeonsGuide.getDungeonsGuide().getSkyblockStatus(); @Override public void drawHUD(float partialTicks) { - if (!skyblockStatus.isOnDungeon()) return; +// if (!skyblockStatus.isOnDungeon()) return; if (!FeatureRegistry.DEBUG.isEnabled()) return; - DungeonContext context = skyblockStatus.getContext(); - if (context == null) return; +// DungeonContext context = skyblockStatus.getContext(); +// if (context == null) return; GlStateManager.pushMatrix(); + double factor = getFeatureRect().getRectangle().getWidth() / 128; + GlStateManager.scale(factor, factor, 1); int[] textureData = dynamicTexture.getTextureData(); MapUtils.getImage().getRGB(0, 0, 128, 128, textureData, 0, 128); dynamicTexture.updateDynamicTexture(); @@ -73,10 +75,10 @@ public class FeatureDebuggableMap extends GuiFeature { if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChat)) return; Rectangle featureRect = this.getFeatureRect().getRectangleNoScale(); - int i = (int) (Mouse.getEventX() - featureRect.getX()); - int j = (int) (Minecraft.getMinecraft().displayHeight - Mouse.getEventY() - featureRect.getY()); + int i = (int) ((int) (Mouse.getEventX() - featureRect.getX()) / factor); + int j = (int) ((int) (Minecraft.getMinecraft().displayHeight - Mouse.getEventY() - featureRect.getY())/ factor); if (i >= 0 && j>= 0 && i <= 128 && j <= 128 && MapUtils.getColors() != null) { - GuiUtils.drawHoveringText(Arrays.asList("Color: "+MapUtils.getColors()[j * 128 + i]),i, j, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight, -1, Minecraft.getMinecraft().fontRendererObj); + GuiUtils.drawHoveringText(Arrays.asList(i+","+j,"Color: "+MapUtils.getColors()[j * 128 + i]),(int)(Mouse.getEventX() - featureRect.getX()), (int) (Minecraft.getMinecraft().displayHeight - Mouse.getEventY() - featureRect.getY()), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight, -1, Minecraft.getMinecraft().fontRendererObj); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java index 4edd5cf1..2c852fdd 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureWarningOnPortal.java @@ -56,7 +56,7 @@ public class FeatureWarningOnPortal extends SimpleFeature implements StyledTextP dummyText.add(new StyledText("Total Secrets","field_name")); dummyText.add(new StyledText(": ","field_separator")); - dummyText.add(new StyledText("103/100 ","field_value")); + dummyText.add(new StyledText("103/100 of 50","field_value")); dummyText.add(new StyledText("(103% 41.2 Explorer)","field_etc")); @@ -121,8 +121,8 @@ public class FeatureWarningOnPortal extends SimpleFeature implements StyledTextP texts.add(new StyledText("Total Secrets","field_name")); texts.add(new StyledText(": ","field_separator")); - texts.add(new StyledText(scoreCalculation.getSecrets() +"/" + scoreCalculation.getTotalSecrets(),"field_value")); - texts.add(new StyledText(" ("+(int)(scoreCalculation.getSecrets() / (float)scoreCalculation.getTotalSecrets() * 100.0f)+"% "+(int)(scoreCalculation.getSecrets() / (float)scoreCalculation.getTotalSecrets() * 40.0f)+" Explorer)\n","field_etc")); + texts.add(new StyledText(scoreCalculation.getSecrets() +"/" + scoreCalculation.getEffectiveTotalSecrets()+" of "+scoreCalculation.getTotalSecrets(),"field_value")); + texts.add(new StyledText(" ("+(int)(scoreCalculation.getSecrets() / (float)scoreCalculation.getEffectiveTotalSecrets() * 100.0f)+"% "+(int)(scoreCalculation.getSecrets() / (float)scoreCalculation.getEffectiveTotalSecrets() * 40.0f)+" Explorer)\n","field_etc")); texts.add(new StyledText("Crypts","field_name")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureCollectScore.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureCollectScore.java new file mode 100644 index 00000000..f7e92262 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureCollectScore.java @@ -0,0 +1,28 @@ +/* + * Dungeons Guide - The most intelligent Hypixel Skyblock Dungeons Mod + * Copyright (C) 2021 cyoung06 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/>. + */ + +package kr.syeyoung.dungeonsguide.features.impl.dungeon; + +import kr.syeyoung.dungeonsguide.features.SimpleFeature; +import kr.syeyoung.dungeonsguide.features.listener.DungeonEndListener; + +public class FeatureCollectScore extends SimpleFeature { + public FeatureCollectScore() { + super("Misc", "Collect Speed Score", "Collect Speed score, run time, and floor and send that to developer's server for speed formula. This data is completely anonymous, opt out of the feature by disabling this feature", "misc.gatherscoredata", true); + } +} 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 e43b96ca..95ccd689 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 @@ -146,7 +146,7 @@ public class FeatureDungeonScore extends TextHUDFeature { actualBit.add(new StyledText(": ", "separator")); actualBit.add(new StyledText(score.explorer + " ", "score")); actualBit.add(new StyledText("(", "brackets")); - actualBit.add(new StyledText("Rooms " + (score.fullyCleared ? "O" : "X") + " Secrets " + score.secrets + "/" + score.totalSecrets + (score.totalSecretsKnown ? "" : "?"), "etc")); + actualBit.add(new StyledText("Rooms " + (score.fullyCleared ? "O" : "X") + " Secrets " + score.secrets + "/" + score.effectiveTotalSecrets +" of "+score.getTotalSecrets() + (score.totalSecretsKnown ? "" : "?"), "etc")); actualBit.add(new StyledText(")\n", "brackets")); actualBit.add(new StyledText("Time", "scorename")); actualBit.add(new StyledText(": ", "separator")); @@ -176,7 +176,7 @@ public class FeatureDungeonScore extends TextHUDFeature { public static class ScoreCalculation { private int skill, explorer, time, bonus, tombs; private boolean fullyCleared; - private int secrets, totalSecrets; + private int secrets, totalSecrets, effectiveTotalSecrets; private boolean totalSecretsKnown; private int deaths; } @@ -259,33 +259,27 @@ public class FeatureDungeonScore extends TextHUDFeature { double total = 0; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { - if (dungeonRoom.getTotalSecrets() != -1) - totalSecrets += dungeonRoom.getTotalSecrets(); - else totalSecretsKnown = false; if (dungeonRoom.getCurrentState() != DungeonRoom.RoomState.DISCOVERED && dungeonRoom.getCurrentState() != DungeonRoom.RoomState.FAILED) completed += dungeonRoom.getUnitPoints().size(); total += dungeonRoom.getUnitPoints().size(); } + totalSecrets = FeatureRegistry.DUNGEON_SECRETS.getTotalSecretsInt() ; + totalSecretsKnown = FeatureRegistry.DUNGEON_SECRETS.sureOfTotalSecrets(); + fullyCleared = completed >= getTotalRooms() && context.getMapProcessor().getUndiscoveredRoom() == 0; explorer += MathHelper.clamp_int((int) Math.floor(6.0 / 10.0 * (context.getMapProcessor().getUndiscoveredRoom() != 0 ? getPercentage() : completed / total * 100)), 0, 60); - explorer += MathHelper.clamp_int((int) Math.floor(40 * ((secrets = FeatureRegistry.DUNGEON_SECRETS.getSecretsFound()) / (double)totalSecrets)),0,40); + explorer += MathHelper.clamp_int((int) Math.floor(40 * (secrets = FeatureRegistry.DUNGEON_SECRETS.getSecretsFound()) / (totalSecrets * context.getSecretPercentage())),0,40); } int time = 0; { - double timeModifier; - int timeModifierModifier = - DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getDungeonName().substring(14).trim().equals("F2") ? -120 : 0; - if (context.getBossRoomEnterSeconds() != -1) { - timeModifier = Math.max(0, context.getBossRoomEnterSeconds() - timeModifierModifier); - } else { - timeModifier = Math.max(0, FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed() / 1000 - timeModifierModifier); - } + int maxTime = context.getMaxSpeed(); + int timeSec = FeatureRegistry.DUNGEON_SBTIME.getTimeElapsed() / 1000; - if (timeModifier <= 1320) time = 100; - else if (timeModifier <= 1420) time = (int) Math.ceil(232 - 0.1 * timeModifier); - else if (timeModifier <= 1820) time = (int) Math.ceil(161 - 0.05 * timeModifier); - else if (timeModifier < 3920) time = (int) Math.ceil(392/3.0 - (1/30.0) * timeModifier); + if (timeSec <= maxTime) time = 100; + else if (timeSec <= maxTime+100) time = (int) Math.ceil(232 - 0.1 * timeSec); + else if (timeSec <= maxTime+500) time = (int) Math.ceil(161 - 0.05 * timeSec); + else if (timeSec < maxTime+2600) time = (int) Math.ceil(392/3.0 - (1/30.0) * timeSec); } int bonus = 0; int tombs; @@ -303,7 +297,7 @@ public class FeatureDungeonScore extends TextHUDFeature { } // amazing thing - return new ScoreCalculation(skill, explorer, time, bonus, tombs, fullyCleared, secrets, totalSecrets, totalSecretsKnown, deaths); + return new ScoreCalculation(skill, explorer, time, bonus, tombs, fullyCleared, secrets, totalSecrets, (int) (totalSecrets * context.getSecretPercentage()), totalSecretsKnown, deaths); } public String getLetter(int score) { if (score <= 99) return "D"; @@ -346,7 +340,7 @@ public class FeatureDungeonScore extends TextHUDFeature { int tombsBreakable = Math.min(5 - calculation.tombs, reqPT); reqPT -= tombsBreakable; - double secretPer = 40.0 / calculation.totalSecrets; + double secretPer = 40.0 / calculation.effectiveTotalSecrets; int secrets = (int) Math.ceil(reqPT / secretPer); actualBit.add(new StyledText(currentLetter,"currentScore")); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java index 75498427..b35d93d9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureDungeonSecrets.java @@ -37,7 +37,7 @@ import java.util.List; public class FeatureDungeonSecrets extends TextHUDFeature { public FeatureDungeonSecrets() { - super("Dungeon.Dungeon Information", "Display Total # of Secrets", "Display how much total secrets have been found in a dungeon run.\n+ sign means DG does not know the correct number, but it's somewhere above that number.", "dungeon.stats.secrets", true, getFontRenderer().getStringWidth("Secrets: 999/999+"), getFontRenderer().FONT_HEIGHT); + super("Dungeon.Dungeon Information", "Display Total # of Secrets", "Display how much total secrets have been found in a dungeon run.\n+ sign means DG does not know the correct number, but it's somewhere above that number.", "dungeon.stats.secrets", true, getFontRenderer().getStringWidth("Secrets: 999/999+ of 999+"), getFontRenderer().FONT_HEIGHT); this.setEnabled(false); getStyles().add(new TextStyle("title", new AColor(0x00, 0xAA,0xAA,255), new AColor(0, 0,0,0), false)); getStyles().add(new TextStyle("separator", new AColor(0x55, 0x55,0x55,255), new AColor(0, 0,0,0), false)); @@ -51,15 +51,26 @@ public class FeatureDungeonSecrets extends TextHUDFeature { public int getSecretsFound() { 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 Secrets Found: §r§b")) { + if (name.startsWith("§r Secrets Found: §r§b") && !name.contains("%")) { String noColor = TextUtils.stripColor(name); return Integer.parseInt(noColor.substring(16)); } } return 0; } + public double getSecretPercentage() { + 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 Secrets Found: §r") && name.contains("%")) { + String noColor = TextUtils.stripColor(name); + return Double.parseDouble(noColor.substring(16).replace("%", "")); + } + } + return 0; + } public int getTotalSecretsInt() { + if (getSecretsFound() != 0) return (int) (getSecretsFound() / getSecretPercentage() * 100); DungeonContext context = skyblockStatus.getContext(); int totalSecrets = 0; for (DungeonRoom dungeonRoom : context.getDungeonRoomList()) { @@ -69,6 +80,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { return totalSecrets; } public boolean sureOfTotalSecrets() { + if (getSecretsFound() != 0) return true; DungeonContext context = skyblockStatus.getContext(); if (context.getMapProcessor().getUndiscoveredRoom() > 0) return false; boolean allknown = true; @@ -124,7 +136,7 @@ public class FeatureDungeonSecrets extends TextHUDFeature { actualBit.add(new StyledText(": ","separator")); actualBit.add(new StyledText(getSecretsFound() +"","currentSecrets")); actualBit.add(new StyledText("/","separator2")); - actualBit.add(new StyledText(getTotalSecrets().replace("+", ""),"totalSecrets")); + actualBit.add(new StyledText((int)(getTotalSecretsInt() * DungeonsGuide.getDungeonsGuide().getSkyblockStatus().getContext().getSecretPercentage())+" of "+getTotalSecretsInt(),"totalSecrets")); actualBit.add(new StyledText(getTotalSecrets().contains("+") ? "+" : "","unknown")); return actualBit; } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java index ef8dd47e..37669835 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/party/customgui/FeatureCustomPartyFinder.java @@ -103,7 +103,6 @@ public class FeatureCustomPartyFinder extends SimpleFeature implements GuiOpenLi for (int i = 0; i < nbttaglist1.tagCount(); i++) { String str = nbttaglist1.getStringTagAt(i); - System.out.println(str); if (str.startsWith("§aCurrently Selected")) { lastClass = str.substring(24); } |