summaryrefslogtreecommitdiff
path: root/DiscoBot/Char.cs
diff options
context:
space:
mode:
authorTrueDoctor <d-kobert@web.de>2017-08-22 20:58:49 +0200
committerTrueDoctor <d-kobert@web.de>2017-08-22 20:58:49 +0200
commitd59a67e552628b464f079bccae20349d649bdd61 (patch)
treeb549066769229d8c7b189efad8ac5bc2dda08015 /DiscoBot/Char.cs
parenteb7a842b8fe784891a8f865cf47cc20e4fcb22b0 (diff)
added syntax highlighting
Diffstat (limited to 'DiscoBot/Char.cs')
-rw-r--r--DiscoBot/Char.cs27
1 files changed, 19 insertions, 8 deletions
diff --git a/DiscoBot/Char.cs b/DiscoBot/Char.cs
index 250810d..28ed7b9 100644
--- a/DiscoBot/Char.cs
+++ b/DiscoBot/Char.cs
@@ -64,23 +64,34 @@ namespace DiscoBot
Proptable.Add("IN", "Intuition");
Proptable.Add("CH", "Charisma");
Proptable.Add("FF", "Fingerfertigkeit");
- Proptable.Add("GE", "Gewandheit");
+ Proptable.Add("GE", "Gewandtheit");
Proptable.Add("KO", "Konstitution");
Proptable.Add("KK", "Körperkraft");
}
- string TestTalent(string talent)
+ public string TestTalent(string talent)
{
- var props =talente.Find(v => v.name.Equals(talent)).Test();
-
- return "";
+ var output = new StringBuilder();
+ var ttalent = talente.Find(v => v.name.Equals(talent));
+ var props =ttalent.Test();
+ int tap = ttalent.value;
+ for (int i = 0; i <= 2; i++)
+ {
+ int temp = dice.Rolld20();
+ int eigenschaft = eigenschaften[Proptable[props[i]]];
+ if (eigenschaft < temp)
+ tap -= temp - eigenschaft ;
+ output.Append(temp+" ");
+ }
+ output.Append("tap: "+ tap);
+ return output.ToString();
}
}
public class Talent
{
public string name, probe;
- private int value;
+ public int value;
public Talent(string name, string probe, int value) { this.name = name; this.probe = probe; this.value = value; }
public string[] Test()
{
@@ -100,10 +111,10 @@ namespace DiscoBot
}
public static class dice
{
+ static System.Random rnd = new System.Random();
public static int Rolld20()
{
- System.Random rnd = new System.Random();
- return rnd.Next(19) + 1;
+ return rnd.Next(1,21) ;
}
}
}