From 2ab4051c6fe720dc47e99b0c305a0d779ee02d51 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 19 May 2019 17:58:42 +0200 Subject: Moved Gamelogic to DSALib --- DSACore/Auxiliary/TalentEnumerableExtension.cs | 73 -------------------------- 1 file changed, 73 deletions(-) delete mode 100644 DSACore/Auxiliary/TalentEnumerableExtension.cs (limited to 'DSACore/Auxiliary/TalentEnumerableExtension.cs') diff --git a/DSACore/Auxiliary/TalentEnumerableExtension.cs b/DSACore/Auxiliary/TalentEnumerableExtension.cs deleted file mode 100644 index d83114c..0000000 --- a/DSACore/Auxiliary/TalentEnumerableExtension.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DSACore.DSA_Game.Characters; -using DSALib; - -namespace DSACore.Auxiliary -{ - public static class TalentEnumerableExtension - { - public static string ProbenTest(this IEnumerable List, Character c, string talent, int erschwernis = 0) - { - var output = new StringBuilder(); - var sc = new SpellCorrect(); - var tTalent = List.OrderBy(x => sc.Compare(talent, x.Name)).First(); - - if (sc.Compare(talent, tTalent.Name) > SpellCorrect.ErrorThreshold) - return $"{c.Name} kann nicht {talent}..."; - - var props = tTalent.GetEigenschaften(); // get the required properties - var tap = tTalent.Value; // get taw - var werte = props.Select(p => c.Eigenschaften[c.PropTable[p]]).ToList(); - - output.AppendFormat( - "{0} würfelt: {1} \n{2} - {3} taw:{4} {5} \n", - c.Name, - tTalent.Name, - tTalent.Probe, - string.Join("/", werte), - tTalent.Value, - erschwernis.Equals(0) ? string.Empty : "Erschwernis: " + erschwernis); - - output.Append(" "); - tap -= erschwernis; - var gesamtErschwernis = tap; - if (gesamtErschwernis < 0) - { - tap = 0; - for (var i = 0; i <= 2; i++) - { - // foreach property, dice and tap - var temp = Dice.Roll(); - var eigenschaft = c.Eigenschaften[c.PropTable[props[i]]]; - - if (eigenschaft + gesamtErschwernis < temp) tap -= temp - (eigenschaft + gesamtErschwernis); - - output.Append($"[{temp}]"); // add to string - } - - if (tap >= 0) tap = 1; - } - else - { - for (var i = 0; i <= 2; i++) - { - // foreach property, dice and tap - var temp = Dice.Roll(); - var eigenschaft = c.Eigenschaften[c.PropTable[props[i]]]; - - if (eigenschaft < temp) tap -= temp - eigenschaft; - - output.Append($"[{temp}]"); // add to string - } - } - - tap = tap == 0 ? 1 : tap; - - output.AppendFormat(" tap: {0,2}", tap); - - return output.ToString(); // return output - } - } -} \ No newline at end of file -- cgit v1.2.3-54-g00ecf