diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 4b60cd30fe..b8c7efb8fc 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -293,7 +293,7 @@ namespace CalamityMod.Events player.ClearBuff(ModContent.BuffType()); } } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/SupremeCalamitasSpawn"), Main.player[ClosestPlayerToWorldCenter].Center); + SoundEngine.PlaySound(SupremeCalamitas.SpawnSound, Main.player[ClosestPlayerToWorldCenter].Center); CalamityUtils.SpawnBossBetter(Main.player[ClosestPlayerToWorldCenter].Top - new Vector2(42f, 84f), type); }, dimnessFactor: 0.6f, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), @@ -304,7 +304,7 @@ namespace CalamityMod.Events { Player player = Main.player[ClosestPlayerToWorldCenter]; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/DevourerSpawn"), player.Center); + SoundEngine.PlaySound(DevourerofGodsHead.SpawnSound, player.Center); NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, type); }, usesSpecialSound: true, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType() }) }; @@ -461,7 +461,7 @@ namespace CalamityMod.Events // Play the typical boss roar sound. if (!Bosses[BossRushStage].UsesSpecialSound) - SoundEngine.PlaySound(SoundID.Roar, Main.player[ClosestPlayerToWorldCenter].position, 0); + SoundEngine.PlaySound(SoundID.Roar, Main.player[ClosestPlayerToWorldCenter].position); // And spawn the boss. Bosses[BossRushStage].SpawnContext.Invoke(CurrentlyFoughtBoss); diff --git a/Gores/AstralWaterDroplet.cs b/Gores/AstralWaterDroplet.cs index f108838532..87a5e4f8e9 100644 --- a/Gores/AstralWaterDroplet.cs +++ b/Gores/AstralWaterDroplet.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Gores gore.frameCounter = 0; if (gore.type != 716 && gore.type != 717 && gore.type != 943) { - SoundEngine.PlaySound(SoundID.Drip, (int)gore.position.X + 8, (int)gore.position.Y + 8, Main.rand.Next(2), 1f, 0f); + SoundEngine.PlaySound(SoundID.Drip, gore.position + Vector2.One * 8); } } } @@ -142,7 +142,7 @@ namespace CalamityMod.Gores gore.frameCounter = 0; if (gore.type != 716 && gore.type != 717 && gore.type != 943) { - SoundEngine.PlaySound(SoundID.Drip, (int)gore.position.X + 8, (int)gore.position.Y + 8, 2, 1f, 0f); + SoundEngine.PlaySound(SoundID.Drip, gore.position + Vector2.One * 8); } ((WaterShaderData)Filters.Scene["WaterDistortion"].GetShader()).QueueRipple(gore.position + new Vector2(8f, 8f), 1f, RippleShape.Square, 0f); } diff --git a/ILEditing/ILHelperMethods.cs b/ILEditing/ILHelperMethods.cs index 4f903766db..d0348f4456 100644 --- a/ILEditing/ILHelperMethods.cs +++ b/ILEditing/ILHelperMethods.cs @@ -56,7 +56,7 @@ namespace CalamityMod.ILEditing WorldGen.TileFrame(doorX, y); // Play the door closing sound (lab doors do not use the door opening sound) - SoundEngine.PlaySound(SoundID.DoorClosed, doorX * 16, doorY * 16); + SoundEngine.PlaySound(SoundID.DoorClosed, new Vector2(doorX * 16, doorY * 16)); return true; } diff --git a/Items/Accessories/ShatteredCommunity.cs b/Items/Accessories/ShatteredCommunity.cs index 62190f63d4..5e67825217 100644 --- a/Items/Accessories/ShatteredCommunity.cs +++ b/Items/Accessories/ShatteredCommunity.cs @@ -141,7 +141,7 @@ namespace CalamityMod.Items.Accessories fx.MaxUpdates = 2; // Make the animation play at double speed. // Play a weird dimensional lightning sound simultaneously. - var extraSound = SoundID.DD2_EtherianPortalDryadTouch.WithVolume(1.4f); + var extraSound = SoundID.DD2_EtherianPortalDryadTouch with { Volume = 1.4f }; SoundEngine.PlaySound(extraSound, player.Center); // Display a level up text notification. diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index c578324798..9727583182 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -471,7 +471,7 @@ namespace CalamityMod.Items position += muzzleOffset; } Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); - SoundEngine.PlaySound(SoundID.Item11.WithPitchVariance(0.05f), position); + SoundEngine.PlaySound(SoundID.Item11 with { PitchVariance = 0.05f }, position); return false; } if (item.type == ItemID.PearlwoodBow) diff --git a/Items/SummonItems/Abomination.cs b/Items/SummonItems/Abomination.cs index ad0339c2bc..092b2571df 100644 --- a/Items/SummonItems/Abomination.cs +++ b/Items/SummonItems/Abomination.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/AncientMedallion.cs b/Items/SummonItems/AncientMedallion.cs index 97f0bbadde..6979423418 100644 --- a/Items/SummonItems/AncientMedallion.cs +++ b/Items/SummonItems/AncientMedallion.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 2); + SoundEngine.PlaySound(SoundID.ScaryScream, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) { int npc = NPC.NewNPC(new EntitySource_BossSpawn(player), (int)(player.position.X + Main.rand.Next(-250, 251)), (int)(player.position.Y - 500f), ModContent.NPCType(), 1); diff --git a/Items/SummonItems/AstralChunk.cs b/Items/SummonItems/AstralChunk.cs index 11137bdc71..cabb4b876c 100644 --- a/Items/SummonItems/AstralChunk.cs +++ b/Items/SummonItems/AstralChunk.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) { int npc = NPC.NewNPC(new EntitySource_BossSpawn(player), (int)(player.position.X + Main.rand.Next(-250, 251)), (int)(player.position.Y - 500f), ModContent.NPCType(), 1); diff --git a/Items/SummonItems/BirbPheromones.cs b/Items/SummonItems/BirbPheromones.cs index 8229b87417..728976df68 100644 --- a/Items/SummonItems/BirbPheromones.cs +++ b/Items/SummonItems/BirbPheromones.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/BlightedEyeball.cs b/Items/SummonItems/BlightedEyeball.cs index 9136b0c697..bfb8a540af 100644 --- a/Items/SummonItems/BlightedEyeball.cs +++ b/Items/SummonItems/BlightedEyeball.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/BloodyWormFood.cs b/Items/SummonItems/BloodyWormFood.cs index 44ad3c2ea4..e3820addb3 100644 --- a/Items/SummonItems/BloodyWormFood.cs +++ b/Items/SummonItems/BloodyWormFood.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/BulbofDoom.cs b/Items/SummonItems/BulbofDoom.cs index 38c6c9e06b..975dcc3ec4 100644 --- a/Items/SummonItems/BulbofDoom.cs +++ b/Items/SummonItems/BulbofDoom.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, NPCID.Plantera); else diff --git a/Items/SummonItems/CharredIdol.cs b/Items/SummonItems/CharredIdol.cs index 6510530c9f..5f9d1a9a8f 100644 --- a/Items/SummonItems/CharredIdol.cs +++ b/Items/SummonItems/CharredIdol.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/ChickenEgg.cs b/Items/SummonItems/ChickenEgg.cs index 8fde02a334..69f4b1c5ed 100644 --- a/Items/SummonItems/ChickenEgg.cs +++ b/Items/SummonItems/ChickenEgg.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/CosmicWorm.cs b/Items/SummonItems/CosmicWorm.cs index 1fae3cdd2e..8601a609e3 100644 --- a/Items/SummonItems/CosmicWorm.cs +++ b/Items/SummonItems/CosmicWorm.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.SummonItems Color messageColor = Color.Cyan; CalamityUtils.DisplayLocalizedText(key, messageColor); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DevourerSpawn"), (int)player.position.X, (int)player.position.Y); + SoundEngine.PlaySound(DevourerofGodsHead.SpawnSound, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/CryoKey.cs b/Items/SummonItems/CryoKey.cs index 62ee338a0e..eca3ff14db 100644 --- a/Items/SummonItems/CryoKey.cs +++ b/Items/SummonItems/CryoKey.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/DecapoditaSprout.cs b/Items/SummonItems/DecapoditaSprout.cs index 8639624bcf..1a21c27259 100644 --- a/Items/SummonItems/DecapoditaSprout.cs +++ b/Items/SummonItems/DecapoditaSprout.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) { int npc = NPC.NewNPC(new EntitySource_BossSpawn(player), (int)(player.position.X + Main.rand.Next(-250, 251)), (int)(player.position.Y - 500f), ModContent.NPCType(), 1); diff --git a/Items/SummonItems/DriedSeafood.cs b/Items/SummonItems/DriedSeafood.cs index a2f6e61ab9..355df70b74 100644 --- a/Items/SummonItems/DriedSeafood.cs +++ b/Items/SummonItems/DriedSeafood.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/NecroplasmicBeacon.cs b/Items/SummonItems/NecroplasmicBeacon.cs index d256d826e0..10838bdc32 100644 --- a/Items/SummonItems/NecroplasmicBeacon.cs +++ b/Items/SummonItems/NecroplasmicBeacon.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/OldPowerCell.cs b/Items/SummonItems/OldPowerCell.cs index ba1dda2e2e..6877aaaa67 100644 --- a/Items/SummonItems/OldPowerCell.cs +++ b/Items/SummonItems/OldPowerCell.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, NPCID.Golem); else diff --git a/Items/SummonItems/OverloadedSludge.cs b/Items/SummonItems/OverloadedSludge.cs index e32e93c66b..a148d9723c 100644 --- a/Items/SummonItems/OverloadedSludge.cs +++ b/Items/SummonItems/OverloadedSludge.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/ProfanedCoreUnlimited.cs b/Items/SummonItems/ProfanedCoreUnlimited.cs index 578643d451..9ba4cbad62 100644 --- a/Items/SummonItems/ProfanedCoreUnlimited.cs +++ b/Items/SummonItems/ProfanedCoreUnlimited.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceSpawn"), (int)player.position.X, (int)player.position.Y); + SoundEngine.PlaySound(Providence.SpawnSound, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) { int npc = NPC.NewNPC(new EntitySource_BossSpawn(player), (int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), ModContent.NPCType(), 1); diff --git a/Items/SummonItems/ProfanedShard.cs b/Items/SummonItems/ProfanedShard.cs index ca0ff86d0e..969bd814ba 100644 --- a/Items/SummonItems/ProfanedShard.cs +++ b/Items/SummonItems/ProfanedShard.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/RuneofCos.cs b/Items/SummonItems/RuneofCos.cs index fc1205d2c8..bb581487b5 100644 --- a/Items/SummonItems/RuneofCos.cs +++ b/Items/SummonItems/RuneofCos.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (player.ZoneDungeon) { if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/Items/SummonItems/SandstormsCore.cs b/Items/SummonItems/SandstormsCore.cs index f58449bf7d..3885017cf4 100644 --- a/Items/SummonItems/SandstormsCore.cs +++ b/Items/SummonItems/SandstormsCore.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/Seafood.cs b/Items/SummonItems/Seafood.cs index c0562114fc..4e72341369 100644 --- a/Items/SummonItems/Seafood.cs +++ b/Items/SummonItems/Seafood.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index 4d2641724e..17c1ac0935 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Items.SummonItems public override bool? UseItem(Player player) { - SoundEngine.PlaySound(SoundID.Roar, player.position, 0); + SoundEngine.PlaySound(SoundID.Roar, player.position); if (Main.netMode != NetmodeID.MultiplayerClient) NPC.SpawnOnPlayer(player.whoAmI, ModContent.NPCType()); else diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index 40223a6933..94a0332114 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -76,7 +76,7 @@ namespace CalamityMod.Items.Weapons.Melee if (multiplier > 1.5f) { - SoundEngine.PlaySound(SoundID.Item105, Main.player[Main.myPlayer].position); + SoundEngine.PlaySound(SoundID.Item105, player.position); bool blue = Main.rand.NextBool(); float angleStart = Main.rand.NextFloat(0f, MathHelper.TwoPi); float var = 0.05f + (2f - multiplier); diff --git a/Items/Weapons/Ranged/Arbalest.cs b/Items/Weapons/Ranged/Arbalest.cs index 6525e0eb3e..2f71cb94c4 100644 --- a/Items/Weapons/Ranged/Arbalest.cs +++ b/Items/Weapons/Ranged/Arbalest.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - SoundEngine.PlaySound(SoundID.Item5, (int)player.Center.X, (int)player.Center.Y); + SoundEngine.PlaySound(SoundID.Item5, player.Center); if (totalProjectiles > 4) { diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 6f19847d97..6b99e44b38 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Weapons.Ranged if (player.Calamity().soundCooldown <= 0) { // WoF vomit sound. - SoundEngine.PlaySound(SoundID.NPCKilled, (int)position.X, (int)position.Y, 13, 0.5f, 0f); + SoundEngine.PlaySound(SoundID.NPCDeath13 with { Volume = SoundID.NPCDeath13 * 0.5f}, position); player.Calamity().soundCooldown = 120; } return false; diff --git a/Items/Weapons/Ranged/HalibutCannon.cs b/Items/Weapons/Ranged/HalibutCannon.cs index b47a248bd3..d385627ebf 100644 --- a/Items/Weapons/Ranged/HalibutCannon.cs +++ b/Items/Weapons/Ranged/HalibutCannon.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - SoundEngine.PlaySound(SoundID.Item38, (int)player.Center.X, (int)player.Center.Y); + SoundEngine.PlaySound(SoundID.Item38, player); int bulletAmt = Main.rand.Next(25, 36); for (int index = 0; index < bulletAmt; ++index) diff --git a/Items/Weapons/Ranged/ScorchedEarth.cs b/Items/Weapons/Ranged/ScorchedEarth.cs index 0e21c09196..b43a39cc1e 100644 --- a/Items/Weapons/Ranged/ScorchedEarth.cs +++ b/Items/Weapons/Ranged/ScorchedEarth.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Items.Weapons.Ranged { public class ScorchedEarth : ModItem { + public static readonly SoundStyle ShootSound = new("Sounds/Item/ScorchedEarthShot", 3); + private int counter = 0; public override void SetStaticDefaults() { @@ -56,7 +58,7 @@ namespace CalamityMod.Items.Weapons.Ranged if (counter == 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/ScorchedEarthShot" + Main.rand.Next(1,4)), position); + SoundEngine.PlaySound(ShootSound, position); } counter++; diff --git a/Items/Weapons/Rogue/SludgeSplotch.cs b/Items/Weapons/Rogue/SludgeSplotch.cs index 72b3fa32f0..8069c33be7 100644 --- a/Items/Weapons/Rogue/SludgeSplotch.cs +++ b/Items/Weapons/Rogue/SludgeSplotch.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - SoundEngine.PlaySound(SoundID.NPCKilled, (int)player.position.X, (int)player.position.Y, 9, 2, 0); + SoundEngine.PlaySound(SoundID.NPCDeath9 with { Volume = SoundID.NPCDeath9 * 2f }, player.position); if (player.Calamity().StealthStrikeAvailable()) { diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index fbe81e2dbe..c0abd8e212 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Weapons.Summon else { // Play some demonic noises prior to a target being selected. - SoundEngine.PlaySound(SoundID.Zombie, player.Center, 93); + SoundEngine.PlaySound(SoundID.Zombie with { Variants = stackalloc int[] { 93 }, player.Center); SoundEngine.PlaySound(SoundID.Item119, player.Center); } return false; diff --git a/Items/Weapons/Summon/PrototypeAndromechaRing.cs b/Items/Weapons/Summon/PrototypeAndromechaRing.cs index cd7011f849..afa027c8e5 100644 --- a/Items/Weapons/Summon/PrototypeAndromechaRing.cs +++ b/Items/Weapons/Summon/PrototypeAndromechaRing.cs @@ -15,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Summon { public class PrototypeAndromechaRing : ModItem { + //Note: In the future i may just do some changes to this item, and the cripple effect will probably be gone. But in the meanwhile + //- Iban + public static readonly SoundStyle CrippleSound = new("Sounds/Custom/AndromedaCripple"); + public override void Load() { if (Main.netMode != NetmodeID.Server) @@ -87,7 +91,7 @@ namespace CalamityMod.Items.Weapons.Summon { player.Calamity().andromedaCripple = CrippleTime; player.AddBuff(ModContent.BuffType(), player.Calamity().andromedaCripple); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AndromedaCripple"), position); + SoundEngine.PlaySound(CrippleSound, position); } return false; } diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index dc100a936b..221bf18e06 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -21,6 +21,7 @@ using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; +using CalamityMod.Sounds; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; @@ -137,8 +138,8 @@ namespace CalamityMod.NPCs.DevourerofGods public int DestroyedSegmentCount; //Sounds + public static readonly SoundStyle SpawnSound = new("Sounds/Custom/DevourerSpawn"); public static readonly SoundStyle AttackSound = new("Sounds/Custom/DevourerAttack"); - public static readonly SoundStyle HitSound = new("Sounds/NPCHit/OtherworldlyHit"); public override void SetStaticDefaults() { @@ -2448,7 +2449,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.soundDelay == 0) { NPC.soundDelay = 8; - SoundEngine.PlaySound(HitSound, NPC.Center); + SoundEngine.PlaySound(CommonNPCSounds.OtherwordlyHitSound, NPC.Center); } if (NPC.life <= 0) { diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 5f9cdb78a8..53040f8f9b 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -152,6 +152,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas private const int sepulcherSpawnCastTime = 75; private const int brothersSpawnCastTime = 150; + //Sounds + public static readonly SoundStyle SpawnSound = new("Sounds/Custom/SupremeCalamitasSpawn"); + public static readonly SoundStyle SepulcherSummonSound = new("Sounds/Custom/SCalSounds/SepulcherSpawn"); + public static readonly SoundStyle BrimstoneShotSound = new("Sounds/Custom/SCalSounds/BrimstoneShoot"); + public static readonly SoundStyle BrimstoneBigShotSound = new("Sounds/Custom/SCalSounds/BrimstoneBigShoot"); //DON'T YOU WANNA BE A [BIG SHOT] + public static readonly SoundStyle DashSound = new("Sounds/Custom/SCalSounds/SCalDash"); + public static readonly SoundStyle HellblastSound = new("Sounds/Custom/SCalSounds/BrimstoneHellblastSound"); + + + // TODO -- This is cumbersome. Change it to be better in 1.4. internal static void LoadHeadIcons() { @@ -1422,7 +1432,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { canFireSplitingFireball = false; randomShot = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneBigShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); for (int i = 0; i < 15; i++) { @@ -1445,7 +1455,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { canFireSplitingFireball = false; randomShot = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneShotSound, NPC.Center); for (int i = 0; i < 20; i++) { @@ -1468,7 +1478,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { canFireSplitingFireball = true; randomShot = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneBigShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); float rotation = MathHelper.ToRadians(20); int numProj = 8; for (int j = 0; j < numProj; j++) @@ -1511,7 +1521,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas shieldRotation = NPC.velocity.ToRotation(); NPC.netUpdate = true; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/SCalDash"), NPC.Center); + SoundEngine.PlaySound(DashSound, NPC.Center); } NPC.ai[1] = 2f; @@ -1603,7 +1613,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.ai[3] >= 20f) { NPC.ai[3] = 0f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneHellblastSound"), NPC.Center); + SoundEngine.PlaySound(HellblastSound, NPC.Center); // Release a burst of magic dust along with a brimstone hellblast skull. for (int i = 0; i < 25; i++) @@ -1691,7 +1701,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneBigShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); Vector2 projectileVelocity = player.Center - NPC.Center; projectileVelocity.Normalize(); Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f; @@ -1755,7 +1765,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int num388 = 0; num388 < 50; num388++) Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SupremeCalamitasSpawn"), NPC.Center); + SoundEngine.PlaySound(SpawnSound, NPC.Center); } } @@ -1941,7 +1951,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int randomShot = Main.rand.Next(6); if (randomShot == 0 && canFireSplitingFireball) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneBigShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); canFireSplitingFireball = false; randomShot = ModContent.ProjectileType(); @@ -1964,7 +1974,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (randomShot == 1 && canFireSplitingFireball) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneShotSound, NPC.Center); canFireSplitingFireball = false; randomShot = ModContent.ProjectileType(); @@ -1987,7 +1997,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneBigShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); canFireSplitingFireball = true; randomShot = ModContent.ProjectileType(); float rotation = MathHelper.ToRadians(20); @@ -2030,7 +2040,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas shieldRotation = NPC.velocity.ToRotation(); NPC.netUpdate = true; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/SCalDash"), NPC.Center); + SoundEngine.PlaySound(DashSound, NPC.Center); } NPC.ai[1] = 2f; @@ -2119,7 +2129,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (NPC.ai[3] >= 24f) { NPC.ai[3] = 0f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneHellblastSound"), NPC.Center); + SoundEngine.PlaySound(HellblastSound, NPC.Center); // Release a burst of magic dust along with a brimstone hellblast skull. for (int i = 0; i < 25; i++) @@ -2211,7 +2221,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneBigShoot"), NPC.Center); + SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); Vector2 projectileVelocity = player.Center - NPC.Center; projectileVelocity.Normalize(); Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f; @@ -2322,7 +2332,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.netUpdate = true; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/SepulcherSpawn"), target.Center); + SoundEngine.PlaySound(SepulcherSummonSound, target.Center); } } diff --git a/Sounds/CommonNPCSounds.cs b/Sounds/CommonNPCSounds.cs new file mode 100644 index 0000000000..23fa143b29 --- /dev/null +++ b/Sounds/CommonNPCSounds.cs @@ -0,0 +1,10 @@ +using System; +using Terraria.Audio; + +namespace CalamityMod.Sounds +{ + public static class CommonNPCSounds + { + public static readonly SoundStyle OtherwordlyHitSound = new("Sounds/NPCHit/OtherworldlyHit"); + } +}