diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 112e608de7..742fc8b3f5 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Buffs } else if (type == BuffID.MagicPower) { - player.GetDamage(DamageClass.Magic) -= 0.1f; + player.GetDamage() -= 0.1f; } else if (type == BuffID.Panic) { @@ -57,7 +57,7 @@ namespace CalamityMod.Buffs else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3) { float nebulaDamage = 0.075f * player.nebulaLevelDamage; // 15% to 45% changed to 7.5% to 22.5% - player.GetDamage(DamageClass.Generic) -= nebulaDamage; + player.GetDamage() -= nebulaDamage; } else if (type == BuffID.Warmth) { diff --git a/Buffs/DamageOverTime/Shred.cs b/Buffs/DamageOverTime/Shred.cs index 2a0aa516e1..154ee2aad3 100644 --- a/Buffs/DamageOverTime/Shred.cs +++ b/Buffs/DamageOverTime/Shred.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Buffs.DamageOverTime // Only deal damage once every several frames. if (applicator.miscCounter % FramesPerDamageTick == 0) { - int dmg = (int)(BaseDamage * cgn.somaShredStacks * applicator.GetDamage(DamageClass.Ranged).Base); + int dmg = (int)(BaseDamage * cgn.somaShredStacks * applicator.GetDamage().Base); Projectile tick = Projectile.NewProjectileDirect(target.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), dmg, 0f, applicator.whoAmI, target.whoAmI); tick.DamageType = DamageClass.Ranged; // Uncommon for DirectStrikes, but it needs to be able to crit. tick.Calamity().canSupercrit = true; diff --git a/Buffs/StatBuffs/HallowedRuneAtkBuff.cs b/Buffs/StatBuffs/HallowedRuneAtkBuff.cs index ab9331a3a3..42b4f3535c 100644 --- a/Buffs/StatBuffs/HallowedRuneAtkBuff.cs +++ b/Buffs/StatBuffs/HallowedRuneAtkBuff.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { player.Calamity().hallowedPower = true; - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; } } } diff --git a/Buffs/StatBuffs/KamiBuff.cs b/Buffs/StatBuffs/KamiBuff.cs index 4494e5ea7b..e99e291a76 100644 --- a/Buffs/StatBuffs/KamiBuff.cs +++ b/Buffs/StatBuffs/KamiBuff.cs @@ -1,6 +1,7 @@ -using Terraria; +using Terraria; using Terraria.Audio; using Terraria.ModLoader; +using CalamityMod.Items.Weapons.Typeless; namespace CalamityMod.Buffs.StatBuffs { @@ -21,7 +22,7 @@ namespace CalamityMod.Buffs.StatBuffs { player.Calamity().kamiBoost = true; if (player.buffTime[buffIndex] == 1) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YanmeiKnifeExpire"), player.Center); + SoundEngine.PlaySound(YanmeisKnife.ExpireSound, player.Center); } } } diff --git a/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs b/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs index eb67e4743a..fbe602d7fb 100644 --- a/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs +++ b/Buffs/StatBuffs/PhantomicEmpowermentBuff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; } } } diff --git a/Buffs/StatBuffs/RageMode.cs b/Buffs/StatBuffs/RageMode.cs index 290ee15fd4..c4b5eaaeab 100644 --- a/Buffs/StatBuffs/RageMode.cs +++ b/Buffs/StatBuffs/RageMode.cs @@ -1,4 +1,4 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -33,7 +33,7 @@ namespace CalamityMod.Buffs.StatBuffs // Otherwise, Rage Mode ends instantly. else { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/RageEnd"), player.position); + SoundEngine.PlaySound(CalamityPlayer.RageEndSound, player.position); player.DelBuff(buffIndex--); // TML documentation requires you to decrement buffIndex if deleting the buff during Update. mp.rageModeActive = false; mp.rage = 0f; diff --git a/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs b/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs index 98c9ba0179..575d111cf6 100644 --- a/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs +++ b/Buffs/StatBuffs/SpiritGeneratorAtkBuff.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; } } } diff --git a/Buffs/Summon/VoidConcentrationBuff.cs b/Buffs/Summon/VoidConcentrationBuff.cs index 28b9b62d39..7c09cf4623 100644 --- a/Buffs/Summon/VoidConcentrationBuff.cs +++ b/Buffs/Summon/VoidConcentrationBuff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Buffs.Summon { CalamityPlayer mp = player.Calamity(); int count = player.ownedProjectileCounts[ModContent.ProjectileType()]; - player.GetDamage(DamageClass.Summon) += 0.05f; //5% + player.GetDamage() += 0.05f; //5% mp.voidConcentrationAura = true; if (!mp.voidAuraDamage && count == 0) { diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 863143560a..092794a69b 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -231,6 +231,17 @@ namespace CalamityMod.CalPlayer public bool playRogueStealthSound = false; public bool playFullRageSound = true; public bool playFullAdrenalineSound = true; + + public static readonly SoundStyle RageFilledSound = new("CalamityMod/Sounds/Custom/AbilitySounds/FullRage"); + public static readonly SoundStyle RageActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/RageActivate"); + public static readonly SoundStyle RageEndSound = new("CalamityMod/Sounds/Custom/AbilitySounds/RageEnd"); + + public static readonly SoundStyle AdrenalineFilledSound = new("CalamityMod/Sounds/Custom/AbilitySounds/FullAdrenaline"); + public static readonly SoundStyle AdrenalineActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/AdrenalineActivate"); + + public static readonly SoundStyle RogueStealthSound = new("CalamityMod/Sounds/Custom/RogueStealth"); + public static readonly SoundStyle DefenseDamageSound = new("CalamityMod/Sounds/Custom/DefenseDamage"); + #endregion #region Proficiency @@ -2603,7 +2614,7 @@ namespace CalamityMod.CalPlayer { int seconds = CalamityUtils.SecondsToFrames(15f); Player.AddBuff(ModContent.BuffType(), seconds, false); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/AngelicAllianceActivation"), Player.Center); + SoundEngine.PlaySound(AngelicAlliance.ActivationSound, Player.Center); // Spawn an archangel for every minion you have float angelAmt = 0f; @@ -2636,7 +2647,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); rogueStealth -= rogueStealthMax * 0.25f; Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), 7, 8, Player.whoAmI); - SoundEngine.PlaySound(SoundID.Item, Player.position, 45); + SoundEngine.PlaySound(SoundID.Item45, Player.position); } if (CalamityKeybinds.SpectralVeilHotKey.JustPressed && spectralVeil && Main.myPlayer == Player.whoAmI && rogueStealth >= rogueStealthMax * 0.25f && wearingRogueArmor && rogueStealthMax > 0) @@ -2711,7 +2722,7 @@ namespace CalamityMod.CalPlayer { brimflameFrenzy = true; Player.AddBuff(ModContent.BuffType(), 10 * 60, true); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/AbilitySounds/BrimflameAbility"), Player.Center); + SoundEngine.PlaySound(BrimflameScowl.ActivationSound, Player.Center); for (int num502 = 0; num502 < 36; num502++) { int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); @@ -2744,7 +2755,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) Player.AddCooldown(BloodflareRangedSet.ID, 1800); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/BloodflareRangerActivation"), Player.Center); + SoundEngine.PlaySound(BloodflareHornedHelm.ActivationSound, Player.Center); for (int d = 0; d < 64; d++) { int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Phantoplasm, 0f, 0f, 0, default, 1f); @@ -2793,7 +2804,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), 300, false); } Player.AddCooldown(OmegaBlue.ID, 1800); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/OmegaBlueAbility"), Player.Center); + SoundEngine.PlaySound(OmegaBlueHelmet.ActivationSound, Player.Center); for (int i = 0; i < 66; i++) { int d = Dust.NewDust(Player.position, Player.width, Player.height, 20, 0, 0, 100, Color.Transparent, 2.6f); @@ -2805,7 +2816,7 @@ namespace CalamityMod.CalPlayer } if (dsSetBonus) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/DemonshadeEnrage"), Player.Center); + SoundEngine.PlaySound(DemonshadeHelm.ActivationSound, Player.Center); for (int num502 = 0; num502 < 36; num502++) { int dust = Dust.NewDust(new Vector2(Player.position.X, Player.position.Y + 16f), Player.width, Player.height - 16, (int)CalamityDusts.Brimstone, 0f, 0f, 0, default, 1f); @@ -2841,7 +2852,7 @@ namespace CalamityMod.CalPlayer } if (plagueReaper && !Player.HasCooldown(PlagueBlackout.ID)) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/PlagueReaperAbility"), Player.Center); + SoundEngine.PlaySound(PlagueReaperMask.ActivationSound, Player.Center); Player.AddCooldown(PlagueBlackout.ID, 1800); } if (forbiddenCirclet && forbiddenCooldown <= 0) @@ -2890,7 +2901,7 @@ namespace CalamityMod.CalPlayer if (Main.netMode == NetmodeID.SinglePlayer) { Player.TeleportationPotion(); - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 6); + SoundEngine.PlaySound(SoundID.Item6, Player.position); } else if (Main.netMode == NetmodeID.MultiplayerClient && Player.whoAmI == Main.myPlayer) { @@ -2921,7 +2932,7 @@ namespace CalamityMod.CalPlayer // Gael's Greatsword replaces Rage Mode with an uber skull attack if (gaelRageAttackCooldown == 0 && Player.ActiveItem().type == ModContent.ItemType() && rage > 0f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/SilvaDispel"), Player.Center); + SoundEngine.PlaySound(SilvaHelmet.DispelSound, Player.Center); for (int i = 0; i < 3; i++) Dust.NewDust(Player.position, 120, 120, 218, 0f, 0f, 100, default, 1.5f); @@ -2967,7 +2978,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), 2); // Play Rage Activation sound - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/RageActivate"), Player.position); + SoundEngine.PlaySound( RageActivationSound, Player.position); // TODO -- improve Rage activation visuals for (int num502 = 0; num502 < 64; num502++) @@ -2998,7 +3009,7 @@ namespace CalamityMod.CalPlayer Player.AddBuff(ModContent.BuffType(), AdrenalineDuration); // Play Adrenaline Activation sound - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/AdrenalineActivate"), Player.position); + SoundEngine.PlaySound(AdrenalineActivationSound, Player.position); // TODO -- improve Adrenaline activation visuals for (int num502 = 0; num502 < 64; num502++) @@ -3040,7 +3051,7 @@ namespace CalamityMod.CalPlayer int offset = Player.height; if (Player.gravDir == -1f) offset = 0; - SoundEngine.PlaySound(SoundID.DoubleJump, (int)Player.position.X, (int)Player.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.DoubleJump, Player.position); Player.velocity.Y = -Player.jumpSpeed * Player.gravDir; Player.jump = (int)(Player.jumpHeight * 1.25); for (int d = 0; d < 30; ++d) @@ -3062,7 +3073,7 @@ namespace CalamityMod.CalPlayer int offset = Player.height; if (Player.gravDir == -1f) offset = 0; - SoundEngine.PlaySound(SoundID.DoubleJump, (int)Player.position.X, (int)Player.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.DoubleJump, Player.position); Player.velocity.Y = -Player.jumpSpeed * Player.gravDir; Player.jump = (int)(Player.jumpHeight * 1.5); for (int d = 0; d < 30; ++d) @@ -3261,7 +3272,7 @@ namespace CalamityMod.CalPlayer } Main.TeleportEffect(player.getRect(), 1); Main.TeleportEffect(player.getRect(), 3); - SoundEngine.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 6); + SoundEngine.PlaySound(SoundID.Item6, player.position); if (Main.netMode != NetmodeID.Server) { return; @@ -3511,25 +3522,25 @@ namespace CalamityMod.CalPlayer if (GemTechState.IsYellowGemActive) meleeSpeedMult += GemTechHeadgear.MeleeSpeedBoost; - Player.GetAttackSpeed(DamageClass.Melee) += meleeSpeedMult; + Player.GetAttackSpeed() += meleeSpeedMult; // Reduce melee speed bonus by 0.25x for Astral Blade, Mantis Claws, Omniblade and Blade of Enmity. if (Player.ActiveItem().type == ModContent.ItemType() || Player.ActiveItem().type == ModContent.ItemType() || Player.ActiveItem().type == ModContent.ItemType() || Player.ActiveItem().type == ModContent.ItemType()) { - float newMeleeSpeed = 1f + ((Player.GetAttackSpeed(DamageClass.Melee) - 1f) * 0.25f); - Player.GetAttackSpeed(DamageClass.Melee) = newMeleeSpeed; + float newMeleeSpeed = 1f + ((Player.GetAttackSpeed() - 1f) * 0.25f); + Player.GetAttackSpeed() = newMeleeSpeed; } // Melee speed does not affect non-true melee weapon projectile rate of fire. if (Player.HoldingProjectileMeleeWeapon()) { // Melee weapons that fire any kind of projectile don't benefit from melee speed anymore, so they get a damage boost from it instead. - Player.GetDamage(DamageClass.Melee) += Player.GetAttackSpeed(DamageClass.Melee) - 1f; + Player.GetDamage() += Player.GetAttackSpeed() - 1f; // Set melee speed to 1f. - float newMeleeSpeed = 1f + ((Player.GetAttackSpeed(DamageClass.Melee) - 1f) * projectileMeleeWeaponMeleeSpeedMultiplier); - Player.GetAttackSpeed(DamageClass.Melee) = newMeleeSpeed; + float newMeleeSpeed = 1f + ((Player.GetAttackSpeed() - 1f) * projectileMeleeWeaponMeleeSpeedMultiplier); + Player.GetAttackSpeed() = newMeleeSpeed; } #endregion @@ -3878,7 +3889,7 @@ namespace CalamityMod.CalPlayer Main.dust[sVeilDustIndex2].noLight = false; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/SilvaDispel"), Player.Center); + SoundEngine.PlaySound(SilvaHelmet.DispelSound, Player.Center); NetMessage.SendData(MessageID.Dodge, -1, -1, null, Player.whoAmI, 1f, 0f, 0f, 0, 0, 0); } @@ -3886,7 +3897,7 @@ namespace CalamityMod.CalPlayer private void GodSlayerDodge() { Player.GiveIFrames(Player.longInvince ? 100 : 60, true); - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 67); + SoundEngine.PlaySound(SoundID.Item67, Player.position); for (int j = 0; j < 30; j++) { @@ -3952,7 +3963,7 @@ namespace CalamityMod.CalPlayer Player.GiveIFrames(Player.longInvince ? 100 : 60, true); rogueStealth += 0.5f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/SilvaActivation"), Player.Center); + SoundEngine.PlaySound(SilvaHelmet.ActivationSound, Player.Center); var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); for (int i = 0; i < 10; i++) @@ -4094,7 +4105,7 @@ namespace CalamityMod.CalPlayer if (nCore && !Player.HasCooldown(Cooldowns.NebulousCore.ID)) { - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 67); + SoundEngine.PlaySound(SoundID.Item67, Player.position); for (int j = 0; j < 50; j++) { @@ -4131,7 +4142,7 @@ namespace CalamityMod.CalPlayer { if (silvaCountdown == silvaReviveDuration && !hasSilvaEffect) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/SilvaActivation"), (int)Player.position.X, (int)Player.position.Y); + SoundEngine.PlaySound(SilvaHelmet.ActivationSound, Player.position); Player.AddBuff(ModContent.BuffType(), silvaReviveDuration); @@ -4612,7 +4623,7 @@ namespace CalamityMod.CalPlayer } if (item.CountsAsClass() && badgeOfBravery) { - int penetratableDefense = (int)Math.Max(target.defense - Player.GetArmorPenetration(DamageClass.Generic), 0); + int penetratableDefense = (int)Math.Max(target.defense - Player.GetArmorPenetration(), 0); int penetratedDefense = Math.Min(penetratableDefense, 5); damage += (int)(0.5f * penetratedDefense); } @@ -4757,7 +4768,7 @@ namespace CalamityMod.CalPlayer { penetrateAmt += 5; } - int penetratableDefense = (int)Math.Max(target.defense - Player.GetArmorPenetration(DamageClass.Generic), 0); //if find how much defense we can penetrate + int penetratableDefense = (int)Math.Max(target.defense - Player.GetArmorPenetration(), 0); //if find how much defense we can penetrate int penetratedDefense = Math.Min(penetratableDefense, penetrateAmt); //if we have more penetrate than enemy defense, use enemy defense damage += (int)(0.5f * penetratedDefense); #endregion @@ -5973,31 +5984,25 @@ namespace CalamityMod.CalPlayer if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) { playSound = false; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/ProvidenceHurt"), (int)Player.position.X, (int)Player.position.Y); + SoundEngine.PlaySound(Providence.DeathSound, Player.position); hurtSoundTimer = 20; } else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) { playSound = false; - SoundEngine.PlaySound(SoundID.NPCHit, (int)Player.position.X, (int)Player.position.Y, 4, 1f, 0f); //metal hit noise + SoundEngine.PlaySound(SoundID.NPCHit4, Player.position); //metal hit noise hurtSoundTimer = 10; } else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide) { playSound = false; - SoundEngine.PlaySound(SoundID.FemaleHit, (int)Player.position.X, (int)Player.position.Y, 1, 1f, 0f); //female hit noise + SoundEngine.PlaySound(SoundID.FemaleHit, Player.position); //female hit noise hurtSoundTimer = 10; } else if (titanHeartSet) { playSound = false; - Terraria.Audio.LegacySoundStyle atlasHurt = Utils.SelectRandom(Main.rand, new Terraria.Audio.LegacySoundStyle[] - { - SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AtlasHurt0"), - SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AtlasHurt1"), - SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AtlasHurt2") - }); - SoundEngine.PlaySound(atlasHurt, (int)Player.position.X, (int)Player.position.Y); + SoundEngine.PlaySound(NPCs.Astral.Atlas.HurtSound, Player.position); hurtSoundTimer = 10; } } @@ -6141,7 +6146,7 @@ namespace CalamityMod.CalPlayer if (amidiasBlessing) { Player.ClearBuff(ModContent.BuffType()); - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 96); + SoundEngine.PlaySound(SoundID.Item96, Player.position); } if ((gShell || flameLickedShell) && !Player.panic) @@ -6158,7 +6163,7 @@ namespace CalamityMod.CalPlayer if (abyssalDivingSuitPlateHits >= 3) { - SoundEngine.PlaySound(SoundID.NPCKilled, (int)Player.position.X, (int)Player.position.Y, 14); + SoundEngine.PlaySound(SoundID.NPCDeath14, Player.position); if (plateCDExists) cooldowns.Remove(DivingPlatesBreaking.ID); Player.AddCooldown(DivingPlatesBroken.ID, 10830); @@ -6185,7 +6190,7 @@ namespace CalamityMod.CalPlayer if (aquaticHeartIce) { - SoundEngine.PlaySound(SoundID.NPCKilled, (int)Player.Center.X, (int)Player.Center.Y, 7); + SoundEngine.PlaySound(SoundID.NPCDeath7, Player.Center); Player.AddCooldown(AquaticHeartIceShield.ID, CalamityUtils.SecondsToFrames(30)); for (int d = 0; d < 10; d++) @@ -6226,7 +6231,7 @@ namespace CalamityMod.CalPlayer if ((fBarrier || (aquaticHeart && NPC.downedBoss3)) && !areThereAnyDamnBosses) { - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 27); + SoundEngine.PlaySound(SoundID.Item27, Player.position); for (int m = 0; m < Main.maxNPCs; m++) { NPC npc = Main.npc[m]; @@ -6426,7 +6431,7 @@ namespace CalamityMod.CalPlayer if (aBulwarkRare) { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 74); + SoundEngine.PlaySound(SoundID.Item74, Player.position); int blazeDamage = (int)Player.GetBestClassDamage().ApplyTo(25); int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(320); Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, 0f, ModContent.ProjectileType(), blazeDamage, 5f, Player.whoAmI, 0f, 1f); @@ -6455,7 +6460,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); if (damage > 0) { - SoundEngine.PlaySound(SoundID.NPCHit, (int)Player.position.X, (int)Player.position.Y, 45); + SoundEngine.PlaySound(SoundID.NPCHit45, Player.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -6481,7 +6486,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); if (damage > 0) { - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 93); + SoundEngine.PlaySound(SoundID.Item93, Player.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -6522,7 +6527,7 @@ namespace CalamityMod.CalPlayer rogueStealth += 0.5f; for (int i = 0; i < 5; i++) { - SoundEngine.PlaySound(SoundID.Item, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 61); + SoundEngine.PlaySound(SoundID.Item61, Player.position); int ink = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, Player.whoAmI); if (ink.WithinBounds(Main.maxProjectiles)) Main.projectile[ink].Calamity().forceClassless = true; @@ -6552,7 +6557,7 @@ namespace CalamityMod.CalPlayer var fuckYouBitch = Player.GetSource_Misc("21"); if (damage > 0) { - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 74); + SoundEngine.PlaySound(SoundID.Item74, Player.position); int eDamage = (int)Player.GetBestClassDamage().ApplyTo(100); if (Player.whoAmI == Main.myPlayer) Projectile.NewProjectile(fuckYouBitch, Player.Center, Vector2.Zero, ModContent.ProjectileType(), eDamage, 1f, Player.whoAmI, 0f, 0f); @@ -6563,7 +6568,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Misc("22"); if (damage > 0) { - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 27); + SoundEngine.PlaySound(SoundID.Item27, Player.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -6601,7 +6606,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Misc("24"); if (damage > 80) { - SoundEngine.PlaySound(SoundID.Item, (int)Player.position.X, (int)Player.position.Y, 73); + SoundEngine.PlaySound(SoundID.Item73, Player.position); float spread = 45f * 0.0174f; double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; @@ -6710,7 +6715,7 @@ namespace CalamityMod.CalPlayer Player.KillMeForGood(); } } - SoundEngine.PlaySound(SoundID.PlayerKilled, (int)Player.position.X, (int)Player.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.PlayerKilled, Player.position); Player.headVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; Player.bodyVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; Player.legVelocity.Y = (float)Main.rand.Next(-40, -10) * 0.1f; @@ -6890,7 +6895,7 @@ namespace CalamityMod.CalPlayer if (playRogueStealthSound && rogueStealth >= rogueStealthMax) { playRogueStealthSound = false; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/RogueStealth"), (int)Player.position.X, (int)Player.position.Y); + SoundEngine.PlaySound(RogueStealthSound, Player.position); } // If the player isn't at full stealth, reset the sound so it'll play again when they hit full stealth. @@ -7586,312 +7591,312 @@ namespace CalamityMod.CalPlayer #region MeleeLevelBoosts if (meleeLevel >= 12500) { - Player.GetDamage(DamageClass.Melee) += 0.06f; - Player.GetCritChance(DamageClass.Melee) += 3; + Player.GetDamage() += 0.06f; + Player.GetCritChance() += 3; } else if (meleeLevel >= 10500) { - Player.GetDamage(DamageClass.Melee) += 0.06f; - Player.GetCritChance(DamageClass.Melee) += 3; + Player.GetDamage() += 0.06f; + Player.GetCritChance() += 3; } else if (meleeLevel >= 9100) { - Player.GetDamage(DamageClass.Melee) += 0.06f; - Player.GetCritChance(DamageClass.Melee) += 3; + Player.GetDamage() += 0.06f; + Player.GetCritChance() += 3; } else if (meleeLevel >= 7800) { - Player.GetDamage(DamageClass.Melee) += 0.05f; - Player.GetCritChance(DamageClass.Melee) += 3; + Player.GetDamage() += 0.05f; + Player.GetCritChance() += 3; } else if (meleeLevel >= 6600) { - Player.GetDamage(DamageClass.Melee) += 0.05f; - Player.GetCritChance(DamageClass.Melee) += 3; + Player.GetDamage() += 0.05f; + Player.GetCritChance() += 3; } else if (meleeLevel >= 5500) //hm limit { - Player.GetDamage(DamageClass.Melee) += 0.05f; - Player.GetCritChance(DamageClass.Melee) += 2; + Player.GetDamage() += 0.05f; + Player.GetCritChance() += 2; } else if (meleeLevel >= 4500) { - Player.GetDamage(DamageClass.Melee) += 0.05f; - Player.GetCritChance(DamageClass.Melee) += 2; + Player.GetDamage() += 0.05f; + Player.GetCritChance() += 2; } else if (meleeLevel >= 3600) { - Player.GetDamage(DamageClass.Melee) += 0.04f; - Player.GetCritChance(DamageClass.Melee) += 2; + Player.GetDamage() += 0.04f; + Player.GetCritChance() += 2; } else if (meleeLevel >= 2800) { - Player.GetDamage(DamageClass.Melee) += 0.04f; - Player.GetCritChance(DamageClass.Melee) += 1; + Player.GetDamage() += 0.04f; + Player.GetCritChance() += 1; } else if (meleeLevel >= 2100) { - Player.GetDamage(DamageClass.Melee) += 0.04f; - Player.GetCritChance(DamageClass.Melee) += 1; + Player.GetDamage() += 0.04f; + Player.GetCritChance() += 1; } else if (meleeLevel >= 1500) //prehm limit { - Player.GetDamage(DamageClass.Melee) += 0.03f; - Player.GetCritChance(DamageClass.Melee) += 1; + Player.GetDamage() += 0.03f; + Player.GetCritChance() += 1; } else if (meleeLevel >= 1000) { - Player.GetDamage(DamageClass.Melee) += 0.02f; - Player.GetCritChance(DamageClass.Melee) += 1; + Player.GetDamage() += 0.02f; + Player.GetCritChance() += 1; } else if (meleeLevel >= 600) { - Player.GetDamage(DamageClass.Melee) += 0.02f; + Player.GetDamage() += 0.02f; } else if (meleeLevel >= 300) - Player.GetDamage(DamageClass.Melee) += 0.02f; + Player.GetDamage() += 0.02f; else if (meleeLevel >= 100) - Player.GetDamage(DamageClass.Melee) += 0.01f; + Player.GetDamage() += 0.01f; #endregion #region RangedLevelBoosts if (rangedLevel >= 12500) { - Player.GetDamage(DamageClass.Ranged) += 0.06f; + Player.GetDamage() += 0.06f; Player.moveSpeed += 0.06f; - Player.GetCritChance(DamageClass.Ranged) += 3; + Player.GetCritChance() += 3; } else if (rangedLevel >= 10500) { - Player.GetDamage(DamageClass.Ranged) += 0.05f; + Player.GetDamage() += 0.05f; Player.moveSpeed += 0.06f; - Player.GetCritChance(DamageClass.Ranged) += 3; + Player.GetCritChance() += 3; } else if (rangedLevel >= 9100) { - Player.GetDamage(DamageClass.Ranged) += 0.05f; + Player.GetDamage() += 0.05f; Player.moveSpeed += 0.05f; - Player.GetCritChance(DamageClass.Ranged) += 3; + Player.GetCritChance() += 3; } else if (rangedLevel >= 7800) { - Player.GetDamage(DamageClass.Ranged) += 0.04f; + Player.GetDamage() += 0.04f; Player.moveSpeed += 0.05f; - Player.GetCritChance(DamageClass.Ranged) += 3; + Player.GetCritChance() += 3; } else if (rangedLevel >= 6600) { - Player.GetDamage(DamageClass.Ranged) += 0.04f; + Player.GetDamage() += 0.04f; Player.moveSpeed += 0.04f; - Player.GetCritChance(DamageClass.Ranged) += 3; + Player.GetCritChance() += 3; } else if (rangedLevel >= 5500) { - Player.GetDamage(DamageClass.Ranged) += 0.04f; + Player.GetDamage() += 0.04f; Player.moveSpeed += 0.04f; - Player.GetCritChance(DamageClass.Ranged) += 2; + Player.GetCritChance() += 2; } else if (rangedLevel >= 4500) { - Player.GetDamage(DamageClass.Ranged) += 0.03f; + Player.GetDamage() += 0.03f; Player.moveSpeed += 0.04f; - Player.GetCritChance(DamageClass.Ranged) += 2; + Player.GetCritChance() += 2; } else if (rangedLevel >= 3600) { - Player.GetDamage(DamageClass.Ranged) += 0.03f; + Player.GetDamage() += 0.03f; Player.moveSpeed += 0.03f; - Player.GetCritChance(DamageClass.Ranged) += 2; + Player.GetCritChance() += 2; } else if (rangedLevel >= 2800) { - Player.GetDamage(DamageClass.Ranged) += 0.02f; + Player.GetDamage() += 0.02f; Player.moveSpeed += 0.03f; - Player.GetCritChance(DamageClass.Ranged) += 2; + Player.GetCritChance() += 2; } else if (rangedLevel >= 2100) { - Player.GetDamage(DamageClass.Ranged) += 0.02f; + Player.GetDamage() += 0.02f; Player.moveSpeed += 0.03f; - Player.GetCritChance(DamageClass.Ranged) += 1; + Player.GetCritChance() += 1; } else if (rangedLevel >= 1500) { - Player.GetDamage(DamageClass.Ranged) += 0.02f; + Player.GetDamage() += 0.02f; Player.moveSpeed += 0.02f; - Player.GetCritChance(DamageClass.Ranged) += 1; + Player.GetCritChance() += 1; } else if (rangedLevel >= 1000) { - Player.GetDamage(DamageClass.Ranged) += 0.02f; + Player.GetDamage() += 0.02f; Player.moveSpeed += 0.01f; - Player.GetCritChance(DamageClass.Ranged) += 1; + Player.GetCritChance() += 1; } else if (rangedLevel >= 600) { - Player.GetDamage(DamageClass.Ranged) += 0.02f; - Player.GetCritChance(DamageClass.Ranged) += 1; + Player.GetDamage() += 0.02f; + Player.GetCritChance() += 1; } else if (rangedLevel >= 300) - Player.GetDamage(DamageClass.Ranged) += 0.02f; + Player.GetDamage() += 0.02f; else if (rangedLevel >= 100) - Player.GetDamage(DamageClass.Ranged) += 0.01f; + Player.GetDamage() += 0.01f; #endregion #region MagicLevelBoosts if (magicLevel >= 12500) { - Player.GetDamage(DamageClass.Magic) += 0.06f; + Player.GetDamage() += 0.06f; Player.manaCost *= 0.94f; - Player.GetCritChance(DamageClass.Magic) += 3; + Player.GetCritChance() += 3; } else if (magicLevel >= 10500) { - Player.GetDamage(DamageClass.Magic) += 0.05f; + Player.GetDamage() += 0.05f; Player.manaCost *= 0.94f; - Player.GetCritChance(DamageClass.Magic) += 3; + Player.GetCritChance() += 3; } else if (magicLevel >= 9100) { - Player.GetDamage(DamageClass.Magic) += 0.05f; + Player.GetDamage() += 0.05f; Player.manaCost *= 0.95f; - Player.GetCritChance(DamageClass.Magic) += 3; + Player.GetCritChance() += 3; } else if (magicLevel >= 7800) { - Player.GetDamage(DamageClass.Magic) += 0.04f; + Player.GetDamage() += 0.04f; Player.manaCost *= 0.95f; - Player.GetCritChance(DamageClass.Magic) += 3; + Player.GetCritChance() += 3; } else if (magicLevel >= 6600) { - Player.GetDamage(DamageClass.Magic) += 0.04f; + Player.GetDamage() += 0.04f; Player.manaCost *= 0.96f; - Player.GetCritChance(DamageClass.Magic) += 3; + Player.GetCritChance() += 3; } else if (magicLevel >= 5500) { - Player.GetDamage(DamageClass.Magic) += 0.04f; + Player.GetDamage() += 0.04f; Player.manaCost *= 0.96f; - Player.GetCritChance(DamageClass.Magic) += 2; + Player.GetCritChance() += 2; } else if (magicLevel >= 4500) { - Player.GetDamage(DamageClass.Magic) += 0.04f; + Player.GetDamage() += 0.04f; Player.manaCost *= 0.97f; - Player.GetCritChance(DamageClass.Magic) += 2; + Player.GetCritChance() += 2; } else if (magicLevel >= 3600) { - Player.GetDamage(DamageClass.Magic) += 0.03f; + Player.GetDamage() += 0.03f; Player.manaCost *= 0.97f; - Player.GetCritChance(DamageClass.Magic) += 2; + Player.GetCritChance() += 2; } else if (magicLevel >= 2800) { - Player.GetDamage(DamageClass.Magic) += 0.03f; + Player.GetDamage() += 0.03f; Player.manaCost *= 0.98f; - Player.GetCritChance(DamageClass.Magic) += 2; + Player.GetCritChance() += 2; } else if (magicLevel >= 2100) { - Player.GetDamage(DamageClass.Magic) += 0.03f; + Player.GetDamage() += 0.03f; Player.manaCost *= 0.98f; - Player.GetCritChance(DamageClass.Magic) += 1; + Player.GetCritChance() += 1; } else if (magicLevel >= 1500) { - Player.GetDamage(DamageClass.Magic) += 0.02f; + Player.GetDamage() += 0.02f; Player.manaCost *= 0.98f; - Player.GetCritChance(DamageClass.Magic) += 1; + Player.GetCritChance() += 1; } else if (magicLevel >= 1000) { - Player.GetDamage(DamageClass.Magic) += 0.02f; + Player.GetDamage() += 0.02f; Player.manaCost *= 0.99f; - Player.GetCritChance(DamageClass.Magic) += 1; + Player.GetCritChance() += 1; } else if (magicLevel >= 600) { - Player.GetDamage(DamageClass.Magic) += 0.02f; + Player.GetDamage() += 0.02f; Player.manaCost *= 0.99f; } else if (magicLevel >= 300) - Player.GetDamage(DamageClass.Magic) += 0.02f; + Player.GetDamage() += 0.02f; else if (magicLevel >= 100) - Player.GetDamage(DamageClass.Magic) += 0.01f; + Player.GetDamage() += 0.01f; #endregion #region SummonLevelBoosts if (summonLevel >= 12500) { - Player.GetDamage(DamageClass.Summon) += 0.12f; - Player.GetKnockback(DamageClass.Summon).Base += 3.0f; + Player.GetDamage() += 0.12f; + Player.GetKnockback(DamageClass.Summon) += 3.0f; } else if (summonLevel >= 10500) { - Player.GetDamage(DamageClass.Summon) += 0.1f; - Player.GetKnockback(DamageClass.Summon).Base += 3.0f; + Player.GetDamage() += 0.1f; + Player.GetKnockback(DamageClass.Summon) += 3.0f; } else if (summonLevel >= 9100) { - Player.GetDamage(DamageClass.Summon) += 0.09f; - Player.GetKnockback(DamageClass.Summon).Base += 2.7f; + Player.GetDamage() += 0.09f; + Player.GetKnockback(DamageClass.Summon) += 2.7f; } else if (summonLevel >= 7800) { - Player.GetDamage(DamageClass.Summon) += 0.08f; - Player.GetKnockback(DamageClass.Summon).Base += 2.4f; + Player.GetDamage() += 0.08f; + Player.GetKnockback(DamageClass.Summon) += 2.4f; } else if (summonLevel >= 6600) { - Player.GetDamage(DamageClass.Summon) += 0.07f; - Player.GetKnockback(DamageClass.Summon).Base += 2.1f; + Player.GetDamage() += 0.07f; + Player.GetKnockback(DamageClass.Summon) += 2.1f; } else if (summonLevel >= 5500) { - Player.GetDamage(DamageClass.Summon) += 0.07f; - Player.GetKnockback(DamageClass.Summon).Base += 1.8f; + Player.GetDamage() += 0.07f; + Player.GetKnockback(DamageClass.Summon) += 1.8f; } else if (summonLevel >= 4500) { - Player.GetDamage(DamageClass.Summon) += 0.06f; - Player.GetKnockback(DamageClass.Summon).Base += 1.8f; + Player.GetDamage() += 0.06f; + Player.GetKnockback(DamageClass.Summon) += 1.8f; } else if (summonLevel >= 3600) { - Player.GetDamage(DamageClass.Summon) += 0.05f; - Player.GetKnockback(DamageClass.Summon).Base += 1.5f; + Player.GetDamage() += 0.05f; + Player.GetKnockback(DamageClass.Summon) += 1.5f; } else if (summonLevel >= 2800) { - Player.GetDamage(DamageClass.Summon) += 0.04f; - Player.GetKnockback(DamageClass.Summon).Base += 1.2f; + Player.GetDamage() += 0.04f; + Player.GetKnockback(DamageClass.Summon) += 1.2f; } else if (summonLevel >= 2100) { - Player.GetDamage(DamageClass.Summon) += 0.04f; - Player.GetKnockback(DamageClass.Summon).Base += 0.9f; + Player.GetDamage() += 0.04f; + Player.GetKnockback(DamageClass.Summon) += 0.9f; } else if (summonLevel >= 1500) { - Player.GetDamage(DamageClass.Summon) += 0.03f; - Player.GetKnockback(DamageClass.Summon).Base += 0.6f; + Player.GetDamage() += 0.03f; + Player.GetKnockback(DamageClass.Summon) += 0.6f; } else if (summonLevel >= 1000) { - Player.GetDamage(DamageClass.Summon) += 0.03f; - Player.GetKnockback(DamageClass.Summon).Base += 0.3f; + Player.GetDamage() += 0.03f; + Player.GetKnockback(DamageClass.Summon) += 0.3f; } else if (summonLevel >= 600) { - Player.GetDamage(DamageClass.Summon) += 0.02f; - Player.GetKnockback(DamageClass.Summon).Base += 0.3f; + Player.GetDamage() += 0.02f; + Player.GetKnockback(DamageClass.Summon) += 0.3f; } else if (summonLevel >= 300) - Player.GetDamage(DamageClass.Summon) += 0.02f; + Player.GetDamage() += 0.02f; else if (summonLevel >= 100) - Player.GetDamage(DamageClass.Summon) += 0.01f; + Player.GetDamage() += 0.01f; #endregion #region RogueLevelBoosts @@ -8247,7 +8252,7 @@ namespace CalamityMod.CalPlayer // Play a sound from taking defense damage. if (hurtSoundTimer == 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DefenseDamage"), (int)Player.position.X, (int)Player.position.Y); + SoundEngine.PlaySound(DefenseDamageSound, Player.position); hurtSoundTimer = 30; } diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 4fe0fd3019..2471d8e287 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -169,8 +169,8 @@ namespace CalamityMod.CalPlayer { // player.rangedCrit already contains the crit stat of the held item, no need to grab it separately. // Don't store the base 4% because you're not removing it. - spiritOriginConvertedCrit = (int)(Player.GetCritChance(DamageClass.Ranged) - 4); - Player.GetCritChance(DamageClass.Ranged) = 4; + spiritOriginConvertedCrit = (int)(Player.GetCritChance() - 4); + Player.GetCritChance() = 4; } if (Player.ActiveItem().type == ModContent.ItemType()) @@ -380,7 +380,7 @@ namespace CalamityMod.CalPlayer if (playFullRageSound) { playFullRageSound = false; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/FullRage"), (int)Player.position.X, (int)Player.position.Y); + SoundEngine.PlaySound(RageFilledSound, Player.position); } } else @@ -426,7 +426,7 @@ namespace CalamityMod.CalPlayer if (playFullAdrenalineSound) { playFullAdrenalineSound = false; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/FullAdrenaline"), (int)Player.position.X, (int)Player.position.Y); + SoundEngine.PlaySound(AdrenalineFilledSound, Player.position); } } else @@ -935,7 +935,7 @@ namespace CalamityMod.CalPlayer if (attack) { - Player.GetDamage(DamageClass.Summon) += 0.1f + + Player.GetDamage() += 0.1f + (defend ? 0.05f : 0f); } } @@ -1183,7 +1183,7 @@ namespace CalamityMod.CalPlayer silvaCountdown -= 1; if (silvaCountdown <= 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AbilitySounds/SilvaDispel"), Player.Center); + SoundEngine.PlaySound(SilvaHelmet.DispelSound, Player.Center); Player.AddCooldown(SilvaRevive.ID, CalamityUtils.SecondsToFrames(5 * 60)); } @@ -1285,8 +1285,8 @@ namespace CalamityMod.CalPlayer Player.AddCooldown(BloodflareFrenzy.ID, CalamityUtils.SecondsToFrames(30)); } - Player.GetCritChance(DamageClass.Melee) += 25; - Player.GetDamage(DamageClass.Melee) += 0.25f; + Player.GetCritChance() += 25; + Player.GetDamage() += 0.25f; for (int j = 0; j < 2; j++) { @@ -1472,8 +1472,8 @@ namespace CalamityMod.CalPlayer // Vortex Armor nerf if (Player.vortexStealthActive) { - Player.GetDamage(DamageClass.Ranged) -= (1f - Player.stealth) * 0.4f; // Change 80 to 40 - Player.GetCritChance(DamageClass.Ranged) -= (int)((1f - Player.stealth) * 5f); // Change 20 to 15 + Player.GetDamage() -= (1f - Player.stealth) * 0.4f; // Change 80 to 40 + Player.GetCritChance() -= (int)((1f - Player.stealth) * 5f); // Change 20 to 15 } // Polaris fish stuff @@ -2346,7 +2346,7 @@ namespace CalamityMod.CalPlayer if (armorCrumbling) { Player.GetCritChance() += 5; - Player.GetCritChance(DamageClass.Melee) += 5; + Player.GetCritChance() += 5; } if (armorShattering) @@ -2354,9 +2354,9 @@ namespace CalamityMod.CalPlayer if (Player.FindBuffIndex(ModContent.BuffType()) > -1) Player.ClearBuff(ModContent.BuffType()); Player.GetDamage() += 0.08f; - Player.GetDamage(DamageClass.Melee) += 0.08f; + Player.GetDamage() += 0.08f; Player.GetCritChance() += 8; - Player.GetCritChance(DamageClass.Melee) += 8; + Player.GetCritChance() += 8; } if (holyWrath) @@ -2384,7 +2384,7 @@ namespace CalamityMod.CalPlayer Player.statDefense -= 10; Player.moveSpeed -= 0.1f; Player.GetDamage() += 0.05f; - Player.GetKnockback().Base += 0.5f; + Player.GetKnockback() += 0.5f; } if (rRage) @@ -2403,13 +2403,13 @@ namespace CalamityMod.CalPlayer { Player.statDefense += 30; Player.endurance += 0.1f; - Player.GetDamage(DamageClass.Melee) += 0.2f; + Player.GetDamage() += 0.2f; } if (tFury) { - Player.GetDamage(DamageClass.Melee) += 0.3f; - Player.GetCritChance(DamageClass.Melee) += 10; + Player.GetDamage() += 0.3f; + Player.GetCritChance() += 10; } if (yPower) @@ -2419,7 +2419,7 @@ namespace CalamityMod.CalPlayer Player.pickSpeed -= 0.05f; Player.GetDamage() += 0.06f; Player.GetCritChance() += YharimsStimulants.CritBoost; - Player.GetKnockback().Base += 1f; + Player.GetKnockback() += 1f; Player.moveSpeed += 0.06f; } @@ -2441,7 +2441,7 @@ namespace CalamityMod.CalPlayer { Player.maxMinions += 2; Player.GetDamage() += 0.12f; - Player.GetKnockback().Base += 1.2f; + Player.GetKnockback() += 1.2f; Player.pickSpeed -= 0.15f; if (Main.eclipse || !Main.dayTime) Player.statDefense += 15; @@ -2451,8 +2451,8 @@ namespace CalamityMod.CalPlayer { Player.kbGlove = true; Player.magmaStone = true; - Player.GetDamage(DamageClass.Melee) += 0.15f; - Player.GetCritChance(DamageClass.Melee) += 5; + Player.GetDamage() += 0.15f; + Player.GetCritChance() += 5; Player.lavaMax += 240; } @@ -2543,7 +2543,7 @@ namespace CalamityMod.CalPlayer if (starBeamRye) { - Player.GetDamage(DamageClass.Magic) += 0.08f; + Player.GetDamage() += 0.08f; Player.manaCost *= 0.9f; } @@ -2554,13 +2554,13 @@ namespace CalamityMod.CalPlayer } if (whiteWine) - Player.GetDamage(DamageClass.Magic) += 0.1f; + Player.GetDamage() += 0.1f; // Adjustment to the Tipsy debuff if (Player.tipsy) { Player.statDefense += 4; - Player.GetCritChance(DamageClass.Melee) -= 2; + Player.GetCritChance() -= 2; } if (giantPearl) @@ -2589,7 +2589,7 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += 0.1f; if (CalamityLists.javelinList.Contains(Player.ActiveItem().type) && Player.invis) - Player.GetArmorPenetration(DamageClass.Generic) += 5; + Player.GetArmorPenetration() += 5; if (CalamityLists.flaskBombList.Contains(Player.ActiveItem().type) && Player.invis) rogueVelocity += 0.1f; @@ -2684,7 +2684,7 @@ namespace CalamityMod.CalPlayer Player.statDefense += integerTypeBoost; Player.GetDamage() += damageBoost; Player.GetCritChance() += critBoost; - Player.GetKnockback().Base += floatTypeBoost; + Player.GetKnockback() += floatTypeBoost; Player.moveSpeed += floatTypeBoost * 0.5f; flightTimeMult += floatTypeBoost; } @@ -2821,9 +2821,9 @@ namespace CalamityMod.CalPlayer Player.blind = true; Player.statDefense -= 3; Player.moveSpeed += 0.1f; - Player.GetDamage(DamageClass.Melee) += 0.05f; - Player.GetDamage(DamageClass.Ranged) -= 0.1f; - Player.GetDamage(DamageClass.Magic) -= 0.1f; + Player.GetDamage() += 0.05f; + Player.GetDamage() -= 0.1f; + Player.GetDamage() -= 0.1f; } if (aCrunch && !laudanum) @@ -2887,7 +2887,7 @@ namespace CalamityMod.CalPlayer } if (warbannerOfTheSun) - Player.GetDamage(DamageClass.Melee) += warBannerBonus; + Player.GetDamage() += warBannerBonus; // The player's true max life value with Calamity adjustments actualMaxLife = Player.statLifeMax2; @@ -2899,7 +2899,7 @@ namespace CalamityMod.CalPlayer } if (manaOverloader) - Player.GetDamage(DamageClass.Magic) += 0.06f; + Player.GetDamage() += 0.06f; if (rBrain) { @@ -2910,7 +2910,7 @@ namespace CalamityMod.CalPlayer } if (bloodyWormTooth) - Player.GetDamage(DamageClass.Melee) += 0.07f; + Player.GetDamage() += 0.07f; if (dAmulet) Player.pStone = true; @@ -2954,7 +2954,7 @@ namespace CalamityMod.CalPlayer if (bloodflareSummon) { if (Player.statLife >= (int)(Player.statLifeMax2 * 0.9)) - Player.GetDamage(DamageClass.Summon) += 0.1f; + Player.GetDamage() += 0.1f; else if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) Player.statDefense += 20; @@ -2982,7 +2982,7 @@ namespace CalamityMod.CalPlayer if (yInsignia) { - Player.GetDamage(DamageClass.Melee) += 0.1f; + Player.GetDamage() += 0.1f; Player.lavaMax += 240; if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) Player.GetDamage() += 0.1f; @@ -3229,8 +3229,8 @@ namespace CalamityMod.CalPlayer bool offenseBuffs = (Main.dayTime && !Player.wet) || Player.lavaWet; if (offenseBuffs) { - Player.GetDamage(DamageClass.Summon) += 0.15f; - Player.GetKnockback().Base += 0.15f; + Player.GetDamage() += 0.15f; + Player.GetKnockback() += 0.15f; Player.moveSpeed += 0.1f; Player.statDefense -= 15; Player.ignoreWater = true; @@ -3522,8 +3522,8 @@ namespace CalamityMod.CalPlayer if (badgeOfBravery) { - Player.GetDamage(DamageClass.Melee) += 0.05f; - Player.GetCritChance(DamageClass.Melee) += 5; + Player.GetDamage() += 0.05f; + Player.GetCritChance() += 5; } if (CalamityConfig.Instance.Proficiency) @@ -3637,7 +3637,7 @@ namespace CalamityMod.CalPlayer Player.statDefense += (int)(Player.statDefense * 0.25); break; case BuffID.Weak: - Player.GetDamage(DamageClass.Melee) += 0.151f; + Player.GetDamage() += 0.151f; Player.statDefense += 14; Player.moveSpeed += 0.3f; break; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 2bd3512b0a..3c78be5926 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -25,6 +25,7 @@ using Terraria.ModLoader; using static Terraria.ModLoader.ModContent; using Terraria.Audio; using CalamityMod.EntitySources; +using CalamityMod.Sounds; namespace CalamityMod.CalPlayer { @@ -678,7 +679,7 @@ namespace CalamityMod.CalPlayer { double useTimeMultiplier = 0.85 + (item.useTime * item.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost double wingTimeFraction = Player.wingTimeMax / 20D; - double meleeStatMultiplier = (double)(Player.GetDamage(DamageClass.Melee).Base * (float)(Player.GetCritChance(DamageClass.Melee) / 10D)); + double meleeStatMultiplier = (double)(Player.GetDamage().Additive * (float)(Player.GetCritChance() / 10D)); if (Player.wingTime < Player.wingTimeMax) Player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); @@ -774,7 +775,7 @@ namespace CalamityMod.CalPlayer { double useTimeMultiplier = 0.85 + (heldItem.useTime * heldItem.useAnimation / 3600D); //28 * 28 = 784 is average so that equals 784 / 3600 = 0.217777 + 1 = 21.7% boost double wingTimeFraction = Player.wingTimeMax / 20D; - double meleeStatMultiplier = Player.GetDamage(DamageClass.Melee).Base * (float)(Player.GetCritChance(DamageClass.Melee) / 10D); + double meleeStatMultiplier = Player.GetDamage().Additive * (float)(Player.GetCritChance() / 10D); if (Player.wingTime < Player.wingTimeMax) Player.wingTime += (int)(useTimeMultiplier * (wingTimeFraction + meleeStatMultiplier)); @@ -889,7 +890,7 @@ namespace CalamityMod.CalPlayer if (silvaMage && silvaMageCooldown <= 0 && (proj.penetrate == 1 || proj.timeLeft <= 5)) { silvaMageCooldown = 300; - SoundEngine.PlaySound(SoundID.Zombie, (int)proj.position.X, (int)proj.position.Y, 103); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103) , proj.position); //So scuffed, just because zombie sounds werent ported normally // Silva Mage Blasts: 800 + 60%, softcap on the whole combined thing starts at 1400 int silvaBurstDamage = CalamityUtils.DamageSoftCap(800.0 + 0.6 * proj.damage, 1400); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), silvaBurstDamage, 8f, Player.whoAmI); diff --git a/CalPlayer/Dashes/AsgardianAegisDash.cs b/CalPlayer/Dashes/AsgardianAegisDash.cs index 1c63e4fe07..3bd54c606d 100644 --- a/CalPlayer/Dashes/AsgardianAegisDash.cs +++ b/CalPlayer/Dashes/AsgardianAegisDash.cs @@ -62,7 +62,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext) { float kbFactor = 15f; - bool crit = Main.rand.Next(100) < player.GetCritChance(DamageClass.Melee); + bool crit = Main.rand.Next(100) < player.GetCritChance(); if (player.kbGlove) kbFactor *= 2f; if (player.kbBuff) diff --git a/CalPlayer/Dashes/AsgardsValorDash.cs b/CalPlayer/Dashes/AsgardsValorDash.cs index 0dd1b79f78..602e973030 100644 --- a/CalPlayer/Dashes/AsgardsValorDash.cs +++ b/CalPlayer/Dashes/AsgardsValorDash.cs @@ -50,7 +50,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext) { float kbFactor = 9f; - bool crit = Main.rand.Next(100) < player.GetCritChance(DamageClass.Melee); + bool crit = Main.rand.Next(100) < player.GetCritChance(); if (player.kbGlove) kbFactor *= 2f; if (player.kbBuff) diff --git a/CalPlayer/Dashes/ElysianAegisDash.cs b/CalPlayer/Dashes/ElysianAegisDash.cs index 1062c17714..4f1f1b929a 100644 --- a/CalPlayer/Dashes/ElysianAegisDash.cs +++ b/CalPlayer/Dashes/ElysianAegisDash.cs @@ -53,7 +53,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext) { float kbFactor = 12f; - bool crit = Main.rand.Next(100) < player.GetCritChance(DamageClass.Melee); + bool crit = Main.rand.Next(100) < player.GetCritChance(); if (player.kbGlove) kbFactor *= 2f; if (player.kbBuff) diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index 5732af403a..04b957d5c2 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -9,6 +9,7 @@ using Terraria.DataStructures; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.NPCs.DevourerofGods; namespace CalamityMod.CalPlayer.Dashes { @@ -22,7 +23,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnDashEffects(Player player) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/DevourerAttack"), player.Center); + SoundEngine.PlaySound(DevourerofGodsHead.AttackSound, player.Center); for (int d = 0; d < 60; d++) { @@ -65,7 +66,7 @@ namespace CalamityMod.CalPlayer.Dashes public override void OnHitEffects(Player player, NPC npc, IEntitySource source, ref DashHitContext hitContext) { - SoundEngine.PlaySound(SoundID.Item, (int)player.position.X, (int)player.position.Y, 67); + SoundEngine.PlaySound(SoundID.Item67, player.position); for (int j = 0; j < 30; j++) { @@ -79,7 +80,7 @@ namespace CalamityMod.CalPlayer.Dashes } float kbFactor = 15f; - bool crit = Main.rand.Next(100) < player.GetCritChance(DamageClass.Melee); + bool crit = Main.rand.Next(100) < player.GetCritChance(); if (player.kbGlove) kbFactor *= 2f; if (player.kbBuff) diff --git a/Cooldowns/BloodflareRangedSet.cs b/Cooldowns/BloodflareRangedSet.cs index e74d44c903..956ec87239 100644 --- a/Cooldowns/BloodflareRangedSet.cs +++ b/Cooldowns/BloodflareRangedSet.cs @@ -15,6 +15,6 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => new Color(216, 60, 90); public override Color CooldownEndColor => new Color(251, 106, 150); - public override LegacySoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/BloodflareRangerRecharge"); + public override SoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/BloodflareRangerRecharge"); } } diff --git a/Cooldowns/BrimflameFrenzy.cs b/Cooldowns/BrimflameFrenzy.cs index 1b27cc3991..5e2d181e7a 100644 --- a/Cooldowns/BrimflameFrenzy.cs +++ b/Cooldowns/BrimflameFrenzy.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Cooldowns public override Color CooldownStartColor => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - instance.Completion); public override Color CooldownEndColor => Color.Lerp(new Color(107, 6, 6), new Color(228, 78, 78), 1 - instance.Completion); - public override LegacySoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/BrimflameRecharge"); + public override SoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/BrimflameRecharge"); //Add red eyes to the icon diff --git a/Cooldowns/ChaosState.cs b/Cooldowns/ChaosState.cs index 64f05cb21f..5212677743 100644 --- a/Cooldowns/ChaosState.cs +++ b/Cooldowns/ChaosState.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Cooldowns public override Color OutlineColor => outlineColor; public override Color CooldownStartColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - instance.Completion); public override Color CooldownEndColor => Color.Lerp(cooldownColorStart, cooldownColorEnd, 1 - instance.Completion); - public override LegacySoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/ChaosStateOver"); + public override SoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/ChaosStateOver"); //It's the same cooldown with different skins each time, basically. public string skinTexture; diff --git a/Cooldowns/CooldownHandler.cs b/Cooldowns/CooldownHandler.cs index 2e8a6a0c48..8da7bf0841 100644 --- a/Cooldowns/CooldownHandler.cs +++ b/Cooldowns/CooldownHandler.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Cooldowns /// /// When the cooldown instance ends, this sound is played. Leave at null for no sound. /// - public virtual LegacySoundStyle EndSound => null; + public virtual SoundStyle EndSound => null; #endregion #region Display & Rendering diff --git a/Cooldowns/OmegaBlue.cs b/Cooldowns/OmegaBlue.cs index 3fe2ec865e..2a03ac9a5a 100644 --- a/Cooldowns/OmegaBlue.cs +++ b/Cooldowns/OmegaBlue.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Cooldowns public override Color OutlineColor => instance.timeLeft > 1500 ? new Color(231, 164, 1) : new Color(72, 135, 205); public override Color CooldownStartColor => instance.timeLeft > 1500 ? Color.Lerp(new Color(98, 110, 179), new Color(216, 176, 80), (instance.timeLeft - 1500) / 300f) : new Color(98, 110, 179); public override Color CooldownEndColor => instance.timeLeft > 1500 ? Color.Lerp(new Color(179, 132, 98), new Color(216, 176, 80), (instance.timeLeft - 1500) / 300f) : new Color(179, 132, 98); - public override LegacySoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/OmegaBlueRecharge"); + public override SoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/OmegaBlueRecharge"); public override void OnCompleted() { diff --git a/Cooldowns/PlagueBlackout.cs b/Cooldowns/PlagueBlackout.cs index f7e1201aac..e8cc039bf4 100644 --- a/Cooldowns/PlagueBlackout.cs +++ b/Cooldowns/PlagueBlackout.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Cooldowns public override Color OutlineColor => new Color(174, 237, 122); public override Color CooldownStartColor => Color.DarkSlateGray; public override Color CooldownEndColor => Color.DarkSlateGray; - public override LegacySoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/PlagueReaperRecharge"); + public override SoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/PlagueReaperRecharge"); public override void OnCompleted() { diff --git a/Cooldowns/PotionSickness.cs b/Cooldowns/PotionSickness.cs index 576efc83d6..0cd4d2f2b4 100644 --- a/Cooldowns/PotionSickness.cs +++ b/Cooldowns/PotionSickness.cs @@ -14,6 +14,6 @@ namespace CalamityMod.Cooldowns public override Color OutlineColor => new Color(255, 142, 165); public override Color CooldownStartColor => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), instance.Completion); public override Color CooldownEndColor => Color.Lerp(new Color(208, 234, 255), new Color(231, 3, 54), instance.Completion); - public override LegacySoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/PotionSicknessOver"); + public override SoundStyle EndSound => SoundLoader.GetLegacySoundSlot(GetInstance(), "Sounds/Custom/AbilitySounds/PotionSicknessOver"); } } diff --git a/DamageClasses/AverageDamageClass.cs b/DamageClasses/AverageDamageClass.cs new file mode 100644 index 0000000000..4f8eeb796f --- /dev/null +++ b/DamageClasses/AverageDamageClass.cs @@ -0,0 +1,24 @@ +using Terraria.ModLoader; + +namespace CalamityMod +{ + public class AverageDamageClass : DamageClass + { + internal static AverageDamageClass Instance; + + internal static readonly StatInheritanceData TwentyPercentBoost = new (0.2f, 0.2f, 0.2f, 0.2f, 0.2f); + + public override void Load() => Instance = this; + public override void Unload() => Instance = null; + + public override StatInheritanceData GetModifierInheritance(DamageClass damageClass) + { + if (damageClass == Melee || damageClass == Ranged || damageClass == Magic || damageClass == Summon || damageClass == RogueDamageClass.Instance) + return TwentyPercentBoost; + if (damageClass == Generic) + return StatInheritanceData.Full; + + return StatInheritanceData.None; + } + } +} diff --git a/DataStructures/GemTechArmorState.cs b/DataStructures/GemTechArmorState.cs index c7dd918e83..25ddbe8e00 100644 --- a/DataStructures/GemTechArmorState.cs +++ b/DataStructures/GemTechArmorState.cs @@ -300,27 +300,27 @@ namespace CalamityMod.DataStructures // The melee speed boost code is present in the Player Misc Effects file. if (IsYellowGemActive) { - Owner.GetCritChance(DamageClass.Melee) += (int)(GemTechHeadgear.MeleeCritBoost * 100f); - Owner.GetDamage(DamageClass.Melee) += GemTechHeadgear.MeleeDamageBoost; + Owner.GetCritChance() += (int)(GemTechHeadgear.MeleeCritBoost * 100f); + Owner.GetDamage() += GemTechHeadgear.MeleeDamageBoost; } if (IsGreenGemActive) { - Owner.GetCritChance(DamageClass.Ranged) += (int)(GemTechHeadgear.RangedCritBoost * 100f); - Owner.GetDamage(DamageClass.Ranged) += GemTechHeadgear.RangedDamageBoost; + Owner.GetCritChance() += (int)(GemTechHeadgear.RangedCritBoost * 100f); + Owner.GetDamage() += GemTechHeadgear.RangedDamageBoost; } if (IsBlueGemActive) { Owner.maxMinions += GemTechHeadgear.SummonMinionCountBoost; - Owner.GetDamage(DamageClass.Summon) += GemTechHeadgear.SummonDamageBoost; + Owner.GetDamage() += GemTechHeadgear.SummonDamageBoost; } if (IsPurpleGemActive) { Owner.statManaMax2 += GemTechHeadgear.MagicManaBoost; - Owner.GetCritChance(DamageClass.Magic) += (int)(GemTechHeadgear.MagicCritBoost * 100f); - Owner.GetDamage(DamageClass.Magic) += GemTechHeadgear.MagicDamageBoost; + Owner.GetCritChance() += (int)(GemTechHeadgear.MagicCritBoost * 100f); + Owner.GetDamage() += GemTechHeadgear.MagicDamageBoost; } if (IsPinkGemActive) diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 47da838917..b8c7efb8fc 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -221,7 +221,7 @@ namespace CalamityMod.Events { Player player = Main.player[ClosestPlayerToWorldCenter]; - SoundEngine.PlaySound(SoundID.Roar, player.position, 2); + SoundEngine.PlaySound(SoundID.ScaryScream, player.position); int ravager = NPC.NewNPC(Source, (int)(player.position.X + Main.rand.Next(-100, 101)), (int)(player.position.Y - 400f), type, 1); Main.npc[ravager].timeLeft *= 20; CalamityUtils.BossAwakenMessage(ravager); @@ -246,7 +246,7 @@ namespace CalamityMod.Events { Player player = Main.player[ClosestPlayerToWorldCenter]; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/AstrumDeusSpawn"), player.Center); + SoundEngine.PlaySound(AstrumDeusHeadSpectral.SpawnSound, player.Center); NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, type); }, usesSpecialSound: true, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType() }), @@ -275,7 +275,7 @@ namespace CalamityMod.Events { Player player = Main.player[ClosestPlayerToWorldCenter]; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/ProvidenceSpawn"), player.Center); + SoundEngine.PlaySound(Providence.SpawnSound, player.Center); int prov = NPC.NewNPC(Source, (int)(player.position.X + Main.rand.Next(-500, 501)), (int)(player.position.Y - 250f), type, 1); Main.npc[prov].timeLeft *= 20; CalamityUtils.BossAwakenMessage(prov); @@ -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/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index fe572fb95f..664d274f96 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -107,6 +107,7 @@ namespace CalamityMod.ILEditing // Fix vanilla bugs exposed by Calamity mechanics IL.Terraria.NPC.NPCLoot += FixSplittingWormBannerDrops; + On.Terraria.Item.Prefix += LetRogueItemsBeReforgeable; // IL.Terraria.Main.DoUpdate += FixProjectileUpdatePriorityProblems; } @@ -192,6 +193,7 @@ namespace CalamityMod.ILEditing // Fix vanilla bugs exposed by Calamity mechanics // On.Terraria.Main.InitLifeBytes -= BossRushLifeBytes; IL.Terraria.NPC.NPCLoot -= FixSplittingWormBannerDrops; + On.Terraria.Item.Prefix -= LetRogueItemsBeReforgeable; // IL.Terraria.Main.DoUpdate -= FixProjectileUpdatePriorityProblems; } } 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/ILEditing/VanillaBugfixingILChanges.cs b/ILEditing/VanillaBugfixingILChanges.cs index 0df7fb8666..0cd1d964cd 100644 --- a/ILEditing/VanillaBugfixingILChanges.cs +++ b/ILEditing/VanillaBugfixingILChanges.cs @@ -10,6 +10,7 @@ using Terraria; using Terraria.GameContent; using Terraria.GameInput; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.ILEditing { @@ -134,6 +135,19 @@ namespace CalamityMod.ILEditing } #endregion Fixing Splitting Worm Banner Spam in Deathmode + #region Let Rogue Items Be Reforgeable + private static bool LetRogueItemsBeReforgeable(On.Terraria.Item.orig_Prefix orig, Item self, int pre) + { + if (self.CountsAsClass() && self.maxStack == 1 && pre == -3) + { + PrefixLoader.Roll(self, ref pre, 40, WorldGen.gen ? WorldGen.genRand : Main.rand, PrefixCategory.AnyWeapon); + return true; + } + + return orig(self, pre); + } + #endregion Let Rogue Items Be Reforgeable + #region Fix Projectile Update Priority Problems // This IL edit is commented out because it seems to be causing issues, sometimes creating errors preventing Terraria from updating diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 31789ea4d8..ce93ac6bd5 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -296,7 +296,7 @@ namespace CalamityMod.ILEditing cursor.EmitDelegate>(projectile => { int damage = (int)(Main.player[projectile.owner].ActiveItem().damage * BalancingConstants.FirecrackerExplosionDamageMultiplier); - damage = (int)Main.player[projectile.owner].GetDamage(DamageClass.Summon).ApplyTo(damage); + damage = (int)Main.player[projectile.owner].GetDamage().ApplyTo(damage); return damage; }); cursor.Emit(OpCodes.Stloc, 64); diff --git a/Items/Accessories/AngelicAlliance.cs b/Items/Accessories/AngelicAlliance.cs index d28e126ac2..1bd6ddd2b0 100644 --- a/Items/Accessories/AngelicAlliance.cs +++ b/Items/Accessories/AngelicAlliance.cs @@ -6,12 +6,15 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using System.Linq; +using Terraria.Audio; namespace CalamityMod.Items.Accessories { //Developer item, dedicatee: Nincity public class AngelicAlliance : ModItem { + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/AngelicAllianceActivation"); + public override void SetStaticDefaults() { SacrificeTotal = 1; @@ -53,7 +56,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.angelicAlliance = true; player.GetDamage() += 0.08f; - player.GetDamage(DamageClass.Summon) += 0.07f; //7% + 8% = 15% + player.GetDamage() += 0.07f; //7% + 8% = 15% player.maxMinions += 2; if (player.controlJump) player.lifeRegen += 4; diff --git a/Items/Accessories/ArtemisEmblem.cs b/Items/Accessories/ArtemisEmblem.cs index c9f49bcd02..2c69a9eb9e 100644 --- a/Items/Accessories/ArtemisEmblem.cs +++ b/Items/Accessories/ArtemisEmblem.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Accessories { player.Calamity().artemisEmblem = true; player.Calamity().rangedAmmoCost *= 0.8f; - player.GetDamage(DamageClass.Ranged) += 0.1f; - player.GetCritChance(DamageClass.Ranged) += 5; + player.GetDamage() += 0.1f; + player.GetCritChance() += 5; } public override void AddRecipes() diff --git a/Items/Accessories/ElementalQuiver.cs b/Items/Accessories/ElementalQuiver.cs index 7edbea70ec..80e24d6e95 100644 --- a/Items/Accessories/ElementalQuiver.cs +++ b/Items/Accessories/ElementalQuiver.cs @@ -29,8 +29,8 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.GetDamage(DamageClass.Ranged) += 0.15f; - player.GetCritChance(DamageClass.Ranged) += 5; + player.GetDamage() += 0.15f; + player.GetCritChance() += 5; player.magicQuiver = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.artemisEmblem = true; diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index 6106321dda..5d4f7d3ee2 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -38,9 +38,9 @@ namespace CalamityMod.Items.Accessories player.manaFlower = true; player.statManaMax2 += 150; - player.GetDamage(DamageClass.Magic) += 0.15f; + player.GetDamage() += 0.15f; player.manaCost *= 0.9f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetCritChance() += 5; } public override void AddRecipes() diff --git a/Items/Accessories/JellyChargedBattery.cs b/Items/Accessories/JellyChargedBattery.cs index 3531d4d5ac..3790cdaef0 100644 --- a/Items/Accessories/JellyChargedBattery.cs +++ b/Items/Accessories/JellyChargedBattery.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Accessories { player.Calamity().voltaicJelly = true; player.Calamity().jellyChargedBattery = true; - player.GetDamage(DamageClass.Summon) += 0.07f; + player.GetDamage() += 0.07f; } public override void AddRecipes() diff --git a/Items/Accessories/Nucleogenesis.cs b/Items/Accessories/Nucleogenesis.cs index 48d1774f7f..8784593dc0 100644 --- a/Items/Accessories/Nucleogenesis.cs +++ b/Items/Accessories/Nucleogenesis.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Accessories modPlayer.voltaicJelly = true; //electrified modPlayer.starTaintedGenerator = true; //astral infection and irradiated player.GetKnockback() += 3f; - player.GetDamage(DamageClass.Summon) += 0.15f; + player.GetDamage() += 0.15f; player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Accessories/PsychoticAmulet.cs b/Items/Accessories/PsychoticAmulet.cs index 95b71fadc9..50711a5412 100644 --- a/Items/Accessories/PsychoticAmulet.cs +++ b/Items/Accessories/PsychoticAmulet.cs @@ -31,8 +31,8 @@ namespace CalamityMod.Items.Accessories player.shroomiteStealth = true; player.GetDamage() += 0.05f; player.GetCritChance() += 5; - player.GetDamage(DamageClass.Ranged) += 0.05f; - player.GetCritChance(DamageClass.Ranged) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; } } } diff --git a/Items/Accessories/ShatteredCommunity.cs b/Items/Accessories/ShatteredCommunity.cs index 62190f63d4..2f9fb0e317 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 = SoundID.DD2_EtherianPortalDryadTouch.Volume * 1.4f }; SoundEngine.PlaySound(extraSound, player.Center); // Display a level up text notification. diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index 4e03868065..387ffeb04d 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories { player.manaMagnet = true; player.statManaMax2 += 100; - player.GetDamage(DamageClass.Magic) += 0.15f; + player.GetDamage() += 0.15f; player.manaCost *= 0.9f; } diff --git a/Items/Accessories/StarTaintedGenerator.cs b/Items/Accessories/StarTaintedGenerator.cs index ebb7d34b5b..6bbddb82b1 100644 --- a/Items/Accessories/StarTaintedGenerator.cs +++ b/Items/Accessories/StarTaintedGenerator.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Accessories player.Calamity().voltaicJelly = true; player.Calamity().starbusterCore = true; player.Calamity().starTaintedGenerator = true; - player.GetDamage(DamageClass.Summon) += 0.07f; + player.GetDamage() += 0.07f; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Accessories/StatisBlessing.cs b/Items/Accessories/StatisBlessing.cs index bf56d7319b..d701934642 100644 --- a/Items/Accessories/StatisBlessing.cs +++ b/Items/Accessories/StatisBlessing.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.holyMinions = true; player.GetKnockback() += 2.5f; - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/Accessories/StatisCurse.cs b/Items/Accessories/StatisCurse.cs index 763d822836..310d88355c 100644 --- a/Items/Accessories/StatisCurse.cs +++ b/Items/Accessories/StatisCurse.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Accessories modPlayer.shadowMinions = true; modPlayer.holyMinions = true; player.GetKnockback() += 2.75f; - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Accessories/TheCamper.cs b/Items/Accessories/TheCamper.cs index ab13f80a05..ef8c5798fb 100644 --- a/Items/Accessories/TheCamper.cs +++ b/Items/Accessories/TheCamper.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Items.Accessories } else if (melee) { - player.GetAttackSpeed(DamageClass.Melee) += 0.1f; + player.GetAttackSpeed() += 0.1f; player.AddBuff(BuffID.Sharpened, 60, true); } else if (ranged) diff --git a/Items/Accessories/WulfrumBattery.cs b/Items/Accessories/WulfrumBattery.cs index a983cac726..565a8e90a6 100644 --- a/Items/Accessories/WulfrumBattery.cs +++ b/Items/Accessories/WulfrumBattery.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.GetDamage(DamageClass.Summon) += 0.07f; + player.GetDamage() += 0.07f; } } } diff --git a/Items/Armor/AerospecHat.cs b/Items/Armor/AerospecHat.cs index d7f22d9fea..5dea592566 100644 --- a/Items/Armor/AerospecHat.cs +++ b/Items/Armor/AerospecHat.cs @@ -44,12 +44,12 @@ namespace CalamityMod.Items.Armor modPlayer.aeroSet = true; player.noFallDmg = true; player.moveSpeed += 0.05f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetCritChance() += 5; } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Magic) += 0.08f; + player.GetDamage() += 0.08f; player.statManaMax2 += 20; } diff --git a/Items/Armor/AerospecHelm.cs b/Items/Armor/AerospecHelm.cs index bb3389de88..0bce173889 100644 --- a/Items/Armor/AerospecHelm.cs +++ b/Items/Armor/AerospecHelm.cs @@ -45,13 +45,13 @@ namespace CalamityMod.Items.Armor modPlayer.aeroSet = true; player.noFallDmg = true; player.moveSpeed += 0.05f; - player.GetCritChance(DamageClass.Melee) += 5; + player.GetCritChance() += 5; player.aggro += 300; } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Melee) += 0.08f; + player.GetDamage() += 0.08f; } public override void AddRecipes() diff --git a/Items/Armor/AerospecHelmet.cs b/Items/Armor/AerospecHelmet.cs index f2a4d85221..f91d9dce78 100644 --- a/Items/Armor/AerospecHelmet.cs +++ b/Items/Armor/AerospecHelmet.cs @@ -62,14 +62,14 @@ namespace CalamityMod.Items.Armor Main.projectile[p].originalDamage = 20; } } - player.GetDamage(DamageClass.Summon) += 0.11f; + player.GetDamage() += 0.11f; player.maxMinions++; } public override void UpdateEquip(Player player) { player.moveSpeed += 0.05f; - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Armor/AerospecHood.cs b/Items/Armor/AerospecHood.cs index 06a8e3b126..8ff5df6a16 100644 --- a/Items/Armor/AerospecHood.cs +++ b/Items/Armor/AerospecHood.cs @@ -44,12 +44,12 @@ namespace CalamityMod.Items.Armor modPlayer.aeroSet = true; player.noFallDmg = true; player.moveSpeed += 0.05f; - player.GetCritChance(DamageClass.Ranged) += 5; + player.GetCritChance() += 5; } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.08f; + player.GetDamage() += 0.08f; } public override void AddRecipes() diff --git a/Items/Armor/AtaxiaHeadgear.cs b/Items/Armor/AtaxiaHeadgear.cs index 7f8fbb4087..074f53ba72 100644 --- a/Items/Armor/AtaxiaHeadgear.cs +++ b/Items/Armor/AtaxiaHeadgear.cs @@ -46,14 +46,14 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaBolt = true; - player.GetDamage(DamageClass.Ranged) += 0.05f; + player.GetDamage() += 0.05f; } public override void UpdateEquip(Player player) { player.ammoCost75 = true; - player.GetDamage(DamageClass.Ranged) += 0.12f; - player.GetCritChance(DamageClass.Ranged) += 10; + player.GetDamage() += 0.12f; + player.GetCritChance() += 10; player.lavaMax += 240; player.buffImmune[BuffID.OnFire] = true; } diff --git a/Items/Armor/AtaxiaHelm.cs b/Items/Armor/AtaxiaHelm.cs index 242495ab70..4f170a7003 100644 --- a/Items/Armor/AtaxiaHelm.cs +++ b/Items/Armor/AtaxiaHelm.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaGeyser = true; - player.GetDamage(DamageClass.Melee) += 0.05f; + player.GetDamage() += 0.05f; player.aggro += 700; } @@ -57,9 +57,9 @@ namespace CalamityMod.Items.Armor { CalamityPlayer modPlayer = player.Calamity(); modPlayer.ataxiaFire = true; - player.GetAttackSpeed(DamageClass.Melee) += 0.18f; - player.GetDamage(DamageClass.Melee) += 0.12f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetAttackSpeed() += 0.18f; + player.GetDamage() += 0.12f; + player.GetCritChance() += 10; player.lavaMax += 240; player.buffImmune[BuffID.OnFire] = true; } diff --git a/Items/Armor/AtaxiaHelmet.cs b/Items/Armor/AtaxiaHelmet.cs index d9807a6a6e..5987f852bd 100644 --- a/Items/Armor/AtaxiaHelmet.cs +++ b/Items/Armor/AtaxiaHelmet.cs @@ -63,13 +63,13 @@ namespace CalamityMod.Items.Armor Main.projectile[p].originalDamage = 190; } } - player.GetDamage(DamageClass.Summon) += 0.4f; + player.GetDamage() += 0.4f; player.maxMinions += 2; } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetDamage() += 0.05f; player.GetKnockback() += 1.5f; player.lavaMax += 240; player.buffImmune[BuffID.OnFire] = true; diff --git a/Items/Armor/AtaxiaMask.cs b/Items/Armor/AtaxiaMask.cs index a4d55f4759..2095d45546 100644 --- a/Items/Armor/AtaxiaMask.cs +++ b/Items/Armor/AtaxiaMask.cs @@ -46,15 +46,15 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.ataxiaBlaze = true; modPlayer.ataxiaMage = true; - player.GetDamage(DamageClass.Magic) += 0.05f; + player.GetDamage() += 0.05f; player.manaCost *= 0.85f; } public override void UpdateEquip(Player player) { player.statManaMax2 += 100; - player.GetDamage(DamageClass.Magic) += 0.12f; - player.GetCritChance(DamageClass.Magic) += 10; + player.GetDamage() += 0.12f; + player.GetCritChance() += 10; player.lavaMax += 240; player.buffImmune[BuffID.OnFire] = true; } diff --git a/Items/Armor/AuricTeslaHelm.cs b/Items/Armor/AuricTeslaHelm.cs index 5f99c4870b..eb97251128 100644 --- a/Items/Armor/AuricTeslaHelm.cs +++ b/Items/Armor/AuricTeslaHelm.cs @@ -65,8 +65,8 @@ namespace CalamityMod.Items.Armor { CalamityPlayer modPlayer = player.Calamity(); modPlayer.auricBoost = true; - player.GetDamage(DamageClass.Melee) += 0.2f; - player.GetCritChance(DamageClass.Melee) += 20; + player.GetDamage() += 0.2f; + player.GetCritChance() += 20; } public override void AddRecipes() diff --git a/Items/Armor/AuricTeslaHoodedFacemask.cs b/Items/Armor/AuricTeslaHoodedFacemask.cs index b7d5b759a7..fe93848322 100644 --- a/Items/Armor/AuricTeslaHoodedFacemask.cs +++ b/Items/Armor/AuricTeslaHoodedFacemask.cs @@ -63,8 +63,8 @@ namespace CalamityMod.Items.Armor { CalamityPlayer modPlayer = player.Calamity(); modPlayer.auricBoost = true; - player.GetDamage(DamageClass.Ranged) += 0.3f; - player.GetCritChance(DamageClass.Ranged) += 30; + player.GetDamage() += 0.3f; + player.GetCritChance() += 30; } public override void AddRecipes() diff --git a/Items/Armor/AuricTeslaSpaceHelmet.cs b/Items/Armor/AuricTeslaSpaceHelmet.cs index 5dd264be9d..af1415ef99 100644 --- a/Items/Armor/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/AuricTeslaSpaceHelmet.cs @@ -58,7 +58,7 @@ namespace CalamityMod.Items.Armor player.lavaMax += 240; player.ignoreWater = true; player.crimsonRegen = true; - player.GetDamage(DamageClass.Summon) += 0.75f; + player.GetDamage() += 0.75f; player.maxMinions += 6; if (player.whoAmI == Main.myPlayer) { @@ -81,7 +81,7 @@ namespace CalamityMod.Items.Armor { CalamityPlayer modPlayer = player.Calamity(); modPlayer.auricBoost = true; - player.GetDamage(DamageClass.Summon) += 0.15f; + player.GetDamage() += 0.15f; } public override void AddRecipes() diff --git a/Items/Armor/AuricTeslaWireHemmedVisage.cs b/Items/Armor/AuricTeslaWireHemmedVisage.cs index 1505696969..3aa2eab331 100644 --- a/Items/Armor/AuricTeslaWireHemmedVisage.cs +++ b/Items/Armor/AuricTeslaWireHemmedVisage.cs @@ -61,8 +61,8 @@ namespace CalamityMod.Items.Armor CalamityPlayer modPlayer = player.Calamity(); modPlayer.auricBoost = true; player.manaCost *= 0.8f; - player.GetDamage(DamageClass.Magic) += 0.3f; - player.GetCritChance(DamageClass.Magic) += 20; + player.GetDamage() += 0.3f; + player.GetCritChance() += 20; player.statManaMax2 += 100; } diff --git a/Items/Armor/BloodflareHelmet.cs b/Items/Armor/BloodflareHelmet.cs index 6e52371e02..4ff5154dfb 100644 --- a/Items/Armor/BloodflareHelmet.cs +++ b/Items/Armor/BloodflareHelmet.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Armor "At 90% life and above you gain 10% increased minion damage\n" + "At 50% life and below you gain 20 defense and 2 life regen"; player.crimsonRegen = true; - player.GetDamage(DamageClass.Summon) += 0.5f; + player.GetDamage() += 0.5f; player.maxMinions += 3; } @@ -59,7 +59,7 @@ namespace CalamityMod.Items.Armor { player.lavaMax += 240; player.ignoreWater = true; - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Armor/BloodflareHornedHelm.cs b/Items/Armor/BloodflareHornedHelm.cs index 09d3bf18d3..2c28271fee 100644 --- a/Items/Armor/BloodflareHornedHelm.cs +++ b/Items/Armor/BloodflareHornedHelm.cs @@ -4,12 +4,15 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using System.Linq; +using Terraria.Audio; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class BloodflareHornedHelm : ModItem { + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/BloodflareRangerActivation"); + public override void SetStaticDefaults() { SacrificeTotal = 1; @@ -57,8 +60,8 @@ namespace CalamityMod.Items.Armor { player.lavaMax += 240; player.ignoreWater = true; - player.GetDamage(DamageClass.Ranged) += 0.1f; - player.GetCritChance(DamageClass.Ranged) += 10; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; } public override void AddRecipes() diff --git a/Items/Armor/BloodflareHornedMask.cs b/Items/Armor/BloodflareHornedMask.cs index 76fe9f2b8b..ef30343796 100644 --- a/Items/Armor/BloodflareHornedMask.cs +++ b/Items/Armor/BloodflareHornedMask.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Items.Armor player.manaCost *= 0.83f; player.lavaMax += 240; player.ignoreWater = true; - player.GetDamage(DamageClass.Magic) += 0.2f; - player.GetCritChance(DamageClass.Magic) += 10; + player.GetDamage() += 0.2f; + player.GetCritChance() += 10; player.statManaMax2 += 100; } diff --git a/Items/Armor/BloodflareMask.cs b/Items/Armor/BloodflareMask.cs index 199a0f7111..d675ba567c 100644 --- a/Items/Armor/BloodflareMask.cs +++ b/Items/Armor/BloodflareMask.cs @@ -58,8 +58,8 @@ namespace CalamityMod.Items.Armor { player.lavaMax += 240; player.ignoreWater = true; - player.GetDamage(DamageClass.Melee) += 0.1f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; } public override void AddRecipes() diff --git a/Items/Armor/BrimflameBoots.cs b/Items/Armor/BrimflameBoots.cs index 153a4f222e..b17a242a76 100644 --- a/Items/Armor/BrimflameBoots.cs +++ b/Items/Armor/BrimflameBoots.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.moveSpeed += 0.05f; - player.GetDamage(DamageClass.Magic) += 0.05f; + player.GetDamage() += 0.05f; player.fireWalk = true; } diff --git a/Items/Armor/BrimflameRobes.cs b/Items/Armor/BrimflameRobes.cs index 19d3b058f6..737488d4f6 100644 --- a/Items/Armor/BrimflameRobes.cs +++ b/Items/Armor/BrimflameRobes.cs @@ -27,8 +27,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Magic) += 0.05f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; player.lavaRose = true; } diff --git a/Items/Armor/BrimflameScowl.cs b/Items/Armor/BrimflameScowl.cs index 7e52a4a0d2..9b6b31a91d 100644 --- a/Items/Armor/BrimflameScowl.cs +++ b/Items/Armor/BrimflameScowl.cs @@ -12,6 +12,8 @@ namespace CalamityMod.Items.Armor [AutoloadEquip(EquipType.Head)] public class BrimflameScowl : ModItem { + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/AngelicAllianceActivation"); + private bool frenzy = false; public static int CooldownLength = 1800; @@ -53,8 +55,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Magic) += 0.05f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; player.statManaMax2 += 70; player.manaCost *= 0.9f; player.buffImmune[ModContent.BuffType()] = true; @@ -77,8 +79,8 @@ namespace CalamityMod.Items.Armor { CalamityPlayer modPlayer = player.Calamity(); modPlayer.brimflameSet = true; - player.GetDamage(DamageClass.Magic) += 0.15f; - player.GetCritChance(DamageClass.Magic) += 15; + player.GetDamage() += 0.15f; + player.GetCritChance() += 15; string hotkey = CalamityKeybinds.SetBonusHotKey.TooltipHotkeyString(); player.setBonus = "Grants an additional 15% increased magic damage and crit\n" + "Press " + hotkey + " to trigger a brimflame frenzy effect\n" + diff --git a/Items/Armor/CirrusDress.cs b/Items/Armor/CirrusDress.cs index da5a0d253b..2dad0edb28 100644 --- a/Items/Armor/CirrusDress.cs +++ b/Items/Armor/CirrusDress.cs @@ -48,8 +48,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.Calamity().cirrusDress = true; - player.GetDamage(DamageClass.Magic) += 0.05f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; } public override void SetMatch(bool male, ref int equipSlot, ref bool robes) diff --git a/Items/Armor/DaedalusHat.cs b/Items/Armor/DaedalusHat.cs index 8876177092..d78d2ccdd4 100644 --- a/Items/Armor/DaedalusHat.cs +++ b/Items/Armor/DaedalusHat.cs @@ -44,14 +44,14 @@ namespace CalamityMod.Items.Armor "If you absorb an attack you are healed for 1/2 of that attack's damage"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.daedalusAbsorb = true; - player.GetDamage(DamageClass.Magic) += 0.05f; + player.GetDamage() += 0.05f; } public override void UpdateEquip(Player player) { player.manaCost *= 0.9f; - player.GetDamage(DamageClass.Magic) += 0.13f; - player.GetCritChance(DamageClass.Magic) += 7; + player.GetDamage() += 0.13f; + player.GetCritChance() += 7; player.statManaMax2 += 60; } diff --git a/Items/Armor/DaedalusHeadgear.cs b/Items/Armor/DaedalusHeadgear.cs index 1deb2f8edf..80d7a62216 100644 --- a/Items/Armor/DaedalusHeadgear.cs +++ b/Items/Armor/DaedalusHeadgear.cs @@ -59,13 +59,13 @@ namespace CalamityMod.Items.Armor p.originalDamage = 95; } } - player.GetDamage(DamageClass.Summon) += 0.2f; + player.GetDamage() += 0.2f; player.maxMinions += 2; } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Armor/DaedalusHelm.cs b/Items/Armor/DaedalusHelm.cs index 3738cc0387..c85b51fa15 100644 --- a/Items/Armor/DaedalusHelm.cs +++ b/Items/Armor/DaedalusHelm.cs @@ -46,15 +46,15 @@ namespace CalamityMod.Items.Armor "This reflect has a 90 second cooldown which is shared with all other dodges and reflects"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.daedalusReflect = true; - player.GetDamage(DamageClass.Melee) += 0.05f; + player.GetDamage() += 0.05f; player.aggro += 500; } public override void UpdateEquip(Player player) { - player.GetAttackSpeed(DamageClass.Melee) += 0.15f; - player.GetDamage(DamageClass.Melee) += 0.1f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetAttackSpeed() += 0.15f; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; } public override void AddRecipes() diff --git a/Items/Armor/DaedalusHelmet.cs b/Items/Armor/DaedalusHelmet.cs index 9dca5302de..39c7af4a53 100644 --- a/Items/Armor/DaedalusHelmet.cs +++ b/Items/Armor/DaedalusHelmet.cs @@ -43,14 +43,14 @@ namespace CalamityMod.Items.Armor "Getting hit causes you to emit a blast of crystal shards"; CalamityPlayer modPlayer = player.Calamity(); modPlayer.daedalusShard = true; - player.GetDamage(DamageClass.Ranged) += 0.05f; + player.GetDamage() += 0.05f; } public override void UpdateEquip(Player player) { player.ammoCost80 = true; - player.GetDamage(DamageClass.Ranged) += 0.13f; - player.GetCritChance(DamageClass.Ranged) += 7; + player.GetDamage() += 0.13f; + player.GetCritChance() += 7; } public override void AddRecipes() diff --git a/Items/Armor/DemonshadeBreastplate.cs b/Items/Armor/DemonshadeBreastplate.cs index 7b87fd94c1..74795b8483 100644 --- a/Items/Armor/DemonshadeBreastplate.cs +++ b/Items/Armor/DemonshadeBreastplate.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor player.statManaMax2 += 200; player.GetDamage() += 0.15f; player.GetCritChance() += 15; - player.GetAttackSpeed(DamageClass.Melee) += 0.2f; + player.GetAttackSpeed() += 0.2f; } public override void AddRecipes() diff --git a/Items/Armor/DemonshadeHelm.cs b/Items/Armor/DemonshadeHelm.cs index 09fb4f9629..07f97ee51c 100644 --- a/Items/Armor/DemonshadeHelm.cs +++ b/Items/Armor/DemonshadeHelm.cs @@ -8,12 +8,15 @@ using Terraria; using Terraria.ModLoader; using System.Linq; using Terraria.DataStructures; +using Terraria.Audio; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class DemonshadeHelm : ModItem, IExtendedHat { + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DemonshadeEnrage"); + public override void SetStaticDefaults() { SacrificeTotal = 1; @@ -71,7 +74,7 @@ namespace CalamityMod.Items.Armor devil.originalDamage = baseDamage; } } - player.GetDamage(DamageClass.Summon) += 1f; + player.GetDamage() += 1f; player.maxMinions += 10; } diff --git a/Items/Armor/DesertProwlerHat.cs b/Items/Armor/DesertProwlerHat.cs index b8a9c0732a..2c7d6a233a 100644 --- a/Items/Armor/DesertProwlerHat.cs +++ b/Items/Armor/DesertProwlerHat.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetCritChance(DamageClass.Ranged) += 4; + player.GetCritChance() += 4; player.ammoCost80 = true; } diff --git a/Items/Armor/DesertProwlerShirt.cs b/Items/Armor/DesertProwlerShirt.cs index f43ba0bb3a..782dfa63a8 100644 --- a/Items/Armor/DesertProwlerShirt.cs +++ b/Items/Armor/DesertProwlerShirt.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetCritChance(DamageClass.Ranged) += 5; + player.GetCritChance() += 5; } public override void AddRecipes() diff --git a/Items/Armor/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmerBoots.cs index 88efcd31df..23dabecdf1 100644 --- a/Items/Armor/FathomSwarmerBoots.cs +++ b/Items/Armor/FathomSwarmerBoots.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.04f; + player.GetDamage() += 0.04f; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { player.moveSpeed += 0.4f; diff --git a/Items/Armor/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmerBreastplate.cs index ffa6c881c5..75ebe8142b 100644 --- a/Items/Armor/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmerBreastplate.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.06f; + player.GetDamage() += 0.06f; player.endurance += 0.06f; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { diff --git a/Items/Armor/FathomSwarmerVisage.cs b/Items/Armor/FathomSwarmerVisage.cs index a9013feb70..e03cb23018 100644 --- a/Items/Armor/FathomSwarmerVisage.cs +++ b/Items/Armor/FathomSwarmerVisage.cs @@ -42,17 +42,17 @@ namespace CalamityMod.Items.Armor modPlayer.fathomSwarmer = true; player.spikedBoots = 2; player.maxMinions += 2; - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { - player.GetDamage(DamageClass.Summon) += 0.3f; + player.GetDamage() += 0.3f; } } public override void UpdateEquip(Player player) { CalamityPlayer modPlayer = player.Calamity(); - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetDamage() += 0.05f; if (player.breath <= player.breathMax + 2 && !modPlayer.ZoneAbyss) { player.breath = player.breathMax + 3; diff --git a/Items/Armor/FearmongerGreathelm.cs b/Items/Armor/FearmongerGreathelm.cs index eaf75454de..f219be41f2 100644 --- a/Items/Armor/FearmongerGreathelm.cs +++ b/Items/Armor/FearmongerGreathelm.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.statManaMax2 += 60; - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; player.manaCost *= 0.9f; } @@ -61,7 +61,7 @@ namespace CalamityMod.Items.Armor // All-class armors count as rogue sets, but don't grant stealth bonuses player.Calamity().wearingRogueArmor = true; player.Calamity().WearingPostMLSummonerSet = true; - player.GetDamage(DamageClass.Summon) += 0.2f; + player.GetDamage() += 0.2f; player.maxMinions += 2; int[] immuneDebuffs = { diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index 17e0762ac4..4bee9957a6 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; player.Calamity().rogueVelocity += 0.15f; } diff --git a/Items/Armor/GodSlayerHelm.cs b/Items/Armor/GodSlayerHelm.cs index 33975be8fc..c6ccd54a6f 100644 --- a/Items/Armor/GodSlayerHelm.cs +++ b/Items/Armor/GodSlayerHelm.cs @@ -63,8 +63,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Melee) += 0.14f; - player.GetCritChance(DamageClass.Melee) += 14; + player.GetDamage() += 0.14f; + player.GetCritChance() += 14; } public override void AddRecipes() diff --git a/Items/Armor/GodSlayerHelmet.cs b/Items/Armor/GodSlayerHelmet.cs index a31532039b..5cd1604f60 100644 --- a/Items/Armor/GodSlayerHelmet.cs +++ b/Items/Armor/GodSlayerHelmet.cs @@ -58,8 +58,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.14f; - player.GetCritChance(DamageClass.Ranged) += 14; + player.GetDamage() += 0.14f; + player.GetCritChance() += 14; } public override void AddRecipes() diff --git a/Items/Armor/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlueHelmet.cs index 05f6d94388..7a58f88e28 100644 --- a/Items/Armor/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlueHelmet.cs @@ -7,12 +7,16 @@ using Terraria.ModLoader; using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using System.Linq; +using Terraria.Audio; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class OmegaBlueHelmet : ModItem { + + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/OmegaBlueAbility); + public override void Load() { if (Main.netMode != NetmodeID.Server) diff --git a/Items/Armor/PlagueReaperMask.cs b/Items/Armor/PlagueReaperMask.cs index f8c6e199bc..3886c03bd3 100644 --- a/Items/Armor/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaperMask.cs @@ -6,12 +6,15 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using System.Linq; +using Terraria.Audio; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class PlagueReaperMask : ModItem { + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/PlagueReaperAbility"); + public override void SetStaticDefaults() { SacrificeTotal = 1; @@ -57,8 +60,8 @@ namespace CalamityMod.Items.Armor player.blind = true; player.headcovered = true; player.blackout = true; - player.GetDamage(DamageClass.Ranged) += 0.6f; //60% ranged dmg and 20% crit - player.GetCritChance(DamageClass.Ranged) += 20; + player.GetDamage() += 0.6f; //60% ranged dmg and 20% crit + player.GetCritChance() += 20; } if (player.whoAmI == Main.myPlayer) @@ -79,8 +82,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.1f; - player.GetCritChance(DamageClass.Ranged) += 8; + player.GetDamage() += 0.1f; + player.GetCritChance() += 8; } public override void AddRecipes() diff --git a/Items/Armor/PlagueReaperStriders.cs b/Items/Armor/PlagueReaperStriders.cs index c36e06d243..c35db41e15 100644 --- a/Items/Armor/PlagueReaperStriders.cs +++ b/Items/Armor/PlagueReaperStriders.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetCritChance(DamageClass.Ranged) += 3; + player.GetCritChance() += 3; player.moveSpeed += 0.15f; } diff --git a/Items/Armor/PlagueReaperVest.cs b/Items/Armor/PlagueReaperVest.cs index 293bb0b055..e5811c4ba2 100644 --- a/Items/Armor/PlagueReaperVest.cs +++ b/Items/Armor/PlagueReaperVest.cs @@ -28,8 +28,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.15f; - player.GetCritChance(DamageClass.Ranged) += 5; + player.GetDamage() += 0.15f; + player.GetCritChance() += 5; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Armor/PlaguebringerCarapace.cs b/Items/Armor/PlaguebringerCarapace.cs index 46a7d78521..2c4cda8e4e 100644 --- a/Items/Armor/PlaguebringerCarapace.cs +++ b/Items/Armor/PlaguebringerCarapace.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.Calamity().plaguebringerCarapace = true; - player.GetDamage(DamageClass.Summon) += 0.12f; + player.GetDamage() += 0.12f; player.buffImmune[ModContent.BuffType()] = true; } diff --git a/Items/Armor/PlaguebringerPistons.cs b/Items/Armor/PlaguebringerPistons.cs index 1dde8b1fbf..b796cb58da 100644 --- a/Items/Armor/PlaguebringerPistons.cs +++ b/Items/Armor/PlaguebringerPistons.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.13f; + player.GetDamage() += 0.13f; player.moveSpeed += 0.15f; player.Calamity().plaguebringerPistons = true; diff --git a/Items/Armor/PlaguebringerVisor.cs b/Items/Armor/PlaguebringerVisor.cs index d9bb174e49..49cd0ee726 100644 --- a/Items/Armor/PlaguebringerVisor.cs +++ b/Items/Armor/PlaguebringerVisor.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.15f; + player.GetDamage() += 0.15f; player.statLifeMax2 += 20; } diff --git a/Items/Armor/PrismaticGreaves.cs b/Items/Armor/PrismaticGreaves.cs index a4cd83a5d4..007850b8aa 100644 --- a/Items/Armor/PrismaticGreaves.cs +++ b/Items/Armor/PrismaticGreaves.cs @@ -32,11 +32,11 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.Calamity().prismaticGreaves = true; - player.GetDamage(DamageClass.Magic) += 0.1f; - player.GetCritChance(DamageClass.Magic) += 12; + player.GetDamage() += 0.1f; + player.GetCritChance() += 12; player.jumpSpeedBoost += 0.1f; player.GetDamage() -= 0.2f; - player.GetDamage(DamageClass.Magic) += 0.2f; + player.GetDamage() += 0.2f; } public override void AddRecipes() diff --git a/Items/Armor/PrismaticHelmet.cs b/Items/Armor/PrismaticHelmet.cs index 95403d8794..8650ccdb43 100644 --- a/Items/Armor/PrismaticHelmet.cs +++ b/Items/Armor/PrismaticHelmet.cs @@ -59,9 +59,9 @@ namespace CalamityMod.Items.Armor { player.Calamity().prismaticHelmet = true; player.GetDamage() -= 0.2f; - player.GetDamage(DamageClass.Magic) += 0.2f; - player.GetDamage(DamageClass.Magic) += 0.18f; - player.GetCritChance(DamageClass.Magic) += 12; + player.GetDamage() += 0.2f; + player.GetDamage() += 0.18f; + player.GetCritChance() += 12; } public override void AddRecipes() diff --git a/Items/Armor/PrismaticRegalia.cs b/Items/Armor/PrismaticRegalia.cs index 5c5f979eb2..2ec2a30514 100644 --- a/Items/Armor/PrismaticRegalia.cs +++ b/Items/Armor/PrismaticRegalia.cs @@ -35,10 +35,10 @@ namespace CalamityMod.Items.Armor player.Calamity().prismaticRegalia = true; player.statLifeMax2 += 20; player.statManaMax2 += 40; - player.GetDamage(DamageClass.Magic) += 0.12f; - player.GetCritChance(DamageClass.Magic) += 15; + player.GetDamage() += 0.12f; + player.GetCritChance() += 15; player.GetDamage() -= 0.2f; - player.GetDamage(DamageClass.Magic) += 0.2f; + player.GetDamage() += 0.2f; } public override void AddRecipes() diff --git a/Items/Armor/SilvaHelmet.cs b/Items/Armor/SilvaHelmet.cs index 99eaee727e..374d7ae451 100644 --- a/Items/Armor/SilvaHelmet.cs +++ b/Items/Armor/SilvaHelmet.cs @@ -7,12 +7,16 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class SilvaHelmet : ModItem { + public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/AbilitySounds/SilvaActivation"); + public static readonly SoundStyle DispelSound = new("CalamityMod/Sounds/Custom/AbilitySounds/SilvaDispel"); + public override void SetStaticDefaults() { SacrificeTotal = 1; @@ -67,11 +71,11 @@ namespace CalamityMod.Items.Armor Main.projectile[p].originalDamage = 600; } } - player.GetDamage(DamageClass.Summon) += 0.65f; + player.GetDamage() += 0.65f; player.maxMinions += 5; } - public override void UpdateEquip(Player player) => player.GetDamage(DamageClass.Summon) += 0.1f; + public override void UpdateEquip(Player player) => player.GetDamage() += 0.1f; public override void AddRecipes() { diff --git a/Items/Armor/SilvaMaskedCap.cs b/Items/Armor/SilvaMaskedCap.cs index acaba9e475..6265ddefe5 100644 --- a/Items/Armor/SilvaMaskedCap.cs +++ b/Items/Armor/SilvaMaskedCap.cs @@ -54,8 +54,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.manaCost *= 0.81f; - player.GetDamage(DamageClass.Magic) += 0.23f; - player.GetCritChance(DamageClass.Magic) += 13; + player.GetDamage() += 0.23f; + player.GetCritChance() += 13; player.statManaMax2 += 100; } diff --git a/Items/Armor/StatigelCap.cs b/Items/Armor/StatigelCap.cs index 9b63f7e700..60dd2071d0 100644 --- a/Items/Armor/StatigelCap.cs +++ b/Items/Armor/StatigelCap.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Magic) += 0.1f; - player.GetCritChance(DamageClass.Magic) += 7; + player.GetDamage() += 0.1f; + player.GetCritChance() += 7; player.manaCost *= 0.9f; player.statManaMax2 += 30; } diff --git a/Items/Armor/StatigelHeadgear.cs b/Items/Armor/StatigelHeadgear.cs index 87855cf655..65ebd32a1f 100644 --- a/Items/Armor/StatigelHeadgear.cs +++ b/Items/Armor/StatigelHeadgear.cs @@ -46,8 +46,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.1f; - player.GetCritChance(DamageClass.Ranged) += 7; + player.GetDamage() += 0.1f; + player.GetCritChance() += 7; } public override void AddRecipes() diff --git a/Items/Armor/StatigelHelm.cs b/Items/Armor/StatigelHelm.cs index c7dc2d1769..1a74b16e37 100644 --- a/Items/Armor/StatigelHelm.cs +++ b/Items/Armor/StatigelHelm.cs @@ -48,9 +48,9 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Melee) += 0.1f; - player.GetCritChance(DamageClass.Melee) += 7; - player.GetAttackSpeed(DamageClass.Melee) += 0.1f; + player.GetDamage() += 0.1f; + player.GetCritChance() += 7; + player.GetAttackSpeed() += 0.1f; } public override void AddRecipes() diff --git a/Items/Armor/StatigelHood.cs b/Items/Armor/StatigelHood.cs index be2461d09a..b3f1c9b365 100644 --- a/Items/Armor/StatigelHood.cs +++ b/Items/Armor/StatigelHood.cs @@ -3,6 +3,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using CalamityMod.Tiles.Furniture.CraftingStations; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -46,7 +47,7 @@ namespace CalamityMod.Items.Armor modPlayer.statigelJump = true; Player.jumpHeight += 5; player.jumpSpeedBoost += 0.6f; - player.GetDamage(DamageClass.Summon) += 0.18f; + player.GetDamage() += 0.18f; player.maxMinions++; if (player.whoAmI == Main.myPlayer) { @@ -55,14 +56,17 @@ namespace CalamityMod.Items.Armor { player.AddBuff(ModContent.BuffType(), 3600, true); } + + int minionID = -1; + int baseDamage = 33; + int minionDamage = (int)player.GetDamage().CombineWith(player.GetDamage()).ApplyTo(baseDamage); if (WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(33f * (player.GetDamage().Base + player.GetDamage(DamageClass.Summon).Base - 1f)), 0f, Main.myPlayer, 0f, 0f); - } + minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); else if (!WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) - { - Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(33f * (player.GetDamage().Base + player.GetDamage(DamageClass.Summon).Base - 1f)), 0f, Main.myPlayer, 0f, 0f); - } + minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); + + if (Main.projectile.IndexInRange(minionID)) + Main.projectile[minionID].originalDamage = baseDamage; } } diff --git a/Items/Armor/TarragonHelm.cs b/Items/Armor/TarragonHelm.cs index 5621515159..0272baccef 100644 --- a/Items/Armor/TarragonHelm.cs +++ b/Items/Armor/TarragonHelm.cs @@ -58,8 +58,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Melee) += 0.1f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; player.endurance += 0.05f; player.lavaMax += 240; player.ignoreWater = true; diff --git a/Items/Armor/TarragonHornedHelm.cs b/Items/Armor/TarragonHornedHelm.cs index a518924470..c3d15749d4 100644 --- a/Items/Armor/TarragonHornedHelm.cs +++ b/Items/Armor/TarragonHornedHelm.cs @@ -49,14 +49,14 @@ namespace CalamityMod.Items.Armor "Increased heart pickup range\n" + "Enemies have a chance to drop extra hearts on death\n" + "Summons a life aura around you that damages nearby enemies"; - player.GetDamage(DamageClass.Summon) += 0.5f; + player.GetDamage() += 0.5f; player.maxMinions += 3; } public override void UpdateEquip(Player player) { player.endurance += 0.05f; - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetDamage() += 0.05f; player.lavaMax += 240; player.ignoreWater = true; } diff --git a/Items/Armor/TarragonMask.cs b/Items/Armor/TarragonMask.cs index da543739de..865a83d2f2 100644 --- a/Items/Armor/TarragonMask.cs +++ b/Items/Armor/TarragonMask.cs @@ -55,8 +55,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { player.manaCost *= 0.85f; - player.GetDamage(DamageClass.Magic) += 0.2f; - player.GetCritChance(DamageClass.Magic) += 10; + player.GetDamage() += 0.2f; + player.GetCritChance() += 10; player.endurance += 0.05f; player.lavaMax += 240; player.statManaMax2 += 100; diff --git a/Items/Armor/TarragonVisage.cs b/Items/Armor/TarragonVisage.cs index 90b9213bd0..b634bbe1f5 100644 --- a/Items/Armor/TarragonVisage.cs +++ b/Items/Armor/TarragonVisage.cs @@ -52,8 +52,8 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.1f; - player.GetCritChance(DamageClass.Ranged) += 10; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; player.endurance += 0.05f; player.lavaMax += 240; player.ignoreWater = true; diff --git a/Items/Armor/VictideHelm.cs b/Items/Armor/VictideHelm.cs index 1f015784f2..2c0e6f4c9a 100644 --- a/Items/Armor/VictideHelm.cs +++ b/Items/Armor/VictideHelm.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor player.ignoreWater = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { - player.GetDamage(DamageClass.Melee) += 0.1f; + player.GetDamage() += 0.1f; player.lifeRegen += 3; } player.aggro += 200; @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Melee) += 0.05f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Armor/VictideHelmet.cs b/Items/Armor/VictideHelmet.cs index e2ef348a25..024a4ef912 100644 --- a/Items/Armor/VictideHelmet.cs +++ b/Items/Armor/VictideHelmet.cs @@ -2,6 +2,7 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -53,22 +54,24 @@ namespace CalamityMod.Items.Armor var source = player.GetSource_ItemUse(Item); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), (int)(7f * (player.GetDamage().Base + player.GetDamage(DamageClass.Summon).Base - 1f)), 0f, Main.myPlayer, 0f, 0f); + int baseDamage = 7; + int minionDamage = (int)player.GetDamage().CombineWith(player.GetDamage()).ApplyTo(baseDamage); + int p = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) - Main.projectile[p].originalDamage = 7; + Main.projectile[p].originalDamage = baseDamage; } } player.ignoreWater = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; player.lifeRegen += 3; } } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/Armor/VictideMask.cs b/Items/Armor/VictideMask.cs index 8107a56f1e..ae3074a3e1 100644 --- a/Items/Armor/VictideMask.cs +++ b/Items/Armor/VictideMask.cs @@ -41,14 +41,14 @@ namespace CalamityMod.Items.Armor player.ignoreWater = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { - player.GetDamage(DamageClass.Magic) += 0.1f; + player.GetDamage() += 0.1f; player.lifeRegen += 3; } } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Magic) += 0.05f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Armor/VictideVisage.cs b/Items/Armor/VictideVisage.cs index dad74333d7..3ed1dbe514 100644 --- a/Items/Armor/VictideVisage.cs +++ b/Items/Armor/VictideVisage.cs @@ -41,14 +41,14 @@ namespace CalamityMod.Items.Armor player.ignoreWater = true; if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) { - player.GetDamage(DamageClass.Ranged) += 0.1f; + player.GetDamage() += 0.1f; player.lifeRegen += 3; } } public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.05f; + player.GetDamage() += 0.05f; } public override void AddRecipes() diff --git a/Items/Armor/WulfrumHeadgear.cs b/Items/Armor/WulfrumHeadgear.cs index 9dcd2b3595..d91b3a9a56 100644 --- a/Items/Armor/WulfrumHeadgear.cs +++ b/Items/Armor/WulfrumHeadgear.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Ranged) += 0.1f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/Armor/WulfrumHelm.cs b/Items/Armor/WulfrumHelm.cs index 9322d660d8..9b2c211409 100644 --- a/Items/Armor/WulfrumHelm.cs +++ b/Items/Armor/WulfrumHelm.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Melee) += 0.1f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/Armor/WulfrumHelmet.cs b/Items/Armor/WulfrumHelmet.cs index 1f579251e9..c03bff87e8 100644 --- a/Items/Armor/WulfrumHelmet.cs +++ b/Items/Armor/WulfrumHelmet.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Summon) += 0.1f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/Armor/WulfrumHood.cs b/Items/Armor/WulfrumHood.cs index 9d1a36053d..3529b148b9 100644 --- a/Items/Armor/WulfrumHood.cs +++ b/Items/Armor/WulfrumHood.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor public override void UpdateEquip(Player player) { - player.GetDamage(DamageClass.Magic) += 0.1f; + player.GetDamage() += 0.1f; } public override void AddRecipes() diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index e3df77e7c9..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) @@ -990,62 +990,62 @@ namespace CalamityMod.Items if (set == "CrystalAssassin") { - player.GetDamage(DamageClass.Generic) -= 0.1f; - player.GetCritChance(DamageClass.Generic) -= 10; + player.GetDamage() -= 0.1f; + player.GetCritChance() -= 10; player.setBonus = "Allows the ability to dash"; } else if (set == "SquireTier2") { player.lifeRegen += 3; - player.GetDamage(DamageClass.Summon) += 0.15f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetDamage() += 0.15f; + player.GetCritChance() += 10; player.setBonus += "\nIncreases your life regeneration\n" + "15% increased minion damage and 10% increased melee critical strike chance"; } else if (set == "HuntressTier2") { - player.GetDamage(DamageClass.Summon) += 0.1f; - player.GetDamage(DamageClass.Ranged) += 0.1f; + player.GetDamage() += 0.1f; + player.GetDamage() += 0.1f; player.setBonus += "\n10% increased minion and ranged damage"; } else if (set == "ApprenticeTier2") { - player.GetDamage(DamageClass.Summon) += 0.05f; - player.GetCritChance(DamageClass.Magic) += 15; + player.GetDamage() += 0.05f; + player.GetCritChance() += 15; player.setBonus += "\n5% increased minion damage and 15% increased magic critical strike chance"; } else if (set == "MonkTier3") { - player.GetDamage(DamageClass.Summon) += 0.3f; - player.GetAttackSpeed(DamageClass.Melee) += 0.1f; - player.GetDamage(DamageClass.Melee) += 0.1f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetDamage() += 0.3f; + player.GetAttackSpeed() += 0.1f; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; player.setBonus += "\n10% increased melee damage, melee critical strike chance and melee speed\n" + "30% increased minion damage"; } else if (set == "SquireTier3") { player.lifeRegen += 6; - player.GetDamage(DamageClass.Summon) += 0.1f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; player.setBonus += "\nMassively increased life regeneration\n" + "10% increased minion damage and melee critical strike chance"; } else if (set == "HuntressTier3") { - player.GetDamage(DamageClass.Summon) += 0.1f; - player.GetDamage(DamageClass.Ranged) += 0.1f; + player.GetDamage() += 0.1f; + player.GetDamage() += 0.1f; player.setBonus += "\n10% increased minion and ranged damage"; } else if (set == "ApprenticeTier3") { - player.GetDamage(DamageClass.Summon) += 0.1f; - player.GetCritChance(DamageClass.Magic) += 15; + player.GetDamage() += 0.1f; + player.GetCritChance() += 15; player.setBonus += "\n10% increased minion damage and 15% increased magic critical strike chance"; } else if (set == "SpectreHealing") { - player.GetDamage(DamageClass.Magic) += 0.2f; + player.GetDamage() += 0.2f; player.setBonus = "Reduces Magic damage by 20% and converts it to healing force\n" + "Magic damage done to enemies heals the player with lowest health"; } @@ -1063,61 +1063,61 @@ namespace CalamityMod.Items switch (item.type) { case ItemID.MagicHat: - player.GetDamage(DamageClass.Magic) -= 0.01f; - player.GetCritChance(DamageClass.Magic) -= 1; + player.GetDamage() -= 0.01f; + player.GetCritChance() -= 1; break; case ItemID.SquireGreatHelm: player.lifeRegen -= 3; break; case ItemID.SquirePlating: - player.GetDamage(DamageClass.Summon) -= 0.05f; - player.GetDamage(DamageClass.Melee) -= 0.05f; + player.GetDamage() -= 0.05f; + player.GetDamage() -= 0.05f; break; case ItemID.SquireGreaves: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetCritChance(DamageClass.Melee) -= 10; + player.GetDamage() -= 0.1f; + player.GetCritChance() -= 10; break; case ItemID.HuntressJerkin: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetDamage(DamageClass.Ranged) -= 0.1f; + player.GetDamage() -= 0.1f; + player.GetDamage() -= 0.1f; break; case ItemID.ApprenticeTrousers: - player.GetDamage(DamageClass.Summon) -= 0.05f; - player.GetCritChance(DamageClass.Magic) -= 15; + player.GetDamage() -= 0.05f; + player.GetCritChance() -= 15; break; case ItemID.SquireAltShirt: player.lifeRegen -= 6; break; case ItemID.SquireAltPants: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetCritChance(DamageClass.Melee) -= 10; + player.GetDamage() -= 0.1f; + player.GetCritChance() -= 10; break; case ItemID.MonkAltHead: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetDamage(DamageClass.Melee) -= 0.1f; + player.GetDamage() -= 0.1f; + player.GetDamage() -= 0.1f; break; case ItemID.MonkAltShirt: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetAttackSpeed(DamageClass.Melee) -= 0.1f; + player.GetDamage() -= 0.1f; + player.GetAttackSpeed() -= 0.1f; break; case ItemID.MonkAltPants: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetCritChance(DamageClass.Melee) -= 10; + player.GetDamage() -= 0.1f; + player.GetCritChance() -= 10; break; case ItemID.HuntressAltShirt: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetDamage(DamageClass.Ranged) -= 0.1f; + player.GetDamage() -= 0.1f; + player.GetDamage() -= 0.1f; break; case ItemID.ApprenticeAltPants: - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetCritChance(DamageClass.Magic) -= 15; + player.GetDamage() -= 0.1f; + player.GetCritChance() -= 15; break; } } @@ -1173,8 +1173,8 @@ namespace CalamityMod.Items if (item.type == ItemID.SniperScope) { - player.GetDamage(DamageClass.Ranged) -= 0.03f; - player.GetCritChance(DamageClass.Ranged) -= 0.03f; + player.GetDamage() -= 0.03f; + player.GetCritChance() -= 0.03f; } if (item.type == ItemID.MagicQuiver) @@ -1185,8 +1185,8 @@ namespace CalamityMod.Items if (item.type == ItemID.FireGauntlet) { - player.GetDamage(DamageClass.Melee) += 0.02f; - player.GetAttackSpeed(DamageClass.Melee) += 0.02f; + player.GetDamage() += 0.02f; + player.GetAttackSpeed() += 0.02f; } if (item.type == ItemID.AngelWings) // Boost to max life, defense, and life regen @@ -1221,9 +1221,9 @@ namespace CalamityMod.Items else if (item.type == ItemID.ButterflyWings) // Boost to magic stats { player.statManaMax2 += 20; - player.GetDamage(DamageClass.Magic) += 0.05f; + player.GetDamage() += 0.05f; player.manaCost *= 0.95f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetCritChance() += 5; player.noFallDmg = true; } else if (item.type == ItemID.FairyWings) // Boost to max life @@ -1253,8 +1253,8 @@ namespace CalamityMod.Items player.body == ArmorIDs.Body.NecroBreastplate && player.legs == ArmorIDs.Legs.NecroGreaves) { player.moveSpeed += 0.1f; - player.GetDamage(DamageClass.Ranged) += 0.1f; - player.GetCritChance(DamageClass.Ranged) += 10; + player.GetDamage() += 0.1f; + player.GetCritChance() += 10; player.statDefense += 30; } } @@ -1269,16 +1269,16 @@ namespace CalamityMod.Items player.noFallDmg = true; if (player.head == ArmorIDs.Head.FrostHelmet && player.body == ArmorIDs.Body.FrostBreastplate && player.legs == ArmorIDs.Legs.FrostLeggings) { - player.GetDamage(DamageClass.Melee) += 0.02f; - player.GetDamage(DamageClass.Ranged) += 0.02f; - player.GetCritChance(DamageClass.Melee) += 1; - player.GetCritChance(DamageClass.Ranged) += 1; + player.GetDamage() += 0.02f; + player.GetDamage() += 0.02f; + player.GetCritChance() += 1; + player.GetCritChance() += 1; } } else if (item.type == ItemID.FlameWings) // Bonus to melee stats { - player.GetDamage(DamageClass.Melee) += 0.05f; - player.GetCritChance(DamageClass.Melee) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; player.noFallDmg = true; } else if (item.type == ItemID.GhostWings) // Bonus to mage stats while wearing spectre armor @@ -1293,8 +1293,8 @@ namespace CalamityMod.Items } else if (player.head == ArmorIDs.Head.SpectreMask) { - player.GetDamage(DamageClass.Magic) += 0.05f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; } } } @@ -1310,8 +1310,8 @@ namespace CalamityMod.Items } else if (player.body == ArmorIDs.Body.BeetleScaleMail) { - player.GetDamage(DamageClass.Melee) += 0.05f; - player.GetCritChance(DamageClass.Melee) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; } } } @@ -1373,8 +1373,8 @@ namespace CalamityMod.Items player.noFallDmg = true; if (player.head == ArmorIDs.Head.SpookyHelmet && player.body == ArmorIDs.Body.SpookyBreastplate && player.legs == ArmorIDs.Legs.SpookyLeggings) { - player.GetKnockback(DamageClass.Summon).Base += 2f; - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetKnockback(DamageClass.Summon) += 2f; + player.GetDamage() += 0.05f; } } else if (item.type == ItemID.TatteredFairyWings) @@ -1396,8 +1396,8 @@ namespace CalamityMod.Items player.noFallDmg = true; if (player.head == ArmorIDs.Head.SolarFlareHelmet && player.body == ArmorIDs.Body.SolarFlareBreastplate && player.legs == ArmorIDs.Legs.SolarFlareLeggings) { - player.GetDamage(DamageClass.Melee) += 0.07f; - player.GetCritChance(DamageClass.Melee) += 3; + player.GetDamage() += 0.07f; + player.GetCritChance() += 3; } } else if (item.type == ItemID.WingsVortex) // Bonus to ranged stats while wearing vortex armor @@ -1405,8 +1405,8 @@ namespace CalamityMod.Items player.noFallDmg = true; if (player.head == ArmorIDs.Head.VortexHelmet && player.body == ArmorIDs.Body.VortexBreastplate && player.legs == ArmorIDs.Legs.VortexLeggings) { - player.GetDamage(DamageClass.Ranged) += 0.03f; - player.GetCritChance(DamageClass.Ranged) += 7; + player.GetDamage() += 0.03f; + player.GetCritChance() += 7; } } else if (item.type == ItemID.WingsNebula) // Bonus to magic stats while wearing nebula armor @@ -1414,8 +1414,8 @@ namespace CalamityMod.Items player.noFallDmg = true; if (player.head == ArmorIDs.Head.NebulaHelmet && player.body == ArmorIDs.Body.NebulaBreastplate && player.legs == ArmorIDs.Legs.NebulaLeggings) { - player.GetDamage(DamageClass.Magic) += 0.05f; - player.GetCritChance(DamageClass.Magic) += 5; + player.GetDamage() += 0.05f; + player.GetCritChance() += 5; player.statManaMax2 += 20; player.manaCost *= 0.95f; } @@ -1426,7 +1426,7 @@ namespace CalamityMod.Items if (player.head == ArmorIDs.Head.StardustHelmet && player.body == ArmorIDs.Body.StardustPlate && player.legs == ArmorIDs.Legs.StardustLeggings) { player.maxMinions++; - player.GetDamage(DamageClass.Summon) += 0.05f; + player.GetDamage() += 0.05f; } } else if (item.type == ItemID.FishronWings || item.type == ItemID.BetsyWings || item.type == ItemID.Yoraiz0rWings || diff --git a/Items/Fishing/AstralCatches/PolarisParrotfish.cs b/Items/Fishing/AstralCatches/PolarisParrotfish.cs index e11e8a6c6f..af3b25dc8d 100644 --- a/Items/Fishing/AstralCatches/PolarisParrotfish.cs +++ b/Items/Fishing/AstralCatches/PolarisParrotfish.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Fishing.AstralCatches { @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Fishing.AstralCatches Item.knockBack = 2.25f; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); //pew pew + Item.UseSound = CommonCalamitySounds.LaserCannonSound; //pew pew Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; diff --git a/Items/Mounts/AlicornMount.cs b/Items/Mounts/AlicornMount.cs index 6fdd8914b0..9ee286545f 100644 --- a/Items/Mounts/AlicornMount.cs +++ b/Items/Mounts/AlicornMount.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Items.Mounts { CalamityPlayer modPlayer = player.Calamity(); if (modPlayer.fabsolVodka) - player.GetDamage(DamageClass.Generic) += 0.1f; + player.GetDamage() += 0.1f; if (player.velocity.Length() > 9f) { diff --git a/Items/Pets/BearEye.cs b/Items/Pets/BearEye.cs index bc54f3f554..6373fa66e4 100644 --- a/Items/Pets/BearEye.cs +++ b/Items/Pets/BearEye.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Pets { @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Pets Item.shoot = ModContent.ProjectileType(); Item.buffType = ModContent.BuffType(); - Item.UseSound = new Terraria.Audio.LegacySoundStyle(SoundID.Meowmere, 5); + Item.UseSound = SoundID.Meowmere; } public override void UseStyle(Player player, Rectangle heldItemFrame) diff --git a/Items/Pets/CosmicPlushie.cs b/Items/Pets/CosmicPlushie.cs index 0acd9a1ff6..53dbfadc73 100644 --- a/Items/Pets/CosmicPlushie.cs +++ b/Items/Pets/CosmicPlushie.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Pets Item.height = 36; Item.shoot = ModContent.ProjectileType(); Item.buffType = ModContent.BuffType(); - Item.UseSound = new Terraria.Audio.LegacySoundStyle(SoundID.Meowmere, 5); + Item.UseSound = SoundID.Meowmere; Item.value = Item.sellPrice(gold: 7); Item.Calamity().customRarity = CalamityRarity.DarkBlue; 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/Tools/CrystylCrusher.cs b/Items/Tools/CrystylCrusher.cs index 098beaec9e..6ce4270a39 100644 --- a/Items/Tools/CrystylCrusher.cs +++ b/Items/Tools/CrystylCrusher.cs @@ -15,6 +15,8 @@ namespace CalamityMod.Items.Tools private static int PickPower = 1000; private static float LaserSpeed = 14f; + public static readonly SoundStyle ChargeSound = new("CalamityMod/Sounds/Item/CrystylCharge"); + public override void SetStaticDefaults() { SacrificeTotal = 1; @@ -40,7 +42,7 @@ namespace CalamityMod.Items.Tools Item.height = 70; Item.useStyle = ItemUseStyleID.Shoot; Item.shootSpeed = LaserSpeed; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/CrystylCharge"); + Item.UseSound = ChargeSound; Item.shoot = ModContent.ProjectileType(); Item.value = CalamityGlobalItem.Rarity16BuyPrice; diff --git a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs index 15ce0a0651..ed6f00a5d0 100644 --- a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs @@ -42,13 +42,13 @@ namespace CalamityMod.Items.VanillaArmorChanges switch (player.armor[0].type) { case ItemID.AdamantiteHeadgear: - player.GetCritChance(DamageClass.Magic) += critBoost; + player.GetCritChance() += critBoost; break; case ItemID.AdamantiteHelmet: - player.GetCritChance(DamageClass.Melee) += critBoost; + player.GetCritChance() += critBoost; break; case ItemID.AdamantiteMask: - player.GetCritChance(DamageClass.Ranged) += critBoost; + player.GetCritChance() += critBoost; break; } player.Calamity().AdamantiteSet = true; diff --git a/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs b/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs index 1535d39b84..329159e5a5 100644 --- a/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MonkT2ArmorSetChange.cs @@ -22,27 +22,27 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyHeadPieceEffect(Player player) { - player.GetAttackSpeed(DamageClass.Melee) -= 0.1f; + player.GetAttackSpeed() -= 0.1f; } public override void ApplyBodyPieceEffect(Player player) { - player.GetDamage(DamageClass.Summon) -= 0.1f; - player.GetDamage(DamageClass.Melee) -= 0.1f; + player.GetDamage() -= 0.1f; + player.GetDamage() -= 0.1f; } public override void ApplyLegPieceEffect(Player player) { - player.GetDamage(DamageClass.Summon) -= 0.05f; - player.GetCritChance(DamageClass.Melee) -= 10; + player.GetDamage() -= 0.05f; + player.GetCritChance() -= 10; } public override void ApplyArmorSetBonus(Player player) { - player.GetDamage(DamageClass.Summon) += 0.15f; - player.GetDamage(DamageClass.Melee) += 0.1f; - player.GetAttackSpeed(DamageClass.Melee) += 0.1f; - player.GetCritChance(DamageClass.Melee) += 10; + player.GetDamage() += 0.15f; + player.GetDamage() += 0.1f; + player.GetAttackSpeed() += 0.1f; + player.GetCritChance() += 10; } } } diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs index 4e90a233e6..e25f713df6 100644 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class GatlingLaser : ModItem { + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/GatlingLaserFireStart"); + // This is the amount of charge consumed every time the holdout projectile fires a laser. public const float HoldoutChargeUse = 0.0075f; @@ -39,7 +41,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.mana = 6; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/GatlingLaserFireStart"); + Item.UseSound = UseSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity8BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs index 57cd028d29..d79a110618 100644 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ b/Items/Weapons/DraedonsArsenal/GaussPistol.cs @@ -6,6 +6,7 @@ using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.DraedonsArsenal { @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/GaussWeaponFire"); + Item.UseSound = CommonCalamitySounds.GaussWeaponFire; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity5BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/GaussRifle.cs b/Items/Weapons/DraedonsArsenal/GaussRifle.cs index 831f53dff0..a70bc20af7 100644 --- a/Items/Weapons/DraedonsArsenal/GaussRifle.cs +++ b/Items/Weapons/DraedonsArsenal/GaussRifle.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.DraedonsArsenal { @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/GaussWeaponFire"); + Item.UseSound = CommonCalamitySounds.GaussWeaponFire; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity8BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/LaserRifle.cs b/Items/Weapons/DraedonsArsenal/LaserRifle.cs index e0605daa92..9ed99fa41a 100644 --- a/Items/Weapons/DraedonsArsenal/LaserRifle.cs +++ b/Items/Weapons/DraedonsArsenal/LaserRifle.cs @@ -8,11 +8,14 @@ using Terraria.ID; using Terraria.DataStructures; using Terraria.ModLoader; using System; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class LaserRifle : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/LaserRifleFire"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Heavy Laser Rifle"); @@ -33,7 +36,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserRifleFire"); + Item.UseSound = FireSound; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/MatterModulator.cs b/Items/Weapons/DraedonsArsenal/MatterModulator.cs index 896a8f5e2e..7023cf13c7 100644 --- a/Items/Weapons/DraedonsArsenal/MatterModulator.cs +++ b/Items/Weapons/DraedonsArsenal/MatterModulator.cs @@ -8,6 +8,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.DraedonsArsenal { @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"); + Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity5BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs index e55c217e48..da3f70909f 100644 --- a/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs +++ b/Items/Weapons/DraedonsArsenal/PlasmaCaster.cs @@ -8,12 +8,15 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.DraedonsArsenal { // still awkward that the item called Plasma Rifle is the same class and exact same tier as this item public class PlasmaCaster : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/PlasmaCasterFire"); + public const int BaseDamage = 705; public override void SetStaticDefaults() { @@ -37,7 +40,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.mana = 24; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaCasterFire"); + Item.UseSound = FireSound; Item.noMelee = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index df08f7aeb0..1969c6e9fc 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.mana = 6; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PulseRifleFire"); + Item.UseSound = PulseRifle.FireSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity3BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/PulseRifle.cs b/Items/Weapons/DraedonsArsenal/PulseRifle.cs index e76744b114..63139314c2 100644 --- a/Items/Weapons/DraedonsArsenal/PulseRifle.cs +++ b/Items/Weapons/DraedonsArsenal/PulseRifle.cs @@ -9,11 +9,14 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.DraedonsArsenal { public class PulseRifle : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/PulseRifleFire"); + private int BaseDamage = 1420; public override void SetStaticDefaults() @@ -37,7 +40,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PulseRifleFire"); + Item.UseSound = FireSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity14BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/Taser.cs b/Items/Weapons/DraedonsArsenal/Taser.cs index 761fe5bd44..f391bf4690 100644 --- a/Items/Weapons/DraedonsArsenal/Taser.cs +++ b/Items/Weapons/DraedonsArsenal/Taser.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.DraedonsArsenal { @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"); + Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity3BuyPrice; diff --git a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs index 7545327790..244027c889 100644 --- a/Items/Weapons/DraedonsArsenal/TeslaCannon.cs +++ b/Items/Weapons/DraedonsArsenal/TeslaCannon.cs @@ -9,6 +9,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.DraedonsArsenal { @@ -16,6 +17,8 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal { private int BaseDamage = 1050; + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/TeslaCannonFire"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Tesla Cannon"); @@ -38,7 +41,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.mana = 30; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/TeslaCannonFire"); + Item.UseSound = FireSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity14BuyPrice; diff --git a/Items/Weapons/Magic/EidolicWail.cs b/Items/Weapons/Magic/EidolicWail.cs index 2ce7e0613e..ed36c5c747 100644 --- a/Items/Weapons/Magic/EidolicWail.cs +++ b/Items/Weapons/Magic/EidolicWail.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Magic { @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.knockBack = 1f; Item.value = Item.buyPrice(1, 40, 0, 0); Item.rare = ItemRarityID.Purple; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/WyrmScream"); + Item.UseSound = CommonCalamitySounds.WyrmScreamSound; Item.autoReuse = true; Item.shootSpeed = 8f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Magic/IceBarrage.cs b/Items/Weapons/Magic/IceBarrage.cs index 3c2d51cd7a..c4302d89f5 100644 --- a/Items/Weapons/Magic/IceBarrage.cs +++ b/Items/Weapons/Magic/IceBarrage.cs @@ -12,6 +12,8 @@ namespace CalamityMod.Items.Weapons.Magic { public class IceBarrage : ModItem { + public static readonly SoundStyle CastSound = new("CalamityMod/Sounds/Item/IceBarrageCast"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Ice Barrage"); @@ -30,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.DamageType = DamageClass.Magic; Item.mana = 180; Item.noMelee = true; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/IceBarrageCast"); + Item.UseSound = CastSound; Item.value = CalamityGlobalItem.Rarity14BuyPrice; Item.Calamity().customRarity = CalamityRarity.DarkBlue; diff --git a/Items/Weapons/Magic/PlasmaRifle.cs b/Items/Weapons/Magic/PlasmaRifle.cs index 31b95e2eeb..a94f9a4f25 100644 --- a/Items/Weapons/Magic/PlasmaRifle.cs +++ b/Items/Weapons/Magic/PlasmaRifle.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Magic { @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.value = CalamityGlobalItem.Rarity12BuyPrice; Item.rare = ItemRarityID.Purple; Item.Calamity().customRarity = CalamityRarity.Turquoise; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBlast"); + Item.UseSound = CommonCalamitySounds.PlasmaBlastSound; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); @@ -46,11 +47,11 @@ namespace CalamityMod.Items.Weapons.Magic { if (player.altFunctionUse == 2) { - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"); + Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; } else { - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBlast"); + Item.UseSound = CommonCalamitySounds.PlasmaBlastSound; } return base.CanUseItem(player); } diff --git a/Items/Weapons/Magic/PurgeGuzzler.cs b/Items/Weapons/Magic/PurgeGuzzler.cs index 02cababdcb..c13c079c9c 100644 --- a/Items/Weapons/Magic/PurgeGuzzler.cs +++ b/Items/Weapons/Magic/PurgeGuzzler.cs @@ -5,6 +5,8 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; + namespace CalamityMod.Items.Weapons.Magic { public class PurgeGuzzler : ModItem @@ -31,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4.5f; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); + Item.UseSound = CommonCalamitySounds.LaserCannonSound; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index 973e0affc8..6f06f91f3d 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Magic { @@ -46,7 +47,7 @@ namespace CalamityMod.Items.Weapons.Magic { if (player.altFunctionUse == 2) { - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); + Item.UseSound = CommonCalamitySounds.LaserCannonSound; } else { diff --git a/Items/Weapons/Magic/SeethingDischarge.cs b/Items/Weapons/Magic/SeethingDischarge.cs index 29da1d396c..568d15afe9 100644 --- a/Items/Weapons/Magic/SeethingDischarge.cs +++ b/Items/Weapons/Magic/SeethingDischarge.cs @@ -5,6 +5,8 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; + namespace CalamityMod.Items.Weapons.Magic { public class SeethingDischarge : ModItem @@ -28,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 6.75f; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/FlareSound"); + Item.UseSound = CommonCalamitySounds.FlareSound; Item.value = Item.buyPrice(0, 36, 0, 0); Item.rare = ItemRarityID.Pink; Item.autoReuse = true; diff --git a/Items/Weapons/Magic/Thunderstorm.cs b/Items/Weapons/Magic/Thunderstorm.cs index 5423b05489..f65ed320b9 100644 --- a/Items/Weapons/Magic/Thunderstorm.cs +++ b/Items/Weapons/Magic/Thunderstorm.cs @@ -3,6 +3,8 @@ using Microsoft.Xna.Framework; using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; + namespace CalamityMod.Items.Weapons.Magic { public class Thunderstorm : ModItem @@ -29,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.value = CalamityGlobalItem.Rarity12BuyPrice; Item.rare = ItemRarityID.Purple; Item.Calamity().customRarity = CalamityRarity.Turquoise; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBlast"); + Item.UseSound = CommonCalamitySounds.PlasmaBlastSound; Item.autoReuse = true; Item.shootSpeed = 6f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Melee/Aftershock.cs b/Items/Weapons/Melee/Aftershock.cs index 515992591f..08affd9ea8 100644 --- a/Items/Weapons/Melee/Aftershock.cs +++ b/Items/Weapons/Melee/Aftershock.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float speedX4 = num78; float speedY5 = num79 + (float)Main.rand.Next(-10, 11) * 0.02f; - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, player.whoAmI, 0f, (float)Main.rand.Next(10)); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, player.whoAmI, 0f, (float)Main.rand.Next(10)); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) @@ -126,7 +126,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float speedX4 = num78; float speedY5 = num79 + (float)Main.rand.Next(-10, 11) * 0.02f; - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/AncientShiv.cs b/Items/Weapons/Melee/AncientShiv.cs index a563fdc456..7f50363382 100644 --- a/Items/Weapons/Melee/AncientShiv.cs +++ b/Items/Weapons/Melee/AncientShiv.cs @@ -43,13 +43,13 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/AquaticDischarge.cs b/Items/Weapons/Melee/AquaticDischarge.cs index 3c4d4ad6bd..bbbc397239 100644 --- a/Items/Weapons/Melee/AquaticDischarge.cs +++ b/Items/Weapons/Melee/AquaticDischarge.cs @@ -43,13 +43,13 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/AstralBlade.cs b/Items/Weapons/Melee/AstralBlade.cs index 57ac7bb660..94a0332114 100644 --- a/Items/Weapons/Melee/AstralBlade.cs +++ b/Items/Weapons/Melee/AstralBlade.cs @@ -72,11 +72,11 @@ namespace CalamityMod.Items.Weapons.Melee knockback *= multiplier; if (!crit) - crit = Main.rand.NextBool((int)MathHelper.Clamp((Item.crit + player.GetCritChance(DamageClass.Melee)) * multiplier, 0f, 99f), 100); + crit = Main.rand.NextBool((int)MathHelper.Clamp((Item.crit + player.GetCritChance()) * multiplier, 0f, 99f), 100); 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/Melee/Avalanche.cs b/Items/Weapons/Melee/Avalanche.cs index 6ea339edc4..430f47ef5d 100644 --- a/Items/Weapons/Melee/Avalanche.cs +++ b/Items/Weapons/Melee/Avalanche.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Items.Weapons.Melee for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(source, target.Center, vector255, type, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, vector255, type, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, Main.myPlayer); } } @@ -67,7 +67,7 @@ namespace CalamityMod.Items.Weapons.Melee for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(source, target.Center, vector255, type, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), 0f, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, vector255, type, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), 0f, Main.myPlayer); } } diff --git a/Items/Weapons/Melee/BloodyRupture.cs b/Items/Weapons/Melee/BloodyRupture.cs index 3ac48f6f18..4584c2f90a 100644 --- a/Items/Weapons/Melee/BloodyRupture.cs +++ b/Items/Weapons/Melee/BloodyRupture.cs @@ -44,13 +44,13 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, Main.myPlayer); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/Carnage.cs b/Items/Weapons/Melee/Carnage.cs index 54beb53414..642ab9287c 100644 --- a/Items/Weapons/Melee/Carnage.cs +++ b/Items/Weapons/Melee/Carnage.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Melee for (int i = 0; i < bloodAmt; i++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - Projectile.NewProjectile(source, targetPos, velocity, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), kBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, targetPos, velocity, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), kBack, player.whoAmI, 0f, 0f); } } } diff --git a/Items/Weapons/Melee/DragonPow.cs b/Items/Weapons/Melee/DragonPow.cs index de06f96b61..e4aa8ab736 100644 --- a/Items/Weapons/Melee/DragonPow.cs +++ b/Items/Weapons/Melee/DragonPow.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Melee; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.NPCs.Yharon; namespace CalamityMod.Items.Weapons.Melee { @@ -38,7 +39,7 @@ Summons a barrage of petals and waterfalls on enemy hits"); Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"); + Item.UseSound = Yharon.ShortRoarSound; Item.channel = true; Item.value = CalamityGlobalItem.Rarity15BuyPrice; diff --git a/Items/Weapons/Melee/Earth.cs b/Items/Weapons/Melee/Earth.cs index 7c3d3497f3..235947a32f 100644 --- a/Items/Weapons/Melee/Earth.cs +++ b/Items/Weapons/Melee/Earth.cs @@ -90,7 +90,7 @@ namespace CalamityMod.Items.Weapons.Melee float speedX4 = num78; float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - int projDamage = (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)); + int projDamage = (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)); Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), projDamage, knockback, player.whoAmI, 0f, (float)Main.rand.Next(10)); } @@ -150,7 +150,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float speedX4 = num78; float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10)); } if (player.moonLeech) diff --git a/Items/Weapons/Melee/ForbiddenOathblade.cs b/Items/Weapons/Melee/ForbiddenOathblade.cs index ca8974a299..70c90b6838 100644 --- a/Items/Weapons/Melee/ForbiddenOathblade.cs +++ b/Items/Weapons/Melee/ForbiddenOathblade.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(BuffID.ShadowFlame, 360); target.AddBuff(BuffID.OnFire, 720); - player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)) * 2, 0f, 0, false); + player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)) * 2, 0f, 0, false); float num50 = 1.7f; float num51 = 0.8f; float num52 = 2f; diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index bd57b42f00..fd71e9e75c 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float speedX4 = num78; float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), num74, i, 0f, (float)Main.rand.Next(10)); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), num74, i, 0f, (float)Main.rand.Next(10)); } } @@ -137,7 +137,7 @@ namespace CalamityMod.Items.Weapons.Melee num79 *= num80; float speedX4 = num78; float speedY5 = num79 + (float)Main.rand.Next(-180, 181) * 0.02f; - Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), num74, i, 0f, (float)Main.rand.Next(10)); + Projectile.NewProjectile(source, vector2.X, vector2.Y, speedX4, speedY5, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), num74, i, 0f, (float)Main.rand.Next(10)); } } diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index ae35f7e61d..9090f0c35e 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.OnFire, 300); - player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), 0f, 0, false); + player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), 0f, 0, false); float num50 = 1.7f; float num51 = 0.8f; float num52 = 2f; diff --git a/Items/Weapons/Melee/HolyCollider.cs b/Items/Weapons/Melee/HolyCollider.cs index 4140a5c8a1..a2c5a7e39b 100644 --- a/Items/Weapons/Melee/HolyCollider.cs +++ b/Items/Weapons/Melee/HolyCollider.cs @@ -50,8 +50,8 @@ namespace CalamityMod.Items.Weapons.Melee for (i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f) * 0.3), knockback, Main.myPlayer); - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f) * 0.3), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f) * 0.3), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f) * 0.3), knockback, Main.myPlayer); } } @@ -67,8 +67,8 @@ namespace CalamityMod.Items.Weapons.Melee for (i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f) * 0.3), Item.knockBack, Main.myPlayer); - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f) * 0.3), Item.knockBack, Main.myPlayer); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f) * 0.3), Item.knockBack, Main.myPlayer); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f) * 0.3), Item.knockBack, Main.myPlayer); } } } diff --git a/Items/Weapons/Melee/LeechingDagger.cs b/Items/Weapons/Melee/LeechingDagger.cs index 235c7e9325..f4b84e6e6f 100644 --- a/Items/Weapons/Melee/LeechingDagger.cs +++ b/Items/Weapons/Melee/LeechingDagger.cs @@ -44,13 +44,13 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * 0.5f * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, Main.myPlayer); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/Mariana.cs b/Items/Weapons/Melee/Mariana.cs index 61bb1caee7..755cf555ca 100644 --- a/Items/Weapons/Melee/Mariana.cs +++ b/Items/Weapons/Melee/Mariana.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Melee } value15.Normalize(); value15 *= Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, player.whoAmI, 0f, 0f); } for (int num621 = 0; num621 < 30; num621++) { @@ -85,7 +85,7 @@ namespace CalamityMod.Items.Weapons.Melee } value15.Normalize(); value15 *= Main.rand.Next(70, 101) * 0.1f; - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, value15.X, value15.Y, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, player.whoAmI, 0f, 0f); } for (int num621 = 0; num621 < 30; num621++) { diff --git a/Items/Weapons/Melee/NightsStabber.cs b/Items/Weapons/Melee/NightsStabber.cs index baf316f948..55739a17a9 100644 --- a/Items/Weapons/Melee/NightsStabber.cs +++ b/Items/Weapons/Melee/NightsStabber.cs @@ -44,13 +44,13 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, Main.myPlayer); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) { var source = player.GetSource_ItemUse(Item); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, Main.myPlayer); + Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, Main.myPlayer); } public override void AddRecipes() diff --git a/Items/Weapons/Melee/PrismaticBreaker.cs b/Items/Weapons/Melee/PrismaticBreaker.cs index 019b4c3fa7..6830295eae 100644 --- a/Items/Weapons/Melee/PrismaticBreaker.cs +++ b/Items/Weapons/Melee/PrismaticBreaker.cs @@ -9,6 +9,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Tools; namespace CalamityMod.Items.Weapons.Melee { @@ -67,8 +68,7 @@ namespace CalamityMod.Items.Weapons.Melee //all damage boosts should still apply public override void ModifyWeaponDamage(Player player, ref StatModifier damage) { - float damageMult = (player.GetDamage(DamageClass.Melee).Additive + player.GetDamage(DamageClass.Ranged).Additive - 2f) / 2f; - damage += damageMult - player.GetDamage(DamageClass.Melee).Base + 1f; + damage = player.GetDamage().CombineWith(player.GetDamage()) * 0.5f; } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) @@ -104,7 +104,7 @@ namespace CalamityMod.Items.Weapons.Melee } else { - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/CrystylCharge"); + Item.UseSound = CrystylCrusher.ChargeSound; Item.useStyle = ItemUseStyleID.Shoot; Item.useTurn = false; Item.autoReuse = false; diff --git a/Items/Weapons/Melee/SoulEdge.cs b/Items/Weapons/Melee/SoulEdge.cs index cef7c2228a..920d8231c9 100644 --- a/Items/Weapons/Melee/SoulEdge.cs +++ b/Items/Weapons/Melee/SoulEdge.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Melee { public class SoulEdge : ModItem { - static internal LegacySoundStyle ProjectileDeathSound = null; + static internal SoundStyle? ProjectileDeathSound = null; public override void SetStaticDefaults() { diff --git a/Items/Weapons/Melee/SoulHarvester.cs b/Items/Weapons/Melee/SoulHarvester.cs index 48d7899f00..20d6825792 100644 --- a/Items/Weapons/Melee/SoulHarvester.cs +++ b/Items/Weapons/Melee/SoulHarvester.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Items.Weapons.Melee if (target.life <= (target.lifeMax * 0.15f)) { SoundEngine.PlaySound(SoundID.Item14, target.position); - player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), 0f, 0, false); + player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), 0f, 0, false); for (int num621 = 0; num621 < 10; num621++) { int num622 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, 89, 0f, 0f, 100, default, 2f); diff --git a/Items/Weapons/Melee/Terracotta.cs b/Items/Weapons/Melee/Terracotta.cs index d1c2fed46f..8c5b013b43 100644 --- a/Items/Weapons/Melee/Terracotta.cs +++ b/Items/Weapons/Melee/Terracotta.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(source, target.Center.X, target.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), 0, 0f, player.whoAmI, player.whoAmI); Projectile.NewProjectile(source, target.Center.X, target.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), 0, 0f, player.whoAmI, player.whoAmI); } - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), knockback, player.whoAmI); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), knockback, player.whoAmI); } public override void OnHitPvp(Player player, Player target, int damage, bool crit) @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(source, target.Center.X, target.Center.Y, randomSpeedX, -randomSpeedY, ModContent.ProjectileType(), 0, 0f, player.whoAmI, player.whoAmI); Projectile.NewProjectile(source, target.Center.X, target.Center.Y, 0f, -randomSpeedY, ModContent.ProjectileType(), 0, 0f, player.whoAmI, player.whoAmI); } - Projectile.NewProjectile(source, target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), Item.knockBack, player.whoAmI); + Projectile.NewProjectile(source, target.Center.X, target.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), Item.knockBack, player.whoAmI); } public override void MeleeEffects(Player player, Rectangle hitbox) diff --git a/Items/Weapons/Melee/TheEnforcer.cs b/Items/Weapons/Melee/TheEnforcer.cs index 5e01743147..439bd784a7 100644 --- a/Items/Weapons/Melee/TheEnforcer.cs +++ b/Items/Weapons/Melee/TheEnforcer.cs @@ -89,7 +89,7 @@ namespace CalamityMod.Items.Weapons.Melee } num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); num80 = num72 / num80; - Projectile.NewProjectile(source, vector2, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f) * 0.25f), 0f, i, 0f, Main.rand.Next(3)); + Projectile.NewProjectile(source, vector2, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f) * 0.25f), 0f, i, 0f, Main.rand.Next(3)); } } @@ -137,7 +137,7 @@ namespace CalamityMod.Items.Weapons.Melee } num80 = (float)Math.Sqrt(num78 * num78 + num79 * num79); num80 = num72 / num80; - Projectile.NewProjectile(source, vector2, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f) * 0.25f), 0f, i, 0f, Main.rand.Next(3)); + Projectile.NewProjectile(source, vector2, Vector2.Zero, ModContent.ProjectileType(), (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f) * 0.25f), 0f, i, 0f, Main.rand.Next(3)); } } diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index a644435ff0..31a90757fb 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit) { target.AddBuff(BuffID.OnFire, 360); - player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage(DamageClass.Melee).Additive - 2f)), 0f, 0, false); + player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 2f)), 0f, 0, false); float num50 = 1.7f; float num51 = 0.8f; float num52 = 2f; diff --git a/Items/Weapons/Ranged/AMR.cs b/Items/Weapons/Ranged/AMR.cs index d63fce23c5..e3445208a7 100644 --- a/Items/Weapons/Ranged/AMR.cs +++ b/Items/Weapons/Ranged/AMR.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { @@ -33,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 9.5f; Item.value = Item.buyPrice(1, 80, 0, 0); Item.rare = ItemRarityID.Red; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"); + Item.UseSound = CommonCalamitySounds.LargeWeaponFireSound; Item.autoReuse = true; Item.shoot = ProjectileID.Bullet; Item.shootSpeed = 12f; 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/Auralis.cs b/Items/Weapons/Ranged/Auralis.cs index 84022d40a8..f6766c3e39 100644 --- a/Items/Weapons/Ranged/Auralis.cs +++ b/Items/Weapons/Ranged/Auralis.cs @@ -8,6 +8,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { @@ -44,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 34; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBlast"); + Item.UseSound = CommonCalamitySounds.PlasmaBlastSound; Item.value = CalamityGlobalItem.Rarity12BuyPrice; Item.Calamity().customRarity = CalamityRarity.Turquoise; Item.Calamity().donorItem = true; diff --git a/Items/Weapons/Ranged/ChargedDartRifle.cs b/Items/Weapons/Ranged/ChargedDartRifle.cs index 8a3061c64f..c51df9f3b1 100644 --- a/Items/Weapons/Ranged/ChargedDartRifle.cs +++ b/Items/Weapons/Ranged/ChargedDartRifle.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 7f; Item.value = CalamityGlobalItem.Rarity10BuyPrice; Item.rare = ItemRarityID.Red; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); + Item.UseSound = CommonCalamitySounds.LaserCannonSound; Item.autoReuse = true; Item.shootSpeed = 22f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/ClamorRifle.cs b/Items/Weapons/Ranged/ClamorRifle.cs index 29cf4203da..7eea7b8069 100644 --- a/Items/Weapons/Ranged/ClamorRifle.cs +++ b/Items/Weapons/Ranged/ClamorRifle.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { @@ -28,7 +29,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.noMelee = true; Item.knockBack = 2.5f; Item.value = Item.buyPrice(0, 36, 0, 0); - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"); + Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; Item.autoReuse = true; Item.rare = ItemRarityID.Pink; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Ranged/ElementalBlaster.cs b/Items/Weapons/Ranged/ElementalBlaster.cs index dcb12c0fd0..46c0fbaa4c 100644 --- a/Items/Weapons/Ranged/ElementalBlaster.cs +++ b/Items/Weapons/Ranged/ElementalBlaster.cs @@ -3,6 +3,7 @@ using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { @@ -29,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 1.75f; Item.value = CalamityGlobalItem.Rarity11BuyPrice; Item.rare = ItemRarityID.Purple; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"); + Item.UseSound = CommonCalamitySounds.PlasmaBoltSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 18f; diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 6f19847d97..123153c22c 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.Volume * 0.5f }, position); player.Calamity().soundCooldown = 120; } return false; diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 6ce8cddc58..04bcbae7c8 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { @@ -34,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 0f; Item.value = Item.buyPrice(0, 60, 0, 0); Item.rare = ItemRarityID.Lime; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); + Item.UseSound = CommonCalamitySounds.LaserCannonSound; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 30f; //30 } 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/HandheldTank.cs b/Items/Weapons/Ranged/HandheldTank.cs index 60b250cb44..29caa17d48 100644 --- a/Items/Weapons/Ranged/HandheldTank.cs +++ b/Items/Weapons/Ranged/HandheldTank.cs @@ -5,11 +5,14 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Ranged { public class HandheldTank : ModItem { + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/TankCannon") { PitchVariance = 0.5f }; + public override void SetStaticDefaults() { DisplayName.SetDefault("Handheld Tank"); @@ -28,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/TankCannon"); + Item.UseSound = UseSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity12BuyPrice; diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index 7baa8659b8..e73be963a8 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.Weapons.Ranged { player.Calamity().hellbornBoost = 600; damage *= 10; - player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage(DamageClass.Generic).Additive + player.GetDamage(DamageClass.Ranged).Additive - 1f)), 0f, 0, false); + player.ApplyDamageToNPC(target, (int)(Item.damage * (player.GetDamage().Additive + player.GetDamage().Additive - 1f)), 0f, 0, false); float num50 = 3.4f; float num51 = 1.6f; float num52 = 4f; diff --git a/Items/Weapons/Ranged/Karasawa.cs b/Items/Weapons/Ranged/Karasawa.cs index ecb403c004..046c9d6774 100644 --- a/Items/Weapons/Ranged/Karasawa.cs +++ b/Items/Weapons/Ranged/Karasawa.cs @@ -6,11 +6,14 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Ranged { public class Karasawa : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/MechGaussRifle"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Karasawa"); @@ -30,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.autoReuse = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/MechGaussRifle"); + Item.UseSound = FireSound; Item.noMelee = true; Item.value = CalamityGlobalItem.Rarity14BuyPrice; diff --git a/Items/Weapons/Ranged/MagnaStriker.cs b/Items/Weapons/Ranged/MagnaStriker.cs index 26410ea3ff..8a1a78fe61 100644 --- a/Items/Weapons/Ranged/MagnaStriker.cs +++ b/Items/Weapons/Ranged/MagnaStriker.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 2.25f; Item.value = Item.buyPrice(0, 80, 0, 0); Item.rare = ItemRarityID.Yellow; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/OpalStrike"); + Item.UseSound = OpalStriker.FireSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 15f; diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index 900ec574fe..b85a2d788f 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -5,11 +5,14 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Ranged { public class OpalStriker : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/OpalStrike"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Opal Striker"); @@ -31,7 +34,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.knockBack = 0f; Item.value = Item.buyPrice(0, 2, 0, 0); Item.rare = ItemRarityID.Green; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/OpalStrike"); + Item.UseSound = FireSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 6f; diff --git a/Items/Weapons/Ranged/ScorchedEarth.cs b/Items/Weapons/Ranged/ScorchedEarth.cs index 0e21c09196..8f9f59a925 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("CalamityMod/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/Ranged/TyrannysEnd.cs b/Items/Weapons/Ranged/TyrannysEnd.cs index dbde5bf53c..52d2921881 100644 --- a/Items/Weapons/Ranged/TyrannysEnd.cs +++ b/Items/Weapons/Ranged/TyrannysEnd.cs @@ -7,6 +7,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Ranged { @@ -37,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 32; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"); + Item.UseSound = CommonCalamitySounds.LargeWeaponFireSound; Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.Calamity().customRarity = CalamityRarity.Violet; diff --git a/Items/Weapons/Rogue/SludgeSplotch.cs b/Items/Weapons/Rogue/SludgeSplotch.cs index 72b3fa32f0..37e73a1e5b 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.Volume * 2f }, player.position); if (player.Calamity().StealthStrikeAvailable()) { diff --git a/Items/Weapons/Summon/AngryChickenStaff.cs b/Items/Weapons/Summon/AngryChickenStaff.cs index b03f7eefe4..4e68a17a0d 100644 --- a/Items/Weapons/Summon/AngryChickenStaff.cs +++ b/Items/Weapons/Summon/AngryChickenStaff.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ID; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Summon { @@ -32,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.value = CalamityGlobalItem.Rarity15BuyPrice; Item.rare = ItemRarityID.Purple; Item.Calamity().customRarity = CalamityRarity.Violet; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/FlareSound"); + Item.UseSound = CommonCalamitySounds.FlareSound; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index 4176261a26..841dd6becf 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -5,6 +5,7 @@ using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.DataStructures; using Microsoft.Xna.Framework; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Summon { @@ -28,9 +29,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 1f; Item.value = CalamityGlobalItem.Rarity3BuyPrice; Item.rare = ItemRarityID.Orange; - - // SoundID has no Zombie24 sound instance, so we must create one ourselves. - Item.UseSound = new TerrariaAudio.LegacySoundStyle(SoundID.Zombie, 24, TerrariaAudio.SoundType.Sound); + Item.UseSound = CommonCalamitySounds.GetZombieSound(24); Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index fbe81e2dbe..9c65002532 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Summon { @@ -55,7 +56,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(CommonCalamitySounds.GetZombieSound(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..9ab42a94df 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("CalamityMod/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/Items/Weapons/Summon/SlimePuppetStaff.cs b/Items/Weapons/Summon/SlimePuppetStaff.cs index 0efeb7a0dd..b23786f764 100644 --- a/Items/Weapons/Summon/SlimePuppetStaff.cs +++ b/Items/Weapons/Summon/SlimePuppetStaff.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.NPCs.SlimeGod namespace CalamityMod.Items.Weapons.Summon { @@ -31,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.knockBack = 3.6f; Item.value = CalamityGlobalItem.Rarity4BuyPrice; Item.rare = ItemRarityID.LightRed; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SlimeGodPossession"); + Item.UseSound = SlimeGodCore.PossessionSound; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; diff --git a/Items/Weapons/Typeless/Aestheticus.cs b/Items/Weapons/Typeless/Aestheticus.cs index 7f357d50bb..6f0644f759 100644 --- a/Items/Weapons/Typeless/Aestheticus.cs +++ b/Items/Weapons/Typeless/Aestheticus.cs @@ -22,8 +22,7 @@ namespace CalamityMod.Items.Weapons.Typeless public override void SetDefaults() { - // TODO -- "scales with all stats at once" - Item.DamageType = DamageClass.Generic; + Item.DamageType = AverageDamageClass.Instance; Item.width = 58; Item.damage = 8; Item.useAnimation = 25; diff --git a/Items/Weapons/Typeless/AethersWhisper.cs b/Items/Weapons/Typeless/AethersWhisper.cs index d759afaca6..d7edd8a808 100644 --- a/Items/Weapons/Typeless/AethersWhisper.cs +++ b/Items/Weapons/Typeless/AethersWhisper.cs @@ -7,6 +7,7 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Typeless { @@ -37,7 +38,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.height = 44; Item.noMelee = true; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); + Item.UseSound = CommonCalamitySounds.LaserCannonSound; Item.value = CalamityGlobalItem.Rarity12BuyPrice; Item.Calamity().customRarity = CalamityRarity.Turquoise; diff --git a/Items/Weapons/Typeless/EyeofMagnus.cs b/Items/Weapons/Typeless/EyeofMagnus.cs index 07b0c2edca..9743d80ca2 100644 --- a/Items/Weapons/Typeless/EyeofMagnus.cs +++ b/Items/Weapons/Typeless/EyeofMagnus.cs @@ -3,6 +3,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; using Terraria.ID; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Typeless { @@ -19,9 +20,7 @@ namespace CalamityMod.Items.Weapons.Typeless public override void SetDefaults() { - // TODO -- "scales with all stats at once" - Item.DamageType = DamageClass.Generic; - + Item.DamageType = AverageDamageClass.Instance; Item.width = 80; Item.damage = 32; Item.rare = ItemRarityID.Cyan; @@ -29,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 5f; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); + Item.UseSound = CommonCalamitySounds.LaserCannonSound; Item.autoReuse = true; Item.noMelee = true; Item.height = 50; diff --git a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs index a648247a8a..332a0af866 100644 --- a/Items/Weapons/Typeless/FiniteUse/Bazooka.cs +++ b/Items/Weapons/Typeless/FiniteUse/Bazooka.cs @@ -6,11 +6,14 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { public class Bazooka : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/BazookaFull"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Bazooka"); @@ -30,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse Item.knockBack = 10f; Item.value = Item.buyPrice(0, 36, 0, 0); Item.rare = ItemRarityID.Pink; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/BazookaFull"); + Item.UseSound = FireSound; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs index 84f6ee0026..d5c1ab9491 100644 --- a/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs +++ b/Items/Weapons/Typeless/FiniteUse/ElephantKiller.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse Item.knockBack = 8f; Item.value = CalamityGlobalItem.Rarity10BuyPrice; Item.rare = ItemRarityID.Red; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/Magnum"); + Item.UseSound = Magnum.FireSound; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Typeless/FiniteUse/Hydra.cs b/Items/Weapons/Typeless/FiniteUse/Hydra.cs index 4100eb51e1..e1a9aa44a1 100644 --- a/Items/Weapons/Typeless/FiniteUse/Hydra.cs +++ b/Items/Weapons/Typeless/FiniteUse/Hydra.cs @@ -6,11 +6,14 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { public class Hydra : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/Hydra"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Hydra"); @@ -30,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse Item.knockBack = 10f; Item.value = Item.buyPrice(0, 80, 0, 0); Item.rare = ItemRarityID.Yellow; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/Hydra"); + Item.UseSound = FireSound; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs index 5354d99e71..19d4d15791 100644 --- a/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs +++ b/Items/Weapons/Typeless/FiniteUse/LightningHawk.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse Item.knockBack = 8f; Item.value = Item.buyPrice(0, 48, 0, 0); Item.rare = ItemRarityID.LightPurple; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/Magnum"); + Item.UseSound = Magnum.FireSound; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Typeless/FiniteUse/Magnum.cs b/Items/Weapons/Typeless/FiniteUse/Magnum.cs index 887679d652..f9c4bd6353 100644 --- a/Items/Weapons/Typeless/FiniteUse/Magnum.cs +++ b/Items/Weapons/Typeless/FiniteUse/Magnum.cs @@ -6,11 +6,14 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Typeless.FiniteUse { public class Magnum : ModItem { + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/Magnum"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Magnum"); @@ -30,7 +33,7 @@ namespace CalamityMod.Items.Weapons.Typeless.FiniteUse Item.knockBack = 8f; Item.value = Item.buyPrice(0, 2, 0, 0); Item.rare = ItemRarityID.Green; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/Magnum"); + Item.UseSound = FireSound; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Typeless/LunicEye.cs b/Items/Weapons/Typeless/LunicEye.cs index 9e903af319..6a1eb67e5c 100644 --- a/Items/Weapons/Typeless/LunicEye.cs +++ b/Items/Weapons/Typeless/LunicEye.cs @@ -5,6 +5,7 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Items.Weapons.Typeless { @@ -20,9 +21,7 @@ namespace CalamityMod.Items.Weapons.Typeless public override void SetDefaults() { - // TODO -- "scales with all stats at once" - Item.DamageType = DamageClass.Generic; - + Item.DamageType = AverageDamageClass.Instance; Item.width = 80; Item.damage = 9; Item.value = CalamityGlobalItem.Rarity4BuyPrice; @@ -31,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Typeless Item.useTime = 15; Item.useStyle = ItemUseStyleID.Shoot; Item.knockBack = 4.5f; - Item.UseSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"); + Item.UseSound = CommonCalamitySounds.LaserCannonSound; Item.autoReuse = true; Item.noMelee = true; Item.height = 50; diff --git a/Items/Weapons/Typeless/MarkedMagnum.cs b/Items/Weapons/Typeless/MarkedMagnum.cs index 6849bdb25b..9aa6daa32b 100644 --- a/Items/Weapons/Typeless/MarkedMagnum.cs +++ b/Items/Weapons/Typeless/MarkedMagnum.cs @@ -19,9 +19,7 @@ namespace CalamityMod.Items.Weapons.Typeless public override void SetDefaults() { - // TODO -- "scales with all stats at once" - Item.DamageType = DamageClass.Generic; - + Item.DamageType = AverageDamageClass.Instance; Item.damage = 4; Item.width = 54; Item.height = 20; diff --git a/Items/Weapons/Typeless/YanmeisKnife.cs b/Items/Weapons/Typeless/YanmeisKnife.cs index 23deada06e..16d737b092 100644 --- a/Items/Weapons/Typeless/YanmeisKnife.cs +++ b/Items/Weapons/Typeless/YanmeisKnife.cs @@ -5,11 +5,14 @@ using Terraria; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Audio; namespace CalamityMod.Items.Weapons.Typeless { public class YanmeisKnife : ModItem { + public static readonly SoundStyle ExpireSound = new("CalamityMod/Sounds/Custom/YanmeiKnifeExpire"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Yanmei's Knife"); diff --git a/Localization/enUS.hjson b/Localization/enUS.hjson index f236124f50..70848bec95 100644 --- a/Localization/enUS.hjson +++ b/Localization/enUS.hjson @@ -1,3 +1,11 @@ -{ - "CalamityMod.DamageClassName.RogueDamageClass": "rogue damage" +Mods: +{ + CalamityMod: + { + DamageClassName: + { + "RogueDamageClass": "rogue damage", + "AverageDamageClass": "average damage", + } + } } \ No newline at end of file diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index 10121c60ed..55d2af3d4b 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -134,7 +134,7 @@ namespace CalamityMod.NPCs.Abyss public void Boom() { - SoundEngine.PlaySound(SoundID.NPCDeath14, (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(SoundID.NPCDeath14, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient && puffedUp) { int damageBoom = 45; diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index c12d1cabbe..bf7fbf2769 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.PlaySoundCommonCalamitySounds.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(CommonCalamitySounds.GetZombieSound(34), NPC.position); } if (NPC.ai[3] > 0f && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) { @@ -406,7 +407,7 @@ namespace CalamityMod.NPCs.Abyss { damage = 55; } - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 111); + SoundEngine.PlaySound(SoundID.Item111, NPC.position); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 60, 0f, 2f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); } NPC.rotation = NPC.velocity.X * 0.05f; @@ -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(CommonCalamitySounds.GetZombieSound(35), NPC.position); } NPC.localAI[2] = 0f; NPC.velocity.X = NPC.velocity.X + (float)NPC.direction * 0.02f; diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index 7625b33b28..b77f54dae4 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -18,6 +18,8 @@ namespace CalamityMod.NPCs.Abyss { public class DevilFish : ModNPC { + public static readonly SoundStyle MaskBreakSound = new("CalamityMod/Sounds/Item/DevilMaskBreak"); + public bool brokenMask = false; public int hitCounter = 0; @@ -100,7 +102,7 @@ namespace CalamityMod.NPCs.Abyss Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("DevilFishMask" + i).Type, 1f); } } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/DevilMaskBreak"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(MaskBreakSound, NPC.position); } if (NPC.wet) diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index 04759199c9..252a8abdb2 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -100,7 +100,7 @@ namespace CalamityMod.NPCs.Abyss Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("DevilFishMask" + i + (i == 3 ? "Alt" : "")).Type, 1f); } } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/DevilMaskBreak"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(DevilFish.MaskBreakSound, NPC.position); } if (NPC.wet) diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index f6c7841d53..2d485591a6 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; using CalamityMod.NPCs.AdultEidolonWyrm; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Abyss { @@ -113,14 +114,14 @@ namespace CalamityMod.NPCs.Abyss if (NPC.soundDelay <= 0) { NPC.soundDelay = 420; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/WyrmScream"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(CommonCalamitySounds.WyrmScreamSound, NPC.position); } } else { if (Main.rand.NextBool(900)) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/WyrmScream"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(CommonCalamitySounds.WyrmScreamSound, NPC.position); } } if (NPC.ai[2] > 0f) diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index ac4c742de7..8c79d8513e 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -20,6 +20,8 @@ namespace CalamityMod.NPCs.Abyss { public class LuminousCorvina : ModNPC { + public static readonly SoundStyle ScreamSound = new("CalamityMod/Sounds/Custom/CorvinaScream"); + private bool hasBeenHit = false; private int screamTimer = 0; @@ -105,7 +107,7 @@ namespace CalamityMod.NPCs.Abyss { if (screamTimer == screamLimit) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/CorvinaScream"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ScreamSound, NPC.position); if (Main.netMode != NetmodeID.Server) { if (!Main.player[NPC.target].dead && Main.player[NPC.target].active) diff --git a/NPCs/Abyss/Reaper.cs b/NPCs/Abyss/Reaper.cs index 8d02498af4..4494d51829 100644 --- a/NPCs/Abyss/Reaper.cs +++ b/NPCs/Abyss/Reaper.cs @@ -19,6 +19,9 @@ namespace CalamityMod.NPCs.Abyss { public class Reaper : ModNPC { + public static readonly SoundStyle SearchRoarSound = new("CalamityMod/Sounds/Custom/ReaperSearchRoar"); + public static readonly SoundStyle EnragedRoarSound = new("CalamityMod/Sounds/Custom/ReaperEnragedRoar"); + public bool hasBeenHit = false; public bool reset = false; public bool reset2 = false; @@ -107,11 +110,11 @@ namespace CalamityMod.NPCs.Abyss NPC.soundDelay = 360; if (hasBeenHit) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ReaperEnragedRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(EnragedRoarSound, NPC.position); } else { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ReaperSearchRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(SearchRoarSound, NPC.position); } } if (phase3 || phase1) @@ -503,7 +506,7 @@ namespace CalamityMod.NPCs.Abyss Main.dust[num21].noLight = true; Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ReaperEnragedRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(EnragedRoarSound, NPC.position); } NPC.ai[2] += 1f; if (NPC.ai[2] >= (float)num16) diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index 862bd1048d..005fe61c59 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(CommonCalamitySounds.GetZombieSound(32), NPC.Center); if (NPC.wet) { diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index b6d52f0df3..c8a8a1cbfd 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(CommonCalamitySounds.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..104d3dda69 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(CommonCalamitySounds.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..01d3d2f24e 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 { @@ -41,6 +42,8 @@ namespace CalamityMod.NPCs.AcidRain set => NPC.localAI[0] = value; } + public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/MaulerRoar"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Mauler"); @@ -164,7 +167,7 @@ namespace CalamityMod.NPCs.AcidRain CurrentFrame = 4; } if (AttackTimer == roarDelay) - SoundEngine.PlaySound(SoundID.Zombie, Target.Center, 97); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(97), Target.Center); // Rotate towards the target. int previousSpriteDirection = NPC.spriteDirection; @@ -339,7 +342,7 @@ namespace CalamityMod.NPCs.AcidRain // Roar as a telegraph. The placement of the sound is offset such that the player and ideally determine the determine where the charge will come from. if (AttackTimer == chargeDelay - telegraphTime) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/MaulerRoar"), Target.Center + Target.SafeDirectionTo(NPC.Center) * 300f); + SoundEngine.PlaySound(RoarSound, Target.Center + Target.SafeDirectionTo(NPC.Center) * 300f); // Charge. if (AttackTimer == chargeDelay) diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index f126606097..de5893274d 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(CommonCalamitySounds.GetZombieSound(13), NPC.Center); float explodeDistance = DownedBossSystem.downedAquaticScourge ? 295f : 195f; if (DownedBossSystem.downedPolterghast) diff --git a/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs index c453f94aad..f60c4bd78e 100644 --- a/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs +++ b/NPCs/AdultEidolonWyrm/EidolonWyrmHeadHuge.cs @@ -20,6 +20,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.AdultEidolonWyrm { @@ -78,6 +79,10 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm // How much less time is needed before activating fast charge private const float fastChargeGateValue = 120f; + //Sounds + public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/Scare"); + public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/EidolonWyrmRoarClose"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Adult Eidolon Wyrm"); @@ -207,7 +212,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (!TailSpawned && NPC.ai[0] == 0f) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/Scare"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(SpawnSound, Main.player[Main.myPlayer].Center); } // Spawn segments @@ -502,7 +507,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (calamityGlobalNPC.newAI[2] == chargePhaseGateValue + 1f) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/EidolonWyrmRoarClose"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(RoarSound, Main.player[Main.myPlayer].Center); chargeDestination = destination + chargeVectorFlipped + player.velocity * chargePredictionAmt; NPC.velocity = Vector2.Normalize(chargeDestination - NPC.Center) * baseVelocity; @@ -569,7 +574,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (calamityGlobalNPC.newAI[2] % 30f == 0f && calamityGlobalNPC.newAI[2] < lightningRainDuration) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/LightningStrike"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, Main.player[Main.myPlayer].Center); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -681,7 +686,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (calamityGlobalNPC.newAI[2] == chargePhaseGateValue + 1f) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/EidolonWyrmRoarClose"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(RoarSound, Main.player[Main.myPlayer].Center); chargeDestination = destination + chargeVectorFlipped + player.velocity * chargePredictionAmt; NPC.velocity = Vector2.Normalize(chargeDestination - NPC.Center) * baseVelocity; @@ -748,7 +753,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (!NPC.AnyNPCs(ModContent.NPCType())) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/WyrmScream"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(CommonCalamitySounds.WyrmScreamSound, Main.player[Main.myPlayer].Center); NPC.SpawnOnPlayer(NPC.FindClosestPlayer(), ModContent.NPCType()); } @@ -789,7 +794,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (calamityGlobalNPC.newAI[2] == chargePhaseGateValue + 1f) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/EidolonWyrmRoarClose"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(RoarSound, Main.player[Main.myPlayer].Center); chargeDestination = destination + chargeVectorFlipped + player.velocity * chargePredictionAmt; NPC.velocity = Vector2.Normalize(chargeDestination - NPC.Center) * baseVelocity; @@ -1063,7 +1068,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (calamityGlobalNPC.newAI[2] == lightningChargePhaseGateValue + 1f) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/EidolonWyrmRoarClose"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(RoarSound, Main.player[Main.myPlayer].Center); chargeDestination = destination + lightningChargeVectorFlipped + player.velocity * chargePredictionAmt; NPC.velocity = Vector2.Normalize(chargeDestination - NPC.Center) * baseVelocity; @@ -1083,7 +1088,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (Main.netMode != NetmodeID.MultiplayerClient && NPC.localAI[3] == 0f) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/LightningStrike"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, Main.player[Main.myPlayer].Center); NPC.localAI[3] = 1f; int type = ProjectileID.CultistBossLightningOrbArc; @@ -1135,7 +1140,7 @@ namespace CalamityMod.NPCs.AdultEidolonWyrm if (!NPC.AnyNPCs(ModContent.NPCType())) { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/EidolistDeath"), Main.player[Main.myPlayer].Center); + SoundEngine.PlaySound(Eidolist.DeathSound, Main.player[Main.myPlayer].Center); // Spawn Eidolists randomly around the target for (int i = 0; i < maxEidolists; i++) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 6da97cf4bf..2daa0c0a90 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -25,6 +25,7 @@ using CalamityMod.Items.Armor.Vanity; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; using System; +using CalamityMod.NPCs.AcidRain; namespace CalamityMod.NPCs.AquaticScourge { @@ -242,7 +243,7 @@ namespace CalamityMod.NPCs.AquaticScourge if (!DownedBossSystem.downedAquaticScourge) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/MaulerRoar"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + SoundEngine.PlaySound(Mauler.RoarSound, Main.player[Main.myPlayer].position); string sulfSeaBoostKey = "Mods.CalamityMod.WetWormBossText"; Color sulfSeaBoostColor = AcidRainEvent.TextColor; diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index 639ac18df5..668d9f631c 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -11,6 +11,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -37,7 +38,7 @@ namespace CalamityMod.NPCs.Astral NPC.lifeMax = 300; NPC.knockBackResist = 0.6f; NPC.value = Item.buyPrice(0, 0, 10, 0); - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) @@ -91,18 +92,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, ModContent.DustType(), 1f, 4, 24); diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 9c513b50b1..1a7eed258a 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -12,6 +12,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -252,18 +253,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } if (NPC.life <= 0) diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index d30e01a362..9362d12dd4 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -13,6 +13,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -41,7 +42,7 @@ namespace CalamityMod.NPCs.Astral NPC.defense = 20; NPC.DR_NERD(0.15f); NPC.lifeMax = 500; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.38f; NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.timeLeft = NPC.activeTime * 2; @@ -126,18 +127,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 4, 22); diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index a1f9dcfdf0..d453394f7a 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -42,7 +43,7 @@ namespace CalamityMod.NPCs.Astral NPC.defense = 20; NPC.DR_NERD(0.15f); NPC.lifeMax = 500; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.value = Item.buyPrice(0, 0, 20, 0); @@ -103,18 +104,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 4, 22); diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 22a5ebd3ed..dd1728f086 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -48,6 +48,13 @@ namespace CalamityMod.NPCs.Astral private byte swing_counter; private short swing_untilNext; + public static readonly SoundStyle HurtSound = new("CalamityMod/Sounds/NPCHit/AtlasHurt", 3); + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/AtlasDeath") { Volume = 0.65f }; + public static readonly SoundStyle AggroSound = new("CalamityMod/Sounds/Custom/AtlasSadAggro") { Volume = 0.5f }; + public static readonly SoundStyle UnaggroSound = new("CalamityMod/Sounds/Custom/AtlasSadUnaggro") { Volume = 0.5f }; + public static readonly SoundStyle SwingSound = new("CalamityMod/Sounds/Custom/AtlasSwing") { Volume = 0.65f }; + public static readonly SoundStyle IdleSound = new("CalamityMod/Sounds/Custom/AtlasIdle", 2) { Volume = 0.6f }; + private float idle_counter { get @@ -117,7 +124,7 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.08f; NPC.value = Item.buyPrice(0, 1, 0, 0); NPC.aiStyle = -1; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AtlasDeath"); + NPC.DeathSound = DeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) @@ -195,7 +202,7 @@ namespace CalamityMod.NPCs.Astral else { //PLAY SOUND (SAD) *but this time it has a target. more like an indicator. he sad because he has to kill you now :c - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AtlasSad0"), NPC.Center); + SoundEngine.PlaySound(AggroSound, NPC.Center); } } @@ -238,7 +245,7 @@ namespace CalamityMod.NPCs.Astral if (swing_counter == swing_playSoundOnFrame) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AtlasSwing"), NPC.Center); + SoundEngine.PlaySound(SwingSound, NPC.Center); } if (swing_counter >= swing_minCounterHit && swing_counter <= swing_maxCounterHit) @@ -336,7 +343,7 @@ namespace CalamityMod.NPCs.Astral NPC.frameCounter = 0; // reset framecounter to start walk. //PLAY SOUND (IDLE) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AtlasIdle" + Main.rand.Next(2)), NPC.Center); + SoundEngine.PlaySound(IdleSound, NPC.Center); } else { @@ -389,7 +396,7 @@ namespace CalamityMod.NPCs.Astral target_counter = 0; //PLAY SOUND (SAD) he sad cos he lost his target :C - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AtlasSad1"), NPC.Center); + SoundEngine.PlaySound(UnaggroSound, NPC.Center); } else if (target_counter == 0 && NPC.velocity.Y == 0) { @@ -438,18 +445,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AtlasHurt0"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AtlasHurt1"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AtlasHurt2"), NPC.Center); - break; - } + SoundEngine.PlaySound(HurtSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 3, 30); diff --git a/NPCs/Astral/BigSightseer.cs b/NPCs/Astral/BigSightseer.cs index b25ad59849..d5a1fab102 100644 --- a/NPCs/Astral/BigSightseer.cs +++ b/NPCs/Astral/BigSightseer.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -41,7 +42,7 @@ namespace CalamityMod.NPCs.Astral NPC.defense = 20; NPC.DR_NERD(0.15f); NPC.lifeMax = 430; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.8f; NPC.value = Item.buyPrice(0, 0, 20, 0); @@ -133,18 +134,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 4, 22); diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index a39eb68bad..3306611753 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 { @@ -52,7 +53,7 @@ namespace CalamityMod.NPCs.Astral NPC.value = Item.buyPrice(0, 0, 20, 0); NPC.knockBackResist = 0.8f; NPC.behindTiles = true; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; AnimationType = NPCID.SandShark; Banner = NPC.type; BannerItem = ModContent.ItemType(); @@ -98,7 +99,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = (int)MathHelper.Clamp(distanceFromTarget / 40f, 10f, 20f); - SoundEngine.PlaySound(SoundID.Roar, NPC.Center, 4); + SoundEngine.PlaySound(SoundID.WormDig, NPC.Center); } tileCheckPoint = (NPC.Center + Vector2.UnitY * 24f).ToTileCoordinates(); @@ -128,7 +129,7 @@ namespace CalamityMod.NPCs.Astral { if (SearchSoundCreationDelay == 0f) { - SoundEngine.PlaySound(SoundID.ZombieMoan, NPC.Center, NPCID.SandShark); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(7), NPC.Center); SearchSoundCreationDelay = -1f; } @@ -243,18 +244,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 4, 25); diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 01653c77d3..40a8d8bc7c 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -14,6 +14,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -38,7 +39,7 @@ namespace CalamityMod.NPCs.Astral NPC.defense = 8; NPC.DR_NERD(0.15f); NPC.lifeMax = 330; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.75f; NPC.value = Item.buyPrice(0, 0, 15, 0); Banner = NPC.type; @@ -172,18 +173,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 3, 20); diff --git a/NPCs/Astral/Hive.cs b/NPCs/Astral/Hive.cs index 21f4f4a802..62276d5910 100644 --- a/NPCs/Astral/Hive.cs +++ b/NPCs/Astral/Hive.cs @@ -12,6 +12,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -36,7 +37,7 @@ namespace CalamityMod.NPCs.Astral NPC.defense = 15; NPC.DR_NERD(0.15f); NPC.lifeMax = 470; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0f; NPC.value = Item.buyPrice(0, 0, 15, 0); Banner = NPC.type; @@ -103,18 +104,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 3, 20); diff --git a/NPCs/Astral/Hiveling.cs b/NPCs/Astral/Hiveling.cs index cbcbf78c34..0d28549fa1 100644 --- a/NPCs/Astral/Hiveling.cs +++ b/NPCs/Astral/Hiveling.cs @@ -9,6 +9,7 @@ using Terraria.GameContent.Bestiary; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -32,7 +33,7 @@ namespace CalamityMod.NPCs.Astral NPC.damage = 30; NPC.defense = 0; NPC.lifeMax = 150; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.5f; NPC.noGravity = true; NPC.value = Item.buyPrice(0, 0, 5, 0); @@ -125,18 +126,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 3, 20); diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 09e5e086bc..2b964c2eef 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -14,6 +14,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -41,7 +42,7 @@ namespace CalamityMod.NPCs.Astral NPC.lifeMax = 340; NPC.knockBackResist = 0.2f; NPC.value = Item.buyPrice(0, 0, 15, 0); - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) @@ -207,18 +208,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, ModContent.DustType(), 1f, 4, 24); diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 19282fc51d..82e1b4fe7a 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; using Terraria.GameContent.ItemDropRules; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -53,7 +54,7 @@ namespace CalamityMod.NPCs.Astral NPC.defense = 15; NPC.DR_NERD(0.15f); NPC.lifeMax = 230; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.5f; NPC.value = Item.buyPrice(0, 0, 20, 0); @@ -247,18 +248,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 3, 40); diff --git a/NPCs/Astral/SmallSightseer.cs b/NPCs/Astral/SmallSightseer.cs index 4940868030..6e5f4ff1e0 100644 --- a/NPCs/Astral/SmallSightseer.cs +++ b/NPCs/Astral/SmallSightseer.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds namespace CalamityMod.NPCs.Astral { @@ -36,7 +37,7 @@ namespace CalamityMod.NPCs.Astral NPC.defense = 16; NPC.DR_NERD(0.15f); NPC.lifeMax = 310; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.58f; NPC.value = Item.buyPrice(0, 0, 10, 0); @@ -95,18 +96,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 4, 22); diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index 40f49b6943..17278eb0fa 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -13,6 +13,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using ReLogic.Content; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Astral { @@ -40,7 +41,7 @@ namespace CalamityMod.NPCs.Astral NPC.knockBackResist = 0.65f; NPC.lifeMax = 210; NPC.value = Item.buyPrice(0, 0, 10, 0); - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstralEnemyDeath"); + NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; AnimationType = NPCID.GiantFlyingFox; Banner = NPC.type; BannerItem = ModContent.ItemType(); @@ -81,18 +82,7 @@ namespace CalamityMod.NPCs.Astral if (NPC.soundDelay == 0) { NPC.soundDelay = 15; - switch (Main.rand.Next(3)) - { - case 0: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit"), NPC.Center); - break; - case 1: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit2"), NPC.Center); - break; - case 2: - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstralEnemyHit3"), NPC.Center); - break; - } + SoundEngine.PlaySound(CommonCalamitySounds.AstralNPCHitSound, NPC.Center); } CalamityGlobalNPC.DoHitDust(NPC, hitDirection, (Main.rand.Next(0, Math.Max(0, NPC.life)) == 0) ? 5 : ModContent.DustType(), 1f, 4, 22); diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index ec76d52dc5..c028ac5024 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -30,6 +30,9 @@ namespace CalamityMod.NPCs.AstrumAureus [AutoloadBossHead] public class AstrumAureus : ModNPC { + public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/AstrumAureusHit"); + public static readonly SoundStyle StompSound = new("CalamityMod/Sounds/Custom/LegStomp"); + private bool stomping = false; public override void SetStaticDefaults() @@ -375,7 +378,7 @@ namespace CalamityMod.NPCs.AstrumAureus if (NPC.soundDelay == 0) { NPC.soundDelay = 20; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/AstrumAureusHit"), NPC.Center); + SoundEngine.PlaySound(HitSound, NPC.Center); } for (int k = 0; k < 5; k++) diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 8e3287d506..78f822a21f 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -162,7 +162,7 @@ namespace CalamityMod.NPCs.AstrumAureus NPC.localAI[0] = 0f; if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height)) { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 109); + SoundEngine.PlaySound(SoundID.Item109, NPC.position); float speed = 5f; Vector2 vector = new Vector2(NPC.position.X + (float)NPC.width * 0.5f, NPC.position.Y + (float)(NPC.height / 2)); float num6 = Main.player[NPC.target].position.X + (float)Main.player[NPC.target].width * 0.5f - vector.X; @@ -365,7 +365,7 @@ namespace CalamityMod.NPCs.AstrumAureus public override bool CheckDead() { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 14); + SoundEngine.PlaySound(SoundID.Item14, NPC.position); NPC.position.X = NPC.position.X + (float)(NPC.width / 2); NPC.position.Y = NPC.position.Y + (float)(NPC.height / 2); NPC.damage = (NPC.downedMoonlord && !BossRushEvent.BossRushActive) ? NPC.defDamage * 2 : NPC.defDamage; diff --git a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs index d01958fbc9..953a28d476 100644 --- a/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusBodySpectral.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.noTileCollide = true; NPC.canGhostHeal = false; NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstrumDeusDeath"); + NPC.DeathSound = AstrumDeusHeadSpectral.DeathSound; NPC.netAlways = true; NPC.boss = true; Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3; diff --git a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs index e4c6060367..fb5e60364a 100644 --- a/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusHeadSpectral.cs @@ -22,12 +22,17 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.GameContent.ItemDropRules; +using Terraria.Audio; namespace CalamityMod.NPCs.AstrumDeus { [AutoloadBossHead] public class AstrumDeusHeadSpectral : ModNPC { + public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/AstrumDeusSpawn"); + public static readonly SoundStyle SplitSound = new("CalamityMod/Sounds/Custom/AstrumDeusSplit"); + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/AstrumDeusDeath"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Astrum Deus"); @@ -66,7 +71,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstrumDeusDeath"); + NPC.DeathSound = DeathSound; NPC.netAlways = true; Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3; NPC.Calamity().VulnerableToHeat = true; diff --git a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs index db230001c9..99b32af018 100644 --- a/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs +++ b/NPCs/AstrumDeus/AstrumDeusTailSpectral.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.noTileCollide = true; NPC.canGhostHeal = false; NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/AstrumDeusDeath"); + NPC.DeathSound = AstrumDeusHeadSpectral.DeathSound; NPC.netAlways = true; NPC.boss = true; Music = CalamityMod.Instance.GetMusicFromMusicMod("AstrumDeus") ?? MusicID.Boss3; diff --git a/NPCs/Calamitas/CalamitasRun3.cs b/NPCs/Calamitas/CalamitasRun3.cs index de8959db1c..288a7125ff 100644 --- a/NPCs/Calamitas/CalamitasRun3.cs +++ b/NPCs/Calamitas/CalamitasRun3.cs @@ -22,6 +22,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.Calamitas { @@ -224,7 +225,7 @@ namespace CalamityMod.NPCs.Calamitas if (!DownedBossSystem.downedCalamitas) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/WyrmScream"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + SoundEngine.PlaySound(CommonCalamitySounds.WyrmScreamSound, Main.player[Main.myPlayer].position); CalamityUtils.DisplayLocalizedText(key, messageColor); } diff --git a/NPCs/CalamityAI.cs b/NPCs/CalamityAI.cs index 4dceec50a5..6802edc816 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 { @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs float barfDivisor = malice ? 30f : expertMode ? 40f : 60f; if (calamityGlobalNPC.newAI[3] % barfDivisor == 0f) { - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 13); + SoundEngine.PlaySound(SoundID.NPCDeath13, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -268,7 +269,7 @@ namespace CalamityMod.NPCs { npc.localAI[0] = 0f; npc.netUpdate = true; - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 13); + SoundEngine.PlaySound(SoundID.NPCDeath13, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -325,7 +326,7 @@ namespace CalamityMod.NPCs npc.TargetClosest(); if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 17); + SoundEngine.PlaySound(SoundID.NPCDeath17, npc.position); Vector2 vector104 = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + (npc.height / 2)); float num942 = player.position.X + player.width * 0.5f - vector104.X; float num943 = player.position.Y + player.height * 0.5f - vector104.Y; @@ -1189,7 +1190,7 @@ namespace CalamityMod.NPCs } if (npc.ai[1] % playSoundTimer == 0f) - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 20); + SoundEngine.PlaySound(SoundID.Item20, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -1250,7 +1251,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 74); + SoundEngine.PlaySound(SoundID.Item72, npc.position); int seekerAmt = death ? 10 : 5; int seekerSpread = 360 / seekerAmt; int seekerDistance = death ? 180 : 150; @@ -2032,7 +2033,7 @@ namespace CalamityMod.NPCs if (npc.localAI[2] > 22f) { npc.localAI[2] = 0f; - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 34); + SoundEngine.PlaySound(SoundID.Item34, npc.position); } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -2068,7 +2069,7 @@ namespace CalamityMod.NPCs { if (npc.ai[1] == 1f) { - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0); + SoundEngine.PlaySound(SoundID.Roar, npc.position); npc.rotation = num842; float num870 = 14f + (death ? 4f * (1f - lifeRatio) : 0f); @@ -2313,7 +2314,7 @@ namespace CalamityMod.NPCs if (npc.localAI[2] > 36f) { npc.localAI[2] = 0f; - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 34); + SoundEngine.PlaySound(SoundID.Item34, npc.position); } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -2349,7 +2350,7 @@ namespace CalamityMod.NPCs { if (npc.ai[1] == 1f) { - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0); + SoundEngine.PlaySound(SoundID.Roar, npc.position); npc.rotation = num842; float num870 = (NPC.AnyNPCs(ModContent.NPCType()) ? 12f : 16f) + (death ? 4f * (1f - lifeRatio) : 0f); @@ -2511,7 +2512,7 @@ namespace CalamityMod.NPCs if (npc.ai[0] >= 5f && npc.ai[0] != 7) { npc.localAI[0] = 0f; - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 109); + SoundEngine.PlaySound(SoundID.Item109, npc.position); float velocity = death ? (8f + npc.localAI[2] * 0.025f) : 7f; int type = ModContent.ProjectileType(); @@ -2533,7 +2534,7 @@ namespace CalamityMod.NPCs if (npc.ai[0] == 2f) { npc.localAI[0] = 0f; - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 33); + SoundEngine.PlaySound(SoundID.Item33, npc.position); float num179 = death ? 20f : 18.5f; int maxProjectiles = malice ? 8 : death ? 6 : 4; @@ -2777,8 +2778,8 @@ namespace CalamityMod.NPCs { if (npc.velocity.Y == 0f) { - // Play stomp sound - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/LegStomp"), (int)npc.position.X, (int)npc.position.Y); + // Play stomp sound. Gotta specify the filepath to avoid confusion between the namespace and npc + SoundEngine.PlaySound(NPCs.AstrumAureus.AstrumAureus.StompSound, npc.position); // Stomp and jump again, if stomped twice then reset and set AI to next phase (Teleport or Idle) npc.TargetClosest(); @@ -2812,7 +2813,7 @@ namespace CalamityMod.NPCs } // Fire lasers on stomp - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 33); + SoundEngine.PlaySound(SoundID.Item33, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { float num179 = death ? 20f : 18.5f; @@ -3016,7 +3017,7 @@ namespace CalamityMod.NPCs if (npc.soundDelay == 0) { npc.soundDelay = 15; - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 109); + SoundEngine.PlaySound(SoundID.Item109, npc.position); } // Emit dust to make the teleport pretty @@ -3069,7 +3070,7 @@ namespace CalamityMod.NPCs if (npc.soundDelay == 0) { npc.soundDelay = 15; - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 109); + SoundEngine.PlaySound(SoundID.Item109, npc.position); } // Emit dust to make the teleport pretty @@ -3188,7 +3189,7 @@ namespace CalamityMod.NPCs { if (calamityGlobalNPC.newAI[0] != 3f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/AstrumDeusSplit"), player.Center); + SoundEngine.PlaySound(AstrumDeusHeadSpectral.SplitSound, player.Center); calamityGlobalNPC.newAI[0] = 3f; npc.defense = 12; calamityGlobalNPC.DR = 0.075f; @@ -3305,7 +3306,7 @@ namespace CalamityMod.NPCs netMessage.Send(); } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/AstrumDeusSplit"), player.Center); + SoundEngine.PlaySound(AstrumDeusHeadSpectral.SplitSound, player.Center); } return; } @@ -4531,11 +4532,7 @@ namespace CalamityMod.NPCs // Sound if (calamityGlobalNPC.newAI[1] == newPhaseTimer - 60f) { - SoundEffectInstance sound = SoundEngine.PlaySound(SoundID.DD2_BetsyScream, (int)npc.position.X, (int)npc.position.Y); - if (sound != null) - { - sound.Pitch = 0.25f; - } + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = 0.25f }, npc.position); } if (calamityGlobalNPC.newAI[1] >= newPhaseTimer) @@ -4557,11 +4554,7 @@ namespace CalamityMod.NPCs // Sound if (calamityGlobalNPC.newAI[0] == newPhaseTimer - 60f) { - SoundEffectInstance sound = SoundEngine.PlaySound(SoundID.DD2_BetsyScream, (int)npc.position.X, (int)npc.position.Y); - if (sound != null) - { - sound.Pitch = 0.25f; - } + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = 0.25f }, npc.position); } if (calamityGlobalNPC.newAI[0] >= newPhaseTimer) @@ -4705,7 +4698,7 @@ namespace CalamityMod.NPCs if (phase2 && npc.ai[3] == 0f) { npc.ai[3] = 3f; - SoundEngine.PlaySound(SoundID.Item102, (int)player.position.X, (int)player.position.Y); + SoundEngine.PlaySound(SoundID.Item102, player.Center); int totalProjectiles = 40; float radians = MathHelper.TwoPi / totalProjectiles; int distance = 800; @@ -4754,7 +4747,7 @@ namespace CalamityMod.NPCs if (npc.ai[3] == 0f) { npc.ai[3] = 3f; - SoundEngine.PlaySound(SoundID.Item102, (int)player.position.X, (int)player.position.Y); + SoundEngine.PlaySound(SoundID.Item102, player.Center); int totalProjectiles = phase2 ? 40 : 48; float radians = MathHelper.TwoPi / totalProjectiles; int distance = phase2 ? 1200 : 1320; @@ -5016,11 +5009,7 @@ namespace CalamityMod.NPCs // Sound if (npc.ai[1] == birbSpawnPhaseTimer - 60f) { - SoundEffectInstance sound = SoundEngine.PlaySound(SoundID.DD2_BetsyScream, (int)npc.position.X, (int)npc.position.Y); - if (sound != null) - { - sound.Pitch = 0.25f; - } + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = 0.25f }, npc.position); } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -5465,7 +5454,7 @@ namespace CalamityMod.NPCs // Play tired sound if (calamityGlobalNPC.newAI[0] % 60f == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeHuff"), player.Center); + SoundEngine.PlaySound(OldDuke.OldDuke.HuffSound, player.Center); calamityGlobalNPC.newAI[0] -= malice ? 1.5f : 1f; if (calamityGlobalNPC.newAI[0] <= 0f) @@ -5666,7 +5655,7 @@ namespace CalamityMod.NPCs Main.dust[num21].velocity = Vector2.Normalize(vector2) * 3f; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.position); } npc.ai[2] += 1f; @@ -5831,12 +5820,12 @@ namespace CalamityMod.NPCs // Play sounds and spawn Tooth Balls if (npc.ai[2] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.position); if (npc.ai[2] % toothBallBelchPhaseDivisor == 0f) { if (npc.ai[2] % 40f == 0f && npc.ai[2] != 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeVomit"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -5876,7 +5865,7 @@ namespace CalamityMod.NPCs // Play sound and spawn sharks if (npc.ai[2] == num9 - 30) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeVomit"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.position); if (npc.ai[2] >= num9 - 90) { @@ -5910,7 +5899,7 @@ namespace CalamityMod.NPCs // Sound if (npc.ai[2] == num10 - 60) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.position); if (npc.ai[2] >= num10 - 60) { @@ -6095,7 +6084,7 @@ namespace CalamityMod.NPCs // Play sounds and spawn Tooth Balls and a Vortex if (npc.ai[2] == 0f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.position); int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -6109,7 +6098,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] % toothBallSpinPhaseDivisor == 0f) { if (npc.ai[2] % 45f == 0f && npc.ai[2] != 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeVomit"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -6148,7 +6137,7 @@ namespace CalamityMod.NPCs // Play sound if (npc.ai[2] == num9 - 30) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeVomit"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -6197,7 +6186,7 @@ namespace CalamityMod.NPCs // Sound if (npc.ai[2] == num10 - 60) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.position); if (npc.ai[2] >= num10 - 60) { @@ -6408,7 +6397,7 @@ namespace CalamityMod.NPCs // Play sound if (npc.ai[2] == num12 / 2) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == num12 / 2) { @@ -6463,7 +6452,7 @@ namespace CalamityMod.NPCs // Play sound if (npc.ai[2] == num9 - 30) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeVomit"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -6509,7 +6498,7 @@ namespace CalamityMod.NPCs // Play sounds and spawn Tooth Balls and a Vortex if (npc.ai[2] == 0f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeRoar"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.position); int type = ModContent.ProjectileType(); int damage = npc.GetProjectileDamage(type); @@ -6523,7 +6512,7 @@ namespace CalamityMod.NPCs if (npc.ai[2] % toothBallSpinPhaseDivisor == 0f) { if (npc.ai[2] % 45f == 0f && npc.ai[2] != 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(mod, "Sounds/Custom/OldDukeVomit"), (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -6989,7 +6978,7 @@ namespace CalamityMod.NPCs { if (npc.ai[1] == 180f) { - SoundEngine.PlaySound(SoundID.Zombie, (int)npc.position.X, (int)npc.position.Y, 104); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(104), npc.position); Vector2 laserVelocity2 = new Vector2(npc.localAI[0], npc.localAI[1]); laserVelocity2.Normalize(); @@ -7030,7 +7019,7 @@ namespace CalamityMod.NPCs } if (npc.ai[1] % playSoundTimer == 0f) - SoundEngine.PlaySound(SoundID.Item, (int)npc.position.X, (int)npc.position.Y, 20); + SoundEngine.PlaySound(SoundID.Item20, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -7340,7 +7329,7 @@ namespace CalamityMod.NPCs npc.velocity.Y -= bounciness; if (npc.type == ModContent.NPCType()) { - SoundEngine.PlaySound(SoundID.Item, npc.Center, 14); + SoundEngine.PlaySound(SoundID.Item14, npc.Center); for (int k = 0; k < 10; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, -1f, 0, default, 1f); @@ -7348,7 +7337,7 @@ namespace CalamityMod.NPCs } if (npc.type == ModContent.NPCType()) { - SoundEngine.PlaySound(SoundID.NPCHit, npc.Center, 7); + SoundEngine.PlaySound(SoundID.NPCHit7, npc.Center); } if (DogPhase2) { diff --git a/NPCs/CalamityGlobalAI.cs b/NPCs/CalamityGlobalAI.cs index e5733a14bc..cd5cf13f51 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 { @@ -465,7 +466,7 @@ namespace CalamityMod.NPCs float time = npc.ai[2] + maxTime + turnToStoneTime; if (time == 1f) { - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 17, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCDeath17, npc.position); } if (time < turnToStoneTime) { @@ -1284,31 +1285,31 @@ 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) { - SoundEngine.PlaySound(SoundID.Mummy, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.Mummy, npc.position); } 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(CommonCalamitySounds.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(CommonCalamitySounds.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(CommonCalamitySounds.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); } @@ -4442,7 +4443,7 @@ namespace CalamityMod.NPCs num54 = 20f; } npc.soundDelay = (int)num54; - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, npc.position); } num52 = (float)Math.Sqrt((double)(num39 * num39 + num40 * num40)); @@ -6481,7 +6482,7 @@ namespace CalamityMod.NPCs if (Main.rand.Next(40) == 0) { - SoundEngine.PlaySound(SoundID.Pixie, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.Pixie, npc.position); } } else if (npc.type == NPCID.IceElemental) @@ -9664,12 +9665,12 @@ namespace CalamityMod.NPCs // Play the portal opening sound at the moment of the portal's creation. if (fadeInTimer == 0f) { - SoundEngine.PlayTrackedSound(SoundID.DD2_EtherianPortalOpen, npc.Center); + SoundEngine.PlaySound(SoundID.DD2_EtherianPortalOpen, npc.Center); idlePlaySoundId = SlotId.Invalid.ToFloat(); } if (fadeInTimer > 150f && SoundEngine.GetActiveSound(SlotId.FromFloat(idlePlaySoundId)) == null) - idlePlaySoundId = SoundEngine.PlayTrackedSound(SoundID.DD2_EtherianPortalIdleLoop, npc.Center).ToFloat(); + idlePlaySoundId = SoundEngine.PlaySound(SoundID.DD2_EtherianPortalIdleLoop, npc.Center).ToFloat(); if (!DD2Event.EnemySpawningIsOnHold) enemySpawnTimer++; @@ -9711,7 +9712,7 @@ namespace CalamityMod.NPCs // Reset the idle play sound if it didn't get activated before for some reason. if (SoundEngine.GetActiveSound(SlotId.FromFloat(idlePlaySoundId)) == null) - idlePlaySoundId = SoundEngine.PlayTrackedSound(SoundID.DD2_EtherianPortalIdleLoop, npc.Center).ToFloat(); + idlePlaySoundId = SoundEngine.PlaySound(SoundID.DD2_EtherianPortalIdleLoop, npc.Center).ToFloat(); ActiveSound activeSound = SoundEngine.GetActiveSound(SlotId.FromFloat(idlePlaySoundId)); if (activeSound != null) diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index 9f360738e5..f3c469e781 100644 --- a/NPCs/CalamityGlobalNPC.cs +++ b/NPCs/CalamityGlobalNPC.cs @@ -594,7 +594,7 @@ namespace CalamityMod.NPCs } Item heldItem = Main.player[owner].ActiveItem(); - int totalDamage = (int)(150 * Main.player[owner].GetDamage(DamageClass.Summon).Base); + int totalDamage = (int)(150 * Main.player[owner].GetDamage().Base); bool forbidden = Main.player[owner].head == ArmorIDs.Head.AncientBattleArmor && Main.player[owner].body == ArmorIDs.Body.AncientBattleArmor && Main.player[owner].legs == ArmorIDs.Legs.AncientBattleArmor; bool reducedNerf = Main.player[owner].Calamity().fearmongerSet || (forbidden && heldItem.CountsAsClass()); diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index 17947bd342..ec62c5373d 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -23,6 +23,7 @@ using Terraria.Audio; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.NPCs.AcidRain; namespace CalamityMod.NPCs { @@ -1683,7 +1684,7 @@ namespace CalamityMod.NPCs { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/MaulerRoar"), + SoundEngine.PlaySound(Mauler.RoarSound), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); } diff --git a/NPCs/CeaselessVoid/CeaselessVoid.cs b/NPCs/CeaselessVoid/CeaselessVoid.cs index c8a75e69e7..3b347e189b 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -18,6 +18,7 @@ using Terraria.ModLoader; using System.IO; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.CeaselessVoid { @@ -266,7 +267,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.soundDelay == 0) { NPC.soundDelay = 8; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/OtherworldlyHit"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound, NPC.Center); } for (int k = 0; k < 5; k++) diff --git a/NPCs/Crabulon/CrabulonIdle.cs b/NPCs/Crabulon/CrabulonIdle.cs index 184cd83853..e09833fb85 100644 --- a/NPCs/Crabulon/CrabulonIdle.cs +++ b/NPCs/Crabulon/CrabulonIdle.cs @@ -217,7 +217,7 @@ namespace CalamityMod.NPCs.Crabulon } float num353 = 10f; int type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundID.Item42, (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(SoundID.Item42, NPC.position); if (phase2) { num353 += 1f; diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index fa0dbb06ec..2ac260182b 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -258,7 +258,7 @@ namespace CalamityMod.NPCs.DesertScourge num24 = 20f; } NPC.soundDelay = (int)num24; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.position.X, (int)NPC.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, NPC.position); } num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); float num25 = Math.Abs(num20); diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index 70deab877c..7c596f3622 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -32,6 +32,8 @@ namespace CalamityMod.NPCs.DesertScourge private bool TailSpawned = false; public bool playRoarSound = false; + public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/DesertScourgeRoar"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Desert Scourge"); @@ -329,7 +331,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().newAI[1] = 1f; if (!playRoarSound) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DesertScourgeRoar"), player.Center); + SoundEngine.PlaySound(RoarSound, player.Center); playRoarSound = true; } } @@ -417,7 +419,7 @@ namespace CalamityMod.NPCs.DesertScourge num24 = 20f; } NPC.soundDelay = (int)num24; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.position.X, (int)NPC.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, NPC.position); } num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); float num25 = Math.Abs(num20); diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 011c901342..e2707dc4ca 100644 --- a/NPCs/DevourerofGods/DevourerofGodsHead.cs +++ b/NPCs/DevourerofGods/DevourerofGodsHead.cs @@ -17,9 +17,11 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +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; @@ -135,6 +137,10 @@ namespace CalamityMod.NPCs.DevourerofGods public int DeathAnimationTimer; public int DestroyedSegmentCount; + //Sounds + public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/DevourerSpawn"); + public static readonly SoundStyle AttackSound = new("CalamityMod/Sounds/Custom/DevourerAttack"); + public override void SetStaticDefaults() { DisplayName.SetDefault("The Devourer of Gods"); @@ -648,7 +654,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Summon Cosmic Guardians if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DevourerAttack"), (int)player.position.X, (int)player.position.Y); + SoundEngine.PlaySound(AttackSound, player.position); for (int i = 0; i < 3; i++) NPC.SpawnOnPlayer(NPC.FindClosestPlayer(), ModContent.NPCType()); @@ -1365,7 +1371,7 @@ namespace CalamityMod.NPCs.DevourerofGods spawnDoGCountdown--; if (spawnDoGCountdown == 0 && Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DevourerAttack"), player.position); + SoundEngine.PlaySound(AttackSound, player.position); for (int i = 0; i < 2; i++) NPC.SpawnOnPlayer(NPC.FindClosestPlayer(), ModContent.NPCType()); @@ -1387,7 +1393,7 @@ namespace CalamityMod.NPCs.DevourerofGods spawnDoGCountdown--; if (spawnDoGCountdown == 0 && Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DevourerAttack"), (int)player.position.X, (int)player.position.Y); + SoundEngine.PlaySound(AttackSound, player.position); NPC.SpawnOnPlayer(NPC.FindClosestPlayer(), ModContent.NPCType()); } @@ -2122,7 +2128,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DevourerAttack"), player.Center); + SoundEngine.PlaySound(AttackSound, player.Center); } public void DoDeathAnimation() @@ -2130,8 +2136,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Play a sound at the start. if (DeathAnimationTimer == 1f) { - var soundInstance = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DevourerAttack"), NPC.Center); - CalamityUtils.SafeVolumeChange(ref soundInstance, 1.6f); + SoundEngine.PlaySound(AttackSound with { Volume = AttackSound.Volume * 1.6f}, NPC.Center); } // Close the health bar, fade in, and stop doing contact damage. @@ -2197,17 +2202,11 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.Server) { - var soundInstance = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DevourerAttack"), NPC.Center); - CalamityUtils.SafeVolumeChange(ref soundInstance, 1.6f); + SoundEngine.PlaySound(AttackSound with { Volume = AttackSound.Volume * 1.6f}, NPC.Center); for (int i = 0; i < 3; i++) { - soundInstance = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/TeslaCannonFire"), NPC.Center); - if (soundInstance != null) - { - soundInstance.Pitch = -MathHelper.Lerp(0.1f, 0.4f, i / 3f); - CalamityUtils.SafeVolumeChange(ref soundInstance, 1.4f); - } + SoundEngine.PlaySound(TeslaCannon.FireSound with { Volume = TeslaCannon.FireSound.Volume * 1.4f, Pitch = TeslaCannon.FireSound.Pitch -MathHelper.Lerp(0.1f, 0.4f, i / 3f) }, NPC.Center); } } } @@ -2450,7 +2449,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.soundDelay == 0) { NPC.soundDelay = 8; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/OtherworldlyHit"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound, NPC.Center); } if (NPC.life <= 0) { diff --git a/NPCs/DevourerofGods/DevourerofGodsTail.cs b/NPCs/DevourerofGods/DevourerofGodsTail.cs index ff79ba83a7..d007584ca4 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -12,6 +12,7 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.DevourerofGods { @@ -366,7 +367,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.soundDelay == 0) { NPC.soundDelay = 8; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/OtherworldlyHit"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound, NPC.Center); } if (NPC.life <= 0) { diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index 647111fb3b..e527cd2e00 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -18,6 +18,8 @@ using Terraria.Graphics.Shaders; using System.Collections.Generic; using CalamityMod.Skies; using Terraria.Audio; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Apollo { @@ -1003,7 +1005,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaCasterFire"), NPC.Center); + SoundEngine.PlaySound(PlasmaCaster.FireSound, NPC.Center); Vector2 plasmaVelocity = Vector2.Normalize(aimedVector) * projectileVelocity; Vector2 offset = Vector2.Normalize(plasmaVelocity) * 70f; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); @@ -1129,7 +1131,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo } // Play a charge sound - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); } } } @@ -1157,7 +1159,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Set charge velocity and fire halos of plasma bolts if (NPC.localAI[2] == 0f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/ELRFire"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, NPC.Center); NPC.velocity = Vector2.Normalize(chargeLocations[(int)calamityGlobalNPC.newAI[2] + 1] - chargeLocations[(int)calamityGlobalNPC.newAI[2]]) * chargeVelocity; NPC.localAI[2] = 1f; NPC.netUpdate = true; @@ -1286,7 +1288,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Shoot lens gore at the target at the proper time if (calamityGlobalNPC.newAI[2] == lensPopTime) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LargeWeaponFireSound, NPC.Center); Vector2 lensDirection = Vector2.Normalize(aimedVector); Vector2 offset = lensDirection * 70f; diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 473c4b3e1b..b973fd7ac3 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -10,6 +10,7 @@ using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.DraedonsArsenal; using CalamityMod.NPCs.ExoMechs.Thanatos; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; @@ -28,6 +29,7 @@ using Terraria.ModLoader; using Terraria.Audio; using CalamityMod.NPCs.ExoMechs.Apollo; using Terraria.GameContent.ItemDropRules; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -134,6 +136,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public PrimitiveTrail LightningDrawer; public PrimitiveTrail LightningBackgroundDrawer; + public static readonly SoundStyle EnragedSound = new("CalamityMod/Sounds/Custom/AresEnraged"); + public override void SetStaticDefaults() { DisplayName.SetDefault("XF-09 Ares"); @@ -723,8 +727,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares // Play enrage sound if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AresEnraged"), - (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + SoundEngine.PlaySound(EnragedSound, Main.player[Main.myPlayer].position); } // Draedon comments on how foolish it is to run @@ -798,7 +801,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); int type = ModContent.ProjectileType(); Vector2 spawnPoint = NPC.Center + new Vector2(-1f, 23f); for (int k = 0; k < totalProjectiles; k++) @@ -816,7 +819,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/TeslaCannonFire"), NPC.Center); + SoundEngine.PlaySound(TeslaCannon.FireSound, NPC.Center); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); Vector2 spawnPoint = NPC.Center + new Vector2(-1f, 23f); diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 7fa4083226..fc9e223680 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -13,6 +13,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -402,7 +403,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LargeWeaponFireSound, NPC.Center); Vector2 gaussNukeVelocity = Vector2.Normalize(rotationVector) * projectileVelocity; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 7bff22eac5..112c2ea740 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -13,6 +13,8 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; +using CalamityMod.Items.Tools; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -397,7 +399,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { // 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) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/CrystylCharge"), NPC.Center); + SoundEngine.PlaySound(CrystylCrusher.ChargeSound, NPC.Center); // Smooth movement towards the location Ares Laser Cannon is meant to be at CalamityUtils.SmoothMovement(NPC, movementDistanceGateValue, distanceFromDestination, baseVelocity, 0f, false); @@ -437,7 +439,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); Vector2 laserVelocity = Vector2.Normalize(player.Center - NPC.Center); Vector2 offset = laserVelocity * 70f + Vector2.UnitY * 16f; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, player.Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); @@ -471,7 +473,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares float offset = 84f; float offset2 = 16f; Vector2 source = horizontalLaserSweep ? new Vector2(NPC.Center.X - offset2 * NPC.direction, NPC.Center.Y + offset) : new Vector2(NPC.Center.X + offset * NPC.direction, NPC.Center.Y + offset2); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), source); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, source); Vector2 laserVelocity = Vector2.Normalize(lookAt - source); if (laserVelocity.HasNaNs()) laserVelocity = -Vector2.UnitY; diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index e44be99640..f1728d2a34 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -13,6 +13,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Items.Weapons.DraedonsArsenal; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -427,7 +428,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.ai[3] += 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaCasterFire"), NPC.Center); + SoundEngine.PlaySound(PlasmaCaster.FireSound, NPC.Center); Vector2 plasmaBoltVelocity = Vector2.Normalize(rotationVector) * projectileVelocity; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 890249ef0a..49b897e113 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -13,6 +13,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Ares { @@ -423,7 +424,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares { if (Main.netMode != NetmodeID.MultiplayerClient) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PlasmaBolt"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.PlasmaBoltSound, NPC.Center); Vector2 teslaOrbVelocity = Vector2.Normalize(rotationVector) * projectileVelocity; int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index be6b2ba190..9ebff0af7c 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -16,6 +16,7 @@ using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Artemis { @@ -714,7 +715,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); Vector2 laserVelocity = Vector2.Normalize(aimedVector); Vector2 projectileDestination = player.Center + predictionVector; Vector2 offset = laserVelocity * 70f; @@ -751,7 +752,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); Vector2 laserVelocity = Vector2.Normalize(aimedVector); Vector2 offset = laserVelocity * 50f; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); @@ -795,7 +796,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis else { // Charge until a certain distance is reached and then return to normal phase - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/ELRFire"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, NPC.Center); AIState = (float)Phase.Charge; // Set charge velocity @@ -849,7 +850,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis { int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); Vector2 laserVelocity = Vector2.Normalize(aimedVector) * 10f; /* Spread: @@ -932,7 +933,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); Vector2 laserVelocity = Vector2.Normalize(spinningPoint - NPC.Center); Vector2 offset = laserVelocity * 70f; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, laserVelocity, type, 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); @@ -1000,7 +1001,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - SoundEngine.PlaySound(29, (int)NPC.Center.X, (int)NPC.Center.Y, 104); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(104), NPC.Center); int damage = NPC.GetProjectileDamage(type); int laser = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); if (Main.projectile.IndexInRange(laser)) @@ -1090,7 +1091,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Shoot lens gore at the target at the proper time if (calamityGlobalNPC.newAI[2] == lensPopTime) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LargeWeaponFire"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LargeWeaponFireSound, NPC.Center); Vector2 lensDirection = Vector2.Normalize(aimedVector); Vector2 offset = lensDirection * 70f; diff --git a/NPCs/ExoMechs/Draedon.cs b/NPCs/ExoMechs/Draedon.cs index a0e26b1fb2..37686a3a12 100644 --- a/NPCs/ExoMechs/Draedon.cs +++ b/NPCs/ExoMechs/Draedon.cs @@ -10,6 +10,7 @@ using Terraria.GameContent; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; using ApolloBoss = CalamityMod.NPCs.ExoMechs.Apollo.Apollo; using ArtemisBoss = CalamityMod.NPCs.ExoMechs.Artemis.Artemis; @@ -66,6 +67,10 @@ namespace CalamityMod.NPCs.ExoMechs public const int ExoMechShakeTime = 100; public const int ExoMechPhaseDialogueTime = ExoMechChooseDelay + ExoMechShakeTime; public const int DelayBeforeDefeatStandup = 30; + + public static readonly SoundStyle LaughSound = new("CalamityMod/Sounds/Custom/DraedonLaugh"); + public static readonly SoundStyle TeleportSound = new("CalamityMod/Sounds/Custom/DraedonTeleport"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Draedon"); @@ -127,7 +132,7 @@ namespace CalamityMod.NPCs.ExoMechs if (TalkTimer == 0f) { NPC.TargetClosest(false); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DraedonTeleport"), PlayerToFollow.Center); + SoundEngine.PlaySound(TeleportSound, PlayerToFollow.Center); } // Pick someone else to pay attention to if the old target is gone. @@ -249,8 +254,7 @@ namespace CalamityMod.NPCs.ExoMechs if (Main.netMode != NetmodeID.Server) { - var sound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/FlareSound"), PlayerToFollow.Center); - CalamityUtils.SafeVolumeChange(ref sound, 1.55f); + SoundEngine.PlaySound(CommonCalamitySounds.FlareSound with { Volume = CommonCalamitySounds.FlareSound.Volume * 1.55f}, PlayerToFollow.Center); } } @@ -277,7 +281,7 @@ namespace CalamityMod.NPCs.ExoMechs if (TalkTimer == ExoMechPhaseDialogueTime) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DraedonLaugh"), PlayerToFollow.Center); + SoundEngine.PlaySound(LaughSound, PlayerToFollow.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonExoPhase2Text1", TextColor); @@ -303,7 +307,7 @@ namespace CalamityMod.NPCs.ExoMechs if (TalkTimer == ExoMechPhaseDialogueTime + DelayPerDialogLine) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DraedonLaugh"), PlayerToFollow.Center); + SoundEngine.PlaySound(LaughSound, PlayerToFollow.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonExoPhase3Text2", TextColor); @@ -361,7 +365,7 @@ namespace CalamityMod.NPCs.ExoMechs if (TalkTimer == ExoMechPhaseDialogueTime + DelayPerDialogLine * 2f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/DraedonLaugh"), PlayerToFollow.Center); + SoundEngine.PlaySound(LaughSound), PlayerToFollow.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.DraedonExoPhase6Text3", TextColor); diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index 7dc5b90b60..ecff3213ac 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -12,6 +12,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Thanatos { @@ -302,9 +303,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - SoundEffectInstance sound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); - if (sound != null) - sound.Volume *= 0.1f; + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = 0.1f * CommonCalamitySounds.LaserCannonSound.Volume}, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -374,7 +373,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { // Fire normal lasers if head is in passive state @@ -464,9 +463,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f; if (NPC.localAI[0] == 0f) { - SoundEffectInstance sound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ThanatosVent"), NPC.Center); - if (sound != null) - sound.Volume *= volume; + SoundEngine.PlaySound(ThanatosHead.VentSound with { Volume = volume * ThanatosHead.VentSound.Volume }, NPC.Center); } // Steam @@ -622,7 +619,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.soundDelay = 8; if (vulnerable) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/OtherworldlyHit"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound, NPC.Center); else SoundEngine.PlaySound(SoundID.NPCHit4, NPC.Center); } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 9aeb894dae..b3890a7da0 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -12,6 +12,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Thanatos { @@ -302,9 +303,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - SoundEffectInstance sound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); - if (sound != null) - sound.Volume *= 0.1f; + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = 0.1f * CommonCalamitySounds.LaserCannonSound.Volume }, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -374,7 +373,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { // Fire normal lasers if head is in passive state @@ -464,9 +463,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f; if (NPC.localAI[0] == 0f) { - SoundEffectInstance sound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ThanatosVent"), NPC.Center); - if (sound != null) - sound.Volume *= volume; + SoundEngine.PlaySound(ThanatosHead.VentSound with { Volume = volume * ThanatosHead.VentSound.Volume }, NPC.Center); } // Steam @@ -623,7 +620,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.soundDelay = 8; if (vulnerable) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/OtherworldlyHit"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound, NPC.Center); else SoundEngine.PlaySound(SoundID.NPCHit4, NPC.Center); } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index 657cd367fd..93b00df794 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -16,14 +16,20 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Skies; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Thanatos { public class ThanatosHead : ModNPC { + + public static int normalIconIndex; public static int vulnerableIconIndex; + public static readonly SoundStyle VentSound = new("CalamityMod/Sounds/Custom/ThanatosVent"); + public static readonly SoundStyle LaserSound = new("CalamityMod/Sounds/Custom/THanosLaser"); + internal static void LoadHeadIcons() { string normalIconPath = "CalamityMod/NPCs/ExoMechs/Thanatos/ThanatosNormalHead"; @@ -844,8 +850,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, NPC.Center) < soundDistance) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/THanosLaser"), - (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + SoundEngine.PlaySound(LaserSound, Main.player[Main.myPlayer].position); } // Create a bunch of lightning bolts in the sky @@ -928,7 +933,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos // Noise if (NPC.localAI[1] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ThanatosVent"), NPC.Center); + SoundEngine.PlaySound(VentSound, NPC.Center); // Steam NPC.localAI[1] += 1f; @@ -1201,7 +1206,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.soundDelay = 8; if (vulnerable) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/OtherworldlyHit"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound, NPC.Center); else SoundEngine.PlaySound(SoundID.NPCHit4, NPC.Center); } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index b2f8b93bb5..2f2b24f8b3 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -12,6 +12,7 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.ExoMechs.Thanatos { @@ -302,9 +303,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - SoundEffectInstance sound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); - if (sound != null) - sound.Volume *= 0.1f; + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = 0.1f * CommonCalamitySounds.LaserCannonSound.Volume }, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -374,7 +373,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/LaserCannon"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { // Fire normal lasers if head is in passive state @@ -464,9 +463,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float volume = calamityGlobalNPC_Head.newAI[0] == (float)ThanatosHead.Phase.Charge ? 0.1f : 1f; if (NPC.localAI[0] == 0f) { - SoundEffectInstance sound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ThanatosVent"), NPC.Center); - if (sound != null) - sound.Volume *= volume; + SoundEngine.PlaySound(ThanatosHead.VentSound with { Volume = volume * ThanatosHead.VentSound.Volume }, NPC.Center); } // Steam @@ -623,7 +620,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.soundDelay = 8; if (vulnerable) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/OtherworldlyHit"), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.OtherwordlyHitSound, NPC.Center); else SoundEngine.PlaySound(SoundID.NPCHit4, NPC.Center); } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 8c90df0afb..3f5a536ba9 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -11,6 +11,8 @@ using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.NPCs.GreatSandShark { [AutoloadBossHead] @@ -18,6 +20,8 @@ namespace CalamityMod.NPCs.GreatSandShark { private bool resetAI = false; + public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/GreatSandSharkRoar"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Great Sand Shark"); @@ -90,7 +94,7 @@ namespace CalamityMod.NPCs.GreatSandShark if (NPC.soundDelay <= 0) { NPC.soundDelay = 480; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/GreatSandSharkRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); } if (NPC.localAI[3] >= 1f || Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > 1000f) @@ -299,7 +303,7 @@ namespace CalamityMod.NPCs.GreatSandShark if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y + 50, NPCID.SandShark, 0, 0f, 0f, 0f, 0f, 255); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/GreatSandSharkRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position; } } diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index 6cdda4a785..7c0a818ef9 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -342,7 +342,7 @@ namespace CalamityMod.NPCs.HiveMind if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { state = 2; - SoundEngine.PlaySound(SoundID.ForceRoar, (int)NPC.Center.X, (int)NPC.Center.Y, -1, 1f, 0f); + SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); } else { @@ -353,9 +353,9 @@ namespace CalamityMod.NPCs.HiveMind nextState = 0; if (state == 2) - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.Center.X, (int)NPC.Center.Y, 0); + SoundEngine.PlaySound(SoundID.Roar, NPC.Center); else - SoundEngine.PlaySound(SoundID.ForceRoar, (int)NPC.Center.X, (int)NPC.Center.Y, -1, 1f, 0f); + SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); } } @@ -420,7 +420,7 @@ namespace CalamityMod.NPCs.HiveMind Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("HiveMindGore" + i).Type, 1f); } - SoundEngine.PlaySound(SoundID.NPCDeath1, (int)NPC.Center.X, (int)NPC.Center.Y); + SoundEngine.PlaySound(SoundID.NPCDeath1, NPC.Center); NPC.position = NPC.Center; NPC.height = height_Phase2; @@ -827,7 +827,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.velocity.Normalize(); NPC.velocity *= teleportRadius / (lungeTime - (int)enrageScale); dashStarted = true; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.Center.X, (int)NPC.Center.Y, 0); + SoundEngine.PlaySound(SoundID.Roar, NPC.Center); } else { @@ -867,7 +867,7 @@ namespace CalamityMod.NPCs.HiveMind if (!dashStarted) { dashStarted = true; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.Center.X, (int)NPC.Center.Y, 0); + SoundEngine.PlaySound(SoundID.Roar, NPC.Center); NPC.velocity.X = MathHelper.Pi * teleportRadius / arcTime; NPC.velocity *= rotationDirection; NPC.netUpdate = true; @@ -924,7 +924,7 @@ namespace CalamityMod.NPCs.HiveMind if (!dashStarted) { dashStarted = true; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.Center.X, (int)NPC.Center.Y, 0); + SoundEngine.PlaySound(SoundID.Roar, NPC.Center); NPC.velocity.X = teleportRadius / arcTime * 3; NPC.velocity *= -rotationDirection; NPC.netUpdate = true; diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 89b0d281ee..60696b451e 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 { @@ -37,6 +38,9 @@ namespace CalamityMod.NPCs.Leviathan private int soundDelay = 0; public static Texture2D AttackTexture = null; + public static readonly SoundStyle RoarMeteorSound = new("CalamityMod/Sounds/Custom/LeviathanRoarMeteor"); + public static readonly SoundStyle RoarChargeSound = new("CalamityMod/Sounds/Custom/LeviathanRoarCharge"); + public override void SetStaticDefaults() { DisplayName.SetDefault("The Leviathan"); @@ -145,7 +149,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(CommonCalamitySounds.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 +246,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(CommonCalamitySounds.GetZombieSound(soundChoiceRage), vector); NPC.Opacity = MathHelper.Clamp(calamityGlobalNPC.newAI[3] / spawnAnimationTime, 0f, 1f); @@ -394,7 +398,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(CommonCalamitySounds.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..e92abbbd9f 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(CommonCalamitySounds.GetZombieSound(35), NPC.position); // Time left if (NPC.timeLeft < 1800) @@ -490,7 +491,7 @@ namespace CalamityMod.NPCs.Leviathan if (Collision.CanHit(vector119, 1, 1, player.position, player.width, player.height) && flag103) { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 85); + SoundEngine.PlaySound(SoundID.Item85, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) { int spawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)vector119.X, (int)vector119.Y, NPCID.DetonatingBubble); diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 96f120adbc..74a3fa9edd 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -244,7 +244,7 @@ namespace CalamityMod.NPCs.NormalNPCs num24 = 20f; } NPC.soundDelay = (int)num24; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.position.X, (int)NPC.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, NPC.position); } num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); float num25 = Math.Abs(num20); diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 68803c0265..28f3dc50fa 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -18,6 +18,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public bool hasBeenHit = false; + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/EidolistDeath"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Eidolist"); @@ -45,7 +47,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.noGravity = true; NPC.noTileCollide = false; NPC.HitSound = SoundID.NPCHit13; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/EidolistDeath"); + NPC.DeathSound = DeathSound; NPC.timeLeft = NPC.activeTime * 2; Banner = NPC.type; BannerItem = ModContent.ItemType(); diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index 30bbe875ad..b4721f2ea4 100644 --- a/NPCs/NormalNPCs/Rimehound.cs +++ b/NPCs/NormalNPCs/Rimehound.cs @@ -12,6 +12,9 @@ namespace CalamityMod.NPCs.NormalNPCs { private bool reset = false; + public static readonly SoundStyle GrowlSound = new("CalamityMod/Sounds/Custom/RimehoundGrowl"); + public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/RimehoundHit"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Rimehound"); @@ -43,7 +46,7 @@ namespace CalamityMod.NPCs.NormalNPCs AnimationType = NPCID.Hellhound; AIType = -1; NPC.value = Item.buyPrice(0, 0, 3, 0); - NPC.HitSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/RimehoundHit"); + NPC.HitSound = HitSound; NPC.DeathSound = SoundID.NPCDeath5; Banner = NPC.type; BannerItem = ModContent.ItemType(); @@ -67,7 +70,7 @@ namespace CalamityMod.NPCs.NormalNPCs { if (Main.rand.NextBool(900)) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/RimehoundGrowl"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(GrowlSound, NPC.position); } bool phase2 = (double)NPC.life <= (double)NPC.lifeMax * (CalamityWorld.death ? 0.9 : 0.5); if (phase2) diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 2249b22849..490c169c2b 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -13,6 +13,11 @@ namespace CalamityMod.NPCs.NormalNPCs { public class ScornEater : ModNPC { + + public static readonly SoundStyle JumpSound = new("CalamityMod/Sounds/Custom/ScornJump"); + public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/NPCHit/ScornHit"); + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/ScornDeath"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Scorn Eater"); @@ -34,7 +39,7 @@ namespace CalamityMod.NPCs.NormalNPCs AIType = -1; NPC.lavaImmune = true; NPC.value = Item.buyPrice(0, 0, 50, 0); - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/ScornDeath"); + NPC.DeathSound = DeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; @@ -100,7 +105,7 @@ namespace CalamityMod.NPCs.NormalNPCs else NPC.velocity.Y = 12f; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ScornJump"), (int)NPC.Center.X, (int)NPC.Center.Y); + SoundEngine.PlaySound(JumpSound, NPC.Center); } NPC.netUpdate = true; } @@ -174,7 +179,7 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.soundDelay == 0) { NPC.soundDelay = 7; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/ScornHurt"), NPC.Center); + SoundEngine.PlaySound(HitSound, NPC.Center); } for (int k = 0; k < 5; k++) { diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index 61716b97b5..de7e80ed86 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -12,6 +12,8 @@ namespace CalamityMod.NPCs.NormalNPCs { public class Sunskater : ModNPC { + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/Sunskater") { Volume = 0.9f}; + private bool hasBeenHit = false; public override void SetStaticDefaults() @@ -33,7 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs AIType = -1; NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.HitSound = SoundID.NPCHit50; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/Sunskater"); + NPC.DeathSound = DeathSound; NPC.knockBackResist = 0.7f; Banner = NPC.type; BannerItem = ModContent.ItemType(); diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 66a87a3817..14affa6528 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -29,6 +29,10 @@ namespace CalamityMod.NPCs.OldDuke [AutoloadBossHead] public class OldDuke : ModNPC { + public static readonly SoundStyle HuffSound = new("CalamityMod/Sounds/Custom/OldDukeHuff"); + public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/OldDukeRoar"); + public static readonly SoundStyle VomitSound = new("CalamityMod/Sounds/Custom/OldDukeVomit"); + public override void SetStaticDefaults() { DisplayName.SetDefault("The Old Duke"); diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 97694a5f59..09d3191598 100644 --- a/NPCs/Perforator/PerforatorHeadLarge.cs +++ b/NPCs/Perforator/PerforatorHeadLarge.cs @@ -372,7 +372,7 @@ namespace CalamityMod.NPCs.Perforator num24 = 20f; } NPC.soundDelay = (int)num24; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.position.X, (int)NPC.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, NPC.position); } num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); float num25 = Math.Abs(num20); diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index cf2b8239a0..b5c5cf746e 100644 --- a/NPCs/Perforator/PerforatorHeadMedium.cs +++ b/NPCs/Perforator/PerforatorHeadMedium.cs @@ -283,7 +283,7 @@ namespace CalamityMod.NPCs.Perforator num54 = 20f; NPC.soundDelay = (int)num54; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.position.X, (int)NPC.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, NPC.position); } num52 = (float)Math.Sqrt(num39 * num39 + num40 * num40); diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index 05aa0a7197..c623400c4b 100644 --- a/NPCs/Perforator/PerforatorHeadSmall.cs +++ b/NPCs/Perforator/PerforatorHeadSmall.cs @@ -314,7 +314,7 @@ namespace CalamityMod.NPCs.Perforator num24 = 20f; } NPC.soundDelay = (int)num24; - SoundEngine.PlaySound(SoundID.Roar, (int)NPC.position.X, (int)NPC.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, NPC.position); } num22 = (float)Math.Sqrt((double)(num20 * num20 + num21 * num21)); float num25 = Math.Abs(num20); diff --git a/NPCs/PlagueEnemies/PlagueBee.cs b/NPCs/PlagueEnemies/PlagueBee.cs index 4dd04dc2fd..9c72ae9955 100644 --- a/NPCs/PlagueEnemies/PlagueBee.cs +++ b/NPCs/PlagueEnemies/PlagueBee.cs @@ -11,6 +11,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.PlagueEnemies { @@ -127,7 +128,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } if (NPC.life <= 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 10; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/PlagueEnemies/PlagueBeeLarge.cs b/NPCs/PlagueEnemies/PlagueBeeLarge.cs index b9c48e04c7..895136509a 100644 --- a/NPCs/PlagueEnemies/PlagueBeeLarge.cs +++ b/NPCs/PlagueEnemies/PlagueBeeLarge.cs @@ -11,6 +11,7 @@ using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.PlagueEnemies { @@ -127,7 +128,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } if (NPC.life <= 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 10; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/PlagueEnemies/PlaguedDerpling.cs b/NPCs/PlagueEnemies/PlaguedDerpling.cs index 4d48519be1..7d4c23e183 100644 --- a/NPCs/PlagueEnemies/PlaguedDerpling.cs +++ b/NPCs/PlagueEnemies/PlaguedDerpling.cs @@ -10,6 +10,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.PlagueEnemies { @@ -174,7 +175,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } if (NPC.life <= 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/PlagueEnemies/PlaguedFlyingFox.cs b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs index 5ddca75c38..e717f97e6a 100644 --- a/NPCs/PlagueEnemies/PlaguedFlyingFox.cs +++ b/NPCs/PlagueEnemies/PlaguedFlyingFox.cs @@ -7,6 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.PlagueEnemies { @@ -61,7 +62,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } if (NPC.life <= 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs index 4f190c9a10..f3ef90be2a 100644 --- a/NPCs/PlagueEnemies/PlaguedJungleSlime.cs +++ b/NPCs/PlagueEnemies/PlaguedJungleSlime.cs @@ -11,6 +11,7 @@ using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.PlagueEnemies { @@ -119,7 +120,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } if (NPC.life <= 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/PlagueEnemies/PlaguedTortoise.cs b/NPCs/PlagueEnemies/PlaguedTortoise.cs index 22a28a2cb4..c758a372fa 100644 --- a/NPCs/PlagueEnemies/PlaguedTortoise.cs +++ b/NPCs/PlagueEnemies/PlaguedTortoise.cs @@ -7,6 +7,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.PlagueEnemies { @@ -47,7 +48,7 @@ namespace CalamityMod.NPCs.PlagueEnemies } if (NPC.life <= 0) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PlagueBoom" + Main.rand.Next(1, 5)), NPC.Center); + SoundEngine.PlaySound(CommonCalamitySounds.PlagueBoomSound, NPC.Center); for (int k = 0; k < 20; k++) { Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Plague, hitDirection, -1f, 0, default, 1f); diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index d5a8ebfe4e..0a98e0b274 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -45,6 +45,11 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath private bool flyingFrame2 = false; private int curTex = 1; + public static readonly SoundStyle NukeWarningSound = new("CalamityMod/Sounds/Custom/PlagueSounds/PBGNukeWarning"); + public static readonly SoundStyle AttackSwitchSound = new("CalamityMod/Sounds/Custom/PlagueSounds/PBGAttackSwitch", 2); + public static readonly SoundStyle DashSound = new("CalamityMod/Sounds/Custom/PlagueSounds/PBGDash"); + public static readonly SoundStyle BarrageLaunchSound = new("CalamityMod/Sounds/Custom/PlagueSounds/PBGBarrageLaunch"); + public override void SetStaticDefaults() { DisplayName.SetDefault("The Plaguebringer Goliath"); @@ -166,7 +171,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath string key = "Mods.CalamityMod.PlagueBossText"; Color messageColor = Color.Lime; CalamityUtils.DisplayLocalizedText(key, messageColor); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGNukeWarning"), NPC.Center); + SoundEngine.PlaySound(NukeWarningSound, NPC.Center); halfLife = true; } @@ -316,7 +321,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.netSpam >= 10) NPC.netSpam = 9; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), NPC.Center); + SoundEngine.PlaySound(AttackSwitchSound, NPC.Center); } } @@ -348,7 +353,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.netSpam >= 10) NPC.netSpam = 9; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), NPC.Center); + SoundEngine.PlaySound(AttackSwitchSound, NPC.Center); return; } @@ -405,7 +410,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.netUpdate = true; NPC.netSpam -= 5; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PBGDash"), NPC.Center); + SoundEngine.PlaySound(DashSound, NPC.Center); return; } @@ -562,7 +567,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.netSpam >= 10) NPC.netSpam = 9; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), NPC.Center); + SoundEngine.PlaySound(AttackSwitchSound, NPC.Center); return; } @@ -596,7 +601,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (flag103) { - SoundEngine.PlaySound(SoundID.NPCHit, (int)NPC.position.X, (int)NPC.position.Y, 8); + SoundEngine.PlaySound(SoundID.NPCHit8, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -642,7 +647,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.netSpam >= 10) NPC.netSpam = 9; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), NPC.Center); + SoundEngine.PlaySound(AttackSwitchSound, NPC.Center); } } @@ -676,7 +681,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (flag103) { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 88); + SoundEngine.PlaySound(SoundID.Item88,NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -724,7 +729,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.netSpam >= 10) NPC.netSpam = 9; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), NPC.Center); + SoundEngine.PlaySound(AttackSwitchSound, NPC.Center); } } @@ -740,7 +745,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.ai[1] % num650 == (num650 - 1) && vectorCenter.Y < player.position.Y) { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 42); + SoundEngine.PlaySound(SoundID.Item42, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -798,7 +803,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (NPC.netSpam >= 10) NPC.netSpam = 9; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), NPC.Center); + SoundEngine.PlaySound(AttackSwitchSound, NPC.Center); } } @@ -822,7 +827,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // A phase switch sync is a critical operation that must be synced. if (NPC.netSpam >= 10) NPC.netSpam = 9; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, $"Sounds/Custom/PlagueSounds/PBGAttackSwitch{Main.rand.Next(1, 3)}"), NPC.Center); + SoundEngine.PlaySound(AttackSwitchSound, NPC.Center); return; } @@ -838,7 +843,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { if (MissileCountdown == 1) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/PlagueSounds/PBGBarrageLaunch"), NPC.Center); + SoundEngine.PlaySound(BarrageLaunchSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 0d0402a647..26f6a8f129 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -25,6 +25,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; +using CalamityMod.NPCs.Abyss; namespace CalamityMod.NPCs.Polterghast { @@ -975,7 +976,7 @@ namespace CalamityMod.NPCs.Polterghast if (!DownedBossSystem.downedPolterghast) { if (!Main.player[Main.myPlayer].dead && Main.player[Main.myPlayer].active) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ReaperSearchRoar"), (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + SoundEngine.PlaySound(Reaper.SearchRoarSound, Main.player[Main.myPlayer].position); string key = "Mods.CalamityMod.GhostBossText"; Color messageColor = Color.RoyalBlue; diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 0bf7bd79b1..582080b40b 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -75,6 +75,13 @@ namespace CalamityMod.NPCs.Providence public bool Dying = false; public int DeathAnimationTimer; + //Sounds + public static readonly SoundStyle SpawnSound = new("CalamityMod/Sounds/Custom/ProvidenceSpawn") { Volume = 1.2f }; + public static readonly SoundStyle HolyRaySound = new("CalamityMod/Sounds/Custom/ProvidenceHolyRay") { Volume = 1.25f }; //note : Volume gets clamped between 0 and 1. I don't think this does anything, but it was in the original ModSound so im keeping it just in case + public static readonly SoundStyle HurtSound = new("CalamityMod/Sounds/NPCHit/ProvidenceHurt"); + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/ProvidenceDeath"); + public static readonly SoundStyle DeathAnimationSound = new("CalamityMod/Sounds/Custom/ProvidenceDeathAnimation"); + public static float normalDR = 0.3f; public static float cocoonDR = 0.9f; @@ -114,7 +121,7 @@ namespace CalamityMod.NPCs.Providence NPC.noTileCollide = true; NPC.netAlways = true; Music = CalamityMod.Instance.GetMusicFromMusicMod("Providence") ?? MusicID.LunarBoss; - NPC.DeathSound = SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/ProvidenceDeath"); + NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; @@ -469,7 +476,7 @@ namespace CalamityMod.NPCs.Providence if ((NPC.life + num660) < bossLife) { bossLife = NPC.life; - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 74); + SoundEngine.PlaySound(SoundID.Item74, NPC.position); int guardianRingAmt = 3; int guardianSpread = 360 / guardianRingAmt; int guardianDistance = 400; @@ -736,7 +743,7 @@ namespace CalamityMod.NPCs.Providence Projectile.NewProjectile(NPC.GetSource_FromAI(), vector + new Vector2(0f, -80f), Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, biomeType, 0f); if (calamityGlobalNPC.newAI[3] == 10f && nightTime) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceHolyRay"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(HolyRaySound, NPC.position); if (calamityGlobalNPC.newAI[3] > 10f && calamityGlobalNPC.newAI[3] < 150f) { @@ -1178,7 +1185,7 @@ namespace CalamityMod.NPCs.Providence { NPC.ai[2] = 0f; - SoundEngine.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, fireFrom); + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, fireFrom); int projectileType = ModContent.ProjectileType(); @@ -1279,8 +1286,7 @@ namespace CalamityMod.NPCs.Providence { if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, vector) < 2800f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceHolyRay"), - (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y); + SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.position); } if (Main.netMode != NetmodeID.MultiplayerClient) @@ -1340,7 +1346,7 @@ namespace CalamityMod.NPCs.Providence if (DeathAnimationTimer == 1f) { if (Main.netMode != NetmodeID.Server && Main.LocalPlayer.WithinRange(NPC.Center, 4800f)) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceDeathAnimation").WithVolume(1.65f), Main.LocalPlayer.Center); + SoundEngine.PlaySound(DeathAnimationSound with { Volume = 1.65f }, Main.LocalPlayer.Center); DespawnSpecificProjectiles(); @@ -1362,8 +1368,8 @@ namespace CalamityMod.NPCs.Providence // above defeat scene sound. if (DeathAnimationTimer == 92f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceHolyBlastImpact"), NPC.Center); - SoundEngine.PlaySound(NPC.DeathSound, NPC.Center); + SoundEngine.PlaySound(HolyBlast.ImpactSound, NPC.Center); + SoundEngine.PlaySound(DeathSound, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f); } @@ -1946,7 +1952,7 @@ namespace CalamityMod.NPCs.Providence if (NPC.soundDelay == 0 && !Dying) { NPC.soundDelay = 8; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCHit/ProvidenceHurt"), NPC.Center); + SoundEngine.PlaySound(HurtSound, NPC.Center); } int dustType = Main.dayTime ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index d01c48a1be..150d61059e 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -425,7 +425,7 @@ namespace CalamityMod.NPCs.Ravager { if (NPC.velocity.Y == 0f && (NPC.ai[1] == 31f || NPC.ai[0] == 1f)) { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 14, 1.25f, -0.25f); + SoundEngine.PlaySound(SoundID.Item14 with { Volume = SoundID.Item14.Volume * 1.25f, Pitch = SoundID.Item14.Pitch - 0.25f }, NPC.position); NPC.ai[0] = 0f; NPC.ai[1] = 0f; diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index 087ac1a51b..7bf2b8ef99 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -339,7 +339,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 122); + SoundEngine.PlaySound(SoundID.Item122, NPC.position); int num660 = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.position.X + 750f), (int)player.position.Y, ModContent.NPCType()); if (Main.netMode == NetmodeID.Server) diff --git a/NPCs/Signus/SignusBomb.cs b/NPCs/Signus/SignusBomb.cs index b8a8908c0e..5f2f97c492 100644 --- a/NPCs/Signus/SignusBomb.cs +++ b/NPCs/Signus/SignusBomb.cs @@ -201,7 +201,7 @@ namespace CalamityMod.NPCs.Signus public override bool CheckDead() { - SoundEngine.PlaySound(SoundID.Item, (int)NPC.position.X, (int)NPC.position.Y, 14); + SoundEngine.PlaySound(SoundID.Item14, NPC.position); NPC.position.X = NPC.position.X + (NPC.width / 2); NPC.position.Y = NPC.position.Y + (NPC.height / 2); NPC.damage = NPC.defDamage; diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index 06cabbea44..325aa3b446 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -34,6 +34,9 @@ namespace CalamityMod.NPCs.SlimeGod private bool slimesSpawned = false; private int buffedSlime = 0; + public static readonly SoundStyle PossessionSound = new("CalamityMod/Sounds/Custom/SlimeGodPossession"); + public static readonly SoundStyle ExitSound = new("CalamityMod/Sounds/Custom/SlimeGodExit"); + public override void SetStaticDefaults() { DisplayName.SetDefault("The Slime God"); @@ -236,7 +239,7 @@ namespace CalamityMod.NPCs.SlimeGod { calamityGlobalNPC.newAI[2] = NPC.life; calamityGlobalNPC.newAI[3] = 1f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SlimeGodPossession"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(PossessionSound, NPC.position); } } @@ -289,7 +292,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.ai[2] = 0f; calamityGlobalNPC.newAI[3] = 0f; NPC.velocity = Vector2.UnitY * -12f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SlimeGodExit"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ExitSound, NPC.position); for (int i = 0; i < 20; i++) { int dust = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y), NPC.width, NPC.height, 4, 0f, 0f, 100, default, 2f); diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index f4e832640b..33b613ce9c 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -21,6 +21,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent.ItemDropRules; +using CalamityMod.Sounds; namespace CalamityMod.NPCs.StormWeaver { @@ -180,7 +181,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.Server) Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, NPC.velocity, Mod.Find("SWArmorHead1").Type, NPC.scale); - SoundEngine.PlaySound(SoundID.NPCDeath14, (int)NPC.Center.X, (int)NPC.Center.Y); + SoundEngine.PlaySound(SoundID.NPCDeath14, NPC.Center); CalamityGlobalNPC global = NPC.Calamity(); NPC.defense = 15; @@ -606,7 +607,7 @@ namespace CalamityMod.NPCs.StormWeaver { soundCenter = Main.player[Main.myPlayer].Center; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/LightningStrike"), (int)soundCenter.X, (int)soundCenter.Y); + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, soundCenter); if (Main.netMode != NetmodeID.Server) { @@ -619,7 +620,7 @@ namespace CalamityMod.NPCs.StormWeaver } } else - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/LightningStrike"), (int)soundCenter.X, (int)soundCenter.Y); + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, soundCenter); NPC.localAI[1] = 2f; diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index f2ec72ae22..63a8f133a8 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -27,6 +27,8 @@ namespace CalamityMod.NPCs.SunkenSea [AutoloadBossHead] public class GiantClam : ModNPC { + public static readonly SoundStyle SlamSound = new("CalamityMod/Sounds/Item/ClamImpact"); + private int hitAmount = 0; private int attack = -1; //-1 doing nothing, 0 = shell hiding, 1 = telestomp, 2 = pearl burst, 3 = pearl rain private bool attackAnim = false; @@ -254,7 +256,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.netUpdate = true; NPC.noGravity = false; attack = -1; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/ClamImpact"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(SlamSound, NPC.position); if (Main.netMode != NetmodeID.Server) { for (int stompDustArea = (int)NPC.position.X - 30; stompDustArea < (int)NPC.position.X + NPC.width + 60; stompDustArea += 30) diff --git a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs index 1ae1e7fe33..f3892cb977 100644 --- a/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs +++ b/NPCs/SupremeCalamitas/SCalWormBodyWeak.cs @@ -119,7 +119,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } NPC.netUpdate = true; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneShoot"), NPC.Center); + SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); } if (Main.npc.IndexInRange((int)NPC.ai[1])) diff --git a/NPCs/SupremeCalamitas/SCalWormHead.cs b/NPCs/SupremeCalamitas/SCalWormHead.cs index 68cbcb7b12..9c55661b21 100644 --- a/NPCs/SupremeCalamitas/SCalWormHead.cs +++ b/NPCs/SupremeCalamitas/SCalWormHead.cs @@ -14,6 +14,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas { public class SCalWormHead : ModNPC { + public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/SepulcherDeath"); + private const int minLength = 51; private const int maxLength = 52; private float passedVar = 0f; @@ -148,7 +150,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.player[NPC.target].dead || !NPC.AnyNPCs(ModContent.NPCType()) || CalamityGlobalNPC.SCal < 0 || !Main.npc[CalamityGlobalNPC.SCal].active) { NPC.TargetClosest(false); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/SepulcherDeath"), Main.player[NPC.target].Center); + SoundEngine.PlaySound(DeathSound, Main.player[NPC.target].Center); NPC.life = 0; NPC.HitEffect(); NPC.active = false; diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index 7cac994170..f539cf5797 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -127,7 +127,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (seeker.type == NPC.type) { if (seeker == NPC) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneShoot"), SCal.Center); + SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, SCal.Center); break; } } diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index 5f9cdb78a8..99325c3e3d 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("CalamityMod/Sounds/Custom/SupremeCalamitasSpawn") { Volume = 1.2f }; + public static readonly SoundStyle SepulcherSummonSound = new("CalamityMod/Sounds/Custom/SCalSounds/SepulcherSpawn"); + public static readonly SoundStyle BrimstoneShotSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneShoot"); + public static readonly SoundStyle BrimstoneBigShotSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneBigShoot"); //DON'T YOU WANNA BE A [BIG SHOT] + public static readonly SoundStyle DashSound = new("CalamityMod/Sounds/Custom/SCalSounds/SCalDash"); + public static readonly SoundStyle HellblastSound = new("CalamityMod/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/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index b8522de211..f0043331d4 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (PunchCounter >= PunchCounterLimit) { PunchCounter = 0f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneHellblastSound"), NPC.Center); + SoundEngine.PlaySound(SupremeCalamitas.HellblastSound, NPC.Center); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -210,7 +210,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (DartBurstCounter >= DartBurstCounterLimit) { DartBurstCounter = 0f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneShoot"), NPC.Center); + SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); // TODO -- Consider changing this to use RotatedBy or ToRotationVector2. float speed = 7f; diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index c6513cdf0f..0ab0c0e069 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (SlashCounter >= SlashCounterLimit) { SlashCounter = 0f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneShoot"), NPC.Center); + SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); int type = ModContent.ProjectileType(); int damage = NPC.GetProjectileDamage(type); @@ -214,7 +214,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (DartBurstCounter >= DartBurstCounterLimit) { DartBurstCounter = 0f; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/SCalSounds/BrimstoneShoot"), NPC.Center); + SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); // TODO -- Consider changing this to use RotatedBy or ToRotationVector2. float speed = 7f; diff --git a/NPCs/TownNPCs/THIEF.cs b/NPCs/TownNPCs/THIEF.cs index ddbb7d2039..81e585dd2c 100644 --- a/NPCs/TownNPCs/THIEF.cs +++ b/NPCs/TownNPCs/THIEF.cs @@ -206,7 +206,7 @@ namespace CalamityMod.NPCs.TownNPCs CalamityWorld.MoneyStolenByBandit = 0; NPC goblinFucker = Main.npc[goblinIndex]; - SoundEngine.PlaySound(SoundID.Coins, -1, -1, 1, 1f, 0f); // Money dink sound + SoundEngine.PlaySound(SoundID.Coins); // Money dink sound switch (Main.rand.Next(2)) { case 0: diff --git a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs index 8b9e3de689..045b48e6bc 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/BrainOfCthulhuAI.cs @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Spawn gore if (npc.localAI[2] == 0f) { - SoundEngine.PlaySound(SoundID.NPCHit, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCHit1, npc.position); npc.localAI[2] = 1f; @@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses for (int num794 = 0; num794 < 20; num794++) Dust.NewDust(npc.position, npc.width, npc.height, 5, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); } // Percent life remaining @@ -164,7 +164,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.ai[1] == 10f) { // Sound - SoundEngine.PlaySound(SoundID.ForceRoar, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); + SoundEngine.PlaySound(SoundID.ForceRoar, npc.position); // Velocity npc.velocity = Vector2.Normalize(Main.player[npc.target].Center + (malice ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center) * ((death ? 20f : 16f) + 4f * enrageScale); @@ -209,7 +209,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses { // Charge sound if (npc.ai[2] == 0f) - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); // Velocity int var = 120; diff --git a/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCOverrides/Bosses/CultistAI.cs index 1fd896eb6e..4ce8dfc2eb 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(CommonCalamitySounds.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(CommonCalamitySounds.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(CommonCalamitySounds.GetZombieSound(105), npc.position); npc.localAI[2] = 13f; } diff --git a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs index 299b5a3d5b..00b9dfa2b2 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/DestroyerAI.cs @@ -467,7 +467,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num24 = 20f; npc.soundDelay = (int)num24; - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, npc.position); } num22 = (float)Math.Sqrt(num20 * num20 + num21 * num21); diff --git a/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/DukeFishronAI.cs index 298ece3932..253396e507 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(CommonCalamitySounds.GetZombieSound(20),npc.Center); } npc.ai[2] += 1f; @@ -445,11 +446,11 @@ 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(CommonCalamitySounds.GetZombieSound(20), npc.Center); if (npc.ai[2] % bubbleBelchPhaseDivisor == 0f) { - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCDeath19, npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -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(CommonCalamitySounds.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(CommonCalamitySounds.GetZombieSound(20), npc.Center); npc.ai[2] += 1f; if (npc.ai[2] >= phaseTransitionTimer) @@ -694,11 +695,11 @@ 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(CommonCalamitySounds.GetZombieSound(20), npc.Center); if (npc.ai[2] % bubbleSpinPhaseDivisor == 0f) { - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.Center.X, (int)npc.Center.Y, 19, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCDeath19, npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -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(CommonCalamitySounds.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(CommonCalamitySounds.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(CommonCalamitySounds.GetZombieSound(20), npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == teleportPhaseTimer / 2) { diff --git a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs index ac505982d9..86d9c9f032 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EaterOfWorldsAI.cs @@ -399,7 +399,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses num54 = 20f; npc.soundDelay = (int)num54; - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.WormDig, npc.position); } num52 = (float)Math.Sqrt(num39 * num39 + num40 * num40); diff --git a/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs index cdc26c19dd..0edaa7650b 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/EyeOfCthulhuAI.cs @@ -156,7 +156,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, num23, 0f, 0f, 0f, 0, 0, 0); } - SoundEngine.PlaySound(SoundID.NPCHit1, (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y); + SoundEngine.PlaySound(SoundID.NPCHit1, servantSpawnCenter); int num; for (int m = 0; m < 10; m = num + 1) @@ -279,7 +279,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[2] = 0f; else { - SoundEngine.PlaySound(SoundID.NPCHit1, (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(SoundID.NPCHit1, npc.position); if (Main.netMode != NetmodeID.Server) { @@ -296,7 +296,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Dust.NewDust(npc.position, npc.width, npc.height, 5, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); } - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); } } @@ -370,7 +370,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.ai[1] == 1f) { - SoundEngine.PlaySound(SoundID.ForceRoar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.ForceRoar, npc.position); npc.rotation = num8; float chargeSpeed = 6.2f + 4f * (0.75f - lifeRatio); @@ -527,7 +527,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.ai[1] == 4f) { if (npc.ai[2] == 0f) - SoundEngine.PlaySound(SoundID.ForceRoar, (int)npc.position.X, (int)npc.position.Y, -1, 1f, 0f); + SoundEngine.PlaySound(SoundID.ForceRoar, npc.position); float num60 = num5; npc.ai[2] += 1f; @@ -675,7 +675,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.ai[1] == 7f) { if (npc.ai[2] == 0f) - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); float num60 = (float)Math.Round(num5 * 2.5f); npc.ai[2] += 1f; diff --git a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs index 135c58c333..6185711819 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/KingSlimeAI.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Main.dust[num622].fadeIn = 1f + Main.rand.Next(10) * 0.1f; } } - SoundEngine.PlaySound(SoundID.Item38, (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(SoundID.Item38, npc.position); NPC.NewNPC(npc.GetSource_FromAI(), (int)vector.X, (int)vector.Y, ModContent.NPCType()); } diff --git a/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCOverrides/Bosses/MoonLordAI.cs index c1c3bb2da4..6d3787819e 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(CommonCalamitySounds.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(CommonCalamitySounds.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(CommonCalamitySounds.GetZombieSound(92), npc.Center); if (npc.ai[1] < 60f) MoonlordDeathDrama.RequestLight(npc.ai[1] / 30f, npc.Center); @@ -892,7 +893,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.localAI[1] = 1f; if (num1207 == num1208 - 35f) - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCDeath6, npc.position); if ((shootFirstBolt || shootSecondBolt || shootThirdBolt) && Main.netMode != NetmodeID.MultiplayerClient) { @@ -1500,7 +1501,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.localAI[1] = 1f; if (num1178 == num1179 - 35f) - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCDeath6, npc.position); if ((shootFirstBolt || shootSecondBolt || shootThirdBolt) && Main.netMode != NetmodeID.MultiplayerClient) { @@ -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(CommonCalamitySounds.GetZombieSound(Main.rand.Next(100, 101)), npc.Center); Vector2 value22 = new Vector2(30f); @@ -1773,7 +1774,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.localAI[2] = MathHelper.Lerp(npc.localAI[2], 0.4f, 0.2f); if (num1245 == num1241 - 35f) - SoundEngine.PlaySound(SoundID.NPCKilled, (int)npc.position.X, (int)npc.position.Y, 6, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCDeath6, npc.position); if ((num1245 == num1241 - 14f || num1245 == num1241 - 7f || num1245 == num1241) && Main.netMode != NetmodeID.MultiplayerClient) { @@ -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(CommonCalamitySounds.GetZombieSound(102), npc.Center); if (num1245 == 105f) npc.netUpdate = true; diff --git a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs index 7d49861b47..6283cddd9a 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/QueenBeeAI.cs @@ -197,7 +197,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.direction = playerLocation < 0 ? 1 : -1; npc.spriteDirection = npc.direction; - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); return false; } @@ -455,7 +455,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Spawn bees or hornets if (Collision.CanHit(vector76, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height) && spawnBee) { - SoundEngine.PlaySound(SoundID.NPCHit1, (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(SoundID.NPCHit1, npc.position); if (Main.netMode != NetmodeID.MultiplayerClient) { int spawnType = Main.rand.Next(210, 212); diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs index c8b003eded..70e0001fcb 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronAI.cs @@ -51,7 +51,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (respawnHands && calamityGlobalNPC.newAI[0] == 0f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 160f) { calamityGlobalNPC.newAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, -0.25f); + SoundEngine.PlaySound(SoundID.Roar with { Pitch = SoundID.Roar.Pitch - 0.25f }, npc.position); SpawnHands(); npc.netUpdate = true; @@ -110,7 +110,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (Main.dayTime && !BossRushEvent.BossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) { npc.ai[1] = 2f; - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); } // Hand immunity @@ -392,7 +392,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses calamityGlobalNPC.newAI[1] += 1f; if (calamityGlobalNPC.newAI[1] == 2f) - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); if (npc.ai[2] >= 300f) { diff --git a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs index c78ec64490..73f6c2d207 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/SkeletronPrimeAI.cs @@ -152,7 +152,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses } npc.ai[1] = 2f; - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); } // Adjust slowing debuff immunity @@ -368,7 +368,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[2] += 1f; if (npc.ai[2] == 2f) - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); // Spin for 3 seconds then return to floating phase float phaseTimer = 240f; @@ -488,7 +488,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[2] == 2f) { // Play angry noise - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); // Set spin direction if (Main.player[npc.target].velocity.X > 0f) diff --git a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs index 1d28e503c4..0704003622 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/TwinsAI.cs @@ -607,7 +607,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[2] = 0f; else { - SoundEngine.PlaySound(SoundID.NPCHit1, (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(SoundID.NPCHit1, npc.position); if (Main.netMode != NetmodeID.Server) { @@ -624,7 +624,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Dust.NewDust(npc.position, npc.width, npc.height, 5, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); } - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); } } @@ -1340,7 +1340,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses npc.ai[2] = 0f; else { - SoundEngine.PlaySound(SoundID.NPCHit, (int)npc.position.X, (int)npc.position.Y, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.NPCHit1, npc.position); if (Main.netMode != NetmodeID.Server) { @@ -1357,7 +1357,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses Dust.NewDust(npc.position, npc.width, npc.height, 5, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); } - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); } } @@ -1514,7 +1514,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.ai[1] == 1f) { // Play charge sound - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); // Set rotation and velocity npc.rotation = num420; @@ -1633,7 +1633,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses else if (npc.ai[1] == 4f) { if (npc.ai[2] == 0f) - SoundEngine.PlaySound(SoundID.Roar, (int)npc.position.X, (int)npc.position.Y, 0, 1f, 0f); + SoundEngine.PlaySound(SoundID.Roar, npc.position); float num60 = ((!retAlive && npc.ai[3] == 4f) ? 75f : 50f) - (float)Math.Round(death ? 14f * (0.7f - lifeRatio) : 0f); diff --git a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs index 8007775c66..8d4fec1ab7 100644 --- a/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCOverrides/Bosses/WallOfFleshAI.cs @@ -94,7 +94,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses if (npc.localAI[3] >= (600 + Main.rand.Next(1000))) { npc.localAI[3] = -Main.rand.Next(200); - SoundEngine.PlaySound(SoundID.NPCDeath10, (int)npc.position.X, (int)npc.position.Y); + SoundEngine.PlaySound(SoundID.NPCDeath10, npc.position); } // Set whoAmI variable @@ -224,7 +224,7 @@ namespace CalamityMod.NPCs.VanillaNPCOverrides.Bosses // Play roar sound on players nearby if (Main.player[Main.myPlayer].active && !Main.player[Main.myPlayer].dead && Vector2.Distance(Main.player[Main.myPlayer].Center, npc.Center) < 2800f) - SoundEngine.PlaySound(SoundID.NPCKilled, (int)Main.player[Main.myPlayer].position.X, (int)Main.player[Main.myPlayer].position.Y, 10, 1f, -0.25f); + SoundEngine.PlaySound(SoundID.NPCDeath10 with { Pitch = SoundID.NPCDeath10.Pitch - 0.25f}, Main.player[Main.myPlayer].position); } } else if (distanceFromTarget < distanceBeforeSlowingDown) diff --git a/NPCs/VanillaNPCOverrides/RegularEnemies/DemonEyeAI.cs b/NPCs/VanillaNPCOverrides/RegularEnemies/DemonEyeAI.cs index fdfb265bd8..0b53ab547b 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(CommonCalamitySounds.GetZombieSound(9), npc.Center); // Disable gravity. npc.noGravity = true; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 02fc8b9e06..862a36720a 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -57,6 +57,10 @@ namespace CalamityMod.NPCs.Yharon public static float normalDR = 0.22f; public static float EnragedDR = 0.9f; + public static readonly SoundStyle RoarSound = new("CalamityMod/Sounds/Custom/YharonRoar"); + public static readonly SoundStyle ShortRoarSound = new("CalamityMod/Sounds/Custom/YharonRoarShort"); + public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Custom/YharonFire"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Jungle Dragon, Yharon"); @@ -481,7 +485,7 @@ namespace CalamityMod.NPCs.Yharon Main.dust[num1470].velocity = Vector2.Normalize(value16) * 3f; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); } NPC.ai[2] += 1f; @@ -596,7 +600,7 @@ namespace CalamityMod.NPCs.Yharon else if (aiState == 5) { if (playFastChargeRoarSound) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); if (doFastCharge) { @@ -658,7 +662,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity *= 0.98f; if (NPC.ai[2] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); if (NPC.ai[2] % flareBombSpawnDivisor == 0f) { @@ -699,7 +703,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); if (NPC.ai[2] == fireTornadoPhaseTimer - 30) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == fireTornadoPhaseTimer - 30) { @@ -725,7 +729,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); if (NPC.ai[2] == newPhaseTimer - 60) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[2] += 1f; if (NPC.ai[2] >= newPhaseTimer) @@ -852,7 +856,7 @@ namespace CalamityMod.NPCs.Yharon bool spawnBulletHellVortex = NPC.ai[2] == phaseSwitchTimer + 15f; if (spawnBulletHellVortex) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -905,7 +909,7 @@ namespace CalamityMod.NPCs.Yharon else if (aiState == 5) { if (playFastChargeRoarSound) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); if (doFastCharge) { @@ -975,7 +979,7 @@ namespace CalamityMod.NPCs.Yharon else if (NPC.ai[0] == 8f) { if (NPC.ai[2] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[2] += 1f; @@ -1006,7 +1010,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); if (NPC.ai[2] == fireTornadoPhaseTimer - 30) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == fireTornadoPhaseTimer - 30) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); @@ -1029,7 +1033,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); if (NPC.ai[2] == newPhaseTimer - 60) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[2] += 1f; if (NPC.ai[2] >= newPhaseTimer) @@ -1065,7 +1069,7 @@ namespace CalamityMod.NPCs.Yharon else if (NPC.ai[0] == 12f) { if (NPC.ai[2] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[2] += 1f; @@ -1195,7 +1199,7 @@ namespace CalamityMod.NPCs.Yharon bool spawnBulletHellVortex = NPC.ai[2] == phaseSwitchTimer + 15f; if (spawnBulletHellVortex) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -1248,7 +1252,7 @@ namespace CalamityMod.NPCs.Yharon else if (aiState == 5) { if (playFastChargeRoarSound) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); if (doFastCharge) { @@ -1325,7 +1329,7 @@ namespace CalamityMod.NPCs.Yharon else if (NPC.ai[0] == 15f) { if (NPC.ai[2] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[2] += 1f; if (NPC.ai[2] % flareDustSpawnDivisor3 == 0f) @@ -1356,7 +1360,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); if (NPC.ai[2] == fireTornadoPhaseTimer - 30) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == fireTornadoPhaseTimer - 30) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); @@ -1380,7 +1384,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); if (NPC.ai[2] == newPhaseTimer - 60) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[2] += 1f; if (NPC.ai[2] >= newPhaseTimer) @@ -1417,7 +1421,7 @@ namespace CalamityMod.NPCs.Yharon else if (NPC.ai[0] == 19f) { if (NPC.ai[2] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[2] += 1f; @@ -1465,7 +1469,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity *= 0.98f; if (NPC.ai[2] == 0f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); if (NPC.ai[2] % flareBombSpawnDivisor == 0f) { @@ -1876,7 +1880,7 @@ namespace CalamityMod.NPCs.Yharon bool spawnBulletHellVortex = NPC.ai[1] == phaseSwitchTimer + timeBeforeTeleport; if (spawnBulletHellVortex) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -1918,7 +1922,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = NPC.rotation.AngleTowards(newRotation, amount); if (playFastChargeRoarSound) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.localAI[1] += 1f; @@ -2031,7 +2035,7 @@ namespace CalamityMod.NPCs.Yharon else if (NPC.ai[0] == 2f) { if (NPC.ai[1] == 1f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); ChargeDust(7, pie); @@ -2082,7 +2086,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity = vector * fireballBreathPhaseVelocity; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonFire"), NPC.Center); + SoundEngine.PlaySound(FireSound, NPC.Center); } if (NPC.ai[1] >= fireballBreathTimer) @@ -2142,7 +2146,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation += pie; NPC.velocity = vector6 * splittingFireballBreathPhaseVelocity; - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonFire"), NPC.Center); + SoundEngine.PlaySound(FireSound, NPC.Center); } else { @@ -2176,7 +2180,7 @@ namespace CalamityMod.NPCs.Yharon else if (NPC.ai[0] == 5f) { if (NPC.ai[1] == 1f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); NPC.ai[1] += 1f; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -2270,7 +2274,7 @@ namespace CalamityMod.NPCs.Yharon { if (NPC.ai[1] == 20f || NPC.ai[1] == 80f || NPC.ai[1] == 140f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); DoFireRing(expertMode ? 300 : 180, NPC.GetProjectileDamage(ModContent.ProjectileType()), NPC.target, 1f); } @@ -2281,7 +2285,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] >= flareSpawnPhaseTimer) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.target + 1); @@ -2297,7 +2301,7 @@ namespace CalamityMod.NPCs.Yharon else if (NPC.ai[0] == 7f) { if (NPC.ai[1] == 1f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); ChargeDust(14, pie); @@ -2325,7 +2329,7 @@ namespace CalamityMod.NPCs.Yharon NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); if (NPC.ai[2] == 15f) - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoarShort"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(ShortRoarSound, NPC.position); if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == 15f) { @@ -2382,7 +2386,7 @@ namespace CalamityMod.NPCs.Yharon } } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/YharonRoar"), (int)NPC.position.X, (int)NPC.position.Y); + SoundEngine.PlaySound(RoarSound, NPC.position); } NPC.ai[2] += 1f; diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index 2636facd88..9616f751e7 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -7,6 +7,8 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Boss { public class AstralFlame : ModProjectile @@ -112,7 +114,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 103, 1f, 0f); + SoundEngine.PlaySoundCommonCalamitySounds.GetZombieSound(103), Projectile.position); Projectile.position = Projectile.Center; Projectile.width = Projectile.height = 96; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); diff --git a/Projectiles/Boss/DeusRitualDrama.cs b/Projectiles/Boss/DeusRitualDrama.cs index 4aa9348425..49ab0df458 100644 --- a/Projectiles/Boss/DeusRitualDrama.cs +++ b/Projectiles/Boss/DeusRitualDrama.cs @@ -13,6 +13,8 @@ namespace CalamityMod.Projectiles.Boss { public class DeusRitualDrama : ModProjectile { + public static readonly SoundStyle PulseSound = new("CalamityMod/Sounds/Custom/AstralBeaconOrbPulse"); + public float Time { get => Projectile.ai[0]; @@ -47,7 +49,7 @@ namespace CalamityMod.Projectiles.Boss int idx = NPC.NewNPC(Projectile.GetSource_FromThis(), (int)Projectile.Center.X, (int)Projectile.Center.Y - (int)MaxUpwardRise, ModContent.NPCType(), 1); if (idx != -1) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AstrumDeusSpawn"), Projectile.Center); + SoundEngine.PlaySound(AstrumDeusHeadSpectral.SpawnSound, Projectile.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { CalamityUtils.BossAwakenMessage(idx); @@ -110,7 +112,7 @@ namespace CalamityMod.Projectiles.Boss dust.velocity = angle.ToRotationVector2() * 7f; dust.noGravity = true; } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AstralBeaconOrbPulse"), Projectile.Center); + SoundEngine.PlaySound(PulseSound, Projectile.Center); } DrawStars(Main.spriteBatch, offset); diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 1c942768a2..6c1c7161e9 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Projectiles.Boss { public class HolyBlast : ModProjectile { + public static readonly SoundStyle ImpactSound = new("CalamityMod/Sounds/Custom/ProvidenceHolyBlastImpact"); + public override void SetStaticDefaults() { DisplayName.SetDefault("Holy Blast"); @@ -112,7 +114,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.NewProjectile(Projectile.GetSource_FromThis(), shootFromVector.X, shootFromVector.Y, (float)(-Math.Sin(offsetAngle) * velocity), (float)(-Math.Cos(offsetAngle) * velocity), type, damage, 0f, Main.myPlayer, 0f, 0f); } } - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/ProvidenceHolyBlastImpact"), Projectile.Center); + SoundEngine.PlaySound(ImpactSound, Projectile.Center); int dustType = (Main.dayTime && !CalamityWorld.malice) ? (int)CalamityDusts.ProfanedFire : (int)CalamityDusts.Nightwither; for (int num193 = 0; num193 < 4; num193++) { diff --git a/Projectiles/Boss/ScavengerLaser.cs b/Projectiles/Boss/ScavengerLaser.cs index 53ec5e1113..b53912a50d 100644 --- a/Projectiles/Boss/ScavengerLaser.cs +++ b/Projectiles/Boss/ScavengerLaser.cs @@ -1,4 +1,4 @@ -using CalamityMod.Events; +using CalamityMod.Events; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -7,6 +7,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Boss { @@ -182,7 +183,7 @@ namespace CalamityMod.Projectiles.Boss public override void Kill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 103, 1f, 0f); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103), Projectile.position); Projectile.position = Projectile.Center; Projectile.width = Projectile.height = 64; Projectile.position.X = Projectile.position.X - (Projectile.width / 2); diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index a4edca8a4e..97c08dd982 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.localAI[0] == 0f) { Projectile.localAI[0] = 1f; - SoundEngine.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.Center); } if (Projectile.ai[0] >= 2f) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index c3dd120026..3e76408aaa 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -22,7 +22,7 @@ using Terraria.ModLoader; using Terraria.Utilities; using Terraria.WorldBuilding; using static Terraria.ModLoader.ModContent; - +using CalamityMod.Sounds; using NanotechProjectile = CalamityMod.Projectiles.Typeless.Nanotech; using Terraria.Audio; using Terraria.GameContent; @@ -1171,7 +1171,7 @@ namespace CalamityMod.Projectiles if (projectile.localAI[1] == 0f) { - SoundEngine.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); + SoundEngine.PlaySound(SoundID.Item33, projectile.position); projectile.localAI[1] = 1f; } @@ -1276,7 +1276,7 @@ namespace CalamityMod.Projectiles if (projectile.localAI[1] == 0f) { - SoundEngine.PlaySound(SoundID.Item33, (int)projectile.position.X, (int)projectile.position.Y); + SoundEngine.PlaySound(SoundID.Item33, projectile.position); projectile.localAI[1] = 1f; } @@ -1929,7 +1929,7 @@ namespace CalamityMod.Projectiles projectile.velocity = -Vector2.UnitY; if (projectile.localAI[0] == 0f) - SoundEngine.PlaySound(SoundID.Zombie, (int)projectile.position.X, (int)projectile.position.Y, 104, 1f, 0f); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(104), projectile.position); float num801 = 1f; projectile.localAI[0] += 1f; diff --git a/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs b/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs index 206867ff68..af5b8e8085 100644 --- a/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs +++ b/Projectiles/Damageable/ArtifactOfResilienceBulwark.cs @@ -14,8 +14,8 @@ namespace CalamityMod.Projectiles.Damageable public override int LifeMax => 1; public override int MaxDamageImmunityFrames => 5; public override DamageSourceType DamageSources => DamageSourceType.FriendlyProjectiles | DamageSourceType.HostileProjectiles | DamageSourceType.HostileNPCs; - public override LegacySoundStyle HitSound => SoundID.NPCHit3; - public override LegacySoundStyle DeathSound => SoundID.NPCDeath14; + public override SoundStyle HitSound => SoundID.NPCHit3; + public override SoundStyle DeathSound => SoundID.NPCDeath14; public override void SetStaticDefaults() { DisplayName.SetDefault("Artifact of Resilience"); diff --git a/Projectiles/Damageable/DamageableProjectile.cs b/Projectiles/Damageable/DamageableProjectile.cs index fc1e8865c3..3745fe14cf 100644 --- a/Projectiles/Damageable/DamageableProjectile.cs +++ b/Projectiles/Damageable/DamageableProjectile.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Projectiles.Damageable /// /// The sound the projectile makes on hit. /// - public abstract LegacySoundStyle HitSound + public abstract SoundStyle HitSound { get; } @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Damageable /// /// The sound the projectile makes on death. /// - public abstract LegacySoundStyle DeathSound + public abstract SoundStyle DeathSound { get; } diff --git a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs index cb7f90d407..b298730950 100644 --- a/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs +++ b/Projectiles/DraedonsArsenal/HydraulicVoltCrasherProjectile.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.DraedonsArsenal { diff --git a/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs b/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs index a0d9b15a39..e27b7ae18f 100644 --- a/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs +++ b/Projectiles/DraedonsArsenal/MassivePlasmaExplosion.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.DraedonsArsenal { @@ -59,7 +60,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal Lighting.AddLight(Projectile.Center, Color.White.ToVector3() * 4f * lightAmt); if (Projectile.localAI[0] == 0f) { - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/FlareSound"), Projectile.Center); + SoundEngine.PlaySound(CommonCalamitySounds.FlareSound, Projectile.Center); Projectile.localAI[0] = 1f; } lightAmt = (float)Math.Sin(Time / 37 * MathHelper.Pi) * 2f; diff --git a/Projectiles/Magic/AcidicReed.cs b/Projectiles/Magic/AcidicReed.cs index cfdf94d916..2661d7fe05 100644 --- a/Projectiles/Magic/AcidicReed.cs +++ b/Projectiles/Magic/AcidicReed.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Magic { if (Projectile.ai[0] == 1f) { - LegacySoundStyle saxSound = Utils.SelectRandom(Main.rand, new LegacySoundStyle[] + SoundStyle saxSound = Utils.SelectRandom(Main.rand, new LegacySoundStyle[] { SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/Saxophone/Sax1"), SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/Saxophone/Sax2"), diff --git a/Projectiles/Magic/EnormousConsumingVortex.cs b/Projectiles/Magic/EnormousConsumingVortex.cs index b78836b1db..ce22d98e25 100644 --- a/Projectiles/Magic/EnormousConsumingVortex.cs +++ b/Projectiles/Magic/EnormousConsumingVortex.cs @@ -6,6 +6,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Magic { @@ -144,7 +145,7 @@ namespace CalamityMod.Projectiles.Magic public void ExplodeEffect() { - SoundEngine.PlaySound(SoundID.Zombie, Projectile.Center, 104); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(104), Projectile.Center; if (!Main.dedServ) { for (int i = 0; i < 200; i++) diff --git a/Projectiles/Magic/HadopelagicEchoSoundwave.cs b/Projectiles/Magic/HadopelagicEchoSoundwave.cs index 15f68ff304..18f6601a2b 100644 --- a/Projectiles/Magic/HadopelagicEchoSoundwave.cs +++ b/Projectiles/Magic/HadopelagicEchoSoundwave.cs @@ -6,6 +6,9 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Magic { public class HadopelagicEchoSoundwave : ModProjectile @@ -46,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic { if (!playedSound) { - SoundEngine.PlaySound(Main.rand.NextBool(100) ? SoundLoader.GetLegacySoundSlot(Mod, "Sounds/NPCKilled/Sunskater") : SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/WyrmScream"), (int)Projectile.Center.X, (int)Projectile.Center.Y); + SoundEngine.PlaySound(Main.rand.NextBool(100) ? Sunskater.DeathSound : CommonCalamitySounds.WyrmScreamSound, Projectile.Center); playedSound = true; } } diff --git a/Projectiles/Magic/ManaMonster.cs b/Projectiles/Magic/ManaMonster.cs index 2a91e3edbd..956126019d 100644 --- a/Projectiles/Magic/ManaMonster.cs +++ b/Projectiles/Magic/ManaMonster.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Magic { @@ -50,7 +51,7 @@ namespace CalamityMod.Projectiles.Magic if (Time == NPCAttackTime) { int ambientNoiseID = Main.rand.Next(39, 41 + 1); - SoundEngine.PlaySound(SoundID.Zombie, Target.Center, ambientNoiseID); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(ambientNoiseID), Target.Center); SoundEngine.PlaySound(SoundID.DD2_DrakinShot, Target.Center); CreateTransitionBurstDust(); } diff --git a/Projectiles/Magic/RancorMagicCircle.cs b/Projectiles/Magic/RancorMagicCircle.cs index 684b7808ad..a560fb73a6 100644 --- a/Projectiles/Magic/RancorMagicCircle.cs +++ b/Projectiles/Magic/RancorMagicCircle.cs @@ -7,6 +7,7 @@ using Terraria.Audio; using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Magic { @@ -72,7 +73,7 @@ namespace CalamityMod.Projectiles.Magic // Create an idle ominous sound once the laser has appeared. else if (SoundEngine.GetActiveSound(SlotId.FromFloat(PulseLoopSoundSlot)) is null) - PulseLoopSoundSlot = SoundEngine.PlayTrackedSound(SoundID.DD2_EtherianPortalIdleLoop, Projectile.Center).ToFloat(); + PulseLoopSoundSlot = SoundEngine.PlaySound(SoundID.DD2_EtherianPortalIdleLoop, Projectile.Center).ToFloat(); // Make a cast sound effect soon after the circle appears. if (Time == 15f) @@ -155,7 +156,7 @@ namespace CalamityMod.Projectiles.Magic if (Time == ChargeupTime - 1f) { // Play a laserbeam deathray sound. Should probably be replaced some day - SoundEngine.PlaySound(SoundID.Zombie, Projectile.Center, 104); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(104), Projectile.Center); if (Main.myPlayer == Projectile.owner) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, Projectile.identity); diff --git a/Projectiles/Magic/SparkInfernal.cs b/Projectiles/Magic/SparkInfernal.cs index 20824ce865..35e584330c 100644 --- a/Projectiles/Magic/SparkInfernal.cs +++ b/Projectiles/Magic/SparkInfernal.cs @@ -2,6 +2,8 @@ using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Items.Weapons.Magic; +using Microsoft.Xna.Framework; + namespace CalamityMod.Projectiles.Magic { public class SparkInfernal : ModProjectile @@ -31,7 +33,9 @@ namespace CalamityMod.Projectiles.Magic public override void Kill(int timeLeft) { Player player = Main.player[Projectile.owner]; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, 0f, ModContent.ProjectileType(), (int)(TheWand.BaseDamage * (player.GetDamage().Base + player.GetDamage(DamageClass.Magic).Base - 1f)), Projectile.knockBack, Projectile.owner, 0f, 0f); + + int infernadoDamage = (int)player.GetDamage().CombineWith(player.GetDamage()).ApplyTo(TheWand.BaseDamage); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), infernadoDamage, Projectile.knockBack, Projectile.owner); } public override void OnHitNPC(NPC target, int damage, float knockback, bool crit) diff --git a/Projectiles/Melee/BladecrestOathswordProj.cs b/Projectiles/Melee/BladecrestOathswordProj.cs index 565c85d267..80df9af2d8 100644 --- a/Projectiles/Melee/BladecrestOathswordProj.cs +++ b/Projectiles/Melee/BladecrestOathswordProj.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Projectiles.Melee { // Initialize the animation max time if necessary. if (Owner.itemAnimationMax == 0) - Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.GetAttackSpeed(DamageClass.Melee)); + Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.GetAttackSpeed()); // Decide the current phase state of the blade. DecideCurrentState(); diff --git a/Projectiles/Melee/CosmicShivBall.cs b/Projectiles/Melee/CosmicShivBall.cs index e16c6fea70..4e037ef6e6 100644 --- a/Projectiles/Melee/CosmicShivBall.cs +++ b/Projectiles/Melee/CosmicShivBall.cs @@ -121,7 +121,7 @@ namespace CalamityMod.Projectiles.Melee if (dist <= radius) { int damage = (int)(Projectile.damage * explosionDamageMultiplier); - bool crit = Main.rand.Next(100) <= owner.GetCritChance(DamageClass.Melee) + 4; + bool crit = Main.rand.Next(100) <= owner.GetCritChance() + 4; target.StrikeNPC(damage, 0f, 0, crit, false, false); if (Main.netMode != NetmodeID.SinglePlayer) diff --git a/Projectiles/Melee/ExoGladComet.cs b/Projectiles/Melee/ExoGladComet.cs index 92c40b2bd0..7c807de19a 100644 --- a/Projectiles/Melee/ExoGladComet.cs +++ b/Projectiles/Melee/ExoGladComet.cs @@ -1,9 +1,11 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Melee { public class ExoGladComet : ModProjectile @@ -92,7 +94,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 103, 1f, 0f); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103),Projectile.position); Projectile.position = Projectile.Center; Projectile.width = Projectile.height = 80; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); diff --git a/Projectiles/Melee/Exobeam.cs b/Projectiles/Melee/Exobeam.cs index d9f1ec30af..21e09e02b4 100644 --- a/Projectiles/Melee/Exobeam.cs +++ b/Projectiles/Melee/Exobeam.cs @@ -1,10 +1,12 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using System; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Melee { public class Exobeam : ModProjectile @@ -36,7 +38,7 @@ namespace CalamityMod.Projectiles.Melee { if (Projectile.localAI[1] == 0f) { - SoundEngine.PlaySound(SoundID.Item60, (int)Projectile.position.X, (int)Projectile.position.Y); + SoundEngine.PlaySound(SoundID.Item60, Projectile.position); Projectile.localAI[1] += 1f; } counter++; @@ -169,7 +171,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.Center.X, (int)Projectile.Center.Y, 103); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103), Projectile.Center); for (int num193 = 0; num193 < 3; num193++) { Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 107, 0f, 0f, 100, new Color(0, 255, 255), 1.5f); diff --git a/Projectiles/Melee/Exocomet.cs b/Projectiles/Melee/Exocomet.cs index ce927b9b91..23aa8e7210 100644 --- a/Projectiles/Melee/Exocomet.cs +++ b/Projectiles/Melee/Exocomet.cs @@ -1,10 +1,12 @@ -using CalamityMod.Projectiles.Healing; +using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Melee { public class Exocomet : ModProjectile @@ -128,7 +130,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 103, 1f, 0f); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103), Projectile.position); Projectile.position = Projectile.Center; Projectile.width = Projectile.height = 80; Projectile.position.X = Projectile.position.X - (float)(Projectile.width / 2); diff --git a/Projectiles/Melee/Galaxia_PolarisGaze.cs b/Projectiles/Melee/Galaxia_PolarisGaze.cs index 60947dcb79..40d88fd5d0 100644 --- a/Projectiles/Melee/Galaxia_PolarisGaze.cs +++ b/Projectiles/Melee/Galaxia_PolarisGaze.cs @@ -173,7 +173,7 @@ namespace CalamityMod.Projectiles.Melee { for (int i = 0; i < 5; i++) { - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Main.rand.NextVector2CircularEdge(15, 15), ProjectileType(), (int)(FourSeasonsGalaxia.PolarisAttunement_SlashBoltsDamage * Owner.GetDamage(DamageClass.Melee).Base), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.02f); + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Main.rand.NextVector2CircularEdge(15, 15), ProjectileType(), (int)(FourSeasonsGalaxia.PolarisAttunement_SlashBoltsDamage * Owner.GetDamage().Base), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.02f); { blast.timeLeft = 100; } diff --git a/Projectiles/Melee/Galaxia_PolarisGazeDash.cs b/Projectiles/Melee/Galaxia_PolarisGazeDash.cs index 3584bcba5f..2b817c5bd8 100644 --- a/Projectiles/Melee/Galaxia_PolarisGazeDash.cs +++ b/Projectiles/Melee/Galaxia_PolarisGazeDash.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Melee //Explode into cosmic bolts for (int i = 0; i < 3; i++) { - Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.SafeDirectionTo(target.Center, Vector2.Zero).RotatedByRandom(MathHelper.PiOver4) * 30f, ProjectileType(), (int)(FourSeasonsGalaxia.PolarisAttunement_SlashBoltsDamage * Owner.GetDamage(DamageClass.Melee).Base), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.01f); + Projectile blast = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.SafeDirectionTo(target.Center, Vector2.Zero).RotatedByRandom(MathHelper.PiOver4) * 30f, ProjectileType(), (int)(FourSeasonsGalaxia.PolarisAttunement_SlashBoltsDamage * Owner.GetDamage().Base), 0f, Owner.whoAmI, 0.55f, MathHelper.Pi * 0.01f); { blast.timeLeft = 100; } diff --git a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs index 3d72f24e74..7eda341ec0 100644 --- a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs +++ b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrowned.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee { if (Math.Abs(HalfTimer / 20f) == 0.5f) { - var splash = new LegacySoundStyle(SoundID.Splash, 0).WithPitchVariance(Main.rand.NextFloat()); + var splash = new SoundStyle(SoundID.Splash, 0).WithPitchVariance(Main.rand.NextFloat()); SoundEngine.PlaySound(splash, Projectile.Center); if (Owner.whoAmI == Main.myPlayer) diff --git a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs index 47c70852b7..20d45179d0 100644 --- a/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs +++ b/Projectiles/Melee/MendedBiomeBlade_GestureForTheDrownedOrb.cs @@ -209,7 +209,7 @@ namespace CalamityMod.Projectiles.Melee public override void Kill(int timeLeft) { - var splash = new LegacySoundStyle(SoundID.Splash, 0).WithPitchVariance(Main.rand.NextFloat()); + var splash = new SoundStyle(SoundID.Splash, 0).WithPitchVariance(Main.rand.NextFloat()); SoundEngine.PlaySound(splash, Projectile.Center); for (int i = 0; i < 4; i++) diff --git a/Projectiles/Melee/OldLordOathswordProj.cs b/Projectiles/Melee/OldLordOathswordProj.cs index e8ef9d542a..63a6b65c3f 100644 --- a/Projectiles/Melee/OldLordOathswordProj.cs +++ b/Projectiles/Melee/OldLordOathswordProj.cs @@ -87,7 +87,7 @@ namespace CalamityMod.Projectiles.Melee // Initialize the animation max time if necessary. if (Owner.itemAnimationMax == 0) - Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.GetAttackSpeed(DamageClass.Melee)); + Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.GetAttackSpeed()); // Decide the current phase state of the blade. DecideCurrentState(); diff --git a/Projectiles/Melee/PwnagehammerProj.cs b/Projectiles/Melee/PwnagehammerProj.cs index 675e89c3d8..56f750017c 100644 --- a/Projectiles/Melee/PwnagehammerProj.cs +++ b/Projectiles/Melee/PwnagehammerProj.cs @@ -14,6 +14,9 @@ namespace CalamityMod.Projectiles.Melee { public override string Texture => "CalamityMod/Items/Weapons/Melee/PwnagehammerMelee"; + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/PwnagehammerSound") { Volume = 0.16f, PitchVariance = 0.16f }; + public static readonly SoundStyle HomingSound = new("CalamityMod/Sounds/Item/PwnagehammerHoming") { Volume = 0.3f }; + public override void SetStaticDefaults() { DisplayName.SetDefault("Pwnagehammer"); @@ -150,12 +153,8 @@ namespace CalamityMod.Projectiles.Melee player.addDPS((int)damage); } } - SoundEffectInstance sound1 = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PwnagehammerHoming"), Projectile.Center); - if (sound1 != null) - sound1.Volume = 0.3f; - SoundEffectInstance sound2 = SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - if (sound2 != null) - sound2.Volume = 0.22f; + SoundEngine.PlaySound(HomingSound, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item14 with { Volume = 0.22f }, Projectile.Center); } else { @@ -187,15 +186,9 @@ namespace CalamityMod.Projectiles.Melee player.addDPS((int)damage); } } - SoundEffectInstance sound1 = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Item/PwnagehammerSound"), Projectile.Center); - if (sound1 != null) - { - sound1.Volume = 0.16f; - sound1.Pitch = Main.rand.NextFloat(-0.08f, 0.08f); - } - SoundEffectInstance sound2 = SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); - if (sound2 != null) - sound2.Volume = 0.11f; + + SoundEngine.PlaySound(UseSound, Projectile.Center); + SoundEngine.PlaySound(SoundID.Item14 with { Volume = 0.11f }, Projectile.Center); } } diff --git a/Projectiles/Melee/StreamGougePortal.cs b/Projectiles/Melee/StreamGougePortal.cs index 2a051c03d3..55344b9435 100644 --- a/Projectiles/Melee/StreamGougePortal.cs +++ b/Projectiles/Melee/StreamGougePortal.cs @@ -11,6 +11,11 @@ namespace CalamityMod.Projectiles.Melee { public class StreamGougePortal : ModProjectile { + public static readonly SoundStyle SpawnSound = new SoundStyle("CalamityMod/Sounds/Custom/SwiftSlice") + { + PitchVariance = 0.1f + }; + public Vector2 SpearCenter => Vector2.Lerp(Projectile.Center + Projectile.velocity + Projectile.velocity.SafeNormalize(Vector2.Zero) * 42f, Projectile.Center, 1f - Projectile.scale); public ref float Time => ref Projectile.ai[0]; @@ -40,7 +45,7 @@ namespace CalamityMod.Projectiles.Melee // Play a slice sound when spawning. if (Projectile.localAI[0] == 0f) { - SoundEngine.PlayTrackedSound(CalamityUtils.GetTrackableSound("CalamityMod/Sounds/Custom/SwiftSlice"), Projectile.Center); + SoundEngine.PlaySound(SpawnSound, Projectile.Center); Projectile.localAI[0] = 1f; } diff --git a/Projectiles/Melee/TaintedBladeSlasher.cs b/Projectiles/Melee/TaintedBladeSlasher.cs index fe9a651d87..9b869a3ca8 100644 --- a/Projectiles/Melee/TaintedBladeSlasher.cs +++ b/Projectiles/Melee/TaintedBladeSlasher.cs @@ -137,7 +137,7 @@ namespace CalamityMod.Projectiles.Melee } if (Owner.itemAnimationMax == 0) - Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.GetAttackSpeed(DamageClass.Melee)); + Owner.itemAnimationMax = (int)(Owner.ActiveItem().useAnimation * Owner.GetAttackSpeed()); float swingOffsetAngle = MathHelper.SmoothStep(-1.87f, 3.79f, AttackCompletionRatio); diff --git a/Projectiles/Melee/YateveoBloomProj.cs b/Projectiles/Melee/YateveoBloomProj.cs index ce46ea7ae2..f0e3bd6318 100644 --- a/Projectiles/Melee/YateveoBloomProj.cs +++ b/Projectiles/Melee/YateveoBloomProj.cs @@ -70,8 +70,8 @@ namespace CalamityMod.Projectiles.Melee } else { - float num211 = 14f / Main.player[Projectile.owner].GetAttackSpeed(DamageClass.Melee) * 1.25f; - float num212 = 0.9f / Main.player[Projectile.owner].GetAttackSpeed(DamageClass.Melee) * 1.25f; + float num211 = 14f / Main.player[Projectile.owner].GetAttackSpeed() * 1.25f; + float num212 = 0.9f / Main.player[Projectile.owner].GetAttackSpeed() * 1.25f; if (Projectile.ai[1] == 1f) Projectile.tileCollide = false; diff --git a/Projectiles/Pets/LadShark.cs b/Projectiles/Pets/LadShark.cs index c240fbab4f..fb5682d0fa 100644 --- a/Projectiles/Pets/LadShark.cs +++ b/Projectiles/Pets/LadShark.cs @@ -5,6 +5,8 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Pets { public class LadShark : ModProjectile @@ -65,7 +67,7 @@ namespace CalamityMod.Projectiles.Pets } } - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 15); //mouse squeak sound + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(15), Projectile.position); //mouse squeak sound float radius = 240f; // 15 blocks for (int j = 0; j < Main.maxNPCs; j++) diff --git a/Projectiles/Pets/ThirdSage.cs b/Projectiles/Pets/ThirdSage.cs index b3a22f85be..9a88f0269f 100644 --- a/Projectiles/Pets/ThirdSage.cs +++ b/Projectiles/Pets/ThirdSage.cs @@ -1,8 +1,9 @@ -using CalamityMod.CalPlayer; +using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Pets { @@ -58,7 +59,7 @@ namespace CalamityMod.Projectiles.Pets } else if (Projectile.frame == 4 && Projectile.ai[1] >= 45) { - SoundEngine.PlaySound(SoundID.Zombie, Projectile.Center, 32); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(32), Projectile.Center); } else if (Projectile.frame > 6) { diff --git a/Projectiles/Ranged/AstralCannonProjectile.cs b/Projectiles/Ranged/AstralCannonProjectile.cs index 621e607cda..ce8161684e 100644 --- a/Projectiles/Ranged/AstralCannonProjectile.cs +++ b/Projectiles/Ranged/AstralCannonProjectile.cs @@ -1,4 +1,4 @@ -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -7,6 +7,8 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Ranged { public class AstralCannonProjectile : ModProjectile @@ -91,7 +93,7 @@ namespace CalamityMod.Projectiles.Ranged Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.Center.X, (int)Projectile.Center.Y, 103, 1f, 0f); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103), Projectile.Center); for (int num193 = 0; num193 < 2; num193++) { Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, ModContent.DustType(), 0f, 0f, 50, default, 1f); diff --git a/Projectiles/Ranged/PrismComet.cs b/Projectiles/Ranged/PrismComet.cs index 62ceefd626..4d0e8d677e 100644 --- a/Projectiles/Ranged/PrismComet.cs +++ b/Projectiles/Ranged/PrismComet.cs @@ -4,6 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Ranged { @@ -90,7 +91,7 @@ namespace CalamityMod.Projectiles.Ranged public override void Kill(int timeLeft) { - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 103, 1f, 0f); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103), Projectile.position); CalamityGlobalProjectile.ExpandHitboxBy(Projectile, 80); Projectile.Damage(); diff --git a/Projectiles/Summon/CalamariMinion.cs b/Projectiles/Summon/CalamariMinion.cs index 45f2cb3e78..c81916add7 100644 --- a/Projectiles/Summon/CalamariMinion.cs +++ b/Projectiles/Summon/CalamariMinion.cs @@ -7,6 +7,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Summon { @@ -86,14 +87,14 @@ namespace CalamityMod.Projectiles.Summon } if (Main.rand.NextBool(600)) { - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 35); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(35), Projectile.position); } if (Projectile.ai[0] == 2f) { Projectile.ai[1] -= 1f; if (Projectile.ai[1] > 3f) { - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.position.X, (int)Projectile.position.Y, 34); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(34), Projectile.position); int num = Dust.NewDust(Projectile.Center, 0, 0, 109, Projectile.velocity.X, Projectile.velocity.Y, 100, default, 1.4f); Main.dust[num].scale = 0.5f + (float)Main.rand.NextDouble() * 0.3f; Main.dust[num].velocity /= 2.5f; diff --git a/Projectiles/Summon/CosmicBlast.cs b/Projectiles/Summon/CosmicBlast.cs index 4b69a47875..6a8fa911b2 100644 --- a/Projectiles/Summon/CosmicBlast.cs +++ b/Projectiles/Summon/CosmicBlast.cs @@ -1,9 +1,11 @@ -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Summon { public class CosmicBlast : ModProjectile @@ -90,7 +92,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.Center.X, (int)Projectile.Center.Y, 103); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103), Projectile.Center); for (int num193 = 0; num193 < 3; num193++) { int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); diff --git a/Projectiles/Summon/CosmicBlastBig.cs b/Projectiles/Summon/CosmicBlastBig.cs index 9e17201b93..9dcfecb0f7 100644 --- a/Projectiles/Summon/CosmicBlastBig.cs +++ b/Projectiles/Summon/CosmicBlastBig.cs @@ -4,6 +4,8 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Summon { public class CosmicBlastBig : ModProjectile @@ -96,7 +98,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 10; Projectile.Damage(); - SoundEngine.PlaySound(SoundID.Zombie, (int)Projectile.Center.X, (int)Projectile.Center.Y, 103); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(103), Projectile.Center); for (int num193 = 0; num193 < 3; num193++) { int dust = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, 66, 0f, 0f, 100, new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), 1.5f); diff --git a/Projectiles/Summon/EndoHydraBody.cs b/Projectiles/Summon/EndoHydraBody.cs index 04c5a57fc5..b226d681c5 100644 --- a/Projectiles/Summon/EndoHydraBody.cs +++ b/Projectiles/Summon/EndoHydraBody.cs @@ -5,6 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; namespace CalamityMod.Projectiles.Summon { @@ -68,7 +69,7 @@ namespace CalamityMod.Projectiles.Summon if (TargetNPCIndex != potentialTarget.whoAmI) { TargetNPCIndex = potentialTarget.whoAmI; - SoundEngine.PlaySound(SoundID.Zombie, Projectile.Center, 53); // Ethereal whisper indicating a new target has been spotted. + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(53), Projectile.Center); // Ethereal whisper indicating a new target has been spotted. Projectile.netUpdate = true; } } diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index 346d885041..396d9f9f74 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -486,7 +486,7 @@ namespace CalamityMod.Projectiles.Summon private void onHit() { - SoundEngine.PlaySound(new LegacySoundStyle(2, 74, Terraria.Audio.SoundType.Sound), (int)Projectile.position.X, (int)Projectile.position.Y); + SoundEngine.PlaySound(new SoundStyle(2, 74, Terraria.Audio.SoundType.Sound), (int)Projectile.position.X, (int)Projectile.position.Y); if (Main.rand.NextBool(2) || Main.rand.NextBool(3)) //so it's not exactly 1 in 2, but it's not more or less consistently either. { Projectile.position.X = Projectile.position.X + (float)(Projectile.width / 2); @@ -677,7 +677,7 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { if (Projectile.timeLeft == 175 && Projectile.scale == 1.5f) - SoundEngine.PlayTrackedSound(SoundID.DD2_BetsyFireballShot, Projectile.Center); + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, Projectile.Center); Projectile.frameCounter++; if (Projectile.frameCounter > 8) diff --git a/Projectiles/Summon/UniverseSplitterField.cs b/Projectiles/Summon/UniverseSplitterField.cs index 8f2833f86c..fdb38b1dcf 100644 --- a/Projectiles/Summon/UniverseSplitterField.cs +++ b/Projectiles/Summon/UniverseSplitterField.cs @@ -5,6 +5,9 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using Terraria.Audio; +using CalamityMod.Sounds; +using CalamityMod.Sounds; + namespace CalamityMod.Projectiles.Summon { public class UniverseSplitterField : ModProjectile @@ -146,7 +149,7 @@ namespace CalamityMod.Projectiles.Summon // Summon a giant beam if (Timer == TimeLeft - UniverseSplitterHugeBeam.TimeLeft && Main.myPlayer == Projectile.owner) { - SoundEngine.PlaySound(SoundID.Zombie, Projectile.Center, 104); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(104), Projectile.Center); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Vector2.UnitY * -UniverseSplitterHugeBeam.MaximumLength / 2f, Vector2.UnitY, diff --git a/Skies/ExoMechsSky.cs b/Skies/ExoMechsSky.cs index 2ca11f243f..735b043813 100644 --- a/Skies/ExoMechsSky.cs +++ b/Skies/ExoMechsSky.cs @@ -86,7 +86,7 @@ namespace CalamityMod.Skies if (playSound && !Main.gamePaused) { - var lightningSound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/LightningStrike"), Main.LocalPlayer.Center); + var lightningSound = SoundEngine.PlaySound(SoundID.Thunder, Main.LocalPlayer.Center); if (lightningSound != null) lightningSound.Volume *= 0.5f; } @@ -122,7 +122,7 @@ namespace CalamityMod.Skies if (!Main.gamePaused) { - var lightningSound = SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/LightningStrike"), Main.LocalPlayer.Center); + var lightningSound = SoundEngine.PlaySound(SoundID.Thunder, Main.LocalPlayer.Center); if (lightningSound != null) lightningSound.Volume *= 0.5f; } diff --git a/Sounds/CommonCalamitySounds.cs b/Sounds/CommonCalamitySounds.cs new file mode 100644 index 0000000000..5ed362bc5c --- /dev/null +++ b/Sounds/CommonCalamitySounds.cs @@ -0,0 +1,42 @@ +using System; +using Terraria.Audio; + +namespace CalamityMod.Sounds +{ + public static class CommonCalamitySounds + { + //Sigma grindset rule #43 + //"Don't bother actually fully updating sounds in a PR all about entirely overhauling the sound engine" + // -Mirsario, probably. + /// + /// Gets a zombie sound variant from its variant number + /// + public static SoundStyle GetZombieSound(int id) => new("Terraria/Sounds/Zombie_" + id.ToString()); + + public static readonly SoundStyle OtherwordlyHitSound = new("CalamityMod/Sounds/NPCHit/OtherworldlyHit"); + + public static readonly SoundStyle AstralNPCHitSound = new("CalamityMod/Sounds/NPCHit/AstralEnemyHit", 3); + + public static readonly SoundStyle AstralNPCDeathSound = new("CalamityMod/Sounds/NPCKilled/AstralEnemyDeath") { Volume = 0.7f }; + + public static readonly SoundStyle PlagueBoomSound = new("CalamityMod/Sounds/Custom/PlagueSounds/PlagueBoom", 4); + + public static readonly SoundStyle WyrmScreamSound = new("CalamityMod/Sounds/Custom/WyrmScream"); + + public static readonly SoundStyle LightningSound = new("CalamityMod/Sounds/Custom/LightningStrike") { Volume = 1.5f }; //This is just the regular SoundID.Thunder sound, except its only the first variant + + public static readonly SoundStyle LaserCannonSound = new("CalamityMod/Sounds/Item/LaserCannon") { Volume = 0.85f }; + + public static readonly SoundStyle ELRFireSound = new("CalamityMod/Sounds/Item/ELRFire"); //What does ELR stand for + + public static readonly SoundStyle LargeWeaponFireSound = new("CalamityMod/Sounds/Item/LargeWeaponFire"); + + public static readonly SoundStyle GaussWeaponFire = new("CalamityMod/Sounds/Item/GaussWeaponFire"); + + public static readonly SoundStyle FlareSound = new("CalamityMod/Sounds/Item/FlareSound"); + + public static readonly SoundStyle PlasmaBoltSound = new("CalamityMod/Sounds/Item/PlasmaBolt") { Volume = 0.8f }; + + public static readonly SoundStyle PlasmaBlastSound = new("CalamityMod/Sounds/Item/PlasmaBlast"); + } +} diff --git a/Sounds/Custom/AbilitySounds/AdrenalineActivate.cs b/Sounds/Custom/AbilitySounds/AdrenalineActivate.cs deleted file mode 100644 index 4dfc381b9f..0000000000 --- a/Sounds/Custom/AbilitySounds/AdrenalineActivate.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class AdrenalineActivate : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/AngelicAllianceActivation.cs b/Sounds/Custom/AbilitySounds/AngelicAllianceActivation.cs deleted file mode 100644 index ebe4b0fbf2..0000000000 --- a/Sounds/Custom/AbilitySounds/AngelicAllianceActivation.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class AngelicAllianceActivation : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/BloodflareRangerActivation.cs b/Sounds/Custom/AbilitySounds/BloodflareRangerActivation.cs deleted file mode 100644 index cb5ed81cc5..0000000000 --- a/Sounds/Custom/AbilitySounds/BloodflareRangerActivation.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class BloodflareRangerActivation : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/BloodflareRangerRecharge.cs b/Sounds/Custom/AbilitySounds/BloodflareRangerRecharge.cs deleted file mode 100644 index ddd9ec2f01..0000000000 --- a/Sounds/Custom/AbilitySounds/BloodflareRangerRecharge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class BloodflareRangerRecharge : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/BrimflameAbility.cs b/Sounds/Custom/AbilitySounds/BrimflameAbility.cs deleted file mode 100644 index d9a0bf8dcd..0000000000 --- a/Sounds/Custom/AbilitySounds/BrimflameAbility.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class BrimflameAbility : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/BrimflameRecharge.cs b/Sounds/Custom/AbilitySounds/BrimflameRecharge.cs deleted file mode 100644 index 191869b1ea..0000000000 --- a/Sounds/Custom/AbilitySounds/BrimflameRecharge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class BrimflameRecharge : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/ChaosStateOver.cs b/Sounds/Custom/AbilitySounds/ChaosStateOver.cs deleted file mode 100644 index e743863e2d..0000000000 --- a/Sounds/Custom/AbilitySounds/ChaosStateOver.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class ChaosStateOver : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/DemonshadeEnrage.cs b/Sounds/Custom/AbilitySounds/DemonshadeEnrage.cs deleted file mode 100644 index 12fdf5efca..0000000000 --- a/Sounds/Custom/AbilitySounds/DemonshadeEnrage.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class DemonshadeEnrage : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/FullAdrenaline.cs b/Sounds/Custom/AbilitySounds/FullAdrenaline.cs deleted file mode 100644 index f6945fdd2c..0000000000 --- a/Sounds/Custom/AbilitySounds/FullAdrenaline.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class FullAdrenaline : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/FullRage.cs b/Sounds/Custom/AbilitySounds/FullRage.cs deleted file mode 100644 index a30d6239b4..0000000000 --- a/Sounds/Custom/AbilitySounds/FullRage.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class FullRage : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/OmegaBlueAbility.cs b/Sounds/Custom/AbilitySounds/OmegaBlueAbility.cs deleted file mode 100644 index 7722d6e591..0000000000 --- a/Sounds/Custom/AbilitySounds/OmegaBlueAbility.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class OmegaBlueAbility : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/OmegaBlueRecharge.cs b/Sounds/Custom/AbilitySounds/OmegaBlueRecharge.cs deleted file mode 100644 index 43b9956f74..0000000000 --- a/Sounds/Custom/AbilitySounds/OmegaBlueRecharge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class OmegaBlueRecharge : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/PlagueReaperAbility.cs b/Sounds/Custom/AbilitySounds/PlagueReaperAbility.cs deleted file mode 100644 index 7436b43e9a..0000000000 --- a/Sounds/Custom/AbilitySounds/PlagueReaperAbility.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class PlagueReaperAbility : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/PlagueReaperRecharge.cs b/Sounds/Custom/AbilitySounds/PlagueReaperRecharge.cs deleted file mode 100644 index b24fbe7a75..0000000000 --- a/Sounds/Custom/AbilitySounds/PlagueReaperRecharge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class PlagueReaperRecharge : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/PotionSicknessOver.cs b/Sounds/Custom/AbilitySounds/PotionSicknessOver.cs deleted file mode 100644 index 4a816b43ce..0000000000 --- a/Sounds/Custom/AbilitySounds/PotionSicknessOver.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class PotionSicknessOver : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/RageActivate.cs b/Sounds/Custom/AbilitySounds/RageActivate.cs deleted file mode 100644 index 0a1422fd61..0000000000 --- a/Sounds/Custom/AbilitySounds/RageActivate.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class RageActivate : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/RageEnd.cs b/Sounds/Custom/AbilitySounds/RageEnd.cs deleted file mode 100644 index 64eece1dbd..0000000000 --- a/Sounds/Custom/AbilitySounds/RageEnd.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class RageEnd : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/SilvaActivation.cs b/Sounds/Custom/AbilitySounds/SilvaActivation.cs deleted file mode 100644 index 8e62a7dafa..0000000000 --- a/Sounds/Custom/AbilitySounds/SilvaActivation.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class SilvaActivation : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AbilitySounds/SilvaDispel.cs b/Sounds/Custom/AbilitySounds/SilvaDispel.cs deleted file mode 100644 index 773dffe9d8..0000000000 --- a/Sounds/Custom/AbilitySounds/SilvaDispel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.AbilitySounds -{ - public class SilvaDispel : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AndromedaCripple.cs b/Sounds/Custom/AndromedaCripple.cs deleted file mode 100644 index ef3d612b93..0000000000 --- a/Sounds/Custom/AndromedaCripple.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AndromedaCripple : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AresEnraged.cs b/Sounds/Custom/AresEnraged.cs deleted file mode 100644 index 4d513c2cf3..0000000000 --- a/Sounds/Custom/AresEnraged.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AresEnraged : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AstralBeaconOrbPulse.cs b/Sounds/Custom/AstralBeaconOrbPulse.cs deleted file mode 100644 index df88744ce2..0000000000 --- a/Sounds/Custom/AstralBeaconOrbPulse.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AstralBeaconOrbPulse : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AstralBeaconUse.cs b/Sounds/Custom/AstralBeaconUse.cs deleted file mode 100644 index c5fe1bac59..0000000000 --- a/Sounds/Custom/AstralBeaconUse.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AstralBeaconUse : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AstrumDeusSpawn.cs b/Sounds/Custom/AstrumDeusSpawn.cs deleted file mode 100644 index ba1b6290be..0000000000 --- a/Sounds/Custom/AstrumDeusSpawn.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AstrumDeusSpawn : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AstrumDeusSplit.cs b/Sounds/Custom/AstrumDeusSplit.cs deleted file mode 100644 index 8753791319..0000000000 --- a/Sounds/Custom/AstrumDeusSplit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AstrumDeusSplit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AtlasIdle0.cs b/Sounds/Custom/AtlasIdle0.cs deleted file mode 100644 index 48e2dc0a65..0000000000 --- a/Sounds/Custom/AtlasIdle0.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AtlasIdle0 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 0.6f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AtlasIdle0.ogg b/Sounds/Custom/AtlasIdle0.ogg deleted file mode 100644 index 4d0f41e64a..0000000000 Binary files a/Sounds/Custom/AtlasIdle0.ogg and /dev/null differ diff --git a/Sounds/Custom/AtlasIdle1.cs b/Sounds/Custom/AtlasIdle1.cs deleted file mode 100644 index b6f0b9727e..0000000000 --- a/Sounds/Custom/AtlasIdle1.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AtlasIdle1 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 0.6f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AtlasIdle1.ogg b/Sounds/Custom/AtlasIdle1.ogg index 2e5760f78a..4d0f41e64a 100644 Binary files a/Sounds/Custom/AtlasIdle1.ogg and b/Sounds/Custom/AtlasIdle1.ogg differ diff --git a/Sounds/Custom/AtlasIdle2.ogg b/Sounds/Custom/AtlasIdle2.ogg new file mode 100644 index 0000000000..2e5760f78a Binary files /dev/null and b/Sounds/Custom/AtlasIdle2.ogg differ diff --git a/Sounds/Custom/AtlasSad0.cs b/Sounds/Custom/AtlasSad0.cs deleted file mode 100644 index f2719af0b7..0000000000 --- a/Sounds/Custom/AtlasSad0.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AtlasSad0 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 0.5f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AtlasSad1.cs b/Sounds/Custom/AtlasSad1.cs deleted file mode 100644 index b22b8d7e37..0000000000 --- a/Sounds/Custom/AtlasSad1.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AtlasSad1 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 0.5f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/AtlasSad0.ogg b/Sounds/Custom/AtlasSadAggro.ogg similarity index 100% rename from Sounds/Custom/AtlasSad0.ogg rename to Sounds/Custom/AtlasSadAggro.ogg diff --git a/Sounds/Custom/AtlasSad1.ogg b/Sounds/Custom/AtlasSadUnaggro.ogg similarity index 100% rename from Sounds/Custom/AtlasSad1.ogg rename to Sounds/Custom/AtlasSadUnaggro.ogg diff --git a/Sounds/Custom/AtlasSwing.cs b/Sounds/Custom/AtlasSwing.cs deleted file mode 100644 index 1d203d4a7d..0000000000 --- a/Sounds/Custom/AtlasSwing.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AtlasSwing : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 0.65f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/BazookaRocket.cs b/Sounds/Custom/BazookaRocket.cs deleted file mode 100644 index db47123922..0000000000 --- a/Sounds/Custom/BazookaRocket.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class BazookaRocket : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/BossRushEnd.cs b/Sounds/Custom/BossRushEnd.cs deleted file mode 100644 index a93d985e81..0000000000 --- a/Sounds/Custom/BossRushEnd.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class BossRushEnd : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/BrimstoneMonsterDrone.cs b/Sounds/Custom/BrimstoneMonsterDrone.cs deleted file mode 100644 index b2830f9c28..0000000000 --- a/Sounds/Custom/BrimstoneMonsterDrone.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class BrimstoneMonsterDrone : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/BrimstoneMonsterSpawn.cs b/Sounds/Custom/BrimstoneMonsterSpawn.cs deleted file mode 100644 index e5793344b5..0000000000 --- a/Sounds/Custom/BrimstoneMonsterSpawn.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class BrimstoneMonsterSpawn : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/CodebreakerBeam.cs b/Sounds/Custom/CodebreakerBeam.cs deleted file mode 100644 index 3194b70ace..0000000000 --- a/Sounds/Custom/CodebreakerBeam.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class CodebreakerBeam : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/CorvinaScream.cs b/Sounds/Custom/CorvinaScream.cs deleted file mode 100644 index f944126735..0000000000 --- a/Sounds/Custom/CorvinaScream.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class CovirnaScream : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/DefenseDamage.cs b/Sounds/Custom/DefenseDamage.cs deleted file mode 100644 index c25b169ee6..0000000000 --- a/Sounds/Custom/DefenseDamage.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DefenseDamage : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/DesertScourgeRoar.cs b/Sounds/Custom/DesertScourgeRoar.cs deleted file mode 100644 index 955886cf22..0000000000 --- a/Sounds/Custom/DesertScourgeRoar.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DesertScourgeRoar : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/DevilMaskBreak.cs b/Sounds/Custom/DevilMaskBreak.cs deleted file mode 100644 index c859aa38ee..0000000000 --- a/Sounds/Custom/DevilMaskBreak.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DevilMaskBreak : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/DevourerAttack.cs b/Sounds/Custom/DevourerAttack.cs deleted file mode 100644 index fc21f880ac..0000000000 --- a/Sounds/Custom/DevourerAttack.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DevourerAttack : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/DevourerSpawn.cs b/Sounds/Custom/DevourerSpawn.cs deleted file mode 100644 index 3d3dfb29dd..0000000000 --- a/Sounds/Custom/DevourerSpawn.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DevourerSpawn : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/DraedonLaugh.cs b/Sounds/Custom/DraedonLaugh.cs deleted file mode 100644 index 63e9160dfb..0000000000 --- a/Sounds/Custom/DraedonLaugh.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DraedonLaugh : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/DraedonTeleport.cs b/Sounds/Custom/DraedonTeleport.cs deleted file mode 100644 index 973e596e44..0000000000 --- a/Sounds/Custom/DraedonTeleport.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class DraedonTeleport : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/EidolonWyrmRoarClose.cs b/Sounds/Custom/EidolonWyrmRoarClose.cs deleted file mode 100644 index 6d6fbeed62..0000000000 --- a/Sounds/Custom/EidolonWyrmRoarClose.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class EidolonWyrmRoarClose : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/GreatSandSharkRoar.cs b/Sounds/Custom/GreatSandSharkRoar.cs deleted file mode 100644 index f18dfbe5b4..0000000000 --- a/Sounds/Custom/GreatSandSharkRoar.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class GreatSandSharkRoar : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/LegStomp.cs b/Sounds/Custom/LegStomp.cs deleted file mode 100644 index a79cbacfb0..0000000000 --- a/Sounds/Custom/LegStomp.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class LegStomp : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/LeviathanRoarCharge.cs b/Sounds/Custom/LeviathanRoarCharge.cs deleted file mode 100644 index 97f8bdffb8..0000000000 --- a/Sounds/Custom/LeviathanRoarCharge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class LeviathanRoarCharge : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/LeviathanRoarMeteor.cs b/Sounds/Custom/LeviathanRoarMeteor.cs deleted file mode 100644 index e3e3edc5eb..0000000000 --- a/Sounds/Custom/LeviathanRoarMeteor.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class LeviathanRoarMeteor : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/LightningStrike.cs b/Sounds/Custom/LightningStrike.cs deleted file mode 100644 index aedf3d68c9..0000000000 --- a/Sounds/Custom/LightningStrike.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class LightningStrike : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = MathHelper.Clamp(volume * 1.5f, 0f, 1f); - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/MMMMMMMMMMMMM.cs b/Sounds/Custom/MMMMMMMMMMMMM.cs deleted file mode 100644 index 076e180b73..0000000000 --- a/Sounds/Custom/MMMMMMMMMMMMM.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class MMMMMMMMMMMMM : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - soundInstance.IsLooped = true; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/MaulerRoar.cs b/Sounds/Custom/MaulerRoar.cs deleted file mode 100644 index bde406e284..0000000000 --- a/Sounds/Custom/MaulerRoar.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class MaulerRoar : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/MeatySlash.cs b/Sounds/Custom/MeatySlash.cs deleted file mode 100644 index 97db570435..0000000000 --- a/Sounds/Custom/MeatySlash.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class MeatySlash : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/MicrowaveBeep.cs b/Sounds/Custom/MicrowaveBeep.cs deleted file mode 100644 index 51a4ff3ce0..0000000000 --- a/Sounds/Custom/MicrowaveBeep.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class MicrowaveBeep : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/OldDukeHuff.cs b/Sounds/Custom/OldDukeHuff.cs deleted file mode 100644 index c720e789e9..0000000000 --- a/Sounds/Custom/OldDukeHuff.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class OldDukeHuff : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/OldDukeRoar.cs b/Sounds/Custom/OldDukeRoar.cs deleted file mode 100644 index 9b75ba6792..0000000000 --- a/Sounds/Custom/OldDukeRoar.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class OldDukeRoar : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/OldDukeVomit.cs b/Sounds/Custom/OldDukeVomit.cs deleted file mode 100644 index d7a79be0e3..0000000000 --- a/Sounds/Custom/OldDukeVomit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class OldDukeVomit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/OldDukeVortex.cs b/Sounds/Custom/OldDukeVortex.cs deleted file mode 100644 index dca244dc59..0000000000 --- a/Sounds/Custom/OldDukeVortex.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class OldDukeVortex : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.cs b/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.cs deleted file mode 100644 index fb07fa19be..0000000000 --- a/Sounds/Custom/PlagueSounds/PBGAttackSwitch1.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PBGAttackSwitch1 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.cs b/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.cs deleted file mode 100644 index 653d340375..0000000000 --- a/Sounds/Custom/PlagueSounds/PBGAttackSwitch2.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PBGAttackSwitch2 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.cs b/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.cs deleted file mode 100644 index 2def015296..0000000000 --- a/Sounds/Custom/PlagueSounds/PBGBarrageLaunch.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PBGBarrageLaunch : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PBGDash.cs b/Sounds/Custom/PlagueSounds/PBGDash.cs deleted file mode 100644 index e2d114afc2..0000000000 --- a/Sounds/Custom/PlagueSounds/PBGDash.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PBGDash : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PBGNukeWarning.cs b/Sounds/Custom/PlagueSounds/PBGNukeWarning.cs deleted file mode 100644 index aaa6aa9a26..0000000000 --- a/Sounds/Custom/PlagueSounds/PBGNukeWarning.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PBGNukeWarning : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom1.cs b/Sounds/Custom/PlagueSounds/PlagueBoom1.cs deleted file mode 100644 index 80500f0fc4..0000000000 --- a/Sounds/Custom/PlagueSounds/PlagueBoom1.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PlagueBoom1 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom2.cs b/Sounds/Custom/PlagueSounds/PlagueBoom2.cs deleted file mode 100644 index 0788ab9ff4..0000000000 --- a/Sounds/Custom/PlagueSounds/PlagueBoom2.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PlagueBoom2 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom3.cs b/Sounds/Custom/PlagueSounds/PlagueBoom3.cs deleted file mode 100644 index 8c387a0c3f..0000000000 --- a/Sounds/Custom/PlagueSounds/PlagueBoom3.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PlagueBoom3 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/PlagueSounds/PlagueBoom4.cs b/Sounds/Custom/PlagueSounds/PlagueBoom4.cs deleted file mode 100644 index 7fde2fb02b..0000000000 --- a/Sounds/Custom/PlagueSounds/PlagueBoom4.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.PlagueSounds -{ - public class PlagueBoom4 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ProvidenceDeathAnimation.cs b/Sounds/Custom/ProvidenceDeathAnimation.cs deleted file mode 100644 index 281823f3e0..0000000000 --- a/Sounds/Custom/ProvidenceDeathAnimation.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ProvidenceDeathAnimation : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ProvidenceHolyBlastImpact.cs b/Sounds/Custom/ProvidenceHolyBlastImpact.cs deleted file mode 100644 index abc3395b33..0000000000 --- a/Sounds/Custom/ProvidenceHolyBlastImpact.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ProvidenceHolyBlastImpact : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ProvidenceHolyBlastShoot.cs b/Sounds/Custom/ProvidenceHolyBlastShoot.cs deleted file mode 100644 index 094cc8c562..0000000000 --- a/Sounds/Custom/ProvidenceHolyBlastShoot.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ProvidenceHolyBlastShoot : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ProvidenceHolyRay.cs b/Sounds/Custom/ProvidenceHolyRay.cs deleted file mode 100644 index 2aeb824782..0000000000 --- a/Sounds/Custom/ProvidenceHolyRay.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ProvidenceHolyRay : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = MathHelper.Clamp(volume * 1.25f, 0f, 1f); - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ProvidenceSpawn.cs b/Sounds/Custom/ProvidenceSpawn.cs deleted file mode 100644 index 3f7d572ee2..0000000000 --- a/Sounds/Custom/ProvidenceSpawn.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ProvidenceSpawn : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = MathHelper.Clamp(volume * 1.2f, 0f, 1f); - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ReaperEnragedRoar.cs b/Sounds/Custom/ReaperEnragedRoar.cs deleted file mode 100644 index 018933e7e5..0000000000 --- a/Sounds/Custom/ReaperEnragedRoar.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ReaperEnragedRoar : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ReaperSearchRoar.cs b/Sounds/Custom/ReaperSearchRoar.cs deleted file mode 100644 index 66155a78ca..0000000000 --- a/Sounds/Custom/ReaperSearchRoar.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ReaperSearchRoar : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/RimehoundGrowl.cs b/Sounds/Custom/RimehoundGrowl.cs deleted file mode 100644 index 5e6786f7b5..0000000000 --- a/Sounds/Custom/RimehoundGrowl.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria.Audio; -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class AngryDogGrowl : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/RogueStealth.cs b/Sounds/Custom/RogueStealth.cs deleted file mode 100644 index 8290f8e4de..0000000000 --- a/Sounds/Custom/RogueStealth.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class RogueStealth : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/BrimstoneBigShoot.cs b/Sounds/Custom/SCalSounds/BrimstoneBigShoot.cs deleted file mode 100644 index 2b4639ac5b..0000000000 --- a/Sounds/Custom/SCalSounds/BrimstoneBigShoot.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class BrimstoneBigShoot : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/BrimstoneFireblastImpact.cs b/Sounds/Custom/SCalSounds/BrimstoneFireblastImpact.cs deleted file mode 100644 index 6c77ae9f56..0000000000 --- a/Sounds/Custom/SCalSounds/BrimstoneFireblastImpact.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class BrimstoneFireblastImpact : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/BrimstoneGigablastImpact.cs b/Sounds/Custom/SCalSounds/BrimstoneGigablastImpact.cs deleted file mode 100644 index f53fb27765..0000000000 --- a/Sounds/Custom/SCalSounds/BrimstoneGigablastImpact.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class BrimstoneGigablastImpact : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/BrimstoneHellblastSound.cs b/Sounds/Custom/SCalSounds/BrimstoneHellblastSound.cs deleted file mode 100644 index e2a0dedee9..0000000000 --- a/Sounds/Custom/SCalSounds/BrimstoneHellblastSound.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class BrimstoneHellblastSound : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/BrimstoneShoot.cs b/Sounds/Custom/SCalSounds/BrimstoneShoot.cs deleted file mode 100644 index d32f529e83..0000000000 --- a/Sounds/Custom/SCalSounds/BrimstoneShoot.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class BrimstoneShoot : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/BrimstoneSkullSound.cs b/Sounds/Custom/SCalSounds/BrimstoneSkullSound.cs deleted file mode 100644 index fcfa0100d3..0000000000 --- a/Sounds/Custom/SCalSounds/BrimstoneSkullSound.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class BrimstoneSkullSound : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/SCalDash.cs b/Sounds/Custom/SCalSounds/SCalDash.cs deleted file mode 100644 index 9e10db70ce..0000000000 --- a/Sounds/Custom/SCalSounds/SCalDash.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class SCalDash : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SCalSounds/SepulcherSpawn.cs b/Sounds/Custom/SCalSounds/SepulcherSpawn.cs deleted file mode 100644 index 9aa68814ca..0000000000 --- a/Sounds/Custom/SCalSounds/SepulcherSpawn.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom.SCalSounds -{ - public class SepulcherSpawn : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/Scare.cs b/Sounds/Custom/Scare.cs deleted file mode 100644 index b1bbbd9166..0000000000 --- a/Sounds/Custom/Scare.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class Scare : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - if (soundInstance.State == SoundState.Playing) - soundInstance.Stop(); - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ScissorGuillotineSnap.cs b/Sounds/Custom/ScissorGuillotineSnap.cs deleted file mode 100644 index e3bef8b8b8..0000000000 --- a/Sounds/Custom/ScissorGuillotineSnap.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ScissorGuillotineSnap : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ScornJump.cs b/Sounds/Custom/ScornJump.cs deleted file mode 100644 index 4b210ba78a..0000000000 --- a/Sounds/Custom/ScornJump.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ScornJump : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SlimeGodExit.cs b/Sounds/Custom/SlimeGodExit.cs deleted file mode 100644 index dc9e4565b2..0000000000 --- a/Sounds/Custom/SlimeGodExit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class SlimeGodExit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SlimeGodPossession.cs b/Sounds/Custom/SlimeGodPossession.cs deleted file mode 100644 index d3dd16d7eb..0000000000 --- a/Sounds/Custom/SlimeGodPossession.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class SlimeGodPossession : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SupremeCalamitasSpawn.cs b/Sounds/Custom/SupremeCalamitasSpawn.cs deleted file mode 100644 index 2f2386476d..0000000000 --- a/Sounds/Custom/SupremeCalamitasSpawn.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class SupremeCalamitasSpawn : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = MathHelper.Clamp(volume * 1.2f, 0f, 1f); - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/SwiftSlice.cs b/Sounds/Custom/SwiftSlice.cs deleted file mode 100644 index ceab2b2ef7..0000000000 --- a/Sounds/Custom/SwiftSlice.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class SwiftSlice : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/THanosLaser.cs b/Sounds/Custom/THanosLaser.cs deleted file mode 100644 index 89464e95e3..0000000000 --- a/Sounds/Custom/THanosLaser.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class THanosLaser : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ThanatosVent.cs b/Sounds/Custom/ThanatosVent.cs deleted file mode 100644 index f7d8b6d03e..0000000000 --- a/Sounds/Custom/ThanatosVent.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ThanatosVent : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/ThunderStrike.cs b/Sounds/Custom/ThunderStrike.cs deleted file mode 100644 index a50635d046..0000000000 --- a/Sounds/Custom/ThunderStrike.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class ThunderStrike : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/WyrmScream.cs b/Sounds/Custom/WyrmScream.cs deleted file mode 100644 index 8c810605e4..0000000000 --- a/Sounds/Custom/WyrmScream.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class WyrmScream : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/YanmeiKnifeExpire.cs b/Sounds/Custom/YanmeiKnifeExpire.cs deleted file mode 100644 index d8823476d1..0000000000 --- a/Sounds/Custom/YanmeiKnifeExpire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class YanmeiKnifeExpire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/YharonFire.cs b/Sounds/Custom/YharonFire.cs deleted file mode 100644 index dab2979a1c..0000000000 --- a/Sounds/Custom/YharonFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class YharonFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/YharonRoar.cs b/Sounds/Custom/YharonRoar.cs deleted file mode 100644 index 32b5fea467..0000000000 --- a/Sounds/Custom/YharonRoar.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class YharonRoar : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Custom/YharonRoarShort.cs b/Sounds/Custom/YharonRoarShort.cs deleted file mode 100644 index 0657f294dc..0000000000 --- a/Sounds/Custom/YharonRoarShort.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Custom -{ - public class YharonRoarShort : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/BazookaFull.cs b/Sounds/Item/BazookaFull.cs deleted file mode 100644 index 73eff46cba..0000000000 --- a/Sounds/Item/BazookaFull.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class BazookaFull : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/ClamImpact.cs b/Sounds/Item/ClamImpact.cs deleted file mode 100644 index 4fc15c1968..0000000000 --- a/Sounds/Item/ClamImpact.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class ClamImpact : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/CrystylCharge.cs b/Sounds/Item/CrystylCharge.cs deleted file mode 100644 index a3439cf2cb..0000000000 --- a/Sounds/Item/CrystylCharge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class CrystylCharge : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/ELRFire.cs b/Sounds/Item/ELRFire.cs deleted file mode 100644 index efe608f59a..0000000000 --- a/Sounds/Item/ELRFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class ELRFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/FlareSound.cs b/Sounds/Item/FlareSound.cs deleted file mode 100644 index 9a29fea0de..0000000000 --- a/Sounds/Item/FlareSound.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class FlareSound : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/GatlingLaserFireEnd.cs b/Sounds/Item/GatlingLaserFireEnd.cs deleted file mode 100644 index 6f979c55cc..0000000000 --- a/Sounds/Item/GatlingLaserFireEnd.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class GatlingLaserFireEnd : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/GatlingLaserFireLoop.cs b/Sounds/Item/GatlingLaserFireLoop.cs deleted file mode 100644 index 54253436b3..0000000000 --- a/Sounds/Item/GatlingLaserFireLoop.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class GatlingLaserFireLoop : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/GatlingLaserFireStart.cs b/Sounds/Item/GatlingLaserFireStart.cs deleted file mode 100644 index 38d7597dcb..0000000000 --- a/Sounds/Item/GatlingLaserFireStart.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class GatlingLaserFireStart : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/GaussWeaponFire.cs b/Sounds/Item/GaussWeaponFire.cs deleted file mode 100644 index bc9c023e82..0000000000 --- a/Sounds/Item/GaussWeaponFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class GaussWeaponFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Hydra.cs b/Sounds/Item/Hydra.cs deleted file mode 100644 index 34f602fd2f..0000000000 --- a/Sounds/Item/Hydra.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class Hydra : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/IceBarrageCast.cs b/Sounds/Item/IceBarrageCast.cs deleted file mode 100644 index 89a1753ce3..0000000000 --- a/Sounds/Item/IceBarrageCast.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Terraria; -using Terraria.ModLoader; -using Microsoft.Xna.Framework.Audio; - -namespace CalamityMod.Sounds.Item -{ - public class IceBarrageCast : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/KendraBark.cs b/Sounds/Item/KendraBark.cs deleted file mode 100644 index 9579ed9c53..0000000000 --- a/Sounds/Item/KendraBark.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class KendraBark : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/LargeMechGaussRifle.cs b/Sounds/Item/LargeMechGaussRifle.cs deleted file mode 100644 index 2a8cd80e1c..0000000000 --- a/Sounds/Item/LargeMechGaussRifle.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class LargeMechGaussRifle : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/LargeWeaponFire.cs b/Sounds/Item/LargeWeaponFire.cs deleted file mode 100644 index 1c0bb70af7..0000000000 --- a/Sounds/Item/LargeWeaponFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class LargeWeaponFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/LaserCannon.cs b/Sounds/Item/LaserCannon.cs deleted file mode 100644 index b148521fe6..0000000000 --- a/Sounds/Item/LaserCannon.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class LaserCannon : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 0.85f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/LaserRifleFire.cs b/Sounds/Item/LaserRifleFire.cs deleted file mode 100644 index 9df347dc2a..0000000000 --- a/Sounds/Item/LaserRifleFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class LaserRifleFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Magnum.cs b/Sounds/Item/Magnum.cs deleted file mode 100644 index 90100ee639..0000000000 --- a/Sounds/Item/Magnum.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class Magnum : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/MechGaussRifle.cs b/Sounds/Item/MechGaussRifle.cs deleted file mode 100644 index 96c4341b4e..0000000000 --- a/Sounds/Item/MechGaussRifle.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class MechGaussRifle : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/OpalStrike.cs b/Sounds/Item/OpalStrike.cs deleted file mode 100644 index 68ec0c1a16..0000000000 --- a/Sounds/Item/OpalStrike.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class OpalStrike : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/PlasmaBlast.cs b/Sounds/Item/PlasmaBlast.cs deleted file mode 100644 index 6e237392b1..0000000000 --- a/Sounds/Item/PlasmaBlast.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class PlasmaBlast : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/PlasmaBolt.cs b/Sounds/Item/PlasmaBolt.cs deleted file mode 100644 index 0150bfbc30..0000000000 --- a/Sounds/Item/PlasmaBolt.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class PlasmaBolt : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - if (soundInstance.State == SoundState.Playing) - soundInstance.Stop(); - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 0.8f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/PlasmaCasterFire.cs b/Sounds/Item/PlasmaCasterFire.cs deleted file mode 100644 index c741fe1cfa..0000000000 --- a/Sounds/Item/PlasmaCasterFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class PlasmaCasterFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/PlasmaGrenadeExplosion.cs b/Sounds/Item/PlasmaGrenadeExplosion.cs deleted file mode 100644 index 456c4cbef2..0000000000 --- a/Sounds/Item/PlasmaGrenadeExplosion.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class PlasmaGrenadeExplosion : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/PulseRifleFire.cs b/Sounds/Item/PulseRifleFire.cs deleted file mode 100644 index 49bed035b7..0000000000 --- a/Sounds/Item/PulseRifleFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class PulseRifleFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/PwnagehammerHoming.cs b/Sounds/Item/PwnagehammerHoming.cs deleted file mode 100644 index a1cf896585..0000000000 --- a/Sounds/Item/PwnagehammerHoming.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class PwnagehammerHoming : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 0.8f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/PwnagehammerSound.cs b/Sounds/Item/PwnagehammerSound.cs deleted file mode 100644 index fe09d16167..0000000000 --- a/Sounds/Item/PwnagehammerSound.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class PwnagehammerSound : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 0.8f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Saxophone/Sax1.cs b/Sounds/Item/Saxophone/Sax1.cs deleted file mode 100644 index c5c6d136a7..0000000000 --- a/Sounds/Item/Saxophone/Sax1.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item.Saxophone -{ - public class Sax1 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Saxophone/Sax2.cs b/Sounds/Item/Saxophone/Sax2.cs deleted file mode 100644 index 438c3e8c08..0000000000 --- a/Sounds/Item/Saxophone/Sax2.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item.Saxophone -{ - public class Sax2 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Saxophone/Sax3.cs b/Sounds/Item/Saxophone/Sax3.cs deleted file mode 100644 index f38d4b5e1e..0000000000 --- a/Sounds/Item/Saxophone/Sax3.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item.Saxophone -{ - public class Sax3 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Saxophone/Sax4.cs b/Sounds/Item/Saxophone/Sax4.cs deleted file mode 100644 index 68c0dc36f2..0000000000 --- a/Sounds/Item/Saxophone/Sax4.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item.Saxophone -{ - public class Sax4 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Saxophone/Sax5.cs b/Sounds/Item/Saxophone/Sax5.cs deleted file mode 100644 index d4b5abd333..0000000000 --- a/Sounds/Item/Saxophone/Sax5.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item.Saxophone -{ - public class Sax5 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/Saxophone/Sax6.cs b/Sounds/Item/Saxophone/Sax6.cs deleted file mode 100644 index 86a8036c56..0000000000 --- a/Sounds/Item/Saxophone/Sax6.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item.Saxophone -{ - public class Sax6 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/SearedPanSmash.cs b/Sounds/Item/SearedPanSmash.cs deleted file mode 100644 index 63eda8d97f..0000000000 --- a/Sounds/Item/SearedPanSmash.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class SearedPanSmash : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/TankCannon.cs b/Sounds/Item/TankCannon.cs deleted file mode 100644 index 893bb1aaa8..0000000000 --- a/Sounds/Item/TankCannon.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class TankCannon : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = MathHelper.Clamp(volume * 1.1f, 0f, 1f); - soundInstance.Pan = pan; - soundInstance.Pitch = (float)Main.rand.Next(-25, 26) * 0.01f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/TeslaCannonFire.cs b/Sounds/Item/TeslaCannonFire.cs deleted file mode 100644 index 48020638e4..0000000000 --- a/Sounds/Item/TeslaCannonFire.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class TeslaCannonFire : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/Item/YanmeiKnifeHit.cs b/Sounds/Item/YanmeiKnifeHit.cs deleted file mode 100644 index 89f9bb586d..0000000000 --- a/Sounds/Item/YanmeiKnifeHit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.Item -{ - public class YanmeiKnifeHit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AstralEnemyHit.cs b/Sounds/NPCHit/AstralEnemyHit.cs deleted file mode 100644 index ea77592101..0000000000 --- a/Sounds/NPCHit/AstralEnemyHit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AstralEnemyHit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AstralEnemyHit.ogg b/Sounds/NPCHit/AstralEnemyHit1.ogg similarity index 100% rename from Sounds/NPCHit/AstralEnemyHit.ogg rename to Sounds/NPCHit/AstralEnemyHit1.ogg diff --git a/Sounds/NPCHit/AstralEnemyHit2.cs b/Sounds/NPCHit/AstralEnemyHit2.cs deleted file mode 100644 index 16a3aac32c..0000000000 --- a/Sounds/NPCHit/AstralEnemyHit2.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AstralEnemyHit2 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AstralEnemyHit3.cs b/Sounds/NPCHit/AstralEnemyHit3.cs deleted file mode 100644 index 7857990846..0000000000 --- a/Sounds/NPCHit/AstralEnemyHit3.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AstralEnemyHit3 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AstrumAureusHit.cs b/Sounds/NPCHit/AstrumAureusHit.cs deleted file mode 100644 index 9b4137ae23..0000000000 --- a/Sounds/NPCHit/AstrumAureusHit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AstrumAureusHit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 0.7f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AtlasHurt0.cs b/Sounds/NPCHit/AtlasHurt0.cs deleted file mode 100644 index 2028b1b4bd..0000000000 --- a/Sounds/NPCHit/AtlasHurt0.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AtlasHurt0 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AtlasHurt0.ogg b/Sounds/NPCHit/AtlasHurt0.ogg deleted file mode 100644 index 521d3e831e..0000000000 Binary files a/Sounds/NPCHit/AtlasHurt0.ogg and /dev/null differ diff --git a/Sounds/NPCHit/AtlasHurt1.cs b/Sounds/NPCHit/AtlasHurt1.cs deleted file mode 100644 index d7a1b9bbde..0000000000 --- a/Sounds/NPCHit/AtlasHurt1.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AtlasHurt1 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AtlasHurt1.ogg b/Sounds/NPCHit/AtlasHurt1.ogg index d8d2a26a78..521d3e831e 100644 Binary files a/Sounds/NPCHit/AtlasHurt1.ogg and b/Sounds/NPCHit/AtlasHurt1.ogg differ diff --git a/Sounds/NPCHit/AtlasHurt2.cs b/Sounds/NPCHit/AtlasHurt2.cs deleted file mode 100644 index 7579f83598..0000000000 --- a/Sounds/NPCHit/AtlasHurt2.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AtlasHurt2 : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/AtlasHurt2.ogg b/Sounds/NPCHit/AtlasHurt2.ogg index 7a186b5905..d8d2a26a78 100644 Binary files a/Sounds/NPCHit/AtlasHurt2.ogg and b/Sounds/NPCHit/AtlasHurt2.ogg differ diff --git a/Sounds/NPCHit/AtlasHurt3.ogg b/Sounds/NPCHit/AtlasHurt3.ogg new file mode 100644 index 0000000000..7a186b5905 Binary files /dev/null and b/Sounds/NPCHit/AtlasHurt3.ogg differ diff --git a/Sounds/NPCHit/OtherworldlyHit.cs b/Sounds/NPCHit/OtherworldlyHit.cs deleted file mode 100644 index 341ace652e..0000000000 --- a/Sounds/NPCHit/OtherworldlyHit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class OtherworldlyHit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/ProvidenceHurt.cs b/Sounds/NPCHit/ProvidenceHurt.cs deleted file mode 100644 index 788a41edd1..0000000000 --- a/Sounds/NPCHit/ProvidenceHurt.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class ProvidenceHurt : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/RimehoundHit.cs b/Sounds/NPCHit/RimehoundHit.cs deleted file mode 100644 index 60276fb6ce..0000000000 --- a/Sounds/NPCHit/RimehoundHit.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class AngryDogHit : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCHit/ScornHurt.cs b/Sounds/NPCHit/ScornHurt.cs deleted file mode 100644 index 55087e9153..0000000000 --- a/Sounds/NPCHit/ScornHurt.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCHit -{ - public class ScornHurt : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/AstralEnemyDeath.cs b/Sounds/NPCKilled/AstralEnemyDeath.cs deleted file mode 100644 index f828ebb984..0000000000 --- a/Sounds/NPCKilled/AstralEnemyDeath.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class AstralEnemyDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 0.7f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/AstrumDeusDeath.cs b/Sounds/NPCKilled/AstrumDeusDeath.cs deleted file mode 100644 index 0b805140e5..0000000000 --- a/Sounds/NPCKilled/AstrumDeusDeath.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class AstrumDeusDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 1f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/AtlasDeath.cs b/Sounds/NPCKilled/AtlasDeath.cs deleted file mode 100644 index fdc5e5e065..0000000000 --- a/Sounds/NPCKilled/AtlasDeath.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class AtlasDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 0.65f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/EidolistDeath.cs b/Sounds/NPCKilled/EidolistDeath.cs deleted file mode 100644 index 1db5c3922f..0000000000 --- a/Sounds/NPCKilled/EidolistDeath.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class EidolistDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/ProvidenceDeath.cs b/Sounds/NPCKilled/ProvidenceDeath.cs deleted file mode 100644 index 9bf5cb73a1..0000000000 --- a/Sounds/NPCKilled/ProvidenceDeath.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class ProvidenceDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/ScornDeath.cs b/Sounds/NPCKilled/ScornDeath.cs deleted file mode 100644 index 2e22b69f42..0000000000 --- a/Sounds/NPCKilled/ScornDeath.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class ScornDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Pan = pan; - soundInstance.Volume = volume * 1f; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/SepulcherDeath.cs b/Sounds/NPCKilled/SepulcherDeath.cs deleted file mode 100644 index ae927bc498..0000000000 --- a/Sounds/NPCKilled/SepulcherDeath.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class SepulcherDeath : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Sounds/NPCKilled/Sunskater.cs b/Sounds/NPCKilled/Sunskater.cs deleted file mode 100644 index b87d7cab90..0000000000 --- a/Sounds/NPCKilled/Sunskater.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Terraria.Audio; -using Microsoft.Xna.Framework.Audio; -using Terraria; -using Terraria.ModLoader; - -namespace CalamityMod.Sounds.NPCKilled -{ - public class Sunskater : ModSound - { - public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan) - { - soundInstance = Sound.Value.CreateInstance(); - soundInstance.Volume = volume * 0.9f; - soundInstance.Pan = pan; - SoundInstanceGarbageCollector.Track(soundInstance); - return soundInstance; - } - } -} diff --git a/Tiles/Abyss/AcidWoodTree.cs b/Tiles/Abyss/AcidWoodTree.cs index f3065aa700..a5d1f8dfc3 100644 --- a/Tiles/Abyss/AcidWoodTree.cs +++ b/Tiles/Abyss/AcidWoodTree.cs @@ -30,8 +30,6 @@ namespace CalamityMod.Tiles.Abyss //I don't know what this means. Why do palm trees have branches?? Since when. Also acidwood trees arent meant to have oasis alts public override Asset GetOasisTopTextures() => ModContent.Request("CalamityMod/Tiles/Abyss/AcidWoodTreeTops"); - public override Asset GetBranchTextures() => null; - public override Asset GetOasisBranchTextures() => ModContent.Request("CalamityMod/Tiles/Abyss/AcidWoodTree"); public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => (int)CalamityDusts.SulfurousSeaAcid; diff --git a/Tiles/Abyss/AcidWoodTree.png b/Tiles/Abyss/AcidWoodTree.png index fd3cd4d235..274034408f 100644 Binary files a/Tiles/Abyss/AcidWoodTree.png and b/Tiles/Abyss/AcidWoodTree.png differ diff --git a/Tiles/Astral/AstralBeacon.cs b/Tiles/Astral/AstralBeacon.cs index 0507ae047a..51fbbd1eac 100644 --- a/Tiles/Astral/AstralBeacon.cs +++ b/Tiles/Astral/AstralBeacon.cs @@ -20,6 +20,9 @@ namespace CalamityMod.Tiles.Astral public const int Width = 5; public const int Height = 4; public static readonly Color FailColor = new Color(237, 93, 83); + + public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Custom/AstralBeaconUse"); + public override void SetStaticDefaults() { Main.tileFrameImportant[Type] = true; @@ -75,7 +78,7 @@ namespace CalamityMod.Tiles.Astral Vector2 ritualSpawnPosition = new Vector2(left + Width / 2, top).ToWorldCoordinates(); ritualSpawnPosition += new Vector2(0f, -24f); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(Mod, "Sounds/Custom/AstralBeaconUse"), ritualSpawnPosition); + SoundEngine.PlaySound(UseSound, ritualSpawnPosition); Projectile.NewProjectile(new EntitySource_WorldEvent(), ritualSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, usingStarcore.ToInt()); if (!usingStarcore) diff --git a/Tiles/AstralDesert/AstralPalmSapling.cs b/Tiles/AstralDesert/AstralPalmSapling.cs index 901859840e..622cfa45aa 100644 --- a/Tiles/AstralDesert/AstralPalmSapling.cs +++ b/Tiles/AstralDesert/AstralPalmSapling.cs @@ -49,117 +49,13 @@ namespace CalamityMod.Tiles.AstralDesert num = fail ? 1 : 3; } - public static bool EmptyTileCheck(int startX, int endX, int startY, int endY, int ignoreID = -1) - { - //Checks if inworld - if (startX < 0) - return false; - if (endX >= Main.maxTilesX) - return false; - if (startY < 0) - return false; - if (endY >= Main.maxTilesY) - return false; - - - bool flag = false; - if (ignoreID != -1 && TileID.Sets.CommonSapling[ignoreID]) - flag = true; - - for (int i = startX; i < endX + 1; i++) - { - for (int j = startY; j < endY + 1; j++) - { - //Check for empty tiles - if (!Main.tile[i, j].HasTile) - continue; - - switch (ignoreID) - { - case -1: - return false; - case 11: - if (Main.tile[i, j].TileType == 11) - continue; - return false; - case 71: - if (Main.tile[i, j].TileType == 71) - continue; - return false; - } - - if (flag) - { - if (TileID.Sets.CommonSapling[Main.tile[i, j].TileType]) - break; - - /* - switch (Main.tile[i, j].type) { - case 3: - case 24: - case 32: - case 61: - case 62: - case 69: - case 71: - case 73: - case 74: - case 82: - case 83: - case 84: - case 110: - case 113: - case 201: - case 233: - case 352: - case 485: - case 529: - case 530: - continue; - } - */ - - if (TileID.Sets.IgnoredByGrowingSaplings[Main.tile[i, j].TileType]) - continue; - - return false; - } - } - } - - return true; - } - + public override void RandomUpdate(int i, int j) { if (WorldGen.genRand.Next(20) == 0 || true) { bool isPlayerNear = WorldGen.PlayerLOS(i, j); - //This is debug code ripped from tml source. I'll remove it when they fix modpalmtrees - - int num = j; - - while (TileID.Sets.TreeSapling[Main.tile[i, num].TileType]) - { - num++; - if (Main.tile[i, num] == null) - return; - } - - Tile tile = Main.tile[i, num]; - - if (tile.TileType != 53 && tile.TileType != 234 && tile.TileType != 116 && tile.TileType != 112 && !TileLoader.CanGrowModPalmTree(tile.TileType)) - return; - - //Check if the very base of the palm tree is occupied (the 2 tiles above the ground should be sapling tiles) - if (!EmptyTileCheck(i, i, num - 2, num - 1, 20)) - return; - - //Check if theres clear space on the upper portion of the palm tree. - if (!EmptyTileCheck(i - 1, i + 1, num - 30, num - 3, 20)) - return; - bool success = WorldGen.GrowPalmTree(i, j); if (success && isPlayerNear) diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index a9ae6122e6..e5246cdd58 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -31,9 +31,6 @@ namespace CalamityMod.Tiles.AstralDesert //I don't know what this means. Why do palm trees have branches?? Since when. Will ask spriters for an oasis alt later public override Asset GetOasisTopTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree_Tops"); - public override Asset GetBranchTextures() => null; - public override Asset GetOasisBranchTextures() => ModContent.Request("CalamityMod/Tiles/AstralDesert/AstralPalmTree"); - public override int DropWood() => ModContent.ItemType(); diff --git a/Tiles/AstralDesert/AstralPalmTree.png b/Tiles/AstralDesert/AstralPalmTree.png index 904e58ab6f..de3de6bfd4 100644 Binary files a/Tiles/AstralDesert/AstralPalmTree.png and b/Tiles/AstralDesert/AstralPalmTree.png differ diff --git a/Tiles/DraedonStructures/LabHologramProjector.cs b/Tiles/DraedonStructures/LabHologramProjector.cs index a1293c07a4..5c406c9461 100644 --- a/Tiles/DraedonStructures/LabHologramProjector.cs +++ b/Tiles/DraedonStructures/LabHologramProjector.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Tiles.DraedonStructures mp.CurrentlyViewedHologramID = projector?.ID ?? -1; if (mp.CurrentlyViewedHologramID != -1) { - SoundEngine.PlaySound(SoundID.Chat, -1, -1, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.Chat); player.SetTalkNPC(-1); } } diff --git a/Tiles/DraedonStructures/RustedPipes.cs b/Tiles/DraedonStructures/RustedPipes.cs index 1a6f720db9..603b1dca28 100644 --- a/Tiles/DraedonStructures/RustedPipes.cs +++ b/Tiles/DraedonStructures/RustedPipes.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures public override void PlaceInWorld(int i, int j, Item item) { - SoundEngine.PlaySound(SoundID.Item,i * 16, j * 16, 52, 0.75f, -0.5f); + SoundEngine.PlaySound(SoundID.Item52 with { Volume = SoundID.Item52.Volume * 0.75f, Pitch = SoundID.Item52.Pitch - 0.5f }, new Vector2( i * 16, j * 16 )); } } } diff --git a/Tiles/FurnitureAstral/MonolithChest.cs b/Tiles/FurnitureAstral/MonolithChest.cs index 2c5a3c4ac3..e298706f9a 100644 --- a/Tiles/FurnitureAstral/MonolithChest.cs +++ b/Tiles/FurnitureAstral/MonolithChest.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Tiles.FurnitureAstral { if (player.chest < 0) { - SoundEngine.PlaySound(SoundID.NPCKilled, Style: 22, volumeScale: 0.5f); + SoundEngine.PlaySound(SoundID.NPCDeath22 with { Volume = SoundID.NPCDeath22.Volume * 0.5f}); } } } diff --git a/UI/AstralArcanumUI.cs b/UI/AstralArcanumUI.cs index 2af1496cf5..b614015ea1 100644 --- a/UI/AstralArcanumUI.cs +++ b/UI/AstralArcanumUI.cs @@ -137,7 +137,7 @@ namespace CalamityMod.UI { LastHovered = selectedCircle; if (LastHovered != -1) - SoundEngine.PlaySound(SoundID.MenuTick, -1, -1, 1, 1f, 0f); + SoundEngine.PlaySound(SoundID.MenuTick); } string text = "Select"; @@ -161,7 +161,7 @@ namespace CalamityMod.UI if (Main.netMode == NetmodeID.SinglePlayer) { p.TeleportationPotion(); - SoundEngine.PlaySound(SoundID.Item, (int)p.position.X, (int)p.position.Y, 6, 1f, 0f); + SoundEngine.PlaySound(SoundID.Item6, p.position); } else if (Main.netMode == NetmodeID.MultiplayerClient) { diff --git a/UI/CodebreakerUI.cs b/UI/CodebreakerUI.cs index a8b91d9419..49bf20cd83 100644 --- a/UI/CodebreakerUI.cs +++ b/UI/CodebreakerUI.cs @@ -13,6 +13,7 @@ using Terraria.ModLoader; using Terraria.UI.Chat; using Terraria.Audio; using Terraria.GameContent; +using CalamityMod.Sounds; namespace CalamityMod.UI { @@ -29,6 +30,9 @@ namespace CalamityMod.UI public static float GeneralScale => MathHelper.Lerp(1f, 0.7f, Utils.GetLerpValue(1325f, 750f, Main.screenWidth, true)) * Main.UIScale; public static Rectangle MouseScreenArea => Utils.CenteredRectangle(Main.MouseScreen, Vector2.One * 2f); + + public static readonly SoundStyle SummonSound = new("CalamityMod/Sounds/Custom/CodebreakerBeam"); + public static void Draw(SpriteBatch spriteBatch) { // If not viewing the specific tile entity's interface anymore, if the ID is for some reason invalid, or if the player is not equipped to continue viewing the UI @@ -303,7 +307,7 @@ namespace CalamityMod.UI // Also play a cool sound. if (Main.mouseLeft && Main.mouseLeftRelease) { - SoundEngine.PlaySound(SoundID.Zombie, Main.LocalPlayer.Center, 67); + SoundEngine.PlaySound(CommonCalamitySounds.GetZombieSound(67), Main.LocalPlayer.Center); AwaitingDecryptionTextClose = true; codebreakerTileEntity.InitialCellCountBeforeDecrypting = codebreakerTileEntity.InputtedCellCount; codebreakerTileEntity.DecryptionCountdown = codebreakerTileEntity.DecryptionTotalTime; @@ -450,7 +454,7 @@ namespace CalamityMod.UI { CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); - SoundEngine.PlaySound(SoundLoader.GetLegacySoundSlot(CalamityMod.Instance, "Sounds/Custom/CodebreakerBeam"), CalamityWorld.DraedonSummonPosition); + SoundEngine.PlaySound(SummonSound, CalamityWorld.DraedonSummonPosition); if (Main.netMode != NetmodeID.SinglePlayer) { diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 03595c0849..c464de5bb0 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -21,27 +21,18 @@ using System.Linq; using System.Reflection; using System.Text; using Terraria; +using Terraria.Audio; using Terraria.Chat; using Terraria.GameContent.Events; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using TerrariaAudio = Terraria.Audio; namespace CalamityMod { public static partial class CalamityUtils { - /// - /// Gets an instance of a sound that is trackable when used in conjunction with . - /// - /// The path to the sound file. - public static TerrariaAudio.CustomSoundStyle GetTrackableSound(string path) - { - return new TerrariaAudio.CustomSoundStyle(ModContent.Request(path, AssetRequestMode.ImmediateLoad).Value, TerrariaAudio.SoundType.Sound); - } - public static void DisplayLocalizedText(string key, Color? textColor = null) { // An attempt to bypass the need for a separate method and runtime/compile-time parameter