From 2b5f97cb697dc53a7fa03ba7004ff99ef7338609 Mon Sep 17 00:00:00 2001 From: GinYuH <> Date: Fri, 13 Jan 2023 02:22:17 -0800 Subject: [PATCH] fixes --- NPCs/Abyss/Bloatfish.cs | 2 +- NPCs/Abyss/ColossalSquid.cs | 43 ++++++++++++++++++++++++++++--------- 2 files changed, 34 insertions(+), 11 deletions(-) diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index cdd9d1829d..c1fdacc898 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -216,7 +216,7 @@ namespace CalamityMod.NPCs.Abyss Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("Bloatfish3").Type, NPC.scale); } } - if (NPC.scale < 2f && !Main.getGoodWorld) // move to zenith seed later + if (NPC.scale < 2f || Main.getGoodWorld) // move to zenith seed later { NPC.scale += 0.05f; } diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 4dd264ea07..313e24885f 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -184,7 +184,7 @@ namespace CalamityMod.NPCs.Abyss NPC.ai[0] = 0f; NPC.ai[1] = 0f; } - if (num1311 < 160f && Main.player[NPC.target].active && !Main.player[NPC.target].dead) + if (num1311 < 160f && Main.player[NPC.target].active && !Main.player[NPC.target].dead && !clone) { NPC.Center = Main.player[NPC.target].Top; NPC.velocity = Vector2.Zero; @@ -293,7 +293,7 @@ namespace CalamityMod.NPCs.Abyss else if (NPC.ai[0] == 5f) { Player player7 = Main.player[NPC.target]; - if (!player7.active || player7.dead) + if (!player7.active || player7.dead || clone) { NPC.ai[0] = 0f; NPC.ai[1] = 0f; @@ -346,8 +346,7 @@ namespace CalamityMod.NPCs.Abyss (Main.player[NPC.target].Center - NPC.Center).Length() < Main.player[NPC.target].Calamity().GetAbyssAggro(240f)) || NPC.justHit) { - hasBeenHit = true; - if (Main.getGoodWorld && Main.netMode != NetmodeID.MultiplayerClient && !clone) // move to zenith seed later + if (Main.getGoodWorld && Main.netMode != NetmodeID.MultiplayerClient && !clone && !hasBeenHit) // move to zenith seed later { // spawn some baby colossal squids in gfb for (int i = 0; i < 3; i++) @@ -358,10 +357,12 @@ namespace CalamityMod.NPCs.Abyss Main.npc[squib].ModNPC().clone = true; Main.npc[squib].ModNPC().hasBeenHit = true; Main.npc[squib].scale = 0.25f; - Main.npc[squib].lifeMax /= 3; + Main.npc[squib].lifeMax /= 5; + Main.npc[squib].life /= 5; } } } + hasBeenHit = true; } NPC.chaseable = hasBeenHit; @@ -426,7 +427,7 @@ namespace CalamityMod.NPCs.Abyss } if (clone) { - damage /= 2; + damage /= 4; } SoundEngine.PlaySound(SoundID.Item111, NPC.position); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); @@ -503,6 +504,28 @@ namespace CalamityMod.NPCs.Abyss } } } + float pushVelocity = 0.05f; + 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) < 160f) + { + if (NPC.position.X < Main.npc[i].position.X) + NPC.velocity.X -= pushVelocity; + else + NPC.velocity.X += pushVelocity; + + if (NPC.position.Y < Main.npc[i].position.Y) + NPC.velocity.Y -= pushVelocity; + else + NPC.velocity.Y += pushVelocity; + } + } + } + } if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 6400f) { NPC.active = false; @@ -599,10 +622,10 @@ namespace CalamityMod.NPCs.Abyss } if (Main.netMode != NetmodeID.Server) { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid").Type, 1f); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid2").Type, 1f); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid3").Type, 1f); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid4").Type, 1f); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid").Type, NPC.scale); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid2").Type, NPC.scale); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid3").Type, NPC.scale); + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("ColossalSquid4").Type, NPC.scale); } } }