diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index fc547da49b..f2c1a1baed 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -1198,8 +1198,11 @@ namespace CalamityMod.CalPlayer if (crawCarapace) { npc.AddBuff(ModContent.BuffType(), 900); - int onHitDamage = Player.CalcIntDamage(40); - Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); + if (!npc.dontTakeDamage) + { + int onHitDamage = Player.CalcIntDamage(40); + Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); + } SoundEngine.PlaySound(SoundID.NPCHit33 with { Volume = 0.5f }, Player.Center); } @@ -1207,8 +1210,11 @@ namespace CalamityMod.CalPlayer { npc.AddBuff(ModContent.BuffType(), 900); npc.AddBuff(ModContent.BuffType(), 900); - int onHitDamage = Player.CalcIntDamage(250); - Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); + if (!npc.dontTakeDamage) + { + int onHitDamage = Player.CalcIntDamage(250); + Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); + } SoundEngine.PlaySound(BaroclawHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY); @@ -1228,8 +1234,11 @@ namespace CalamityMod.CalPlayer if (absorber) { npc.AddBuff(ModContent.BuffType(), 900); - int onHitDamage = Player.CalcIntDamage(350); - Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); + if (!npc.dontTakeDamage) + { + int onHitDamage = Player.CalcIntDamage(350); + Player.ApplyDamageToNPC(npc, onHitDamage, 0f, 0, false); + } SoundEngine.PlaySound(AbsorberHit, Player.Center); Vector2 bloodSpawnPosition = Player.Center + Main.rand.NextVector2Circular(Player.width, Player.height) * 0.04f; Vector2 splatterDirection = (Player.Center - bloodSpawnPosition).SafeNormalize(Vector2.UnitY);