diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 5ae4267a8a..f98769fada 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -391,7 +391,7 @@ namespace CalamityMod.CalPlayer if (player.whoAmI == Main.myPlayer && modPlayer.bloodfinTimer <= 0) { modPlayer.bloodfinTimer = 30; - if (player.statLife <= (int)(player.statLifeMax2 * 0.75)) + if (player.statLife <= (int)(player.statLifeMax2 * 0.75) && !CalamityWorld.ironHeart) player.statLife += 1; } } diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 4ea4280573..a7b68b1b4a 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -2,6 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Buffs.Potions; +using CalamityMod.World; using System.Collections.Generic; namespace CalamityMod.Items.Fishing.BrimstoneCragCatches @@ -38,14 +39,16 @@ The life regen boost is stronger if below 75% health"); public override void OnConsumeItem(Player player) { - player.statLife += 240; + int healAmt = CalamityWorld.ironHeart ? 0 : 240; + player.statLife += healAmt; if (player.statLife > player.statLifeMax2) { player.statLife = player.statLifeMax2; } if (Main.myPlayer == player.whoAmI) { - player.HealEffect(240, true); + if (!CalamityWorld.ironHeart) + player.HealEffect(healAmt, true); } player.AddBuff(ModContent.BuffType(), 600); @@ -63,7 +66,7 @@ The life regen boost is stronger if below 75% health"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life"; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; } } } diff --git a/Items/Potions/Alcohol/GrapeBeer.cs b/Items/Potions/Alcohol/GrapeBeer.cs index 68c3e97a5e..4f0a0bc2f4 100644 --- a/Items/Potions/Alcohol/GrapeBeer.cs +++ b/Items/Potions/Alcohol/GrapeBeer.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.Alcohol; +using CalamityMod.World; using System.Collections.Generic; using Terraria; using Terraria.ID; @@ -40,7 +41,8 @@ Reduces defense by 2 and movement speed by 5%"); public override void OnConsumeItem(Player player) { - player.statLife += 100; + int healAmt = CalamityWorld.ironHeart ? 0 : 100; + player.statLife += healAmt; player.statMana += 100; if (player.statLife > player.statLifeMax2) { @@ -53,7 +55,8 @@ Reduces defense by 2 and movement speed by 5%"); player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true); if (Main.myPlayer == player.whoAmI) { - player.HealEffect(100, true); + if (!CalamityWorld.ironHeart) + player.HealEffect(healAmt, true); player.ManaEffect(100); } player.AddBuff(ModContent.BuffType(), 3600); @@ -68,7 +71,7 @@ Reduces defense by 2 and movement speed by 5%"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life"; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; } } } diff --git a/Items/Potions/Alcohol/Margarita.cs b/Items/Potions/Alcohol/Margarita.cs index 613329475c..884fd01e9d 100644 --- a/Items/Potions/Alcohol/Margarita.cs +++ b/Items/Potions/Alcohol/Margarita.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.Alcohol; +using CalamityMod.World; using System.Collections.Generic; using Terraria; using Terraria.ID; @@ -43,7 +44,8 @@ Reduces defense by 6 and life regen by 1"); public override void OnConsumeItem(Player player) { - player.statLife += 200; + int healAmt = CalamityWorld.ironHeart ? 0 : 200; + player.statLife += healAmt; player.statMana += 200; if (player.statLife > player.statLifeMax2) { @@ -56,7 +58,8 @@ Reduces defense by 6 and life regen by 1"); player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true); if (Main.myPlayer == player.whoAmI) { - player.HealEffect(200, true); + if (!CalamityWorld.ironHeart) + player.HealEffect(healAmt, true); player.ManaEffect(200); } player.AddBuff(ModContent.BuffType(), 10800); @@ -71,7 +74,7 @@ Reduces defense by 6 and life regen by 1"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life"; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; } } } diff --git a/Items/Potions/Alcohol/RedWine.cs b/Items/Potions/Alcohol/RedWine.cs index 48facc24f6..d982e67b2d 100644 --- a/Items/Potions/Alcohol/RedWine.cs +++ b/Items/Potions/Alcohol/RedWine.cs @@ -34,33 +34,20 @@ Reduces life regen by 1"); public override bool CanUseItem(Player player) { - return player.FindBuffIndex(BuffID.PotionSickness) == -1; + if (player.Calamity().baguette) + { + item.healLife = 250; + } + else + { + item.healLife = 200; + } + return base.CanUseItem(player); } public override void OnConsumeItem(Player player) { - player.statLife += (player.Calamity().baguette ? 250 : 200); - if (player.statLife > player.statLifeMax2) - { - player.statLife = player.statLifeMax2; - } - if (Main.myPlayer == player.whoAmI) - { - player.HealEffect((player.Calamity().baguette ? 250 : 200), true); - } player.AddBuff(ModContent.BuffType(), 900); } - - // Zeroes out the hardcoded healing function from having a healLife value. The item still heals in the UseItem hook. - public override void GetHealLife(Player player, bool quickHeal, ref int healValue) - { - healValue = 0; - } - - // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). - public override void ModifyTooltips(List tooltips) - { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life"; - } } } \ No newline at end of file diff --git a/Items/Potions/SunkenStew.cs b/Items/Potions/SunkenStew.cs index 2376a0ab90..3c4ec5bf6a 100644 --- a/Items/Potions/SunkenStew.cs +++ b/Items/Potions/SunkenStew.cs @@ -1,5 +1,6 @@ using CalamityMod.Items.Placeables; using CalamityMod.Items.Fishing.BrimstoneCragCatches; +using CalamityMod.World; using System.Collections.Generic; using Terraria; using Terraria.ID; @@ -43,7 +44,8 @@ Grants Well Fed"); public override bool UseItem(Player player) { - player.statLife += 120; + int healAmt = CalamityWorld.ironHeart ? 0 : 120; + player.statLife += healAmt; player.statMana += 150; if (player.statLife > player.statLifeMax2) { @@ -56,7 +58,8 @@ Grants Well Fed"); player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true); if (Main.myPlayer == player.whoAmI) { - player.HealEffect(120, true); + if (!CalamityWorld.ironHeart) + player.HealEffect(healAmt, true); player.ManaEffect(150); } @@ -76,7 +79,7 @@ Grants Well Fed"); // Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function). public override void ModifyTooltips(List tooltips) { - tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life"; + tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life"; } public override void AddRecipes()