diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-07-08 12:51:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-08 12:51:45 +0800 |
commit | cf09e753c3240895fd2051cf416b612a903be63c (patch) | |
tree | 122456b79e20897a2e936a8bd3454421c66502bf /features/slayers/index.js | |
parent | 29ac62eeb7f1cf3ca0ec0c7667d7918ad202666d (diff) | |
parent | 8fee4a716bfd27f6f8c4aad85a8f46c87524f138 (diff) | |
download | SoopyV2-cf09e753c3240895fd2051cf416b612a903be63c.tar.gz SoopyV2-cf09e753c3240895fd2051cf416b612a903be63c.tar.bz2 SoopyV2-cf09e753c3240895fd2051cf416b612a903be63c.zip |
Merge pull request #28 from EmeraldMerchant/patch-29
fixes
Diffstat (limited to 'features/slayers/index.js')
-rw-r--r-- | features/slayers/index.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/features/slayers/index.js b/features/slayers/index.js index c8144ad..29b2964 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -68,7 +68,10 @@ class Slayers extends Feature { this.summonFeatureMaster = new ToggleSetting("Summon Features Main Toggle", "enable this to use summon features", false, "summons_master", this).contributor("EmeraldMerchant"); this.summonsHideNametag = new ToggleSetting("Hide your summons' nametags", "so u can see your boss more clearly", false, "hide_summons_nametags", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); - this.summonsShowNametag = new ToggleSetting("Renders your summons' HP on screen", "this shows your summons' hp on screen", false, "show_summons_hp", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); + this.summonsLowWarning = new ToggleSetting("Warns you when a summon is low", "this warns you after a delay after each bosses, until you respawn them", false, "warn_when_summon_low", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); + this.warnDelay = new TextSetting("Delay for warning", "How long should it wait after the boss to warn you a summon is low", "3", "summon_warn_delay", this, "(seconds)", false).requires(this.summonsLowWarning).contributor("EmeraldMerchant"); + this.summonPercentage = new TextSetting("When will it start warning you", "Below how many % hp (your summons) should it start warning you", "30", "summon_warn_percentage", this, "(%)", false).requires(this.summonsLowWarning).contributor("EmeraldMerchant"); + this.summonHPGuiElement = new ToggleSetting("Render the HP of your summons on your screen", "This will help you to know how much HP your summons have left while hide summons nametags is on", false, "summon_hp_hud", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); this.summonHPElement = new HudTextElement() .setText("") .setToggleSetting(this.summonsShowNametag) @@ -144,7 +147,7 @@ class Slayers extends Feature { } this.lastBossSlain = Date.now(); - if (this.summonsLowWarning.getValue() && this.warnAfterBoss) { + if (this.summonFeatureMaster.getValue() && this.summonsLowWarning.getValue() && this.warnAfterBoss) { this.warnAfterBoss = false let delayForWarn = parseInt(this.warnDelay.getValue()) * 1000 if (delayForWarn < 0 || delayForWarn > 10000) { @@ -175,9 +178,9 @@ class Slayers extends Feature { } this.registerChat("&r&aYou have spawned your ${soul} &r&asoul! &r&d(${mana} Mana)&r", (soul, mana) => { - if (!this.summonFeatureMaster) { + if (!this.summonFeatureMaster.getValue()) { return - } else if (!this.summonsHideNametag && !this.summonsShowNametag && !this.summonsLowWarning) { + } else if (!this.summonsHideNametag.getValue() && !this.summonHPGuiElement.getValue() && !this.summonsLowWarning.getValue()) { return } if (!soul.removeFormatting().includes("Tank Zombie")) { @@ -390,7 +393,7 @@ class Slayers extends Feature { this.renderEntityEvent.unregister(); } - if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { + if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonHPGuiElement.getValue() || this.summonsLowWarning.getValue()) { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((name) => { if (this.cannotFindEmanBoss) { if (!this.bossSpawnedMessage) { @@ -404,7 +407,7 @@ class Slayers extends Feature { let nameSplit = name.getName().removeFormatting().split(" ") let MobName = `${nameSplit[0]} ${nameSplit[1]}` if (this.summonEntity.length !== parseInt(this.maxSummons.getValue())) { - if (this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { + if (this.summonsHideNametag.getValue() || this.summonsLowWarning.getValue() || this.summonHPGuiElement.getValue()) { // 2nd statement makes it to support both tank zombie and super tank zombie if (nameSplit[0] === `${Player.getName()}'s` && `${nameSplit[nameSplit.length - 3]} ${nameSplit[nameSplit.length - 2]}` === "Tank Zombie" && !this.summonEntity?.map(a => a.getUUID().toString()).includes(name.getUUID().toString())) { this.summonEntity.push(name) @@ -545,7 +548,7 @@ class Slayers extends Feature { if (this.summonsHideNametag.getValue()) { eArray.getEntity()[m.setAlwaysRenderNameTag](false) } - if (this.summonsShowNametag.getValue()) { + if (this.summonHPGuiElement.getValue()) { if (this.formatNumber(summonHP) <= this.summonAtHPShouldWarn) { summonHpFloatText += `&c&l${summonHP.removeFormatting().replace("❤", "")}&r&c❤ ` } else { summonHpFloatText += `${summonHP} ` } |