diff --git a/Items/Weapons/Magic/AbyssalTome.cs b/Items/Weapons/Magic/AbyssalTome.cs index 59e5f92910..386e745d0d 100644 --- a/Items/Weapons/Magic/AbyssalTome.cs +++ b/Items/Weapons/Magic/AbyssalTome.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.NPCs.SlimeGod; +using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.knockBack = 6; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; - Item.UseSound = SoundID.Item8; + Item.UseSound = SlimeGodCore.ShotSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 9f; diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 5c193af9c6..921ce1d868 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -14,6 +14,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Sounds; +using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -60,6 +61,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Total duration of the gauss nuke firing phase private const float gaussNukeReloadDuration = 360f; + //This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position. + private SlotId TelegraphSoundSlot; + + //Telegraph sound + public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/AresGaussNukeArmCharge"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -382,6 +389,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares float telegraphDuration = enraged ? (gaussNukeTelegraphDuration * 0.5f) : gaussNukeTelegraphDuration; if (calamityGlobalNPC.newAI[2] < telegraphDuration) { + // Play a charge up sound so that the player knows when it's about to fire the nuke + if (calamityGlobalNPC.newAI[2] == 1f) + { + TelegraphSoundSlot = SoundEngine.PlaySound(TelSound, NPC.Center); + } + // Set frames to gauss nuke charge up frames, which begin on frame 12 if (calamityGlobalNPC.newAI[2] == 1f) { @@ -460,6 +473,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Smooth movement towards the location Ares Gauss Nuke is meant to be at CalamityUtils.SmoothMovement(NPC, movementDistanceGateValue, distanceFromDestination, baseVelocity, 0f, false); + + //Update the telegraph sound if it's being done. + if (TelegraphSoundSlot != null && SoundEngine.TryGetActiveSound(TelegraphSoundSlot, out var telSound) && telSound.IsPlaying) + { + telSound.Position = NPC.Center; + } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index bb6fa0c466..f2834d054c 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -60,7 +60,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Total duration of the deathray private const float deathrayDuration = 60f; - //This stores the sound slot of the crystyl crusher sound it makes, so it may be properly updated in terms of position. + //This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position. private SlotId DeathraySoundSlot; //Telegraph sound @@ -404,7 +404,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) { // Play a charge up sound so that the player knows when it's about to fire the deathray - if (calamityGlobalNPC.newAI[2] == deathrayTelegraphDuration - 100f && !fireNormalLasers) + if (calamityGlobalNPC.newAI[2] == 1 && !fireNormalLasers) DeathraySoundSlot = SoundEngine.PlaySound(TelSound, NPC.Center); // Smooth movement towards the location Ares Laser Cannon is meant to be at diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 56ec12c7db..7aa242ab8d 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -14,6 +14,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Items.Weapons.DraedonsArsenal; +using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -58,6 +59,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Total duration of the plasma bolt firing phase private const float plasmaBoltDuration = 120f; + //This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position. + private SlotId TelegraphSoundSlot; + + //Telegraph sound + public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/AresPlasmaArmCharge"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -399,6 +406,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[2] += 1f; if (calamityGlobalNPC.newAI[2] < plasmaBoltTelegraphDuration) { + // Play a charge up sound so that the player knows when it's about to fire fireballs + if (calamityGlobalNPC.newAI[2] == 1) + TelegraphSoundSlot = SoundEngine.PlaySound(TelSound, NPC.Center); + // Set frames to plasma orb charge up frames, which begin on frame 12 if (calamityGlobalNPC.newAI[2] == 1f) { @@ -460,6 +471,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Smooth movement towards the location Ares Plasma Flamethrower is meant to be at CalamityUtils.SmoothMovement(NPC, movementDistanceGateValue, distanceFromDestination, baseVelocity, 0f, false); + + //Update the telegraph sound if it's being done. + if (TelegraphSoundSlot != null && SoundEngine.TryGetActiveSound(TelegraphSoundSlot, out var telSound) && telSound.IsPlaying) + { + telSound.Position = NPC.Center; + } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 5a7032df76..e559c86509 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -14,6 +14,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.Sounds; +using ReLogic.Utilities; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -58,6 +59,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Total duration of the tesla orb firing phase private const float teslaOrbDuration = 120f; + //This stores the sound slot of the telegraph sound it makes, so it may be properly updated in terms of position. + private SlotId TelegraphSoundSlot; + + //Telegraph sound + public static readonly SoundStyle TelSound = new("CalamityMod/Sounds/Custom/AresTeslaArmCharge"); + public override void SetStaticDefaults() { this.HideFromBestiary(); @@ -395,6 +402,10 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[2] += 1f; if (calamityGlobalNPC.newAI[2] < teslaOrbTelegraphDuration) { + // Play a charge up sound so that the player knows when it's about to fire tesla orbs + if (calamityGlobalNPC.newAI[2] == 1) + TelegraphSoundSlot = SoundEngine.PlaySound(TelSound, NPC.Center); + // Set frames to tesla orb charge up frames, which begin on frame 12 if (calamityGlobalNPC.newAI[2] == 1f) { @@ -454,6 +465,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Smooth movement towards the location Ares Tesla Cannon is meant to be at CalamityUtils.SmoothMovement(NPC, movementDistanceGateValue, distanceFromDestination, baseVelocity, 0f, false); + + //Update the telegraph sound if it's being done. + if (TelegraphSoundSlot != null && SoundEngine.TryGetActiveSound(TelegraphSoundSlot, out var telSound) && telSound.IsPlaying) + { + telSound.Position = NPC.Center; + } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; diff --git a/NPCs/SlimeGod/CrimulanSlimeGod.cs b/NPCs/SlimeGod/CrimulanSlimeGod.cs index a52523d8b5..94084708be 100644 --- a/NPCs/SlimeGod/CrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/CrimulanSlimeGod.cs @@ -397,7 +397,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[1] += 1f; if (NPC.ai[1] > 10f) { - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); + SoundEngine.PlaySound(SlimeGodCore.BigShotSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { // Eruption of slime balls that fall down diff --git a/NPCs/SlimeGod/EbonianSlimeGod.cs b/NPCs/SlimeGod/EbonianSlimeGod.cs index f9e8551eec..f8141d7539 100644 --- a/NPCs/SlimeGod/EbonianSlimeGod.cs +++ b/NPCs/SlimeGod/EbonianSlimeGod.cs @@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[1] += 1f; if (NPC.ai[1] > 10f) { - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); + SoundEngine.PlaySound(SlimeGodCore.BigShotSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { // Eruption of slime balls diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 35966bd5bf..4acce04613 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -38,6 +38,8 @@ namespace CalamityMod.NPCs.SlimeGod public static readonly SoundStyle PossessionSound = new("CalamityMod/Sounds/Custom/SlimeGodPossession"); public static readonly SoundStyle ExitSound = new("CalamityMod/Sounds/Custom/SlimeGodExit"); + public static readonly SoundStyle ShotSound = new("CalamityMod/Sounds/Custom/SlimeGodShot", 2); + public static readonly SoundStyle BigShotSound = new("CalamityMod/Sounds/Custom/SlimeGodBigShot", 2); public override void SetStaticDefaults() { @@ -386,7 +388,7 @@ namespace CalamityMod.NPCs.SlimeGod if (calamityGlobalNPC.newAI[2] % divisor == 0f) { - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); + SoundEngine.PlaySound(ShotSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { if (Main.rand.NextBool()) diff --git a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs index 3300d3b3bc..1bdcd41370 100644 --- a/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs +++ b/NPCs/SlimeGod/SplitCrimulanSlimeGod.cs @@ -393,7 +393,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[1] += 1f; if (NPC.ai[1] > 10f) { - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); + SoundEngine.PlaySound(SlimeGodCore.BigShotSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { // Eruption of slime balls that fall down diff --git a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs index bae4556150..642b429664 100644 --- a/NPCs/SlimeGod/SplitEbonianSlimeGod.cs +++ b/NPCs/SlimeGod/SplitEbonianSlimeGod.cs @@ -406,7 +406,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[1] += 1f; if (NPC.ai[1] > 10f) { - SoundEngine.PlaySound(SoundID.Item33, NPC.Center); + SoundEngine.PlaySound(SlimeGodCore.BigShotSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { // Eruption of slime balls diff --git a/Sounds/Custom/SlimeGodBigShot1.ogg b/Sounds/Custom/SlimeGodBigShot1.ogg new file mode 100644 index 0000000000..3879d5aa29 Binary files /dev/null and b/Sounds/Custom/SlimeGodBigShot1.ogg differ diff --git a/Sounds/Custom/SlimeGodBigShot2.ogg b/Sounds/Custom/SlimeGodBigShot2.ogg new file mode 100644 index 0000000000..f265ff7bd6 Binary files /dev/null and b/Sounds/Custom/SlimeGodBigShot2.ogg differ diff --git a/Sounds/Custom/SlimeGodShot1.ogg b/Sounds/Custom/SlimeGodShot1.ogg new file mode 100644 index 0000000000..cd7bb988c7 Binary files /dev/null and b/Sounds/Custom/SlimeGodShot1.ogg differ diff --git a/Sounds/Custom/SlimeGodShot2.ogg b/Sounds/Custom/SlimeGodShot2.ogg new file mode 100644 index 0000000000..26a0bde19a Binary files /dev/null and b/Sounds/Custom/SlimeGodShot2.ogg differ