From 181dba0f96d8792e3565286b3983830674624cc5 Mon Sep 17 00:00:00 2001 From: TrueDoctor Date: Tue, 24 Apr 2018 14:13:58 +0200 Subject: fixed sound playback moved post_processing to base constructor --- DiscoBot/Characters/Character.cs | 18 ++++++------------ DiscoBot/Characters/ICharacter.cs | 2 +- 2 files changed, 7 insertions(+), 13 deletions(-) (limited to 'DiscoBot/Characters') 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); -- cgit v1.3.1