diff options
-rw-r--r-- | features/dataLoader/index.js | 2 | ||||
-rw-r--r-- | features/dungeonMap2/index.js | 2 | ||||
-rw-r--r-- | features/dungeonMap2/metadata.json | 2 | ||||
-rw-r--r-- | features/dungeonSolvers/index.js | 3 | ||||
-rw-r--r-- | features/hud/index.js | 78 | ||||
-rw-r--r-- | metadata.json | 1 | ||||
-rw-r--r-- | utils/numberUtils.js | 4 |
7 files changed, 78 insertions, 14 deletions
diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js index d4134d2..c5dbb2c 100644 --- a/features/dataLoader/index.js +++ b/features/dataLoader/index.js @@ -158,6 +158,8 @@ class DataLoader extends Feature { if (!this.isInSkyblock) { this.stats = {} + this.isInDungeon = false + this.dungeonFloor = undefined return } diff --git a/features/dungeonMap2/index.js b/features/dungeonMap2/index.js index 08f0869..61909a0 100644 --- a/features/dungeonMap2/index.js +++ b/features/dungeonMap2/index.js @@ -19,7 +19,7 @@ class DungeonMap extends Feature { onEnable() { if (Player.getUUID().toString() !== "dc8c3964-7b29-4e03-ae9e-d13ebd65dd29") { - new SettingBase("Coming soontm", "maby", undefined, "coming_soontm", this) + new SettingBase("not Coming soontm", "maby", undefined, "coming_soontm", this) return } this.mapLocation = new ImageLocationSetting("Map Location", "Sets the location of the map on the hud", "dmap_location", this, [10, 10, 1], new Image(javax.imageio.ImageIO.read(new java.io.File("./config/ChatTriggers/modules/SoopyV2/features/dungeonMap/map.png"))), 150, 150) diff --git a/features/dungeonMap2/metadata.json b/features/dungeonMap2/metadata.json index a32de89..53e7e03 100644 --- a/features/dungeonMap2/metadata.json +++ b/features/dungeonMap2/metadata.json @@ -1,7 +1,7 @@ { "name": "Dungeon Map 2", "description": "WIP", - "isHidden": false, + "isHidden": true, "isTogglable": true, "defaultEnabled": false, "sortA": 1 diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js index 2d3c4b7..a724891 100644 --- a/features/dungeonSolvers/index.js +++ b/features/dungeonSolvers/index.js @@ -703,7 +703,8 @@ class DungeonSolvers extends Feature { this.nameToUuid = { "you": Player.getUUID().toString() } - + this.spiritBowPickUps = [] + this.bearSpawning = 0 this.startSpawningTime = 0; this.spawnIdThing = 0; this.eMovingThing = {}; diff --git a/features/hud/index.js b/features/hud/index.js index 25506a3..0f16e80 100644 --- a/features/hud/index.js +++ b/features/hud/index.js @@ -10,7 +10,7 @@ import DropdownSetting from "../settings/settingThings/dropdownSetting"; import { getLevelByXp } from "../../utils/statUtils"; import { firstLetterCapital } from "../../utils/stringUtils"; import renderLibs from "../../../guimanager/renderLibs"; -import { numberWithCommas } from "../../utils/numberUtils.js"; +import { addNotation, numberWithCommas } from "../../utils/numberUtils.js"; const ProcessBuilder = Java.type("java.lang.ProcessBuilder") const Scanner = Java.type("java.util.Scanner") @@ -215,13 +215,13 @@ class Hud extends Feature { } - // this.showDragonDamages = new ToggleSetting("Show dragon damages", "This will render the top 3 damages + your damage during a dragon fight", true, "dragon_dmg_enable", this).requires(this.soulflowEnabledSetting) - // this.dragonDamageElement = new HudTextElement() - // .setToggleSetting(this.showDragonDamages) - // .setLocationSetting(new LocationSetting("Damage Location", "Allows you to edit the location of the damage leaderboard", "dragon_dmg_location", this, [50, 40, 1, 1]) - // .requires(this.showDragonDamages) - // .editTempText("Test Line 1\nTest line 2\nTest line 3\nTest line 4 (longer KEKW)")) - // this.hudElements.push(this.dragonDamageElement) + this.showDragonDamages = new ToggleSetting("Show dragon damages", "This will render the top 3 damages + your damage during a dragon fight", true, "dragon_dmg_enable", this).requires(this.soulflowEnabledSetting) + this.dragonDamageElement = new HudTextElement() + .setToggleSetting(this.showDragonDamages) + .setLocationSetting(new LocationSetting("Damage Location", "Allows you to edit the location of the damage leaderboard", "dragon_dmg_location", this, [50, 40, 1, 1]) + .requires(this.showDragonDamages) + .editTempText("&6Old Dragon &7(&f13.4&7M HP)\n&7- &fSoopyboo32&7:&f 13.4&7M\n&7- &fCamCamSatNav&7:&f 12.3&7M\n&7- &fMuffixy&7:&f 3.4&7M")) + this.hudElements.push(this.dragonDamageElement) this.step_5second() @@ -497,6 +497,68 @@ class Hud extends Feature { } } + this.dragonDamageElement.setText("") + + if (this.showDragonDamages.getValue()) { + + let playerDamage = -1 + let dragonHealth = -1 + + Scoreboard.getLines().forEach(line => { + if (ChatLib.removeFormatting(line).startsWith("Your Damage: ")) { + playerDamage = parseInt(ChatLib.removeFormatting(line).replace("Your Damage: ", "").replace(/[^0-9\.]/g, "")) + } + if (ChatLib.removeFormatting(line).startsWith("Dragon HP: ")) { + dragonHealth = parseInt(ChatLib.removeFormatting(line).replace("Dragon HP: ", "").replace(/[^0-9\.]/g, "")) + } + }) + + if (playerDamage > -1) { + + let damages = [[Player.getName(), playerDamage]] + let dragonType = "" + + let lbNum = 0 + + TabList.getNames().forEach(n => { + l = ChatLib.removeFormatting(n) + + if (lbNum > 0) { + lbNum-- + + // Soopyboo32: 3.2M + + let name = l.split(":")[0].trim() + + if (name === Player.getName()) return + + let damage = l.split(" ").pop() + + let actualDamage = parseFloat(damage) + + if (damage.includes("k")) actualDamage *= 1000 + if (damage.includes("M")) actualDamage *= 1000000 + + damages.push([name, actualDamage]) + } + if (l.startsWith("Dragon Fight: (")) { + dragonType = l.split("(")[1].split(")")[0] + + lbNum = 3 + } + }) + + let text = `&6${dragonType} Dragon &7(&f${addNotation("oneLetters", dragonHealth, "&7")} HP)` + + damages.sort((a, b) => b[1] - a[1]).forEach(d => { + text += `\n&7- &f${d[0]}&7: &f${addNotation("oneLetters", d[1], "&7")}` + }) + + this.dragonDamageElement.setText(text) + } + + } + if (Player.getPlayer()[m.getAbsorptionAmount]() > this.lastAbsorbtion) { if (Date.now() - this.impactTest < 750) { this.lastWitherImpact = Date.now() diff --git a/metadata.json b/metadata.json index a0dd5ed..45bdbda 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,6 @@ "requires": [ "soopyApis", "soopyAddonsData", - "CustomTabCompletions", "guimanager", "mappings", "BeaconBeam" diff --git a/utils/numberUtils.js b/utils/numberUtils.js index 597a538..7889d74 100644 --- a/utils/numberUtils.js +++ b/utils/numberUtils.js @@ -5,7 +5,7 @@ let utils = { parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ","); return parts.join("."); }, - addNotation: function (type, value) { + addNotation: function (type, value, joiner="") { let returnVal = value; let notList = []; if (type === "shortScale") { @@ -36,7 +36,7 @@ let utils = { returnVal = value / (checkNum / 100); returnVal = Math.floor(returnVal); returnVal = (returnVal / Math.pow(10, o)) * 10; - returnVal = +returnVal.toFixed(o - 1) + notValue; + returnVal = +returnVal.toFixed(o - 1) + joiner + notValue; } checkNum *= 10; } |