diff --git a/Projectiles/Ranged/BuzzkillHoldout.cs b/Projectiles/Ranged/BuzzkillHoldout.cs index 6083cda40c..bd39024f7a 100644 --- a/Projectiles/Ranged/BuzzkillHoldout.cs +++ b/Projectiles/Ranged/BuzzkillHoldout.cs @@ -5,6 +5,7 @@ using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.DataStructures; @@ -26,6 +27,7 @@ namespace CalamityMod.Projectiles.Ranged public ref float Time => ref Projectile.ai[0]; public const float ChargeupTime = 120f; + public SlotId ChargeIdle; // Controls the saw visually disappearing from the holdout when it fires. public bool NoSawOnHoldout = false; @@ -59,12 +61,19 @@ namespace CalamityMod.Projectiles.Ranged { Time++; + ActiveSound Idle; + if (SoundEngine.TryGetActiveSound(ChargeIdle, out Idle) && Idle.IsPlaying) + Idle.Position = GunTipPosition; + if (Owner.CantUseHoldout()) { if (Projectile.ai[1] < 1f) { KeepRefreshingLifetime = false; + if (SoundEngine.TryGetActiveSound(ChargeIdle, out Idle)) + Idle?.Stop(); + Projectile.ai[1] = 1f; Projectile.timeLeft = 30; SoundEngine.PlaySound(SoundID.DD2_BallistaTowerShot, GunTipPosition); @@ -151,6 +160,9 @@ namespace CalamityMod.Projectiles.Ranged } else { + if ((Time + 240) % 360 == 0) + ChargeIdle = SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/BuzzsawIdle") { Volume = Main.zenithWorld ? 1f : 0.5f }, GunTipPosition); + if (Time % 3 == 0) { Vector2 smokeVelocity = new Vector2(0f, Main.rand.NextFloat(-7f, -12f)); @@ -170,7 +182,11 @@ namespace CalamityMod.Projectiles.Ranged // The holdout can deal damage; you're literally spinning up a buzzsaw at the end, after all. public override bool? CanDamage() => !NoSawOnHoldout; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 240); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") { Volume = 0.7f }, GunTipPosition); + } public override void ModifyDamageHitbox(ref Rectangle hitbox) { diff --git a/Projectiles/Ranged/BuzzkillSaw.cs b/Projectiles/Ranged/BuzzkillSaw.cs index 5ee0d11119..8cb60d7e8b 100644 --- a/Projectiles/Ranged/BuzzkillSaw.cs +++ b/Projectiles/Ranged/BuzzkillSaw.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Projectiles.Ranged { public new string LocalizationCategory => "Projectiles.Ranged"; + public static readonly SoundStyle TileCollideGFB = new("CalamityMod/Sounds/Custom/MetalPipeFalling") { Volume = 1.5f }; + public override void SetStaticDefaults() { Main.projFrames[Projectile.type] = 4; @@ -51,7 +53,7 @@ namespace CalamityMod.Projectiles.Ranged public override bool OnTileCollide(Vector2 oldVelocity) { - SoundEngine.PlaySound(SoundID.Item178, Projectile.Center); // Probably placeholder sound? + SoundEngine.PlaySound(Main.zenithWorld ? TileCollideGFB : SoundID.Item178, Projectile.Center); // Placeholder sound? Could fit for (int s = 0; s < 7; s++) { @@ -91,6 +93,7 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 150); + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice"), Projectile.Center); for (int p = 0; p < 6; p++) { diff --git a/Sounds/Custom/BuzzsawIdle.ogg b/Sounds/Custom/BuzzsawIdle.ogg new file mode 100644 index 0000000000..a9deb63893 Binary files /dev/null and b/Sounds/Custom/BuzzsawIdle.ogg differ diff --git a/Sounds/Custom/MetalPipeFalling.ogg b/Sounds/Custom/MetalPipeFalling.ogg new file mode 100644 index 0000000000..08c0b41a0f Binary files /dev/null and b/Sounds/Custom/MetalPipeFalling.ogg differ