summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2018-06-07 11:41:30 +0200
committerTrueDoctor <d-kobert@web.de>2018-06-07 11:41:30 +0200
commitc1d0851ec35c410733da53b919541b8fab491407 (patch)
tree46a397de524f3b913343cb71c4e9f99a8661c5e0
parent5b87516befe2e4fd0d2f4b372747836d2abf0c8c (diff)
fixed Dice and Soundplayback errors
-rw-r--r--DiscoBot/Auxiliary/RandomMisc.cs11
-rw-r--r--DiscoBot/Auxiliary/TalentEnumerableExtension.cs12
-rw-r--r--DiscoBot/DSA_Game/Characters/Character.cs19
3 files changed, 32 insertions, 10 deletions
diff --git a/DiscoBot/Auxiliary/RandomMisc.cs b/DiscoBot/Auxiliary/RandomMisc.cs
index b0df456..7ba625e 100644
--- a/DiscoBot/Auxiliary/RandomMisc.cs
+++ b/DiscoBot/Auxiliary/RandomMisc.cs
@@ -28,11 +28,12 @@
sum += roll;
output.Append("[" + roll + "] ");
}
-
- if (count > 1)
- {
- output.Append("sum: " + sum);
- }
+
+ if (strings.Count > 1)
+ {
+ sum += Convert.ToInt32(strings[1]);
+ output.Append("sum: " + sum);
+ }
return output.ToString();
}
diff --git a/DiscoBot/Auxiliary/TalentEnumerableExtension.cs b/DiscoBot/Auxiliary/TalentEnumerableExtension.cs
index 83975e7..c366674 100644
--- a/DiscoBot/Auxiliary/TalentEnumerableExtension.cs
+++ b/DiscoBot/Auxiliary/TalentEnumerableExtension.cs
@@ -21,7 +21,11 @@ namespace DiscoBot.Auxiliary
if (sc.Compare(talent, tTalent.Name) > SpellCorrect.ErrorThreshold)
{
- SoundEffects.Play(Sound.Wrong);
+ try
+ {
+ SoundEffects.Play(Sound.Stupid);
+ }
+ catch { }
return $"{c.Name} kann nicht {talent}...";
}
@@ -84,7 +88,11 @@ namespace DiscoBot.Auxiliary
if (tap < 0)
{
- //SoundEffects.Play(Sound.Wrong).Wait();
+ try
+ {
+ SoundEffects.Play(Sound.Wrong);
+ }
+ catch { }
}
output.AppendFormat(" tap: {0,2}", tap);
diff --git a/DiscoBot/DSA_Game/Characters/Character.cs b/DiscoBot/DSA_Game/Characters/Character.cs
index d92fc63..5c39fc5 100644
--- a/DiscoBot/DSA_Game/Characters/Character.cs
+++ b/DiscoBot/DSA_Game/Characters/Character.cs
@@ -118,7 +118,12 @@
var attack = this.Kampftalente.OrderBy(x => sc.Compare(talent, x.Name)).First();
if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold)
{
- SoundEffects.Play(Sound.Wrong);
+ try
+ {
+ SoundEffects.Play(Sound.Wrong);
+ }
+ catch { }
+
return $"{this.Name} kann nicht mit der Waffenart {talent} umgehen...";
}
@@ -142,7 +147,11 @@
if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold)
{
- SoundEffects.Play(Sound.Wrong);
+ try
+ {
+ SoundEffects.Play(Sound.Wrong);
+ }
+ catch { }
return $"{this.Name} kann nicht mit der Waffenart {talent} umgehen...";
}
@@ -166,7 +175,11 @@
var attack = this.Talente.OrderBy(x => sc.Compare(talent, x.Name)).First();
if (sc.Compare(talent, attack.Name) > SpellCorrect.ErrorThreshold)
{
- SoundEffects.Play(Sound.Wrong);
+ try
+ {
+ SoundEffects.Play(Sound.Wrong);
+ }
+ catch { }
return $"{this.Name} kann nicht mit der Waffenart {talent} umgehen...";
}