summaryrefslogtreecommitdiff
path: root/DSACore/Auxiliary/TalentEnumerableExtension.cs
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
committerDennis Kobert <d-kobert@web.de>2019-05-19 16:03:38 +0200
commitf89f308c525e9deebc6d2cf6416e27dfe1a299dc (patch)
tree7097ef871ead0245efda696198443eab8e443d3a /DSACore/Auxiliary/TalentEnumerableExtension.cs
parentf3983341be939235c1a6cd522b3bb5cc318a6d1a (diff)
Cleanup DiscoBot Project
Diffstat (limited to 'DSACore/Auxiliary/TalentEnumerableExtension.cs')
-rw-r--r--DSACore/Auxiliary/TalentEnumerableExtension.cs39
1 files changed, 14 insertions, 25 deletions
diff --git a/DSACore/Auxiliary/TalentEnumerableExtension.cs b/DSACore/Auxiliary/TalentEnumerableExtension.cs
index a4ace2f..159480d 100644
--- a/DSACore/Auxiliary/TalentEnumerableExtension.cs
+++ b/DSACore/Auxiliary/TalentEnumerableExtension.cs
@@ -15,12 +15,10 @@ namespace DSACore.Auxiliary
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
- int tap = tTalent.Value; // get taw
+ var tap = tTalent.Value; // get taw
var werte = props.Select(p => c.Eigenschaften[c.PropTable[p]]).ToList();
output.AppendFormat(
@@ -34,51 +32,42 @@ namespace DSACore.Auxiliary
output.Append(" ");
tap -= erschwernis;
- int gesamtErschwernis = tap;
+ var gesamtErschwernis = tap;
if (gesamtErschwernis < 0)
{
tap = 0;
- for (int i = 0; i <= 2; i++)
+ for (var i = 0; i <= 2; i++)
{
// foreach property, dice and tap
- int temp = Dice.Roll();
- int eigenschaft = c.Eigenschaften[c.PropTable[props[i]]];
+ var temp = Dice.Roll();
+ var eigenschaft = c.Eigenschaften[c.PropTable[props[i]]];
- if (eigenschaft + gesamtErschwernis < temp)
- {
- tap -= temp - (eigenschaft + gesamtErschwernis);
- }
+ if (eigenschaft + gesamtErschwernis < temp) tap -= temp - (eigenschaft + gesamtErschwernis);
output.Append($"[{temp}]"); // add to string
}
- if (tap >= 0)
- {
- tap = 1;
- }
+ if (tap >= 0) tap = 1;
}
else
{
- for (int i = 0; i <= 2; i++)
+ for (var i = 0; i <= 2; i++)
{
// foreach property, dice and tap
- int temp = Dice.Roll();
- int eigenschaft = c.Eigenschaften[c.PropTable[props[i]]];
+ var temp = Dice.Roll();
+ var eigenschaft = c.Eigenschaften[c.PropTable[props[i]]];
- if (eigenschaft < temp)
- {
- tap -= temp - eigenschaft;
- }
+ if (eigenschaft < temp) tap -= temp - eigenschaft;
output.Append($"[{temp}]"); // add to string
}
}
- tap = (tap == 0) ? 1 : tap;
-
+ tap = tap == 0 ? 1 : tap;
+
output.AppendFormat(" tap: {0,2}", tap);
return output.ToString(); // return output
}
}
-}
+} \ No newline at end of file