diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index af8cfffbf9..8a3d6ff9a1 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -602,9 +602,12 @@ namespace CalamityMod.CalPlayer public bool meteorSet = false; //vanilla armor, for space gun nerf public bool victideSet = false; public bool sulfurSet = false; + public bool jumpAgainSulfur = false; public int sulphurBubbleCooldown = 0; public bool aeroSet = false; public bool statigelSet = false; + public bool statigelJump = false; + public bool jumpAgainStatigel = false; public bool tarraSet = false; public bool tarraMelee = false; public bool tarragonCloak = false; @@ -1662,6 +1665,7 @@ namespace CalamityMod.CalPlayer aeroSet = false; statigelSet = false; + statigelJump = false; titanHeartSet = false; titanHeartMask = false; @@ -2318,7 +2322,11 @@ namespace CalamityMod.CalPlayer meteorSet = false; //vanilla armor, for Space Gun nerf victideSet = false; aeroSet = false; + sulfurSet = false; + jumpAgainSulfur = false; statigelSet = false; + statigelJump = false; + jumpAgainStatigel = false; tarraSet = false; tarraMelee = false; tarragonCloak = false; @@ -3095,12 +3103,67 @@ namespace CalamityMod.CalPlayer player.AddBuff(ModContent.BuffType(), AdrenalineDuration); } } - if (sulfurSet && player.controlJump && player.justJumped && player.jumpAgainSandstorm && sulphurBubbleCooldown <= 0) - { - int bubble = Projectile.NewProjectile(new Vector2(Main.LocalPlayer.position.X, Main.LocalPlayer.position.Y + (Main.LocalPlayer.gravDir == -1f ? 20 : -20)), new Vector2(0f, 0f), ModContent.ProjectileType(), (int)(20f * player.RogueDamage()), 0f, Main.LocalPlayer.whoAmI, 1f, 0f); - Main.projectile[bubble].Calamity().forceRogue = true; - sulphurBubbleCooldown = 20; - } + + bool canJump = (!player.doubleJumpCloud || !player.jumpAgainCloud) && + (!player.doubleJumpSandstorm || !player.jumpAgainSandstorm) && + (!player.doubleJumpBlizzard || !player.jumpAgainBlizzard) && + (!player.doubleJumpFart || !player.jumpAgainFart) && + (!player.doubleJumpSail || !player.jumpAgainSail) && + (!player.doubleJumpUnicorn || !player.jumpAgainUnicorn) && + CalamityUtils.CountHookProj() <= 0; + if (PlayerInput.Triggers.JustPressed.Jump && player.position.Y != player.oldPosition.Y && canJump) + { + if (statigelJump && jumpAgainStatigel) + { + jumpAgainStatigel = false; + int offset = player.height; + if (player.gravDir == -1f) + offset = 0; + Main.PlaySound(SoundID.DoubleJump, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); + player.velocity.Y = -Player.jumpSpeed * player.gravDir; + player.jump = (int)(Player.jumpHeight * 1.25); + for (int d = 0; d < 30; ++d) + { + int goo = Dust.NewDust(new Vector2(player.position.X, player.position.Y + offset), player.width, 12, 4, player.velocity.X * 0.3f, player.velocity.Y * 0.3f, 100, new Color(0, 80, 255, 100), 1.5f); + if (d % 2 == 0) + Main.dust[goo].velocity.X += (float)Main.rand.Next(30, 71) * 0.1f; + else + Main.dust[goo].velocity.X -= (float)Main.rand.Next(30, 71) * 0.1f; + Main.dust[goo].velocity.Y += (float)Main.rand.Next(-10, 31) * 0.1f; + Main.dust[goo].noGravity = true; + Main.dust[goo].scale += (float)Main.rand.Next(-10, 41) * 0.01f; + Main.dust[goo].velocity *= Main.dust[goo].scale * 0.7f; + } + } + else if (sulfurSet && jumpAgainSulfur) + { + jumpAgainSulfur = false; + int offset = player.height; + if (player.gravDir == -1f) + offset = 0; + Main.PlaySound(SoundID.DoubleJump, (int)player.position.X, (int)player.position.Y, 1, 1f, 0f); + player.velocity.Y = -Player.jumpSpeed * player.gravDir; + player.jump = (int)(Player.jumpHeight * 1.5); + for (int d = 0; d < 30; ++d) + { + int sulfur = Dust.NewDust(new Vector2(player.position.X, player.position.Y + offset), player.width, 12, 31, player.velocity.X * 0.3f, player.velocity.Y * 0.3f, 100, default, 1.5f); + if (d % 2 == 0) + Main.dust[sulfur].velocity.X += (float)Main.rand.Next(30, 71) * 0.1f; + else + Main.dust[sulfur].velocity.X -= (float)Main.rand.Next(30, 71) * 0.1f; + Main.dust[sulfur].velocity.Y += (float)Main.rand.Next(-10, 31) * 0.1f; + Main.dust[sulfur].noGravity = true; + Main.dust[sulfur].scale += (float)Main.rand.Next(-10, 41) * 0.01f; + Main.dust[sulfur].velocity *= Main.dust[sulfur].scale * 0.7f; + } + if (sulphurBubbleCooldown <= 0) + { + int bubble = Projectile.NewProjectile(new Vector2(Main.LocalPlayer.position.X, Main.LocalPlayer.position.Y + (Main.LocalPlayer.gravDir == -1f ? 20 : -20)), Vector2.Zero, ModContent.ProjectileType(), (int)(20f * player.RogueDamage()), 0f, Main.LocalPlayer.whoAmI, 1f, 0f); + Main.projectile[bubble].Calamity().forceRogue = true; + sulphurBubbleCooldown = 20; + } + } + } } #endregion diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 886742f09a..a3b61befce 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -98,6 +98,9 @@ namespace CalamityMod.CalPlayer // Rogue Mirrors RogueMirrors(player, modPlayer); + + // Double Jumps + DoubleJumps(player, modPlayer); } #endregion @@ -3917,5 +3920,26 @@ namespace CalamityMod.CalPlayer } } #endregion + + #region Double Jumps + private static void DoubleJumps(Player player, CalamityPlayer modPlayer) + { + if (CalamityUtils.CountHookProj() > 0) + { + modPlayer.jumpAgainSulfur = true; + modPlayer.jumpAgainStatigel = true; + } + + bool mountCheck = true; + if (player.mount != null && player.mount.Active) + mountCheck = player.mount.BlockExtraJumps; + + if (player.position.Y == player.oldPosition.Y && player.wingTime == player.wingTimeMax && mountCheck) + { + modPlayer.jumpAgainSulfur = true; + modPlayer.jumpAgainStatigel = true; + } + } + #endregion } } diff --git a/Items/Armor/StatigelCap.cs b/Items/Armor/StatigelCap.cs index 4ac3046f6d..9dc3c1101b 100644 --- a/Items/Armor/StatigelCap.cs +++ b/Items/Armor/StatigelCap.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor "30% increased jump speed"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.statigelSet = true; - player.doubleJumpSail = true; + modPlayer.statigelJump = true; Player.jumpHeight += 5; player.jumpSpeedBoost += 1.5f; } diff --git a/Items/Armor/StatigelHeadgear.cs b/Items/Armor/StatigelHeadgear.cs index 0f199aa456..7a03113433 100644 --- a/Items/Armor/StatigelHeadgear.cs +++ b/Items/Armor/StatigelHeadgear.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor "30% increased jump speed"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.statigelSet = true; - player.doubleJumpSail = true; + modPlayer.statigelJump = true; Player.jumpHeight += 5; player.jumpSpeedBoost += 1.5f; } diff --git a/Items/Armor/StatigelHelm.cs b/Items/Armor/StatigelHelm.cs index 42e3982386..ae3d6fd38d 100644 --- a/Items/Armor/StatigelHelm.cs +++ b/Items/Armor/StatigelHelm.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor "30% increased jump speed"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.statigelSet = true; - player.doubleJumpSail = true; + modPlayer.statigelJump = true; Player.jumpHeight += 5; player.jumpSpeedBoost += 1.5f; } diff --git a/Items/Armor/StatigelHood.cs b/Items/Armor/StatigelHood.cs index b19e5d77fa..089c3540e9 100644 --- a/Items/Armor/StatigelHood.cs +++ b/Items/Armor/StatigelHood.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.statigelSet = true; modPlayer.slimeGod = true; - player.doubleJumpSail = true; + modPlayer.statigelJump = true; Player.jumpHeight += 5; player.jumpSpeedBoost += 1.5f; player.minionDamage += 0.18f; diff --git a/Items/Armor/StatigelMask.cs b/Items/Armor/StatigelMask.cs index 8625f8e775..463248c727 100644 --- a/Items/Armor/StatigelMask.cs +++ b/Items/Armor/StatigelMask.cs @@ -42,11 +42,11 @@ namespace CalamityMod.Items.Armor "The higher your rogue stealth the higher your rogue damage, crit, and movement speed"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.statigelSet = true; + modPlayer.statigelJump = true; modPlayer.rogueStealthMax += 1f; - player.doubleJumpSail = true; + modPlayer.wearingRogueArmor = true; Player.jumpHeight += 5; player.jumpSpeedBoost += 1.5f; - player.Calamity().wearingRogueArmor = true; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/SulfurHelmet.cs b/Items/Armor/SulfurHelmet.cs index b4882a1266..6f31ffd99f 100644 --- a/Items/Armor/SulfurHelmet.cs +++ b/Items/Armor/SulfurHelmet.cs @@ -36,8 +36,7 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { player.setBonus = "Attacking and being attacked by enemies inflicts poison\n" + - "Grants an additional jump\n" + - "Jumping off the ground leaves behind a sulphurous bubble that applies venom on hit\n" + + "Grants an additional jump that summons a sulphurous bubble\n" + "Reduces the severity of the sulphuric waters\n" + "Slightly reduces breath loss in the abyss\n" + "Rogue stealth builds while not attacking and slower while moving, up to a max of 100\n" + @@ -49,7 +48,6 @@ namespace CalamityMod.Items.Armor modPlayer.rogueStealthMax += 1f; modPlayer.wearingRogueArmor = true; player.ignoreWater = true; - player.doubleJumpSandstorm = true; } public override void UpdateEquip(Player player)