Adds footstep sound variety, makes diving and clown suits have unique footstep sounds!
https://puu.sh/yQ8fs/61e12f15c6.webm TODO: Get rid of the "damagesoundtype" system and replace it with simple "tag" checking to allow customizability from content pack side Fix damagemodifier sounds never being played (I've never once heard LimbArmor play on anything but mantis)
This commit is contained in:
@@ -87,6 +87,10 @@ namespace Barotrauma
|
||||
DebugConsole.ThrowError("File \"" + file + "\" not found!");
|
||||
return null;
|
||||
}
|
||||
|
||||
Sound dupe = Sound.loadedSounds.Find(s => s.filePath == file);
|
||||
if (dupe != null)
|
||||
return dupe;
|
||||
|
||||
return new Sound(file, destroyOnGameEnd);
|
||||
}
|
||||
@@ -100,6 +104,9 @@ namespace Barotrauma
|
||||
{
|
||||
newSound.baseVolume = element.GetAttributeFloat("volume", 1.0f);
|
||||
newSound.range = element.GetAttributeFloat("range", 1000.0f);
|
||||
Sound dupe = Sound.loadedSounds.Find(s => s.filePath == filePath && s.baseVolume == newSound.baseVolume && s.range == newSound.range);
|
||||
if (dupe != null)
|
||||
return dupe;
|
||||
}
|
||||
|
||||
return newSound;
|
||||
|
||||
@@ -271,7 +271,7 @@ namespace Barotrauma
|
||||
public static Sound GetSound(string soundTag)
|
||||
{
|
||||
var matchingSounds = miscSounds[soundTag].ToList();
|
||||
if (matchingSounds.Count == 0) return null;
|
||||
if (matchingSounds.Count == 0) return Sound.Load(soundTag);
|
||||
|
||||
return matchingSounds[Rand.Int(matchingSounds.Count)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user