From 6f846f8f490f297cef353e64de50270bccc3ca44 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Thu, 6 Oct 2022 18:00:51 +0800 Subject: Terminal/devices done count at end of p3 --- src/features/dungeonSolvers/index.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'src') diff --git a/src/features/dungeonSolvers/index.js b/src/features/dungeonSolvers/index.js index 344f460..6edb039 100644 --- a/src/features/dungeonSolvers/index.js +++ b/src/features/dungeonSolvers/index.js @@ -191,6 +191,7 @@ class DungeonSolvers extends Feature { }) 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); + this.f7waypointschat = new ToggleSetting("Show how many terms/devices people did", "At end of p3", true, "f7_waypoints_chat", this); this.IceSprayWarn = new ToggleSetting("Ice Spray Drop Ping", "Renders a big title so you don't miss ice spray wands", false, "ice_spray_ping", this).contributor("EmeraldMerchant"); @@ -362,6 +363,7 @@ class DungeonSolvers extends Feature { }) this.registerChat("[BOSS] Goldor: Who dares trespass into my domain?", () => { this.area = 0 + this.termsDone.clear() this.areaUpdated() }) @@ -376,9 +378,18 @@ class DungeonSolvers extends Feature { }) }) + this.termsDone = new Map() this.registerChat("${name} activated a lever! (${start}/${end})", (name, start, end) => { let player = World.getPlayerByName(ChatLib.removeFormatting(name)) + let data = this.termsDone.get(name) || { + terms: 0, + devices: 0, + levers: 0 + } + data.levers++ + this.termsDone.set(name, data) + if (!player) return let closestDist = calculateDistanceQuick([this.levers[0].params.x, this.levers[0].params.y, this.levers[0].params.z], [player.getX(), player.getY(), player.getZ()]) @@ -402,6 +413,14 @@ class DungeonSolvers extends Feature { this.registerChat("${name} completed a device! (${start}/${end})", (name, start, end) => { + let data = this.termsDone.get(name) || { + terms: 0, + devices: 0, + levers: 0 + } + data.devices++ + this.termsDone.set(name, data) + let closest = this.devices[0] closest.stopRender() @@ -415,6 +434,14 @@ class DungeonSolvers extends Feature { this.registerChat("${name} activated a terminal! (${start}/${end})", (name, start, end) => { let player = World.getPlayerByName(ChatLib.removeFormatting(name)) + let data = this.termsDone.get(name) || { + terms: 0, + devices: 0, + levers: 0 + } + data.terms++ + this.termsDone.set(name, data) + if (!player) return let closestDist = calculateDistanceQuick([this.terminals[0].params.x, this.terminals[0].params.y, this.terminals[0].params.z], [player.getX(), player.getY(), player.getZ()]) @@ -506,6 +533,14 @@ class DungeonSolvers extends Feature { } areaUpdated() { + if (this.f7waypointschat.getValue() && this.terminals.length > 0 && (this.area === -1 || this.area === 4)) { + delay(1000, () => { + this.termsDone.forEach((data, name) => { + ChatLib.chat(this.FeatureManager.messagePrefix + name + " &7completed &f" + data.terms + "&7 terms, &f" + data.devices + "&7 devices, and &f" + data.levers + ' &7levers!') + }) + }) + } + this.terminals.forEach(w => w.stopRender()) this.levers.forEach(w => w.stopRender()) this.devices.forEach(w => w.stopRender()) -- cgit