From dfeab334f878283352f2068d473231e186b9249c Mon Sep 17 00:00:00 2001 From: Mishiro Usui Date: Sat, 8 Jul 2023 19:14:55 +0100 Subject: [PATCH] Deific/Rampart and health pots now work as expected --- CalPlayer/CalamityPlayer.cs | 12 ++++++++++++ CalPlayer/CalamityPlayerMiscEffects.cs | 3 --- Items/Accessories/DeificAmulet.cs | 1 + Items/Accessories/RampartofDeities.cs | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 78cf74b0b1..f5fb3c20af 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -3409,6 +3409,18 @@ namespace CalamityMod.CalPlayer if (Player.potionDelay > 0 && !Player.HasCooldown(PotionSickness.ID)) Player.AddCooldown(PotionSickness.ID, Player.potionDelay, false); + if (cooldowns.TryGetValue(PotionSickness.ID, out CooldownInstance cd)) + { + if (Player.potionDelay != cd.timeLeft && cd.timeLeft > 0) + { + cd.timeLeft = Player.potionDelay; + } + + if (cd.timeLeft > cd.duration) + cd.duration = cd.timeLeft; // If the new cooldown is larger than the full duration, update, else keep it the same. + } + + // Add a cooldown display for chaos state if the player has the vanilla counter ticking // This will make the cooldown look like vanilla Rod of Discord, as it wasn't applied by either Normality Relocator or Spectral Veil if (Player.chaosState && !Player.HasCooldown(ChaosState.ID)) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 36c6ae6097..18028ae8e4 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2835,9 +2835,6 @@ namespace CalamityMod.CalPlayer bonusStealthDamage += nanotech ? 0.05f : 0.08f; } - if (dAmulet) - Player.pStone = true; - if (frostFlare) { Player.resistCold = true; diff --git a/Items/Accessories/DeificAmulet.cs b/Items/Accessories/DeificAmulet.cs index d370ad9ca4..5a8fcd3a55 100644 --- a/Items/Accessories/DeificAmulet.cs +++ b/Items/Accessories/DeificAmulet.cs @@ -23,6 +23,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.dAmulet = true; player.longInvince = true; + player.pStone = true; player.lifeRegen += 1; } diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index 4f2525dc1b..c994cc1856 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.dAmulet = true; player.longInvince = true; + player.pStone = true; player.lifeRegen += 1; if (player.statLife <= player.statLifeMax2 * 0.5)