aboutsummaryrefslogtreecommitdiff
path: root/features/hud/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-11-06 20:44:33 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2021-11-06 20:44:33 +0800
commit924e4acc25b71ad2ab5339bd7c062ed6f2031160 (patch)
tree72792f3afd039e50d12c72378d6c76cdaec98a92 /features/hud/index.js
parentcc668931e3f2031f65fd77b5b773b2d9a0e55ed0 (diff)
downloadSoopyV2-924e4acc25b71ad2ab5339bd7c062ed6f2031160.tar.gz
SoopyV2-924e4acc25b71ad2ab5339bd7c062ed6f2031160.tar.bz2
SoopyV2-924e4acc25b71ad2ab5339bd7c062ed6f2031160.zip
2.0.3
+ Better module failed to load detection + Wither impact cooldown
Diffstat (limited to 'features/hud/index.js')
-rw-r--r--features/hud/index.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/features/hud/index.js b/features/hud/index.js
index b6db8c6..e8dc604 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -49,6 +49,12 @@ class Hud extends Feature {
this.numberUtils = undefined
this.petText = undefined
+
+ this.lastWitherImpact = undefined
+ this.aup = undefined
+ this.lastTickEventEpochTimestamp = undefined
+ this.lastAbsorbtion = undefined
+ this.impactTest = undefined
}
onEnable(){
@@ -91,6 +97,8 @@ class Hud extends Feature {
.requires(this.soulflowEnabledSetting))
this.hudElements.push(this.soulflowElement)
+ this.witherImpactCooldownSetting = new ToggleSetting("Show Wither Impact Cooldown", "This will render a small cooldown above your crosshair", true, "wither_impact_cooldown_enabled", this)
+
// 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)
@@ -106,6 +114,12 @@ class Hud extends Feature {
this.lastframe = 0
this.slowestFrameTime = 0
+ this.lastWitherImpact = 0
+ this.aup = 0
+ this.lastTickEventEpochTimestamp = 0
+ this.lastAbsorbtion = 0
+ this.impactTest = false
+
this.lastFrameRates = [0,0,0,0,0,0,0,0,0,0]
this.lastFrameRatesS = [0,0,0,0,0,0,0,0,0,0]
@@ -142,6 +156,8 @@ class Hud extends Feature {
if(this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock){
this.apiLoad(this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock, "skyblock", true, true)
}
+
+ this.registerActionBar("${m}", this.actionbarMessage)
}
onDisable(){
@@ -165,6 +181,11 @@ class Hud extends Feature {
for(let element of this.hudElements){
element.render()
}
+
+
+ if (this.witherImpactCooldownSetting.getValue() && Date.now()-this.lastWitherImpact < 10000) {
+ Renderer.drawString(Math.max(0,Math.ceil((5000-(Date.now()-this.lastWitherImpact))/1000)) + "s", Renderer.screen.getWidth() / 2 - Renderer.getStringWidth(Math.max(0,Math.ceil((5000-(Date.now()-this.lastWitherImpact))/1000)) + "s") / 2, Renderer.screen.getHeight() / 2 - 15)
+ }
}
renderWorld(){
@@ -183,6 +204,17 @@ class Hud extends Feature {
this.lastFrame = time
}
+ actionbarMessage(m){
+ if(ChatLib.removeFormatting(m).includes("(Wither Impact)")){
+ if(Date.now()-this.aup < 750){
+ this.lastWitherImpact = Date.now()
+ this.aup = 0
+ }else{
+ this.impactTest = Date.now()
+ }
+ }
+ }
+
step(){
let fps = 0
@@ -234,6 +266,16 @@ class Hud extends Feature {
}
}
}
+
+ if(Player.getPlayer().func_110139_bj() > this.lastAbsorbtion){
+ if(Date.now()-this.impactTest < 750){
+ this.lastWitherImpact = Date.now()
+ this.impactTest = 0
+ }else{
+ this.aup = Date.now()
+ }
+ }
+ this.lastAbsorbtion = Player.getPlayer().func_110139_bj()
}
step_5second(){