From 5da85b4d72d93bc50e8563cf884d006823c8ee7f Mon Sep 17 00:00:00 2001 From: Andrew Marheine Date: Thu, 23 Dec 2021 15:58:29 -0600 Subject: [PATCH] 1 - Artemis and Apollo despawn their projectiles when switching to certain phases. --- NPCs/ExoMechs/Apollo/Apollo.cs | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index a91b934906..7e61b68f05 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -578,6 +578,23 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo { if (spawnOtherExoMechs) { + // Despawn projectile bullshit + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active) + { + if (projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType()) + { + projectile.Kill(); + projectile.owner = Main.maxPlayers; + } + } + } + // Set Artemis variables if (exoMechTwinRedAlive) { @@ -665,6 +682,23 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // This is only called if two exo mechs are alive if (otherMechIsBerserk) { + // Despawn projectile bullshit + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active) + { + if (projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType()) + { + projectile.Kill(); + projectile.owner = Main.maxPlayers; + } + } + } + // Set Artemis variables if (exoMechTwinRedAlive) { @@ -718,6 +752,23 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Enter passive and invincible phase if one of the other exo mechs is berserk if (otherMechIsBerserk) { + // Despawn projectile bullshit + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active) + { + if (projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType()) + { + projectile.Kill(); + projectile.owner = Main.maxPlayers; + } + } + } + // Set Artemis variables if (exoMechTwinRedAlive) {