From ec48ae73deda95613c876529883175db46eabeb6 Mon Sep 17 00:00:00 2001
From: Altixal <73398287+Altixal@users.noreply.github.com>
Date: Sun, 9 Nov 2025 15:53:33 +0700
Subject: [PATCH] Hadal Stew now uses ModifyPotionDelay
---
CalPlayer/CalamityPlayer.cs | 3 ---
CalPlayer/CalamityPlayerMiscEffects.cs | 17 +----------------
Items/Potions/HadalStew.cs | 12 ++----------
Utilities/ItemUtils.cs | 2 +-
4 files changed, 4 insertions(+), 30 deletions(-)
diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs
index 3663f11431..033a5ed558 100644
--- a/CalPlayer/CalamityPlayer.cs
+++ b/CalPlayer/CalamityPlayer.cs
@@ -114,8 +114,6 @@ namespace CalamityMod.CalPlayer
public int garandShots = 0;
public int searedPanCounter = 0;
public int searedPanTimer = 0;
- /// Used to get around the hardcoded Potion Sickness duration to allow Hadal Stew's reduced duration.
- public int potionTimer = 0;
/// If set to true, prevents all player dashes. Used by Ball and Chain, and Stygian Shield.
public bool blockAllDashes = false;
/// Used by Flamsteed Ring to reset the player's hitbox size after dismounting.
@@ -3259,7 +3257,6 @@ namespace CalamityMod.CalPlayer
garandShots = 0;
searedPanCounter = 0;
searedPanTimer = 0;
- potionTimer = 0;
persecutedEnchantSummonTimer = 0;
momentumCapacitorTime = 0;
momentumCapacitorBoost = 0f;
diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs
index 5cedede0db..5d4217667a 100644
--- a/CalPlayer/CalamityPlayerMiscEffects.cs
+++ b/CalPlayer/CalamityPlayerMiscEffects.cs
@@ -5222,28 +5222,13 @@ namespace CalamityMod.CalPlayer
#region Potion Handling
private void HandlePotions()
{
- // Hadal Stew
- if (potionTimer > 0)
- potionTimer--;
- if (potionTimer > 0 && Player.potionDelay == 0)
- Player.potionDelay = potionTimer;
- if (potionTimer == 1)
- {
- // Reduced duration than normal
- int duration = HadalStew.SicknessDuration;
- if (Player.pStone)
- duration = (int)(duration * 0.75);
- Player.ClearBuff(BuffID.PotionSickness);
- Player.AddBuff(BuffID.PotionSickness, duration);
- }
-
if (PlayerInput.Triggers.JustPressed.QuickBuff)
{
for (int i = 0; i < Main.InventorySlotsTotal; ++i)
{
Item item = Player.inventory[i];
- if (Player.potionDelay > 0 || potionTimer > 0)
+ if (Player.potionDelay > 0)
break;
if (item is null || item.stack <= 0)
continue;
diff --git a/Items/Potions/HadalStew.cs b/Items/Potions/HadalStew.cs
index a724a51365..dc722b23d0 100644
--- a/Items/Potions/HadalStew.cs
+++ b/Items/Potions/HadalStew.cs
@@ -45,17 +45,9 @@ namespace CalamityMod.Items.Potions
list.FindAndReplace("[S]", duration);
}
- public override bool CanUseItem(Player player)
- {
- return player.potionDelay <= 0 && player.Calamity().potionTimer <= 0;
- }
+ public override void ModifyPotionDelay(Player player, ref int baseDelay) => baseDelay -= CalamityUtils.SecondsToFrames(60) - SicknessDuration;
- public override void OnConsumeItem(Player player)
- {
- player.AddBuff(BuffType, BuffDuration);
- // fixes hardcoded potion sickness duration from quick heal (see CalamityPlayerMiscEffects.cs)
- player.Calamity().potionTimer = 2;
- }
+ public override void OnConsumeItem(Player player) => player.AddBuff(BuffType, BuffDuration);
public override void AddRecipes()
{
diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs
index b2c02ad6d9..a470e0db8e 100644
--- a/Utilities/ItemUtils.cs
+++ b/Utilities/ItemUtils.cs
@@ -709,7 +709,7 @@ namespace CalamityMod
showsOver = true;
}
//Fail if you have potion sickness
- if (player.potionDelay > 0 || player.Calamity().potionTimer > 0)
+ if (player.potionDelay > 0)
showsOver = true;
if (!showsOver)