Changed defaultmoves

From LawlyPoppz
This commit is contained in:
appelemac 2016-03-27 18:36:42 +02:00
parent 41a6b84934
commit 7c6e1918e8

View File

@ -15,14 +15,14 @@ using NadekoBot.Modules.Pokemon.PokeTypes;
namespace NadekoBot.Modules.Pokemon namespace NadekoBot.Modules.Pokemon
{ {
class PokemonGame : DiscordModule class PokemonGame : DiscordModule
{ {
public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Pokemon; public override string Prefix { get; } = NadekoBot.Config.CommandPrefixes.Pokemon;
public readonly int BASEHEALTH = 500; public readonly int BASEHEALTH = 500;
//private Dictionary<ulong, Pokestats> stats = new Dictionary<ulong, Pokestats>(); //private Dictionary<ulong, Pokestats> stats = new Dictionary<ulong, Pokestats>();
private ConcurrentDictionary<ulong, Pokestats> stats = new ConcurrentDictionary<ulong, Pokestats>(); private ConcurrentDictionary<ulong, Pokestats> stats = new ConcurrentDictionary<ulong, Pokestats>();
public PokemonGame() public PokemonGame()
{ {
@ -53,7 +53,8 @@ namespace NadekoBot.Modules.Pokemon
await e.Channel.SendMessage("No such person."); await e.Channel.SendMessage("No such person.");
return; return;
} }
} else }
else
{ {
await e.Channel.SendMessage("No such person."); await e.Channel.SendMessage("No such person.");
return; return;
@ -62,7 +63,7 @@ namespace NadekoBot.Modules.Pokemon
//Set up the userstats //Set up the userstats
Pokestats userstats; Pokestats userstats;
userstats = stats.GetOrAdd(e.User.Id, defaultStats()); userstats = stats.GetOrAdd(e.User.Id, defaultStats());
//Check if able to move //Check if able to move
//User not able if HP < 0, has made more than 4 attacks //User not able if HP < 0, has made more than 4 attacks
if (userstats.HP < 0) if (userstats.HP < 0)
@ -83,7 +84,7 @@ namespace NadekoBot.Modules.Pokemon
//get target stats //get target stats
Pokestats targetstats; Pokestats targetstats;
targetstats = stats.GetOrAdd(target.Id, defaultStats()); targetstats = stats.GetOrAdd(target.Id, defaultStats());
//If target's HP is below 0, no use attacking //If target's HP is below 0, no use attacking
if (targetstats.HP <= 0) if (targetstats.HP <= 0)
{ {
@ -272,37 +273,75 @@ namespace NadekoBot.Modules.Pokemon
Dictionary<string, int> defaultmoves = new Dictionary<string, int>() Dictionary<string, int> defaultmoves = new Dictionary<string, int>()
{ {
{"flame",1}, {"sonic boom",0},
{"hack",3}, {"quick attack",0},
{"scare",13}, {"doubleslap",0},
{"splash",2}, {"headbutt",0},
{"freeze",5}, {"incinerate",1},
{"strike",4}, {"ember",1},
{"surge",3}, {"fire punch",1},
{"electrocute",3}, {"fiery dance",1},
{"surf",2}, {"bubblebeam",2},
{"mellow",4}, {"dive",2},
{"flamethrower",1}, {"whirlpool",2},
{"aqua tail",2},
{"nuzzle",3},
{"thunderbolt",3},
{"thundershock",3}, {"thundershock",3},
{"lava",12}, {"discharge",3},
{"fly",9}, {"absorb",4},
{"control",10}, {"mega drain",4},
{"sting",11}, {"vine whip",4},
{"poison",7}, {"razor leaf",4},
{"confusion",10}, {"ice ball",5},
{"breathe",14}, {"powder snow",5},
{"ultrabash",6}, {"avalanche",5},
{"punch",6}, {"icy wind",5},
{"blind",15}, {"low kick",6},
{"earthquake",8}, {"force palm",6},
{"rocksmash",12}, {"mach punch",6},
{"transform",0}, {"double kick",6},
{"acid",7},
{"smog",7},
{"sludge",7},
{"poison jab",7},
{"mud-slap",8},
{"boomerang",8},
{"bulldoze",8}, {"bulldoze",8},
{"frustate",0}, {"dig",8},
{"confide",0}, {"peck",9},
{"metronome",0}, {"pluck",9},
{"dracometeor",14}, {"gust",9},
{"outrage",14} {"aerial ace",9},
{"confusion",10},
{"psybeam",10},
{"psywave",10},
{"heart stamp",10},
{"bug bite",11},
{"infestation",11},
{"x-scissor",11},
{"twineedle",11},
{"rock throw",12},
{"rollout",12},
{"rock tomb",12},
{"rock blast",12},
{"astonish",13},
{"night shade",13},
{"lick",13},
{"ominous wind",13},
{"hex",13},
{"dragon tail",14},
{"dragon rage",14},
{"dragonbreath",14},
{"twister",14},
{"pursuit",15},
{"assurance",15},
{"bite",15},
{"faint attack",15},
{"bullet punch",16},
{"metal burst",16},
{"gear grind",16},
{"magnet bomb",16}
}; };
foreach (KeyValuePair<string, int> entry in defaultmoves) foreach (KeyValuePair<string, int> entry in defaultmoves)
@ -323,7 +362,7 @@ namespace NadekoBot.Modules.Pokemon
str += $"\n{t.getImage()}{m.move}"; str += $"\n{t.getImage()}{m.move}";
} }
await e.Channel.SendMessage(str); await e.Channel.SendMessage(str);
}); });
@ -377,8 +416,8 @@ namespace NadekoBot.Modules.Pokemon
}); });
} }
private int getDamage(IPokeType usertype, IPokeType targetType) private int getDamage(IPokeType usertype, IPokeType targetType)
{ {