From 316ec4bf4252ccd4024dde01fffcd65681bbe4e4 Mon Sep 17 00:00:00 2001 From: IbanPlay <56191483+IbanPlay@users.noreply.github.com> Date: Tue, 24 May 2022 02:27:39 +0200 Subject: [PATCH] More zombie shit --- NPCs/Abyss/ColossalSquid.cs | 7 ++++--- NPCs/AcidRain/AcidEel.cs | 3 ++- NPCs/AcidRain/CragmawMire.cs | 3 ++- NPCs/AcidRain/GammaSlime.cs | 3 ++- NPCs/AcidRain/Mauler.cs | 3 ++- NPCs/AcidRain/NuclearToad.cs | 3 ++- NPCs/Astral/FusionFeeder.cs | 3 ++- NPCs/CalamityAI.cs | 3 ++- NPCs/CalamityGlobalAI.cs | 13 +++++++------ NPCs/Leviathan/Leviathan.cs | 7 ++++--- NPCs/Leviathan/Siren.cs | 3 ++- NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs | 7 ++++--- .../VanillaNPCOverrides/Bosses/DukeFishronAI.cs | 17 +++++++++-------- NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs | 11 ++++++----- .../RegularEnemies/DemonEyeAI.cs | 3 ++- 15 files changed, 52 insertions(+), 37 deletions(-) diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index c12d1cabbe..c1019680ad 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -16,6 +16,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Abyss { @@ -105,7 +106,7 @@ namespace CalamityMod.NPCs.Abyss } if (Main.rand.NextBool(300)) { - SoundEngine.PlaySound(SoundID.Zombie, (int)NPC.position.X, (int)NPC.position.Y, 34); + SoundEngine.PlaySoundCommonNPCSounds.GetZombieSound(34), NPC.position); } NPC.noTileCollide = false; if (NPC.ai[0] == 0f) @@ -352,7 +353,7 @@ namespace CalamityMod.NPCs.Abyss { if (Main.rand.NextBool(300)) { - SoundEngine.PlaySound(SoundID.Zombie, (int)NPC.position.X, (int)NPC.position.Y, 34); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(34), NPC.position); } if (NPC.ai[3] > 0f && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) { @@ -432,7 +433,7 @@ namespace CalamityMod.NPCs.Abyss { if (Main.rand.NextBool(300)) { - SoundEngine.PlaySound(SoundID.Zombie, (int)NPC.position.X, (int)NPC.position.Y, 35); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(35), NPC.position); } NPC.localAI[2] = 0f; NPC.velocity.X = NPC.velocity.X + (float)NPC.direction * 0.02f; diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 862bd1048d..e10bd88f26 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -11,6 +11,7 @@ using Terraria.ID; using Terraria.ModLoader; using System; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.AcidRain { @@ -85,7 +86,7 @@ namespace CalamityMod.NPCs.AcidRain // Play a slither sound from time to time. if (Main.rand.NextBool(480)) - SoundEngine.PlaySound(SoundID.Zombie, NPC.Center, 32); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(32), NPC.Center); if (NPC.wet) { diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index b6d52f0df3..7fe0801fa7 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -14,6 +14,7 @@ using CalamityMod.Items.Weapons.Rogue; using Terraria.Utilities; using Terraria.WorldBuilding; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.AcidRain { @@ -403,7 +404,7 @@ namespace CalamityMod.NPCs.AcidRain if (AttackTimer == digReapperTime + chargeupTelegraphTime) { // Play a sound and create dust. - SoundEngine.PlaySound(SoundID.Zombie, NPC.Center, 104); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(104), NPC.Center); for (int i = 0; i < 40; i++) { Dust burstDust = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2Circular(75f, 75f), 267); diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index 45802e1718..17ff886b6a 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -11,6 +11,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.AcidRain { @@ -146,7 +147,7 @@ namespace CalamityMod.NPCs.AcidRain DustAngleMultiplier2 = Main.rand.NextFloat(4f); if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundID.Zombie, (int)NPC.position.X, (int)NPC.position.Y, 104); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(104), NPC.position); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -Vector2.UnitY, ModContent.ProjectileType(), Main.expertMode ? 96 : 120, 4f, Main.myPlayer, 0f, NPC.whoAmI); } NPC.netUpdate = true; diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 61e97152b4..ac57d1e6fc 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -14,6 +14,7 @@ using Terraria.ModLoader; using Terraria.Utilities; using Terraria.WorldBuilding; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.AcidRain { @@ -164,7 +165,7 @@ namespace CalamityMod.NPCs.AcidRain CurrentFrame = 4; } if (AttackTimer == roarDelay) - SoundEngine.PlaySound(SoundID.Zombie, Target.Center, 97); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(97), Target.Center); // Rotate towards the target. int previousSpriteDirection = NPC.spriteDirection; diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index f126606097..75e0cc242a 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -12,6 +12,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.AcidRain { @@ -103,7 +104,7 @@ namespace CalamityMod.NPCs.AcidRain // Make a frog croak sound from time to time. if (Main.rand.NextBool(480)) - SoundEngine.PlaySound(SoundID.Zombie, NPC.Center, 13); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(13), NPC.Center); float explodeDistance = DownedBossSystem.downedAquaticScourge ? 295f : 195f; if (DownedBossSystem.downedPolterghast) diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index a39eb68bad..1e93ae15ab 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -13,6 +13,7 @@ using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; using CalamityMod.Projectiles.Enemy; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -128,7 +129,7 @@ namespace CalamityMod.NPCs.Astral { if (SearchSoundCreationDelay == 0f) { - SoundEngine.PlaySound(SoundID.ZombieMoan, NPC.Center, NPCID.SandShark); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(7), NPC.Center); SearchSoundCreationDelay = -1f; } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index e650b84e6d..4554da52a4 100644 --- a/NPCs/CalamityAI.cs +++ b/NPCs/CalamityAI.cs @@ -26,6 +26,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs { @@ -6989,7 +6990,7 @@ namespace CalamityMod.NPCs { if (npc.ai[1] == 180f) { - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 104); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(104), npc.position); Vector2 laserVelocity2 = new Vector2(npc.localAI[0], npc.localAI[1]); laserVelocity2.Normalize(); diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index 374e49557b..25cfbcdbaa 100644 --- a/NPCs/CalamityGlobalAI.cs +++ b/NPCs/CalamityGlobalAI.cs @@ -13,6 +13,7 @@ using Terraria.GameContent; using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.NPCs { @@ -1284,11 +1285,11 @@ namespace CalamityMod.NPCs { if ((npcType == NPCID.Zombie || npcType == NPCID.ZombieXmas || npcType == NPCID.ZombieSweater || npcType == NPCID.Skeleton || (npcType >= NPCID.BoneThrowingSkeleton && npcType <= NPCID.BoneThrowingSkeleton4) || npcType == NPCID.AngryBones || npcType == NPCID.AngryBonesBig || npcType == NPCID.AngryBonesBigHelmet || npcType == NPCID.AngryBonesBigMuscle || npcType == NPCID.ArmoredSkeleton || npcType == NPCID.SkeletonArcher || npcType == NPCID.BaldZombie || npcType == NPCID.UndeadViking || npcType == NPCID.ZombieEskimo || npcType == NPCID.Frankenstein || npcType == NPCID.PincushionZombie || npcType == NPCID.SlimedZombie || npcType == NPCID.SwampZombie || npcType == NPCID.TwiggyZombie || npcType == NPCID.ArmoredViking || npcType == NPCID.FemaleZombie || npcType == NPCID.HeadacheSkeleton || npcType == NPCID.MisassembledSkeleton || npcType == NPCID.PantlessSkeleton || npcType == NPCID.ZombieRaincoat || npcType == NPCID.SkeletonSniper || npcType == NPCID.TacticalSkeleton || npcType == NPCID.SkeletonCommando || npcType == NPCID.ZombieSuperman || npcType == NPCID.ZombiePixie || npcType == NPCID.ZombieDoctor || npcType == NPCID.GreekSkeleton) && Main.rand.Next(1000) == 0) { - SoundEngine.PlaySound(SoundID.ZombieMoan, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.ZombieMoan, npc.position); } if (npcType == NPCID.BloodZombie && Main.rand.Next(800) == 0) { - SoundEngine.PlaySound(SoundID.ZombieMoan, (int)npc.position.X, (int)npc.position.Y, npcType, 1f, 0f); + SoundEngine.PlaySound(SoundID.ZombieMoan, npc.position); //There was a npcType thing afterwards but its not really useable now. Hilarious, frankly } if ((npcType == NPCID.Mummy || npcType == NPCID.DarkMummy || npcType == NPCID.LightMummy) && Main.rand.Next(500) == 0) { @@ -1296,19 +1297,19 @@ namespace CalamityMod.NPCs } if (npcType == NPCID.Vampire && Main.rand.Next(500) == 0) { - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 7, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(7), npc.position); } if (npcType == NPCID.Frankenstein && Main.rand.Next(500) == 0) { - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(6), npc.position); } if (npcType == NPCID.FaceMonster && Main.rand.Next(500) == 0) { - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 8, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(8), npc.position); } if (npcType >= 269 && npcType <= 280 && Main.rand.Next(1000) == 0) { - SoundEngine.PlaySound(SoundID.ZombieMoan, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.ZombieMoan, npc.position); } npc.TargetClosest(true); } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 89b0d281ee..26d98a71d1 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -25,6 +25,7 @@ using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Leviathan { @@ -145,7 +146,7 @@ namespace CalamityMod.NPCs.Leviathan soundDelay--; if (Main.rand.NextBool(600) && !spawnAnimation) - SoundEngine.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, (sirenAlive && !death) ? soundChoice : soundChoiceRage); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound((sirenAlive && !death) ? soundChoice : soundChoiceRage), vector); // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -242,7 +243,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.velocity = new Vector2(0f, -velocityY); if (calamityGlobalNPC.newAI[3] == 10f) - SoundEngine.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, soundChoiceRage); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(soundChoiceRage), vector); NPC.Opacity = MathHelper.Clamp(calamityGlobalNPC.newAI[3] / spawnAnimationTime, 0f, 1f); @@ -394,7 +395,7 @@ namespace CalamityMod.NPCs.Leviathan int spawnLimit = (sirenAlive && !phase4) ? 2 : (death ? 3 : 4); if (flag103 && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit) { - SoundEngine.PlaySound(SoundID.Zombie, (int)vector.X, (int)vector.Y, soundChoice); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(soundChoice), vector); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, ModContent.NPCType()); } diff --git a/NPCs/Leviathan/Siren.cs b/NPCs/Leviathan/Siren.cs index fec3b79722..34fd267f18 100644 --- a/NPCs/Leviathan/Siren.cs +++ b/NPCs/Leviathan/Siren.cs @@ -21,6 +21,7 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.LoreItems; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Leviathan { @@ -318,7 +319,7 @@ namespace CalamityMod.NPCs.Leviathan // Play sound if (Main.rand.NextBool(300)) - SoundEngine.PlaySound(SoundID.Zombie, (int)NPC.position.X, (int)NPC.position.Y, 35); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(35), NPC.position); // Time left if (NPC.timeLeft < 1800) diff --git a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs index 1fd896eb6e..94b6cba2e5 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { @@ -19,7 +20,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Chant sound if (npc.ai[0] != -1f && Main.rand.NextBool(1000)) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, Main.rand.Next(88, 92), 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(Main.rand.Next(88, 92)), npc.position); // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -164,7 +165,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Spawn and play sound if (npc.localAI[0] == 0f) { - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 89, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(89), npc.position); npc.localAI[0] = 1f; npc.alpha = 255; npc.rotation = 0f; @@ -195,7 +196,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.velocity *= 0.95f; if (npc.localAI[2] != 13f) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 105, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(105), npc.position); npc.localAI[2] = 13f; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs index 298ece3932..9cfcb4a55b 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { @@ -281,7 +282,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; } - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 20, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(20),npc.Center); } npc.ai[2] += 1f; @@ -445,7 +446,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Play sounds and spawn bubbles if (npc.ai[2] == 0f) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 20, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(20), npc.Center); if (npc.ai[2] % bubbleBelchPhaseDivisor == 0f) { @@ -488,7 +489,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Play sound and spawn sharknadoes if (npc.ai[2] == (sharknadoPhaseTimer - 30)) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 9, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(9), npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == sharknadoPhaseTimer - 30) { @@ -525,7 +526,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Sound if (npc.ai[2] == phaseTransitionTimer - 60) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 20, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(20), npc.Center); npc.ai[2] += 1f; if (npc.ai[2] >= phaseTransitionTimer) @@ -694,7 +695,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { // Play sounds and spawn bubbles if (npc.ai[2] == 0f) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 20, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(20), npc.Center); if (npc.ai[2] % bubbleSpinPhaseDivisor == 0f) { @@ -741,7 +742,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Play sound and spawn cthulhunado if (npc.ai[2] == sharknadoPhaseTimer - 30) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 20, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(20), npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == sharknadoPhaseTimer - 30) Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, ProjectileID.SharknadoBolt, 0, 0f, Main.myPlayer, 1f, npc.target + 1); @@ -786,7 +787,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Play sound if (npc.ai[2] == phaseTransitionTimer - 60) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 20, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(20), npc.Center); npc.ai[2] += 1f; if (npc.ai[2] >= phaseTransitionTimer) @@ -981,7 +982,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Play sound if (npc.ai[2] == teleportPhaseTimer / 2) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 20, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(20), npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == teleportPhaseTimer / 2) { diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index c1c3bb2da4..0c8e9ff213 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs @@ -7,6 +7,7 @@ using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { @@ -49,7 +50,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { // Play a random Moon Lord sound if (npc.ai[0] != -1f && npc.ai[0] != 2f && Main.rand.NextBool(200)) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(93, 100), 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(Main.rand.Next(93, 100)), npc.Center); // Start the AI if (npc.localAI[3] == 0f) @@ -65,7 +66,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[1] += 1f; if (npc.ai[1] == 30f) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 92, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(92), npc.Center); if (npc.ai[1] < 60f) MoonlordDeathDrama.RequestLight(npc.ai[1] / 30f, npc.Center); @@ -90,7 +91,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[1] += 1f; if (npc.ai[1] == 30f) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 92, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(92), npc.Center); if (npc.ai[1] < 60f) MoonlordDeathDrama.RequestLight(npc.ai[1] / 30f, npc.Center); @@ -1608,7 +1609,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } if (Main.rand.Next(420) == 0) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, Main.rand.Next(100, 101), 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(Main.rand.Next(100, 101)), npc.Center); Vector2 value22 = new Vector2(30f); @@ -1903,7 +1904,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (num1245 < 120f) { - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.Center.X, (int)npc.Center.Y, 102, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(102), npc.Center); if (num1245 == 105f) npc.netUpdate = true; diff --git a/NPCs/VanillaNPCOverrides/RegularEnemies/DemonEyeAI.cs b/NPCs/VanillaNPCOverrides/RegularEnemies/DemonEyeAI.cs index fdfb265bd8..c4d4824fc6 100644 --- a/NPCs/VanillaNPCOverrides/RegularEnemies/DemonEyeAI.cs +++ b/NPCs/VanillaNPCOverrides/RegularEnemies/DemonEyeAI.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.VanillaNPCOverrides.RegularEnemies { @@ -108,7 +109,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.RegularEnemies { // Randomly play pigron noises if the NPC is a pigron. if (Pigrons.Contains(npc.type) && Main.rand.NextBool(1000)) - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 9, 1f, 0f); + SoundEngine.PlaySound(CommonNPCSounds.GetZombieSound(9), npc.Center); // Disable gravity. npc.noGravity = true;