diff options
author | TrueDoctor <d-kobert@web.de> | 2017-08-22 23:20:23 +0200 |
---|---|---|
committer | TrueDoctor <d-kobert@web.de> | 2017-08-22 23:20:23 +0200 |
commit | 5861eccde04faa9c1584c6705a69040182296f93 (patch) | |
tree | 504e390724c26a0a044bc73189cfd8fdd118e546 /DiscoBot/Char.cs | |
parent | d59a67e552628b464f079bccae20349d649bdd61 (diff) |
added support for more charackters
automated char selection
attack parade ranged combat
Diffstat (limited to 'DiscoBot/Char.cs')
-rw-r--r-- | DiscoBot/Char.cs | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/DiscoBot/Char.cs b/DiscoBot/Char.cs index 28ed7b9..d64f434 100644 --- a/DiscoBot/Char.cs +++ b/DiscoBot/Char.cs @@ -10,7 +10,7 @@ namespace DiscoBot public class Char { - string name; + public string name; public Dictionary<string, int> eigenschaften = new Dictionary<string, int>(); public List<Talent> talente = new List<Talent>(); public List<Kampf> kampftalente = new List<Kampf>(); @@ -18,7 +18,7 @@ namespace DiscoBot public Dictionary<string, string> Proptable = new Dictionary<string, string>(); - public Char(String path = "Felis.xml") + public Char(String path ) { Load(path); @@ -73,19 +73,43 @@ namespace DiscoBot { var output = new StringBuilder(); var ttalent = talente.Find(v => v.name.Equals(talent)); - var props =ttalent.Test(); + 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+" "); + tap -= temp - eigenschaft; + output.Append(temp + " "); } - output.Append("tap: "+ tap); + output.Append("tap: " + tap); return output.ToString(); } + public string Angriff(string talent) + { + var attack = kampftalente.Find(x => x.name.Equals(talent)); + int tap = attack.at/*+eigenschaften["at"]*/; + int temp = dice.Rolld20(); + tap -= temp; + return temp + " " + tap; + } + public string Parade(string talent) + { + var attack = kampftalente.Find(x => x.name.Equals(talent)); + int tap = attack.pa /*+ eigenschaften["pa"]*/; + int temp = dice.Rolld20(); + tap -= temp; + return temp + " " + tap; + } + public string Fernkampf(string talent,int erschwernis=0) + { + var attack = talente.Find(v => v.name.Equals(talent)); + int tap = attack.value + eigenschaften["fk"]-erschwernis; + int temp = dice.Rolld20(); + tap -= -temp; + return temp + " " + tap; + } } public class Talent @@ -104,8 +128,8 @@ namespace DiscoBot } public class Kampf { - string name; - private int at, pa; + public string name; + public int at, pa; public Kampf(string name, int at, int pa) { this.name = name; this.at = at; this.pa = pa; } void Test() { } } @@ -114,7 +138,7 @@ namespace DiscoBot static System.Random rnd = new System.Random(); public static int Rolld20() { - return rnd.Next(1,21) ; + return rnd.Next(1, 21); } } } |