diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 85763c153..c92056d6b 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -4806,7 +4806,7 @@ public class ModItems { .addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 6)) .addEffect(new PotionEffect(Potion.regeneration.id, 20, 1)) .addEffect(new PotionEffect(Potion.nightVision.id, 15 * 20, 0)) - .setDashCount(3) + .setDashCount(6) .setUnlocalizedName("bismuth_helmet").setTextureName(RefStrings.MODID + ":bismuth_helmet"); bismuth_plate = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_plate").setTextureName(RefStrings.MODID + ":bismuth_plate"); bismuth_legs = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_legs").setTextureName(RefStrings.MODID + ":bismuth_legs"); diff --git a/src/main/java/com/hbm/items/armor/ArmorFSB.java b/src/main/java/com/hbm/items/armor/ArmorFSB.java index d06ad30d7..de75033e8 100644 --- a/src/main/java/com/hbm/items/armor/ArmorFSB.java +++ b/src/main/java/com/hbm/items/armor/ArmorFSB.java @@ -461,33 +461,42 @@ public class ArmorFSB extends ItemArmor { } } - boolean v1enabled = true; - if(dashCount > 0) { - int perDash = 64; + int perDash = 60; HbmPlayerProps props = (HbmPlayerProps) player.getExtendedProperties("NTM_EXT_PLAYER"); props.setDashCount(dashCount); + + int stamina = props.getStamina(); if(props.getDashCooldown() <= 0) { - if(!player.capabilities.isFlying && player.isSneaking() && props.getStamina() >= perDash) { + if(!player.capabilities.isFlying && player.isSneaking() && stamina >= perDash) { Vec3 lookingIn = player.getLookVec(); player.addVelocity(lookingIn.xCoord, 0, lookingIn.zCoord); + player.playSound("hbm:player.dash", 1.0F, 1.0F); props.setDashCooldown(HbmPlayerProps.dashCooldownLength); - props.setStamina(props.getStamina() - perDash); + stamina -= perDash; } } else { props.setDashCooldown(props.getDashCooldown() - 1); } - if(props.getStamina() < props.getDashCount() * perDash) { - props.setStamina(props.getStamina() + 1); + if(stamina < props.getDashCount() * perDash) { + stamina++; + + if(stamina % perDash == perDash-1) { + + player.playSound("hbm:player.dashRecharge", 1.0F, (1.0F + ((1F/12F)*(stamina/perDash)))); + stamina++; + } } + + props.setStamina(stamina); } } } diff --git a/src/main/java/com/hbm/render/util/RenderScreenOverlay.java b/src/main/java/com/hbm/render/util/RenderScreenOverlay.java index 44036255e..2829d9585 100644 --- a/src/main/java/com/hbm/render/util/RenderScreenOverlay.java +++ b/src/main/java/com/hbm/render/util/RenderScreenOverlay.java @@ -4,6 +4,7 @@ import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import com.hbm.extprop.HbmPlayerProps; +import com.hbm.interfaces.Spaghetti; import com.hbm.lib.RefStrings; import net.minecraft.client.Minecraft; @@ -25,6 +26,8 @@ public class RenderScreenOverlay { private static float prevResult; private static float lastResult; + private static float fadeOut = 0F; + public static void renderRadCounter(ScaledResolution resolution, float in, Gui gui) { GL11.glPushMatrix(); @@ -164,6 +167,7 @@ public class RenderScreenOverlay { Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons); } + @Spaghetti ("like a fella once said, aint that a kick in the head") public static void renderDashBar(ScaledResolution resolution, Gui gui, HbmPlayerProps props) { @@ -178,28 +182,100 @@ public class RenderScreenOverlay { Minecraft mc = Minecraft.getMinecraft(); - int posX = 16; - int posY = resolution.getScaledHeight() - 48 - 2; + int width = 30; + + int posX = 16;//(int)(resolution.getScaledWidth()/2 - ((props.getDashCount()*(width+2))/2)); + int posY = resolution.getScaledHeight() - 40 - 2; mc.renderEngine.bindTexture(misc); - gui.drawTexturedModalRect(posX-10, posY, 99, 18, 7, 10); + gui.drawTexturedModalRect(posX-10, posY, 107, 18, 7, 10); int stamina = props.getStamina(); - for(int x = 0; x < props.getDashCount(); x++) { - int status = 3; - int width = 22; - gui.drawTexturedModalRect(posX + (width+2)*x, posY, 76, 48, 30, 10); - if(stamina / 64 > x) { - status = 1; - } else if(stamina / 64 == x) { - width = (int)( (float)(stamina % 64) * (width/64F) ); - status = 2; + int dashes = props.getDashCount(); + + //int count = props.getDashCount(); + //int x3count = count / 3; + + int rows = dashes / 3; + int finalColumns = dashes % 3; + + for(int y = 0; y < rows; y++) { + for(int x = 0; x < 3; x++) { + if(y == rows && x > finalColumns) + break; + gui.drawTexturedModalRect(posX + (width+2)*x, posY - 12*y, 76, 48, width, 10); + int staminaDiv = stamina / 60; + int staminaMod = stamina % 60; + int barID = (3*y)+x; + int barStatus = 1; //0 = red, 1 = normal, 2 = greyed, 3 = dashed, 4 = ascended + int barSize = width; + if(staminaDiv < barID) { + barStatus = 3; + } else if(staminaDiv == barID) { + barStatus = 2; + barSize = (int)((float)(stamina % 60) * (width/60F) ); + if(barID == 0) + barStatus = 0; + } + gui.drawTexturedModalRect(posX + (width+2)*x, posY - 12*y, 76, 18+(10*barStatus), barSize, 10); + + if(staminaDiv == barID && staminaMod >= 57) { + fadeOut = 1F; + } + if(fadeOut > 0 && staminaDiv-1 == barID) { + GL11.glColor4f(1F, 1F, 1F, fadeOut); + int bar = barID; + if(stamina % 60 >= 50) + bar++; + int yPos = y; + if(bar / 3 != y) + y++; + bar = bar % 3; + gui.drawTexturedModalRect(posX + (width+2)*bar, posY - 12*y, 76, 58, width, 10); + fadeOut -= 0.04F; + GL11.glColor4f(1F, 1F, 1F, 1F); + } } - gui.drawTexturedModalRect(posX + 24*x, posY, 76, 18+(10*status), width, 10); } + /*for(int x = 0; x < props.getDashCount(); x++) { + int status = 3; + gui.drawTexturedModalRect(posX + (24)*x, posY, 76, 48, 24, 10); + int staminaDiv = stamina / 60; + if(staminaDiv > x) { + status = 1; + } else if(staminaDiv == x) { + width = (int)( (float)(stamina % 60) * (width/60F) ); + status = 2; + if(staminaDiv == 0) + status = 0; + } + /*if(staminaDiv-1 == x && (stamina % 60 < 20 && stamina % 60 != 0)) { + status = 4; + } + /*if(((staminaDiv == x && stamina % 60 >= 55) || (staminaDiv-1 == x && stamina % 60 <= 5)) && !(stamina == props.totalDashCount * 60)) { + status = 4; + } + gui.drawTexturedModalRect(posX + (24)*x, posY, 76, 18+(10*status), width, 10); + + if(staminaDiv == x && stamina % 60 >= 57) { + fadeOut = 1F; + } + if(fadeOut > 0 && staminaDiv-1 == x) { + GL11.glColor4f(1F, 1F, 1F, fadeOut); + int bar = x; + if(stamina % 60 >= 50) + bar++; + System.out.println(bar); + gui.drawTexturedModalRect(posX + 24*bar, posY, 76, 58, width, 10); + fadeOut -= 0.04F; + GL11.glColor4f(1F, 1F, 1F, 1F); + } + }*/ + + GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glPopMatrix(); diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 5e2bcbc51..d4a081300 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -120,6 +120,7 @@ achievement.ZIRNOXBoom=CIRNOX armor.blastProtection=Damage modifier of %s against explosions armor.cap=Hard damage cap of %s armor.damageModifier=Damage modifier of %s against %s +armor.dash=Grants %s dashes armor.electricJetpack=Ion Jetpack armor.explosionImmune=Cannot take any damage except from explosions armor.fastFall=Fast Fall diff --git a/src/main/resources/assets/hbm/sounds.json b/src/main/resources/assets/hbm/sounds.json index 5053a3015..6c9c290f8 100644 --- a/src/main/resources/assets/hbm/sounds.json +++ b/src/main/resources/assets/hbm/sounds.json @@ -199,6 +199,8 @@ "player.vomit": {"category": "player", "sounds": [{"name": "player/vomit", "stream": false}]}, "player.cough": {"category": "player", "sounds": ["player/cough1", "player/cough2", "player/cough3", "player/cough4"]}, + "player.dash": {"category": "player", "sounds": [{"name": "player/dash", "stream": false}]}, + "player.dashRecharge": {"category": "player", "sounds": [{"name": "player/dashRecharge", "stream": false}]}, "potatos.random": {"category": "player", "sounds": ["potatos/randResponse0", "potatos/randResponse1", "potatos/randResponse2", "potatos/randResponse3", "potatos/randResponse4", "potatos/randResponse5", "potatos/randResponse6", "potatos/randResponse7"]}, diff --git a/src/main/resources/assets/hbm/sounds/player/dash.ogg b/src/main/resources/assets/hbm/sounds/player/dash.ogg new file mode 100644 index 000000000..1483626ff Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/player/dash.ogg differ diff --git a/src/main/resources/assets/hbm/sounds/player/dashRecharge.ogg b/src/main/resources/assets/hbm/sounds/player/dashRecharge.ogg new file mode 100644 index 000000000..61a724e74 Binary files /dev/null and b/src/main/resources/assets/hbm/sounds/player/dashRecharge.ogg differ diff --git a/src/main/resources/assets/hbm/textures/misc/overlay_dash.png b/src/main/resources/assets/hbm/textures/misc/overlay_dash.png deleted file mode 100644 index 40f4037db..000000000 Binary files a/src/main/resources/assets/hbm/textures/misc/overlay_dash.png and /dev/null differ diff --git a/src/main/resources/assets/hbm/textures/misc/overlay_misc.png b/src/main/resources/assets/hbm/textures/misc/overlay_misc.png index 71d77f729..f0c03e6d8 100644 Binary files a/src/main/resources/assets/hbm/textures/misc/overlay_misc.png and b/src/main/resources/assets/hbm/textures/misc/overlay_misc.png differ