aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-01-27 19:01:40 +0900
committersyeyoung <cyong06@naver.com>2021-01-27 19:01:40 +0900
commit4dc9da6c2b23d145583ef528260cc7023a60bdfa (patch)
tree2916b02e3866b03a98092fd38406e3954b552b7c /src/main/java/kr/syeyoung/dungeonsguide/features/impl
parentb5cbefcccf5ae5b7d156b181c5cefdcee3861ab8 (diff)
downloadSkyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.gz
Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.tar.bz2
Skyblock-Dungeons-Guide-4dc9da6c2b23d145583ef528260cc7023a60bdfa.zip
BONZO
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java
new file mode 100644
index 00000000..7bb0c43f
--- /dev/null
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/boss/FeatureBossHealth.java
@@ -0,0 +1,58 @@
+package kr.syeyoung.dungeonsguide.features.impl.boss;
+
+import kr.syeyoung.dungeonsguide.SkyblockStatus;
+import kr.syeyoung.dungeonsguide.dungeon.DungeonContext;
+import kr.syeyoung.dungeonsguide.e;
+import kr.syeyoung.dungeonsguide.features.FeatureParameter;
+import kr.syeyoung.dungeonsguide.features.GuiFeature;
+import kr.syeyoung.dungeonsguide.features.listener.ChatListener;
+import kr.syeyoung.dungeonsguide.roomprocessor.bossfight.HealthData;
+import kr.syeyoung.dungeonsguide.utils.TextUtils;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.util.ChatComponentText;
+import net.minecraftforge.client.event.ClientChatReceivedEvent;
+
+import java.awt.*;
+import java.awt.font.TextHitInfo;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.List;
+import java.util.regex.Pattern;
+
+public class FeatureBossHealth extends GuiFeature {
+ public FeatureBossHealth() {
+ super("Bossfight", "Display Boss Health(s)", "Show the health of boss and minibosses in bossfight (Guardians, Priests..)", "bossfight.health", false, getFontRenderer().getStringWidth("The Professor: 4242m"), getFontRenderer().FONT_HEIGHT * 5);
+ this.setEnabled(true);
+ parameters.put("color", new FeatureParameter<Color>("color", "Color", "Color of text", Color.orange, "color"));
+ parameters.put("totalHealth", new FeatureParameter<Boolean>("totalHealth", "show total health", "Show total health along with current health", false, "boolean"));
+ parameters.put("formatHealth", new FeatureParameter<Boolean>("formatHealth", "format health", "1234568 -> 1m", true, "boolean"));
+ }
+
+ SkyblockStatus skyblockStatus = e.getDungeonsGuide().getSkyblockStatus();
+ @Override
+ public void drawHUD(float partialTicks) {
+ if (!skyblockStatus.isOnDungeon()) return;
+ DungeonContext context = skyblockStatus.getContext();
+ if (context == null) return;
+ if (context.getBossfightProcessor() == null) return;
+ List<HealthData> healths = context.getBossfightProcessor().getHealths();
+ int i = 0;
+ FontRenderer fr = getFontRenderer();
+ boolean format = this.<Boolean>getParameter("formatHealth").getValue();
+ boolean total = this.<Boolean>getParameter("totalHealth").getValue();
+ for (HealthData heal : healths) {
+ fr.drawString(heal.getName() + ": " + (format ? TextUtils.format(heal.getHealth()) : heal.getHealth()) + (total ? "/"+(format ? TextUtils.format(heal.getMaxHealth()) : heal.getMaxHealth()) : ""), 0, i, this.<Color>getParameter("color").getValue().getRGB());
+ i += 8;
+ }
+ }
+
+ @Override
+ public void drawDemo(float partialTicks) {
+ FontRenderer fr = getFontRenderer();
+ fr.drawString("The Professor: 3.3m", 0,0, this.<Color>getParameter("color").getValue().getRGB());
+ fr.drawString("Chaos Guardian: 500k", 0,8, this.<Color>getParameter("color").getValue().getRGB());
+ fr.drawString("Healing Guardian: 1m", 0,16, this.<Color>getParameter("color").getValue().getRGB());
+ fr.drawString("Laser Guardian: 5m", 0,24, this.<Color>getParameter("color").getValue().getRGB());
+ fr.drawString("Giant: 10m", 0,32, this.<Color>getParameter("color").getValue().getRGB());
+ }
+}