diff options
author | natrixaeria <janng@gmx.de> | 2019-05-19 17:40:59 +0200 |
---|---|---|
committer | natrixaeria <janng@gmx.de> | 2019-05-19 17:40:59 +0200 |
commit | 1509b5ef3d7e9e71d9294e234ec0e39f2d831998 (patch) | |
tree | 78300ffff230958101b422a4e6026925b287822f /DSACore/Commands/LebenUndAstral.cs | |
parent | c3bb858bb54dc8c64bbd48054c2c58dc0073f09c (diff) | |
parent | c4d046858e0822b7c2c540ac2368b2c0e88e7a26 (diff) |
Merge branch 'scribble' of https://github.com/TrueDoctor/DiscoBot into scribble
Diffstat (limited to 'DSACore/Commands/LebenUndAstral.cs')
-rw-r--r-- | DSACore/Commands/LebenUndAstral.cs | 56 |
1 files changed, 30 insertions, 26 deletions
diff --git a/DSACore/Commands/LebenUndAstral.cs b/DSACore/Commands/LebenUndAstral.cs index b5bc260..a671296 100644 --- a/DSACore/Commands/LebenUndAstral.cs +++ b/DSACore/Commands/LebenUndAstral.cs @@ -1,8 +1,6 @@ using System; -using System.Linq; -using System.Threading.Tasks; -using DSACore.DSA_Game; using DSACore.Auxiliary; +using DSACore.DSA_Game; using DSALib.Characters; namespace DSACore.Commands @@ -12,9 +10,9 @@ namespace DSACore.Commands public static string LEAsync(ulong id, string modifier) { //This is the string that will be printed - string res = ""; + var res = ""; + - //Get the actual text res += Dsa.GetCharacter(id).get_LE_Text(modifier); @@ -23,17 +21,17 @@ namespace DSACore.Commands } } - public class AE + public class AE { public static string AEAsync(ulong id, string modifier) { //This is the string that will be printed - string res = ""; + var res = ""; //Get the actual text res += Dsa.GetCharacter(id).get_AE_Text(modifier); - + return res; } } @@ -42,11 +40,11 @@ namespace DSACore.Commands { public static string get_LE_Text(this ICharacter c, string prop) { - string res = ""; + var res = ""; var comp = new SpellCorrect(); var character = c; - res += (character.Name + ":\n"); + res += character.Name + ":\n"; //If there is actual input we process it if (prop.Length > 0) @@ -60,15 +58,20 @@ namespace DSACore.Commands //Allow overflowing the max if (prop.StartsWith("++")) { - character.Lebenspunkte_Aktuell = character.Lebenspunkte_Aktuell + Convert.ToInt32(prop.Substring(1, prop.Length - 1)); + character.Lebenspunkte_Aktuell = character.Lebenspunkte_Aktuell + + Convert.ToInt32(prop.Substring(1, prop.Length - 1)); } else { - int temp = character.Lebenspunkte_Aktuell + Convert.ToInt32(prop) - character.Lebenspunkte_Basis; + var temp = character.Lebenspunkte_Aktuell + Convert.ToInt32(prop) - + character.Lebenspunkte_Basis; //Stop from overflow overflow if (temp > 0 && prop.StartsWith("+")) { - character.Lebenspunkte_Aktuell = (character.Lebenspunkte_Basis > character.Lebenspunkte_Aktuell) ? character.Lebenspunkte_Basis : character.Lebenspunkte_Aktuell; + character.Lebenspunkte_Aktuell = + character.Lebenspunkte_Basis > character.Lebenspunkte_Aktuell + ? character.Lebenspunkte_Basis + : character.Lebenspunkte_Aktuell; res += " Maximale Lebenspunkte sind erreicht "; } //Simply apply change @@ -91,23 +94,23 @@ namespace DSACore.Commands //If no value is passed, the curent value is displayed else { - res += ("LE: " + character.Lebenspunkte_Aktuell + "/" + character.Lebenspunkte_Basis); + res += "LE: " + character.Lebenspunkte_Aktuell + "/" + character.Lebenspunkte_Basis; } return res; } + public static string get_AE_Text(this ICharacter c, string prop) { - string res = ""; + var res = ""; var comp = new SpellCorrect(); var character = c; - res += (character.Name + ":\n"); + res += character.Name + ":\n"; //If there is actual input we process it if (prop.Length > 0) { - res += "AE: "; res += character.Astralpunkte_Aktuell + "/" + character.Astralpunkte_Basis + " -> "; @@ -117,15 +120,20 @@ namespace DSACore.Commands //Allow overflowing the max if (prop.StartsWith("++")) { - character.Astralpunkte_Aktuell = character.Astralpunkte_Aktuell + Convert.ToInt32(prop.Substring(1, prop.Length - 1)); + character.Astralpunkte_Aktuell = character.Astralpunkte_Aktuell + + Convert.ToInt32(prop.Substring(1, prop.Length - 1)); } else { - int temp = character.Astralpunkte_Aktuell + Convert.ToInt32(prop) - character.Astralpunkte_Basis; + var temp = character.Astralpunkte_Aktuell + Convert.ToInt32(prop) - + character.Astralpunkte_Basis; //Stop from overflow overflow if (temp > 0 && prop.StartsWith("+")) { - character.Astralpunkte_Aktuell = (character.Astralpunkte_Basis > character.Astralpunkte_Aktuell) ? character.Astralpunkte_Basis : character.Astralpunkte_Aktuell; + character.Astralpunkte_Aktuell = + character.Astralpunkte_Basis > character.Astralpunkte_Aktuell + ? character.Astralpunkte_Basis + : character.Astralpunkte_Aktuell; res += " Maximale Astralpunkte sind erreicht "; } //Simply apply change @@ -142,7 +150,6 @@ namespace DSACore.Commands } res += character.Astralpunkte_Aktuell + "/" + character.Astralpunkte_Basis; - } //Set to new value regardless of original else @@ -155,14 +162,11 @@ namespace DSACore.Commands //If no value is passed, the curent value is displayed else { - res += ("AE: " + character.Astralpunkte_Aktuell + "/" + character.Astralpunkte_Basis); + res += "AE: " + character.Astralpunkte_Aktuell + "/" + character.Astralpunkte_Basis; } return res; } } -} - - - +}
\ No newline at end of file |