aboutsummaryrefslogtreecommitdiff
path: root/features/slayers
diff options
context:
space:
mode:
Diffstat (limited to 'features/slayers')
-rw-r--r--features/slayers/index.js90
1 files changed, 85 insertions, 5 deletions
diff --git a/features/slayers/index.js b/features/slayers/index.js
index fb3cc33..3a06139 100644
--- a/features/slayers/index.js
+++ b/features/slayers/index.js
@@ -48,14 +48,22 @@ class Slayers extends Feature {
this.slayerXpElement = new HudTextElement()
.setText("&6Slayer&7> &fLoading...")
.setToggleSetting(this.slayerXpGuiElement)
- .setLocationSetting(new LocationSetting("Slayer Xp Location", "Allows you to edit the location of you current slayer xp", "slayer_xp_location", this, [10, 50, 1, 1]).requires(this.slayerXpGuiElement).editTempText("&6Enderman&7> &d&l2,147,483,647 XP").contributor("EmeraldMerchant"));
+ .setLocationSetting(new LocationSetting("Slayer Xp Location", "Allows you to edit the location of your current slayer xp", "slayer_xp_location", this, [10, 50, 1, 1]).requires(this.slayerXpGuiElement).editTempText("&6Enderman&7> &d&l2,147,483,647 XP").contributor("EmeraldMerchant"));
this.hudElements.push(this.slayerXpElement);
this.MinibossAlert = new ToggleSetting("Alert when miniboss spawned nearby", "Pops up notification when a miniboss spawned", false, "miniboss_title_ping", this).contributor("EmeraldMerchant");
this.MinibossPing = new ToggleSetting("Also make a sound when miniboss spawned", "Sound ping when a miniboss spawned", false, "miniboss_sound_ping", this).contributor("EmeraldMerchant");
this.BoxAroundMiniboss = new ToggleSetting("Draws boxes around minibosses.", "If they are too far away it doesnt draw.", false, "box_around_miniboss", this).contributor("EmeraldMerchant");
+ this.BoxAroundAreaMiniboss = new ToggleSetting("Draws boxes around area minibosses", "eg. Voidling Extremist in void sepulture", false, "box_around_area_mini", this).contributor("EmeraldMerchant");
this.MinibossOffWhenBoss = new ToggleSetting("Disable miniboss features when your boss spawned", "this will boost your fps a little bit during boss", true, "miniboss_off_when_boss", this).contributor("EmeraldMerchant");
+ this.MinibossGuiElement = new ToggleSetting("Lists Nearby Miniboss HP on Screen", "This will help you to know if theres miniboss nearby/ know their hp", true, "miniboss_hud", this).contributor("EmeraldMerchant");
+ this.MinibossElement = new HudTextElement()
+ .setText("")
+ .setToggleSetting(this.MinibossGuiElement)
+ .setLocationSetting(new LocationSetting("Nearby Miniboss HP Location", "Allows you to edit the location of Nearby Miniboss HP hud", "miniboss_hud_location", this, [10, 50, 1, 1]).requires(this.MinibossGuiElement).editTempText("&5Voidling Radical &a25M&c❤").contributor("EmeraldMerchant"));
+ this.hudElements.push(this.MinibossElement);
+
this.betterHideDeadEntity = new ToggleSetting("Also hides mob nametag when it's dead.", "An improvement for Skytils's hide dead entity", false, "hide_dead_mob_nametag", this);
this.beaconSoundType = {
@@ -246,6 +254,7 @@ class Slayers extends Feature {
this.beaconLocations = {};
this.eyeE = [];
this.minibossEntity = [];
+ this.areaMiniEntity = [];
this.todoE2 = [];
this.emanBoss = undefined;
this.actualEmanBoss = undefined
@@ -270,6 +279,13 @@ class Slayers extends Feature {
enderman: new Set(["Voidling Devotee", "Voidling Radical", "Voidcrazed Maniac"]),
blaze: new Set(["Flare Demon", "Kindleheart Demon", "Burningsoul Demon"])
}
+ //dont think spider has an area mini
+ this.areaMini = {
+ zombie: new Set(["Golden Ghoul"]),
+ wolf: new Set(["Old Wolf", "Soul of the Alpha"]),
+ enderman: new Set(["Voidling Extremist"]),
+ blaze: new Set(["Millenia-Aged Blaze"])
+ }
this.SlayerWidth = {
zombie: 1,
@@ -285,6 +301,28 @@ class Slayers extends Feature {
enderman: -3,
blaze: -2
}
+ this.areaColor = {
+ zombie: {
+ r: 1,
+ g: 0.67,
+ b: 0
+ },
+ wolf: {
+ r: 0,
+ g: 0.67,
+ b: 0.67
+ },
+ enderman: {
+ r: 1,
+ g: 0.33,
+ b: 1
+ },
+ blaze: {
+ r: 0.67,
+ g: 0,
+ b: 0
+ }
+ }
//the volume of miniboss spawning is 0.6000000238418579
this.registerSoundPlay("random.explode", (pos, name, vol, pitch, categoryName, event) => {
if (Math.round(10 * vol) !== 6 || Math.abs(pos.getY() - Player.getY()) > 5 || pos.getX() - Player.getX() > 20 || pos.getZ() - Player.getZ() > 20) return
@@ -341,6 +379,7 @@ class Slayers extends Feature {
this.beaconLocations = {};
this.eyeE = [];
this.minibossEntity = [];
+ this.areaMiniEntity = [];
this.emanBoss = undefined;
this.actualEmanBoss = undefined;
this.hideSummons = false
@@ -377,7 +416,12 @@ class Slayers extends Feature {
}
renderWorld(ticks) {
this.minibossEntity.forEach((x) => {
- drawBoxAtEntity(x[0], 0, 255, 0, this.SlayerWidth[x[1]], this.SlayerHeight[x[1]], ticks, 4, false);
+ drawBoxAtEntity(x[0], 0, 1, 0, this.SlayerWidth[x[1]], this.SlayerHeight[x[1]], ticks, 4, false);
+ })
+
+
+ this.areaMiniEntity.forEach((x) => {
+ drawBoxAtEntity(x[0], this.areaColor[x[1]].r, this.areaColor[x[1]].g, this.areaColor[x[1]].b, this.SlayerWidth[x[1]], this.SlayerHeight[x[1]], ticks, 4, false);
})
if (this.emanBoss && this.boxAroundEmanBoss.getValue()) drawBoxAtEntity(this.emanBoss, 0, 255, 0, 1, -3, ticks, 4, false);
@@ -430,7 +474,7 @@ class Slayers extends Feature {
this.renderEntityEvent.unregister();
}
- if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonHPGuiElement.getValue() || this.summonsLowWarning.getValue() || (this.isCorrectBind && this.bossBindDefault.getValue() != "CHAR_NONE")) {
+ if (this.BoxAroundMiniboss.getValue() || this.BoxAroundAreaMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonHPGuiElement.getValue() || this.summonsLowWarning.getValue() || (this.isCorrectBind && this.bossBindDefault.getValue() != "CHAR_NONE")) {
World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((name) => {
let nameRemoveFormat = name.getName().removeFormatting()
if (this.cannotFindEmanBoss) {
@@ -449,6 +493,8 @@ class Slayers extends Feature {
}
let nameSplit = nameRemoveFormat.split(" ")
let MobName = `${nameSplit[0]} ${nameSplit[1]}`
+ let MobName12 = `${nameSplit[1]} ${nameSplit[2]}`
+ let MobName1234 = `${nameSplit[1]} ${nameSplit[2]} ${nameSplit[3]} ${nameSplit[4]}` //so cringe that soul of the alpha is 4 words
if (this.summonEntity.length !== parseInt(this.maxSummons.getValue())) {
if (this.summonsHideNametag.getValue() || this.summonsLowWarning.getValue() || this.summonHPGuiElement.getValue()) {
// 2nd statement makes it to support both tank zombie and super tank zombie
@@ -463,8 +509,12 @@ class Slayers extends Feature {
if (this.BoxAroundMiniboss.getValue() && !this.bossSpawnedMessage && this.Miniboss[this.lastSlayerType]?.has(MobName) && !this.minibossEntity.map(a => a[0].getUUID().toString()).includes(name.getUUID().toString())) {
this.minibossEntity.push([name, this.lastSlayerType]);
}
+ if (this.BoxAroundAreaMiniboss.getValue() && !this.bossSpawnedMessage && (this.areaMini[this.lastSlayerType]?.has(MobName12) || this.areaMini[this.lastSlayerType]?.has(MobName1234)) && !this.areaMiniEntity.map(a => a[0].getUUID().toString()).includes(name.getUUID().toString())) {
+ this.areaMiniEntity.push([name, this.lastSlayerType]);
+ }
if (this.betterHideDeadEntity.getValue()) {
- if (nameSplit[nameSplit.length - 1].startsWith("0") && nameSplit[nameSplit.length - 1].endsWith("❤")) {
+ let lastArgs = nameSplit[nameSplit.length - 1]
+ if (lastArgs.startsWith("0") && lastArgs.endsWith("❤")) {
name.getEntity()[m.setAlwaysRenderNameTag](false)
}
}
@@ -536,12 +586,20 @@ class Slayers extends Feature {
}
if (!this.bossSpawnedMessage && e instanceof net.minecraft.entity.item.EntityArmorStand) {
- let mobName = `${e[m.getCustomNameTag]().removeFormatting().split(" ")[0]} ${e[m.getCustomNameTag]().removeFormatting().split(" ")[1]}`
+ let nameSplit = e[m.getCustomNameTag]().removeFormatting().split(" ")
+ let mobName = `${nameSplit[0]} ${nameSplit[1]}`
+ let MobName12 = `${nameSplit[1]} ${nameSplit[2]}`
+ let MobName1234 = `${nameSplit[1]} ${nameSplit[2]} ${nameSplit[3]} ${nameSplit[4]}`
if (this.Miniboss[this.lastSlayerType]?.has(mobName)) {
if (this.BoxAroundMiniboss.getValue() && !this.minibossEntity.map(a => a[0].getUUID().toString()).includes(e[m.getEntityId.Entity]().toString())) {
this.minibossEntity.push([new Entity(e), this.lastSlayerType]);
}
}
+ if (this.areaMini[this.lastSlayerType]?.has(MobName12) || this.areaMini[this.lastSlayerType]?.has(MobName1234)) {
+ if (this.BoxAroundAreaMiniboss.getValue() && !this.areaMiniEntity.map(a => a[0].getUUID().toString()).includes(e[m.getEntityId.Entity]().toString())) {
+ this.areaMiniEntity.push([new Entity(e), this.lastSlayerType]);
+ }
+ }
}
if (e instanceof net.minecraft.entity.item.EntityArmorStand && e[m.getCustomNameTag]() && this.blazeTowerDink.getValue()) {
@@ -612,6 +670,11 @@ class Slayers extends Feature {
this.minibossEntity.splice(this.minibossEntity.indexOf(eArray))
}
})
+ this.areaMiniEntity.forEach((eArray) => {
+ if (eArray[0].getEntity()[f.isDead]) {
+ this.areaMiniEntity.splice(this.areaMiniEntity.indexOf(eArray))
+ }
+ })
this.eyeE = this.eyeE.filter((e) => !e.getEntity()[f.isDead]);
this.candidateBoss = this.candidateBoss.filter((e) => !e[f.isDead]);
this.beaconE = this.beaconE.filter((e) => {
@@ -734,6 +797,22 @@ class Slayers extends Feature {
} else {
this.emanHpElement.setText("");
}
+
+ if (this.MinibossGuiElement.getValue() && !this.bossSpawnedMessage && this.minibossEntity.length > 0) {
+ let PY = Player.getY()
+ let minis = this.minibossEntity
+ let tempArray = []
+ let tempEntity = []
+ minis.forEach((x) => {//this.SlayerHeight[slayerType] values are negative
+ if (tempEntity.includes(x[0])) return
+ if (Math.abs((x[0].getY() + this.SlayerHeight[x[1]] - PY)) > 6) return
+ let name = x[0].getName()
+ if (name.split(" ")[2] === "§e0§c❤") return
+ tempEntity.push(x[0])
+ tempArray.push(name)
+ })
+ this.MinibossElement.setText(tempArray.join("\n"))
+ } else this.MinibossElement.setText("")
if (this.pillerE) {
if (this.pillerE.getEntity()[f.isDead]) this.pillerE = undefined
@@ -900,6 +979,7 @@ class Slayers extends Feature {
this.emanStartedSittingTime = undefined
this.eyeE = undefined;
this.minibossEntity = undefined;
+ this.areaMiniEntity = undefined;
this.nextIsBoss = undefined;
this.hudElements = [];
this.entityAttackEventLoaded = undefined;