diff --git a/AlientAttack.MonoGame/Audio/AudioManager.cs b/AlientAttack.MonoGame/Audio/AudioManager.cs index b8c39e3..a6cee7a 100644 --- a/AlientAttack.MonoGame/Audio/AudioManager.cs +++ b/AlientAttack.MonoGame/Audio/AudioManager.cs @@ -1,4 +1,5 @@ -using AlienAttack.MonoGame.Things.Items; +using AlienAttack.MonoGame.Things.Bullets; +using AlienAttack.MonoGame.Things.Items; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Audio; using Microsoft.Xna.Framework.Content; @@ -18,10 +19,14 @@ public sealed class AudioManager // Pools private VariantSoundPool _playerGunPool = default!; + private readonly Dictionary _playerGunPool2 = []; + private VariantSoundPool _enemyGunPool = default!; + private readonly Dictionary _enemyGunPool2 = []; + private VariantSoundPool _explosionPool = default!; private VariantSoundPool _impactPool = default!; - private Dictionary _pickupPool = []; + private readonly Dictionary _pickupPool = []; // Rate limiters (global caps per category/event) private RateLimiter _playerGunLimiter = new(0.06f); // max ~16 plays/sec @@ -45,6 +50,7 @@ public sealed class AudioManager LoadShieldPickupPool(content); LoadAmmoPickupPool(content); LoadRocketsPickupPool(content); + LoadPlasmaPickupPool(content); } private void LoadPlayerGunPool(ContentManager content) @@ -155,6 +161,23 @@ public sealed class AudioManager _pickupPool.Add(PickupKind.Rockets, new VariantSoundPool(variants, voicesPerVariant: 1, rng: _random)); } + //SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS + + private void LoadPlasmaPickupPool(ContentManager content) + { + var variants = new[] + { + content.Load("Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS"), + content.Load("Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_02_SFRMS_SCIWPNS"), + content.Load("Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_03_SFRMS_SCIWPNS"), + content.Load("Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_04_SFRMS_SCIWPNS"), + content.Load("Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_05_SFRMS_SCIWPNS"), + content.Load("Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_06_SFRMS_SCIWPNS"), + }; + + _pickupPool.Add(PickupKind.Plasma, new VariantSoundPool(variants, voicesPerVariant: 1, rng: _random)); + } + //GUNMech_Rocket Launcher Reload_01_SFRMS_SCIWPNS // Call this once per frame diff --git a/AlientAttack.MonoGame/Content/Content.mgcb b/AlientAttack.MonoGame/Content/Content.mgcb index 2f3c15e..4454dbc 100644 --- a/AlientAttack.MonoGame/Content/Content.mgcb +++ b/AlientAttack.MonoGame/Content/Content.mgcb @@ -355,6 +355,120 @@ /processorParam:Quality=Best /build:Sfx/Rocket Launcher/GUNMech_Rocket Launcher Reload_11_SFRMS_SCIWPNS.wav;Sfx/Rocket Launcher/GUNMech_Rocket Launcher Reload_11_SFRMS_SCIWPNS +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_01_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_01_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_01_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_02_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_02_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_02_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_03_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_03_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_03_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_04_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_04_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_04_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_05_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_05_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_05_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_06_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_06_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_06_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_01_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_01_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_01_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_02_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_02_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_02_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_03_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_03_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_03_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_04_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_04_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_04_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_05_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_05_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_05_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_06_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_06_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_06_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_07_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_07_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_07_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_02_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_02_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_02_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_03_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_03_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_03_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_04_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_04_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_04_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_05_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_05_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_05_SFRMS_SCIWPNS + +#begin Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_06_SFRMS_SCIWPNS.wav +/importer:WavImporter +/processor:SoundEffectProcessor +/processorParam:Quality=Best +/build:Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_06_SFRMS_SCIWPNS.wav;Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_06_SFRMS_SCIWPNS + #begin Sfx/Shield/SCIEnrg_Shield Activate_01_SFRMS_SCIWPNS.wav /importer:WavImporter /processor:SoundEffectProcessor diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_01_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_01_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..2f01b30 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_01_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_02_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_02_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..c44b215 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_02_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_03_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_03_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..9a2588d Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_03_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_04_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_04_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..9d7409b Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_04_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_05_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_05_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..073bcb6 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_05_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_06_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_06_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..6a055c8 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire Heavy_06_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_01_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_01_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..bf2003b Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_01_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_02_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_02_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..33e8da3 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_02_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_03_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_03_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..4b187d1 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_03_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_04_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_04_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..dd46f25 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_04_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_05_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_05_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..4fac2fa Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_05_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_06_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_06_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..7c24903 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_06_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_07_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_07_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..4867ac7 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/GUNTech_Sci Fi Shotgun Fire_07_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..6bd5a88 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_01_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_02_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_02_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..0c1c507 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_02_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_03_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_03_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..ec2979f Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_03_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_04_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_04_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..3865c05 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_04_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_05_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_05_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..e57dd00 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_05_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_06_SFRMS_SCIWPNS.wav b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_06_SFRMS_SCIWPNS.wav new file mode 100644 index 0000000..4599727 Binary files /dev/null and b/AlientAttack.MonoGame/Content/Sfx/Sci Fi Shotgun/SCIMisc_Sci Fi Shotgun Reload_06_SFRMS_SCIWPNS.wav differ diff --git a/AlientAttack.MonoGame/Things/Bullets/BulletKind.cs b/AlientAttack.MonoGame/Things/Bullets/BulletKind.cs new file mode 100644 index 0000000..6a4b219 --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/BulletKind.cs @@ -0,0 +1,17 @@ +namespace AlienAttack.MonoGame.Things.Bullets; + +public enum BulletKind +{ + LaserSmall, + LaserMedium, + LaserLarge, + MinigunSmall, + MinigunMedium, + MinigunLarge, + PlasmaSmall, + PlasmaMedium, + PlasmaLarge, + ProtonSmall, + ProtonMedium, + ProtonLarge +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/LaserBulletLarge.cs b/AlientAttack.MonoGame/Things/Bullets/LaserBulletLarge.cs new file mode 100644 index 0000000..aa63f2d --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/LaserBulletLarge.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class LaserBulletLarge : Bullet +{ + public const int Width = 8; + public const int Height = 28; + + public LaserBulletLarge(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 3; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Laser_Large"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/LaserBulletMedium.cs b/AlientAttack.MonoGame/Things/Bullets/LaserBulletMedium.cs new file mode 100644 index 0000000..fc41588 --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/LaserBulletMedium.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class LaserBulletMedium : Bullet +{ + public const int Width = 7; + public const int Height = 21; + + public LaserBulletMedium(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 2; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Laser_Medium"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/LaserBulletSmall.cs b/AlientAttack.MonoGame/Things/Bullets/LaserBulletSmall.cs new file mode 100644 index 0000000..73c55ba --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/LaserBulletSmall.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class LaserBulletSmall : Bullet +{ + public const int Width = 6; + public const int Height = 18; + + public LaserBulletSmall(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 1; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Laser_Small"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletLarge.cs b/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletLarge.cs new file mode 100644 index 0000000..72c283f --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletLarge.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class PlasmaBulletLarge : Bullet +{ + public const int Width = 9; + public const int Height = 31; + + public PlasmaBulletLarge(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 3; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Plasma_Large"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletMedium.cs b/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletMedium.cs new file mode 100644 index 0000000..506c43a --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletMedium.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class PlasmaBulletMedium : Bullet +{ + public const int Width = 8; + public const int Height = 26; + + public PlasmaBulletMedium(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 2; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Plasma_Medium"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletSmall.cs b/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletSmall.cs new file mode 100644 index 0000000..36a07af --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/PlasmaBulletSmall.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class PlasmaBulletSmall : Bullet +{ + public const int Width = 7; + public const int Height = 24; + + public PlasmaBulletSmall(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 1; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Plasma_Small"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/ProtonBulletLarge.cs b/AlientAttack.MonoGame/Things/Bullets/ProtonBulletLarge.cs new file mode 100644 index 0000000..d244091 --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/ProtonBulletLarge.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class ProtonBulletLarge : Bullet +{ + public const int Width = 13; + public const int Height = 13; + + public ProtonBulletLarge(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 3; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Proton_Large"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/ProtonBulletMedium.cs b/AlientAttack.MonoGame/Things/Bullets/ProtonBulletMedium.cs new file mode 100644 index 0000000..a08a4d5 --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/ProtonBulletMedium.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class ProtonBulletMedium : Bullet +{ + public const int Width = 10; + public const int Height = 10; + + public ProtonBulletMedium(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 2; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Proton_Medium"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Bullets/ProtonBulletSmall.cs b/AlientAttack.MonoGame/Things/Bullets/ProtonBulletSmall.cs new file mode 100644 index 0000000..1b9bd56 --- /dev/null +++ b/AlientAttack.MonoGame/Things/Bullets/ProtonBulletSmall.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using System; + +namespace AlienAttack.MonoGame.Things.Bullets; + +internal class ProtonBulletSmall : Bullet +{ + public const int Width = 6; + public const int Height = 6; + + public ProtonBulletSmall(float x, float y, float xVel, float yVel, Sprite owner) : base(x, y, xVel, yVel, owner) + { + BoundBox = new(0, 0, Width, Height); + Damage = 1; + } + + public override void Draw(SpriteDrawArgs args) + { + Texture2D texture = args.Content.Load(@$"Sprites\Proton_Small"); + + float rotation = MathF.Atan2(YVelocity, XVelocity) + MathF.PI / 2f; + Vector2 origin = new(texture.Width / 2f, texture.Height / 2f); + + args.SpriteBatch.Draw(texture, Position, null, DrawColor, rotation, origin, 1f, SpriteEffects.None, 1); + } +} \ No newline at end of file diff --git a/AlientAttack.MonoGame/Things/Weapons/Minigun.cs b/AlientAttack.MonoGame/Things/Weapons/Minigun.cs index 6305052..48107c3 100644 --- a/AlientAttack.MonoGame/Things/Weapons/Minigun.cs +++ b/AlientAttack.MonoGame/Things/Weapons/Minigun.cs @@ -22,53 +22,6 @@ internal class Minigun : Weapon context.SpawnSprite(bullet1); context.SpawnSprite(bullet2); - //int number = context.Random.Next(1, 7); - - //SoundEffect soundEffect = context.Content.Load(@$"Sfx\GUNAuto_Assault Rifle A Fire_0{number}_SFRMS_SCIWPNS"); - //soundEffect.Play(0.25f, (float)(context.Random.NextDouble() * 0.1 - 0.05), 0); - - context.AudioManager.PlayPlayerFire(); - } -} - -internal class MinigunSpread : Weapon -{ - public override int FireThreshold => 20; - - public override void Fire(Sprite owner, SpriteUpdateContext context) - { - // Calculate bullet spawn positions relative to the player's bounding box - int x1 = (int)owner.XPosition + 14; - int x2 = (int)owner.XPosition + owner.BoundBox.Width - 16; - int x3 = (int)owner.XPosition + owner.BoundBox.Width / 2 - 1; - int y = (int)owner.YPosition + 10; - - MinigunBulletLarge bullet1 = new(x1, y, -1, -6, owner); - MinigunBulletLarge bullet2 = new(x2, y, 1, -6, owner); - MinigunBulletLarge bullet3 = new(x3, y-16, 0, -6, owner); - - //context.SpawnSprite(bullet1); - //context.SpawnSprite(bullet2); - //context.SpawnSprite(bullet3); - - FireBulletFromMuzzleContext fireBulletContext = new() - { - Owner = owner, - SpriteUpdateContext = context, - BulletWidth = MinigunBulletLarge.Width, - BulletHeight = MinigunBulletLarge.Height, - Factory = (x, y, vx, vy2, o) => new MinigunBulletLarge(x, y, vx, vy2, o), - ExtraOffset = new(4f, 0), - Shots = - [ - new() { Muzzle = MuzzleId.Left, XVelocity = -1, YVelocity = -6 }, - new() { Muzzle = MuzzleId.Right, XVelocity = 1, YVelocity = -6 }, - new() { Muzzle = MuzzleId.Center, XVelocity = 0, YVelocity = -6 } - ] - }; - - FireFromMuzzle(fireBulletContext); - context.AudioManager.PlayPlayerFire(); } } @@ -204,9 +157,9 @@ internal abstract class MinigunTripleSpread : Weapon { Owner = owner, SpriteUpdateContext = context, - BulletWidth = MinigunBulletLarge.Width, - BulletHeight = MinigunBulletLarge.Height, - Factory = (x, y, vx, vy2, o) => new MinigunBulletLarge(x, y, vx, vy2, o), + BulletWidth = LaserBulletLarge.Width, + BulletHeight = LaserBulletLarge.Height, + Factory = (x, y, vx, vy2, o) => new LaserBulletLarge(x, y, vx, vy2, o), ExtraOffset = new(4f, 0), Shots = [