From cd15fb992ccebc176899a9d6acf811b5bef9c201 Mon Sep 17 00:00:00 2001 From: Altixal <73398287+Altixal@users.noreply.github.com> Date: Thu, 6 Jun 2024 18:35:18 +0700 Subject: [PATCH] Mining speed fixes - Fixed Chisel/HoC mining speed nerf applying post-cap - Fixed Ocean Crest mining speed applying post-cap - Updated Mining Potion + HoC tooltips --- CalPlayer/CalamityPlayer.cs | 27 ++++++++++++++++++++++++++ CalPlayer/CalamityPlayerMiscEffects.cs | 27 -------------------------- Items/CalamityGlobalItemTooltip.cs | 10 ++++++++-- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 9781f2c84b..4dcec39a48 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3698,6 +3698,33 @@ namespace CalamityMod.CalPlayer #region PostUpdateEquips public override void PostUpdateEquips() { + // PostUpdateMiscEffects runs after the cap has been applied. Do NOT put mining speed stuff there. + // Ancient Chisel nerf (also affects Hand of Creation) + if (Player.chiselSpeed) + Player.pickSpeed += 0.1f; + + if (oceanCrest) + { + bool surface = Player.Center.Y < Main.worldSurface * 16.0; + bool GetEffects = ((Main.raining && surface) || Player.dripping || (Player.wet && !Player.lavaWet && !Player.honeyWet)); + if (GetEffects) + { + if (oceanCrestTimer < 300) + oceanCrestTimer += 5; + if (Player.StandingStill(0.1f) && !ZoneAbyss && Player.breath < 201 && Player.miscCounter % 2 == 0) + Player.breath += 1; + } + else + if (oceanCrestTimer > 0) + oceanCrestTimer--; + + if (oceanCrestTimer > 0 || GetEffects) + Player.pickSpeed -= 0.15f; // 15% mining speed + + Vector3 Light = new Vector3(0.090f, 0.180f, 0.200f); + Lighting.AddLight(Player.Center, Light * (0.55f + (oceanCrestTimer * 0.0035f))); + } + // True melee damage from various vanilla equipment placed here. // Titan Glove and ALL upgrades. diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index c25a521b6a..34450adaa5 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -342,28 +342,6 @@ namespace CalamityMod.CalPlayer else HasReducedDashFirstFrame = false; } - - if (oceanCrest) - { - bool surface = Player.Center.Y < Main.worldSurface * 16.0; - bool GetEffects = ((Main.raining && surface) || Player.dripping || (Player.wet && !Player.lavaWet && !Player.honeyWet)); - if (GetEffects) - { - if (oceanCrestTimer < 300) - oceanCrestTimer += 5; - if (Player.StandingStill(0.1f) && !ZoneAbyss && Player.breath < 201 && Player.miscCounter % 2 == 0) - Player.breath += 1; - } - else - if (oceanCrestTimer > 0) - oceanCrestTimer--; - - if (oceanCrestTimer > 0 || GetEffects) - Player.pickSpeed -= 0.15f; // 15% mining speed - - Vector3 Light = new Vector3(0.090f, 0.180f, 0.200f); - Lighting.AddLight(Player.Center, Light * (0.55f + (oceanCrestTimer * 0.0035f))); - } } #endregion @@ -2722,11 +2700,6 @@ namespace CalamityMod.CalPlayer } } - - // Ancient Chisel nerf - if (Player.chiselSpeed) - Player.pickSpeed += 0.1f; - if (eGauntlet) { Player.GetDamage() += 0.15f; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 42c82acfd8..528a0e8afa 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -716,9 +716,15 @@ namespace CalamityMod.Items // Rebalances to vanilla item stats #region Vanilla Item Rebalance Tooltips - // Ancient Chisel rebalance. + // Various mining speed nerfs + if (item.type == ItemID.MiningPotion) + EditTooltipByNum(0, (line) => line.Text.Replace("25", "15")); + if (item.type == ItemID.AncientChisel) - EditTooltipByNum(0, (line) => line.Text = "Increases mining speed by 15%"); + EditTooltipByNum(0, (line) => line.Text.Replace("25", "15")); + + if (item.type == ItemID.HandOfCreation) + EditTooltipByNum(0, (line) => line.Text.Replace("25", "15")); // Frozen Turtle Shell rebalance. if (item.type == ItemID.FrozenTurtleShell)