diff options
author | TrueDoctor <d-kobert@web.de> | 2018-04-24 14:13:58 +0200 |
---|---|---|
committer | TrueDoctor <d-kobert@web.de> | 2018-04-24 14:13:58 +0200 |
commit | 181dba0f96d8792e3565286b3983830674624cc5 (patch) | |
tree | 9c6a5fc00bf69aad09d5a335c59a11854ae49002 /DiscoBot/Characters | |
parent | e5e0c1c5c9fb6afd68ebe9dc075af23f46f11e25 (diff) |
fixed sound playback
moved post_processing to base constructor
Diffstat (limited to 'DiscoBot/Characters')
-rw-r--r-- | DiscoBot/Characters/Character.cs | 18 | ||||
-rw-r--r-- | DiscoBot/Characters/ICharacter.cs | 2 |
2 files changed, 7 insertions, 13 deletions
diff --git a/DiscoBot/Characters/Character.cs b/DiscoBot/Characters/Character.cs index 9d84fa8..c092154 100644 --- a/DiscoBot/Characters/Character.cs +++ b/DiscoBot/Characters/Character.cs @@ -21,12 +21,13 @@ this.PropTable.Add("GE", "Gewandtheit"); this.PropTable.Add("KO", "Konstitution"); this.PropTable.Add("KK", "Körperkraft"); + + this.Post_process(); // calculate derived values } public Character(string path) : this() { this.Load(path); // load - this.Post_process(); // calculate derived values } public Character(Character c, string name, int stDv = 2) : this() @@ -69,8 +70,6 @@ public string TestTalent(string talent, int erschwernis = 0) // Talentprobe { - try - { var output = new StringBuilder(); var sc = new SpellCorrect(); var tTalent = this.Talente.OrderBy(x => sc.Compare(talent, x.Name)).First(); @@ -138,19 +137,15 @@ tap = (tap == 0) ? 1 : tap; - if(tap < 0) + if (tap < 0) { SoundEffects.Play(Sound.Wrong).Wait(); } + output.AppendFormat(" tap: {0,2}", tap); return output.ToString(); // return output - } - catch (Exception) - { - throw new Exception( - $"{talent} nicht vorhanden! Besitzt {this.Name} {talent} nicht? \n Oder ist {talent} falsch geschrieben?"); - } + } public string TestEigenschaft(string eigenschaft, int erschwernis = 0) @@ -247,8 +242,7 @@ var KO__Wert = this.Eigenschaften.First(s => s.Key.Contains("Konst")).Value; this.Lebenspunkte = LE_Wert + (int)(KO__Wert + (KK_Wert/2.0) + 0.5); - - + } private void Load(string path) diff --git a/DiscoBot/Characters/ICharacter.cs b/DiscoBot/Characters/ICharacter.cs index 62bc1a5..e8bc653 100644 --- a/DiscoBot/Characters/ICharacter.cs +++ b/DiscoBot/Characters/ICharacter.cs @@ -10,7 +10,7 @@ //int Astralpunkte { get; set; } - //int Karmalpunkte { get; set; } + //int Karmapunkte { get; set; } string TestTalent(string talent, int erschwernis = 0); |