From 889111c3c4dcd8d9b95134041c239f8d94ca352a Mon Sep 17 00:00:00 2001 From: termigator1359 <45545085+termigator1359@users.noreply.github.com> Date: Mon, 12 Oct 2020 19:40:23 -0400 Subject: [PATCH] seeker sound should now only be played by the first seeker in the array --- NPCs/SupremeCalamitas/SoulSeekerSupreme.cs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 7d33528e4b..eb267daff0 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -56,12 +56,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override bool PreAI() { + NPC parent = Main.npc[CalamityGlobalNPC.SCal]; bool expertMode = Main.expertMode; if (start) { for (int num621 = 0; num621 < 10; num621++) { - int num622 = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y), npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + int num622 = Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); } npc.ai[1] = npc.ai[0]; start = false; @@ -74,24 +75,32 @@ namespace CalamityMod.NPCs.SupremeCalamitas timer++; if (timer > 180) { - Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), npc.Center); + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC seeker = Main.npc[i]; + if (seeker.type == npc.type) + { + if (seeker == npc) + Main.PlaySound(mod.GetLegacySoundSlot(SoundType.Custom, "Sounds/Custom/SCalSounds/BrimstoneShoot"), parent.Center); + break; + } + } if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.Center.X, npc.Center.Y, direction.X, direction.Y, type, damage, 1f, Main.myPlayer); + Projectile.NewProjectile(npc.Center, direction, type, damage, 1f, Main.myPlayer); } timer = 0; npc.netUpdate = true; } - if (CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active) + if (CalamityGlobalNPC.SCal < 0 || !parent.active) { npc.active = false; npc.netUpdate = true; return false; } Player player = Main.player[npc.target]; - NPC parent = Main.npc[NPC.FindFirstNPC(ModContent.NPCType())]; double deg = (double)npc.ai[1]; double rad = deg * (Math.PI / 180); double dist = 300;