diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-06-25 15:57:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-25 15:57:32 +0800 |
commit | 18d42e724643828d23ce20cf634dfba42b93c6a6 (patch) | |
tree | 5f8faac265c737d33afdf87b35f5de3b7a3ee0ae | |
parent | 118fb2e6547fc4078b539afd42b4e373682b747e (diff) | |
parent | 59e714cec0b71d2e6cb4ba4f939436c0b382237b (diff) | |
download | SoopyV2-18d42e724643828d23ce20cf634dfba42b93c6a6.tar.gz SoopyV2-18d42e724643828d23ce20cf634dfba42b93c6a6.tar.bz2 SoopyV2-18d42e724643828d23ce20cf634dfba42b93c6a6.zip |
Merge pull request #20 from EmeraldMerchant/patch-17
added diana mob hp display
-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..de5d119 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 (mythMobs.length >= 1) { + 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(); } } |