Added more sound effects.

This commit is contained in:
2026-01-04 18:26:51 -05:00
parent e8e31bb143
commit 7f47e2617c
136 changed files with 959 additions and 3 deletions

View File

@@ -43,6 +43,7 @@ public sealed class AudioManager
{
// Load SoundEffects once
LoadPlayerGunPool(content);
LoadGunPools(content);
LoadEnemyGunPool(content);
LoadImpactPool(content);
LoadExplosionPool(content);
@@ -68,6 +69,149 @@ public sealed class AudioManager
_playerGunPool = new VariantSoundPool(playerGunVariants, voicesPerVariant: 1, rng: _random);
}
private void LoadGunPools(ContentManager content)
{
var minigunSmallVariants = new[]
{
content.Load<SoundEffect>("Sfx/Pistol/GUNPis_Pistol Fire_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Pistol/GUNPis_Pistol Fire_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Pistol/GUNPis_Pistol Fire_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Pistol/GUNPis_Pistol Fire_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Pistol/GUNPis_Pistol Fire_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Pistol/GUNPis_Pistol Fire_06_SFRMS_SCIWPNS")
};
var minigunLargeVariants = new[]
{
content.Load<SoundEffect>("Sfx/GUNAuto_Assault Rifle A Fire_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/GUNAuto_Assault Rifle A Fire_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/GUNAuto_Assault Rifle A Fire_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/GUNAuto_Assault Rifle A Fire_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/GUNAuto_Assault Rifle A Fire_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/GUNAuto_Assault Rifle A Fire_06_SFRMS_SCIWPNS")
};
// Laser
//LASRGun_Alien Handgun Fire Light_01_SFRMS_SCIWPNS
var laserSmallVariants = new[]
{
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Light_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Light_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Light_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Light_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Light_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Light_06_SFRMS_SCIWPNS")
};
var laserMediumVariants = new[]
{
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_06_SFRMS_SCIWPNS")
};
var laserLargeVariants = new[]
{
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Alien Handgun/LASRGun_Alien Handgun Fire Heavy_06_SFRMS_SCIWPNS")
};
// Plasma
//GUNAuto_Plasmid Machinegun Single_01_SFRMS_SCIWPNS
//GUNAuto_Plasmid Machinegun B Single_01_SFRMS_SCIWPNS
var plasmaSmallVariants = new[]
{
content.Load<SoundEffect>("Sfx/Plasmid Machinegun/GUNAuto_Plasmid Machinegun Single_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun/GUNAuto_Plasmid Machinegun Single_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun/GUNAuto_Plasmid Machinegun Single_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun/GUNAuto_Plasmid Machinegun Single_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun/GUNAuto_Plasmid Machinegun Single_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun/GUNAuto_Plasmid Machinegun Single_06_SFRMS_SCIWPNS")
};
var plasmaMediumVariants = new[]
{
content.Load<SoundEffect>("Sfx/Plasmid Machinegun B/GUNAuto_Plasmid Machinegun B Single_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun B/GUNAuto_Plasmid Machinegun B Single_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun B/GUNAuto_Plasmid Machinegun B Single_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun B/GUNAuto_Plasmid Machinegun B Single_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun B/GUNAuto_Plasmid Machinegun B Single_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun B/GUNAuto_Plasmid Machinegun B Single_06_SFRMS_SCIWPNS")
};
var plasmaLargeVariants = new[]
{
content.Load<SoundEffect>("Sfx/Plasmid Machinegun C/GUNAuto_Plasmid Machinegun C Single_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun C/GUNAuto_Plasmid Machinegun C Single_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun C/GUNAuto_Plasmid Machinegun C Single_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun C/GUNAuto_Plasmid Machinegun C Single_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun C/GUNAuto_Plasmid Machinegun C Single_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/Plasmid Machinegun C/GUNAuto_Plasmid Machinegun C Single_06_SFRMS_SCIWPNS")
};
// Proton
var protonSmallVariants = new[]
{
content.Load<SoundEffect>("Sfx/RPU1/GUNAuto_RPU1 Fire_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1/GUNAuto_RPU1 Fire_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1/GUNAuto_RPU1 Fire_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1/GUNAuto_RPU1 Fire_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1/GUNAuto_RPU1 Fire_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1/GUNAuto_RPU1 Fire_06_SFRMS_SCIWPNS")
};
var protonMediumVariants = new[]
{
content.Load<SoundEffect>("Sfx/RPU1 B/GUNAuto_RPU1 B Fire_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 B/GUNAuto_RPU1 B Fire_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 B/GUNAuto_RPU1 B Fire_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 B/GUNAuto_RPU1 B Fire_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 B/GUNAuto_RPU1 B Fire_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 B/GUNAuto_RPU1 B Fire_06_SFRMS_SCIWPNS")
};
var protonLargeVariants = new[]
{
content.Load<SoundEffect>("Sfx/RPU1 C/GUNAuto_RPU1 C Fire_01_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 C/GUNAuto_RPU1 C Fire_02_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 C/GUNAuto_RPU1 C Fire_03_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 C/GUNAuto_RPU1 C Fire_04_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 C/GUNAuto_RPU1 C Fire_05_SFRMS_SCIWPNS"),
content.Load<SoundEffect>("Sfx/RPU1 C/GUNAuto_RPU1 C Fire_06_SFRMS_SCIWPNS")
};
//GUNAuto_RPU1 Fire_01_SFRMS_SCIWPNS
_playerGunPool2.Add(BulletKind.MinigunSmall, new VariantSoundPool(minigunSmallVariants, voicesPerVariant: 1, rng: _random));
//_playerGunPool2.Add(BulletKind.MinigunMedium, new VariantSoundPool(minigunLargeVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.MinigunLarge, new VariantSoundPool(minigunLargeVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.LaserSmall, new VariantSoundPool(laserSmallVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.LaserMedium, new VariantSoundPool(laserMediumVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.LaserLarge, new VariantSoundPool(laserLargeVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.PlasmaSmall, new VariantSoundPool(plasmaSmallVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.PlasmaMedium, new VariantSoundPool(plasmaMediumVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.PlasmaLarge, new VariantSoundPool(plasmaLargeVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.ProtonSmall, new VariantSoundPool(protonSmallVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.ProtonMedium, new VariantSoundPool(protonMediumVariants, voicesPerVariant: 1, rng: _random));
_playerGunPool2.Add(BulletKind.ProtonLarge, new VariantSoundPool(protonLargeVariants, voicesPerVariant: 1, rng: _random));
}
private void LoadEnemyGunPool(ContentManager content)
{
var variants = new[]
@@ -215,6 +359,25 @@ public sealed class AudioManager
);
}
public void PlayPlayerFire(BulletKind bulletKind)
{
if (!_playerGunLimiter.TryConsume())
return;
if (_playerGunPool2.TryGetValue(bulletKind, out VariantSoundPool soundPool) == false)
return;
// Bullet sounds should be short + quiet-ish
float baseVol = 0.35f;
float vol = baseVol * RandRange(0.92f, 1.05f);
float pitch = RandRange(-0.05f, 0.05f);
soundPool.Play(
volume: Clamp01(MasterVolume * SfxVolume * vol),
pitch: pitch
);
}
public void PlayEnemyFire()
{
if (!_enemyGunLimiter.TryConsume()) return;