From 2ea87938477cb5ae11fcd1586100fec441c0075c Mon Sep 17 00:00:00 2001 From: Xyk Date: Mon, 29 Jan 2024 13:30:56 -0800 Subject: [PATCH] Fixed gills effects on gfb All gills effects applied to the player now only happen is the player is underwater --- Buffs/StatBuffs/AbyssalDivingSuitBuff.cs | 5 +++-- CalPlayer/CalamityPlayerMiscEffects.cs | 2 +- Items/Accessories/AquaticEmblem.cs | 3 ++- Items/Armor/Sulphurous/SulphurousHelmet.cs | 3 ++- Items/CalamityGlobalItem.cs | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs index c385db4eec..92cab6a912 100644 --- a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs +++ b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +20,8 @@ namespace CalamityMod.Buffs.StatBuffs CalamityPlayer modPlayer = player.Calamity(); if (modPlayer.abyssalDivingSuitPrevious) { - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; modPlayer.abyssalDivingSuitPower = true; modPlayer.depthCharm = true; modPlayer.jellyfishNecklace = true; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 9337f9509d..f790bce610 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -2499,7 +2499,7 @@ namespace CalamityMod.CalPlayer if (decayEffigy) { Player.buffImmune[ModContent.BuffType()] = true; - if (!ZoneAbyss) + if (!ZoneAbyss && Player.IsUnderwater()) { Player.gills = true; } diff --git a/Items/Accessories/AquaticEmblem.cs b/Items/Accessories/AquaticEmblem.cs index bc9a9983b9..958a5c23bf 100644 --- a/Items/Accessories/AquaticEmblem.cs +++ b/Items/Accessories/AquaticEmblem.cs @@ -26,7 +26,8 @@ namespace CalamityMod.Items.Accessories player.npcTypeNoAggro[NPCID.PinkJellyfish] = true; player.npcTypeNoAggro[NPCID.Crab] = true; player.npcTypeNoAggro[NPCID.Squid] = true; - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; } } } diff --git a/Items/Armor/Sulphurous/SulphurousHelmet.cs b/Items/Armor/Sulphurous/SulphurousHelmet.cs index ce99062974..6e78118aa0 100644 --- a/Items/Armor/Sulphurous/SulphurousHelmet.cs +++ b/Items/Armor/Sulphurous/SulphurousHelmet.cs @@ -42,7 +42,8 @@ namespace CalamityMod.Items.Armor.Sulphurous { player.GetDamage() += 0.04f; player.GetCritChance() += 2; - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; } public override void AddRecipes() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 1186d1d5f6..4cdcdf7210 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -1256,7 +1256,8 @@ namespace CalamityMod.Items } else if (item.type == ItemID.FinWings) // Boosted water abilities, faster fall in water { - player.gills = true; + if (player.IsUnderwater()) + player.gills = true; player.ignoreWater = true; player.noFallDmg = true; if (!player.mount.Active)