diff options
Diffstat (limited to 'DiscoBot/Audio/Soundeffects.cs')
-rw-r--r-- | DiscoBot/Audio/Soundeffects.cs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/DiscoBot/Audio/Soundeffects.cs b/DiscoBot/Audio/Soundeffects.cs index 919e149..f3a014c 100644 --- a/DiscoBot/Audio/Soundeffects.cs +++ b/DiscoBot/Audio/Soundeffects.cs @@ -24,12 +24,17 @@ public static class SoundEffects { - public static int Volume { get; set; } = 50; + public static int MaxVolume { get; set; } = 50; public static void Play(string s) { string url = string.Empty; int volume = 255; + + var tSound = DSA_Game.Save.Properties.Sounds.OrderBy(x => SpellCorrect.CompareEasy(s, x.Name)).First(); + + url = s; + switch (s) { case "Bell": @@ -64,16 +69,15 @@ break; } - var tSound = DSA_Game.Save.Properties.Sounds.OrderBy(x => SpellCorrect.CompareEasy(s, x.Name)).First(); - - url = s; + - if (SpellCorrect.CompareEasy(s, tSound.Name) > SpellCorrect.ErrorThreshold) + if (SpellCorrect.CompareEasy(s, tSound.Name) < SpellCorrect.ErrorThreshold) { url = tSound.Url; + volume = tSound.Volume; } - volume = (int)(volume * (Volume / 100.0)); + volume = (int)(volume * (MaxVolume / 100.0)); if (url != string.Empty) |