From e6181c24124d97f2fbc932b8a68311e625463156 Mon Sep 17 00:00:00 2001 From: uzvkl Date: Tue, 11 Jun 2019 23:05:52 +0200 Subject: Move dsa related stuff to subfolder --- DSALib/Auxiliary/TalentEnumerableExtension.cs | 74 --------------------------- 1 file changed, 74 deletions(-) delete mode 100644 DSALib/Auxiliary/TalentEnumerableExtension.cs (limited to 'DSALib/Auxiliary/TalentEnumerableExtension.cs') diff --git a/DSALib/Auxiliary/TalentEnumerableExtension.cs b/DSALib/Auxiliary/TalentEnumerableExtension.cs deleted file mode 100644 index 6ec7fcc..0000000 --- a/DSALib/Auxiliary/TalentEnumerableExtension.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Text; -using DSACore.Auxiliary; -using DSALib.DSA_Game.Characters; -using DSALib.Models.Dsa; - -namespace DSALib.Auxiliary -{ - public static class TalentEnumerableExtension - { - public static string ProbenTest(this IEnumerable List, Character c, string talentName, int erschwernis = 0) - { - var output = new StringBuilder(); - var sc = new SpellCorrect(); - - if (!List.TryMatch(out var iTalent, talentName)) - return $"{c.Name} kann nicht {talentName}..."; - - var talent = (Talent) iTalent; - var props = talent.GetEigenschaften(); // get the required properties - var tap = talent.Value; // get taw - var werte = props.Select(p => c.Eigenschaften[c.PropTable[p]]).ToArray(); - - output.AppendFormat( - "{0} würfelt: {1} \n{2} - {3} taw:{4} {5} \n", - c.Name, - talent.Name, - talent.Probe, - string.Join("/", werte), - talent.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