From 887e54594ae0bc6681f25ff253b2d889f1c0819f Mon Sep 17 00:00:00 2001 From: CongratsIsTrash <1q2w3e4dasd@gmail.com> Date: Sat, 22 Mar 2025 11:00:51 -0400 Subject: [PATCH] Ion Blaster and Apoc Array disable picking up stars instead of making them restore no mana --- Items/CalamityGlobalItem.cs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 49c79cc472..aa46204ec2 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -544,20 +544,23 @@ namespace CalamityMod.Items #endregion #region Pickup Item Changes + public override bool CanPickup(Item item, Player player) + { + // Prevent Mana Stars from being picked up while wielding Ion Blaster or Apoctosis Array + if (item.type == ItemID.Star || item.type == ItemID.SoulCake || item.type == ItemID.SugarPlum) + { + if (player.ActiveItem().type == ModContent.ItemType() || player.ActiveItem().type == ModContent.ItemType()) + return false; + } + return base.CanPickup(item, player); + } + public override bool OnPickup(Item item, Player player) { if (item.type == ItemID.Heart || item.type == ItemID.CandyApple || item.type == ItemID.CandyCane) // On heart pickup { - bool boostedHeart = player.Calamity().photosynthesis; - if (boostedHeart) - { + if (player.Calamity().photosynthesis) player.HealPlayer(PhotosynthesisPotion.IncreasedHeartHeal); - } - } - if (item.type == ItemID.Star || item.type == ItemID.SoulCake || item.type == ItemID.SugarPlum) // On star pickup - { - if (player.ActiveItem().type == ModContent.ItemType() || player.ActiveItem().type == ModContent.ItemType()) - return false; } return true; }