Hadal Stew now uses ModifyPotionDelay

This commit is contained in:
Altixal committed 2025-11-09 15:53:33 +07:00
1 parent 1dc7c3b8c6
commit ec48ae73de
4 files changed
+4 -30

No files matched your search

-3
View File
@@ -114,8 +114,6 @@ namespace CalamityMod.CalPlayer
public int garandShots = 0;
public int searedPanCounter = 0;
public int searedPanTimer = 0;
/// <summary> Used to get around the hardcoded Potion Sickness duration to allow Hadal Stew's reduced duration. </summary>
public int potionTimer = 0;
/// <summary> If set to true, prevents all player dashes. Used by Ball and Chain, and Stygian Shield. </summary>
public bool blockAllDashes = false;
/// <summary> Used by Flamsteed Ring to reset the player's hitbox size after dismounting. </summary>
@@ -3259,7 +3257,6 @@ namespace CalamityMod.CalPlayer
garandShots = 0;
searedPanCounter = 0;
searedPanTimer = 0;
potionTimer = 0;
persecutedEnchantSummonTimer = 0;
momentumCapacitorTime = 0;
momentumCapacitorBoost = 0f;
+1 -16
View File
@@ -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;
+2 -10
View File
@@ -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()
{
+1 -1
View File
@@ -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)