public Pokemon Breed(Pokemon father) { int average_hp = (MaxHP + father.HP) / 2; int average_atk = (attack + father.AttackPower) / 2; int average_def = (defense + father.Defense) / 2; int average_spa = (special_attack + father.SpecialAttack) / 2; int average_spdef = (special_defense + father.SpecialDefense) / 2; int average_spd = (speed + father.Speed) / 2; Pokemon baby = new Pokemon(type_1, father.Type_2, average_hp, average_atk, average_def, average_spa, average_spdef, average_spd, NameGenerator.Generate(name, father.name)); int mutate = random.Next(0, 7); switch (mutate) { case 0: baby.MutateType(); break; case 1: baby.MutateStat(); break; case 2: baby.Reroll(); break; default: break; } return baby; }
private Pokemon FindMatch(Pokemon source) { return RandomPokemon(population.Where(candidate => candidate != source).ToList<Pokemon>()); }
public void Attack(Pokemon target) { target.Damage(attacks[random.Next(attacks.Count)].GetDamage(this, target)); }
private Pokemon FindBreedingMatch(Pokemon source) { return RandomPokemon(population.Where(candidate => candidate != source && candidate.Breedable).ToList<Pokemon>()); }