From 867161ee65a9af38e438cc6a8ad1bd5da032cca9 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Tue, 15 Feb 2022 15:50:19 -0600 Subject: [PATCH] 1 - Added something I missed. --- NPCs/Leviathan/AquaticAberration.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 13f053d164..31f9ef311e 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -200,6 +200,32 @@ namespace CalamityMod.NPCs.Leviathan } npc.velocity *= 0.98f; } + + if (death) + { + float pushVelocity = 0.5f; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active) + { + if (i != npc.whoAmI && Main.npc[i].type == npc.type) + { + if (Vector2.Distance(npc.Center, Main.npc[i].Center) < 320f) + { + if (npc.position.X < Main.npc[i].position.X) + npc.velocity.X = npc.velocity.X - pushVelocity; + else + npc.velocity.X = npc.velocity.X + pushVelocity; + + if (npc.position.Y < Main.npc[i].position.Y) + npc.velocity.Y = npc.velocity.Y - pushVelocity; + else + npc.velocity.Y = npc.velocity.Y + pushVelocity; + } + } + } + } + } } public override bool PreNPCLoot()