diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-08-10 05:31:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-10 05:31:35 +0800 |
commit | 7949ad0ee8ca8e851f141cf2dc75e5675103a785 (patch) | |
tree | 22c3e00711693d0ff57df58b99b3d7b6224d15b1 | |
parent | f15b6b06d27525e80be44512cc8554fb12b33c9d (diff) | |
download | SoopyV2-7949ad0ee8ca8e851f141cf2dc75e5675103a785.tar.gz SoopyV2-7949ad0ee8ca8e851f141cf2dc75e5675103a785.tar.bz2 SoopyV2-7949ad0ee8ca8e851f141cf2dc75e5675103a785.zip |
Added Bozo Mask Features
+ Bonzo Mask Timer (in dun)
+ Fragged Bonzo Mask Timer (in dun)
+ Spirit Mask Timer (in dun/ in+out dun toggleable)
-rw-r--r-- | features/dungeonSolvers/index.js | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index 26bbc1b..ea1838e 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -50,6 +50,12 @@ class DungeonSolvers extends Feature { Arcade: "&e", }; + this.bonzoMaskTimer = 0; + this.fraggedBonzoMaskTimer = 0; + this.spiritMaskTimer = 0; + this.eraseBonzoTimer = true; + this.bonzoMaskCooldown = 0; + this.lastWorldload = Date.now() this.lividFindEnabled = new ToggleSetting("Correct livid finder", "Finds the real livid to kill in the f5 boss fight", true, "livid_find_enabled", this); this.lividFindHud = new ToggleSetting("Show Livid Hp", "Shows the nametag of the correct livid", true, "livid_hud_enabled", this).requires(this.lividFindEnabled); @@ -103,7 +109,92 @@ class DungeonSolvers extends Feature { if (this.lastDungFinishes.length > 5) { this.lastDungFinishes.shift(); } + + this.bonzoMaskTimer = 0; + this.fraggedBonzoMaskTimer = 0; + this.spiritMaskTimer = 0; + this.eraseBonzoTimer = true; }); + this.registerChat("${prefix}\"mode\":\"dungeon\",\"map\":\"Dungeon\"}&r", () => { + [...Player.getInventory().getItems()].forEach(i => { + if (!i) return + let itemName = i.getName() + if (itemName.removeFormatting().includes("Bonzo's Mask")) { + i.getLore().forEach(line => { + if (line.includes("Cooldown:")) { + this.bonzoMaskCooldown = Number(line.removeFormatting().split("n: ")[1].replace("s", "")) + } + }) + } + }) + }) + this.bonzoSpiritMaskTimer = new ToggleSetting("Timer for when bonzo/spirit mask will be ready", "works for both bonzo masks, hides bonzo masks' timers after you leave the run", false, "bonzo_mask_timer", this); + this.bonzoSpiritMaskTimerElement = new HudTextElement().setToggleSetting(this.bonzoSpiritMaskTimer).setLocationSetting(new LocationSetting("Bonzo/Spirit Mask timer location", "Allows you to edit the location of the timer", "bonzo_mask_timer_location", this, [10, 100, 1, 1]).requires(this.bonzoSpiritMaskTimer).editTempText("&9Bonzo's Mask: &c157s")); + this.hudElements.push(this.bonzoSpiritMaskTimerElement); + this.spiritMaskOutsideDungeon = new ToggleSetting("Spirit Mask Timer Outside Dungeons", "should spirit mask timer be shown outside dungeon?", false, "spirit_mask_timer", this).requires(this.bonzoSpiritMaskTimer); + + this.normalBonzoMask = new ToggleSetting("Bonzo Mask Proc'ed Alert", "Enable this to change the message", true, "bonzo_mask_alert", this).requires(this.bonzoSpiritMaskTimer); + this.normalBonzoMaskMessage = new TextSetting("Bonzo Mask Proc'ed Message", "change bonzo mask proc message here", "&cBonzo Mask Used", "bonzo_mask_alert_message", this, "&cBonzo Mask Used", false).requires(this.normalBonzoMask); + this.fraggedBonzoMask = new ToggleSetting("⚚ Bonzo Mask Proc'ed Alert", "Enable this to change the message", true, "fragged_bonzo_mask_alert", this).requires(this.bonzoSpiritMaskTimer); + this.fraggedBonzoMaskMessage = new TextSetting("⚚ Bonzo Mask Proc'ed Message", "change bonzo mask proc message here", "&c⚚ Bonzo Mask Used", "fragged_bonzo_mask_alert_message", this, "&c⚚ Bonzo Mask Used", false).requires(this.fraggedBonzoMask); + this.spiritMask = new ToggleSetting("Spirit Mask Proc'ed Alert", "Enable this to change the message", true, "spirit_mask_alert", this).requires(this.bonzoSpiritMaskTimer); + this.spiritMaskMessage = new TextSetting("Spirit Mask Proc'ed Message", "change spirit mask proc message here", "&cSpirit Mask Used", "spirit_mask_alert_message", this, "&cSpirit Mask Used", false).requires(this.spiritMask); + + this.registerChat("&r&aYour &r&9Bonzo's Mask &r&asaved your life!&r", () => { + this.eraseBonzoTimer = false; + if (this.bonzoSpiritMaskTimer.getValue()) { + this.bonzoMaskTimer = Date.now() + this.bonzoMaskCooldown * 1000; + } + if (this.normalBonzoMask.getValue()) { + let m = this.normalBonzoMaskMessage.getValue() + Client.showTitle(m ? m : "&cBonzo Mask Used", "", 0, 60, 10) + } + }) + + this.registerChat("&r&aYour &r&9⚚ Bonzo's Mask &r&asaved your life!&r", () => { + this.eraseBonzoTimer = false; + if (this.bonzoSpiritMaskTimer.getValue()) { + this.fraggedBonzoMaskTimer = Date.now() + this.bonzoMaskCooldown * 1000; + } + if (this.fraggedBonzoMask.getValue()) { + let m = this.fraggedBonzoMaskMessage.getValue() + Client.showTitle(m ? m : "&c⚚ Bonzo Mask Used", "", 0, 60, 10) + } + }) + + this.registerChat("&r&6Second Wind Activated&r&a! &r&aYour Spirit Mask saved your life!&r", () => { + if (this.bonzoSpiritMaskTimer.getValue()) { + if (this.spiritMaskOutsideDungeon.getValue() ? true : !this.eraseBonzoTimer) { + this.spiritMaskTimer = Date.now() + 30 * 1000; + } + } + if (this.fraggedBonzoMask.getValue()) { + let m = this.spiritMaskMessage.getValue() + Client.showTitle((m ? m : "&cSpirit Mask Used"), "", 0, 60, 10) + } + }) + + this.registerStep(true, 10, () => { + if (!this.bonzoSpiritMaskTimer.getValue()) return + let timerText = "" + if (this.spiritMaskOutsideDungeon.getValue() ? true : !this.eraseBonzoTimer) { + if (this.spiritMask.getValue()) { + let timer1 = Math.round((this.spiritMaskTimer - Date.now())/100)/10 + timerText += "&5Spirit Mask: " + (timer1 > 0 ? "&c" + timer1 + "&6s" : "&6READY") + "\n" + } + } + if (!this.eraseBonzoTimer) { + if (this.normalBonzoMask.getValue()) { + let timer2 = Math.round((this.bonzoMaskTimer - Date.now())/100)/10 + timerText += "&9Bonzo's Mask: " + (timer2 > 0 ? "&c" + timer2 + "&6s" : "&6READY") + "\n" + } + if (this.fraggedBonzoMask.getValue()) { + let timer3 = Math.round((this.fraggedBonzoMaskTimer - Date.now())/100)/10 + timerText += "&9⚚ Bonzo's Mask: " + (timer3 > 0 ? "&c" + timer3 + "&6s" : "&6READY") + } + } + this.bonzoSpiritMaskTimerElement.setText(timerText) + }) this.forgorEnabled = new ToggleSetting("Change withermancer death message to forgor ", "", true, "withermancer_forgor", this); this.f7waypoints = new ToggleSetting("Waypoints for P3 F7/M7", "(Only shows unfinished ones)", true, "f7_waypoints", this); |