From 085000999468e6ee345cd728d52e5e8bf1b8aa53 Mon Sep 17 00:00:00 2001 From: SheerExpanse Date: Sun, 14 Jul 2019 20:40:04 -0400 Subject: [PATCH] Sunken Stew works with Quick Heal and Quick Buff --- Items/AbyssItems/SunkenStew.cs | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) diff --git a/Items/AbyssItems/SunkenStew.cs b/Items/AbyssItems/SunkenStew.cs index 84b969d6bd..44a7bd31f1 100644 --- a/Items/AbyssItems/SunkenStew.cs +++ b/Items/AbyssItems/SunkenStew.cs @@ -29,6 +29,9 @@ namespace CalamityMod.Items.AbyssItems item.useStyle = 2; item.UseSound = SoundID.Item3; item.consumable = true; + item.potion = true; + item.healLife = 120; + item.healMana = 150; item.buffType = BuffID.WellFed; item.buffTime = 216000; item.value = Item.buyPrice(0, 2, 0, 0); @@ -37,33 +40,15 @@ namespace CalamityMod.Items.AbyssItems public override bool CanUseItem(Player player) { return player.FindBuffIndex(BuffID.PotionSickness) == -1; - } - - public override bool ConsumeItem(Player player) + } + + // due to the lovely code of Quick Heal, have to cancel Restoration Potion's hardcoded heal time and replace it + public override bool UseItem(Player player) { - return player.FindBuffIndex(BuffID.PotionSickness) == -1; - } - - public override void OnConsumeItem(Player player) - { - player.statLife += 120; - player.statMana += 150; - if (player.statLife > player.statLifeMax2) - { - player.statLife = player.statLifeMax2; - } - if (player.statMana > player.statManaMax2) - { - player.statMana = player.statManaMax2; - } - player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true); - if (Main.myPlayer == player.whoAmI) - { - player.HealEffect(120, true); - player.ManaEffect(150); - } player.AddBuff(BuffID.WellFed, 216000); + player.ClearBuff(BuffID.PotionSickness); player.AddBuff(BuffID.PotionSickness, (player.pStone ? 2220 : 3000)); + return true; } public override void AddRecipes()