diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-06-25 14:56:23 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-25 14:56:23 +0800 |
commit | d65b7fa3dff0c7d7a6011caa3d1b1c6624101ec9 (patch) | |
tree | d26d8a84d7e73f44e99aa7003d26c245bc33c992 /features | |
parent | 30e0e951950bf7001fb3586e6471bc4948566904 (diff) | |
download | SoopyV2-d65b7fa3dff0c7d7a6011caa3d1b1c6624101ec9.tar.gz SoopyV2-d65b7fa3dff0c7d7a6011caa3d1b1c6624101ec9.tar.bz2 SoopyV2-d65b7fa3dff0c7d7a6011caa3d1b1c6624101ec9.zip |
added diana mob hp display
- added Mythological Mobs HP hud diaplay
Diffstat (limited to 'features')
-rw-r--r-- | features/events/index.js | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/features/events/index.js b/features/events/index.js index cda2c64..0cbf33c 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -7,6 +7,8 @@ import { drawBoxAtBlock, drawBoxAtBlockNotVisThruWalls, drawCoolWaypoint, drawLi import { calculateDistance, calculateDistanceQuick } from "../../utils/utils"; import SettingBase from "../settings/settingThings/settingBase"; import ToggleSetting from "../settings/settingThings/toggle"; +import HudTextElement from "../hud/HudTextElement"; +import LocationSetting from "../settings/settingThings/location"; import { fetch } from "../../utils/networkUtils" import ButtonSetting from "../settings/settingThings/button"; import { delay } from "../../utils/delayUtils"; @@ -64,6 +66,10 @@ class Events extends Feature { this.limitPMemb = new ToggleSetting("Only send inquis ping to party members", "If not in a party it works as default", true, "inquis_ping_party", this).requires(this.otherInquisPing) this.shinyBlocks = [] + this.MythMobsHPGuiElement = new ToggleSetting("Render Mythological Mobs hp on your screen", "This will help you to know their HP.", true, "myth_mobs_hp", this).contributor("EmeraldMerchant"); + this.MythMobsHP = new HudTextElement().setToggleSetting(this.MythMobsHPGuiElement).setLocationSetting(new LocationSetting("Mythological Mobs Hp Location", "Allows you to edit the location of Mythological Mobs hp", "myth_mobs_location", this, [10, 50, 1, 1]).requires(this.MythMobsHPGuiElement).editTempText("&8[&7Lv750&8] &2Exalted Minos Inquisitor &a40M&f/&a40M&c❤&r")); + this.hudElements.push(this.MythMobsHP); + this.lastDing = 0 this.lastDingPitch = 0 this.firstPitch = 0 @@ -222,8 +228,13 @@ class Events extends Feature { } }) + let mythMobs = [] this.todoE.forEach(e => { e = new Entity(e) + let health = e.getName().removeFormatting().split(" ")[4].split("/")[0] + if (this.MythMobsHP.getValue() && health != 0 && (e.getName().removeFormatting().includes("Exalted") || e.getName().removeFormatting().includes("Stalwart"))) { + mythMobs.push(e.getName()) + } if (e.getName().toLowerCase().includes("inquis") && Math.abs(e.getY() - Player.getY()) < 10 && Math.abs(e.getX() - Player.getX()) < 10 && Math.abs(e.getZ() - Player.getZ()) < 10) { let loc = [e.getX(), e.getY() - 1, e.getZ()] let self = false @@ -241,6 +252,9 @@ class Events extends Feature { } }) this.todoE = [] + if (this.MythMobsHP.getValue()) { + this.mythMobsElement.setText(mythMobs.join("\n")) + } if (Player.getContainer().getName() === "Fast Travel") { this.openedWarpsMenu = true @@ -553,10 +567,12 @@ class Events extends Feature { this.lastPath = undefined this.updatingPath = undefined this.lastPathCords = undefined + this.hudElements = []; } onDisable() { - this.initVariables() + this.hudElements.forEach(h => h.delete()) + this.initVariables(); } } |