public static void PokemonTest( PKMN.Game game, PKMN.Species species ) { PKMN.Pokemon pokemon = new PKMN.Pokemon(species, game, "", 30); PokemonTestParams testParams = new PokemonTestParams( PKMN.Ball.GREAT_BALL, new PKMN.Ball[] { PKMN.Ball.GREAT_BALL }, PKMN.Item.POTION, new PKMN.Item[] { PKMN.Item.POTION }, "Special", new string[] { "Route 1" }, new string[] { "Route 1" }, new PKMN.Move[] { PKMN.Move.SLASH, PKMN.Move.FLAMETHROWER, PKMN.Move.TAIL_WHIP, PKMN.Move.FIRE_BLAST }, new PKMN.Move[] { PKMN.Move.RETURN }, new PKMN.Game[] { PKMN.Game.RED }, new PKMN.Game[] { PKMN.Game.RED } ); PokemonTestCommon.TestCommon(pokemon, testParams); // Test attributes. Assert.AreEqual(pokemon.NumericAttributes["Catch rate"], 45); }
public static void PokemonTest( PKMN.Game game, PKMN.Species species ) { PKMN.Pokemon pokemon = new PKMN.Pokemon(species, game, "", 30); PokemonTestParams testParams = new PokemonTestParams( PKMN.Ball.GREAT_BALL, new PKMN.Ball[] { PKMN.Ball.GREAT_BALL }, PKMN.Item.BERRY, new PKMN.Item[] { PKMN.Item.RAZZ_BERRY, PKMN.Item.BICYCLE }, "Special", new string[] { "Sprout Tower", "Tohjo Falls" }, new string[] { "Littleroot Town", "Petalburg Woods" }, new PKMN.Move[] { PKMN.Move.SLASH, PKMN.Move.FLAMETHROWER, PKMN.Move.RETURN, PKMN.Move.FIRE_BLAST }, new PKMN.Move[] { PKMN.Move.FRENZY_PLANT, PKMN.Move.ROOST }, new PKMN.Game[] { PKMN.Game.GOLD }, new PKMN.Game[] { PKMN.Game.GOLD } ); PokemonTestCommon.TestCommon(pokemon, testParams); // Gender is tied to IVs, so make sure the abstraction reflects that. pokemon.Gender = PKMN.Gender.MALE; Assert.AreEqual(pokemon.IVs[PKMN.Stat.ATTACK], 15); pokemon.Gender = PKMN.Gender.FEMALE; Assert.Less(pokemon.IVs[PKMN.Stat.ATTACK], 15); pokemon.IVs[PKMN.Stat.ATTACK] = 0; Assert.AreEqual(pokemon.Gender, PKMN.Gender.FEMALE); pokemon.IVs[PKMN.Stat.ATTACK] = 15; Assert.AreEqual(pokemon.Gender, PKMN.Gender.MALE); // Shininess is tied to IVs, so make sure the abstraction reflects that. pokemon.IsShiny = false; Assert.AreEqual(pokemon.IVs[PKMN.Stat.ATTACK], 13); pokemon.IsShiny = true; Assert.AreEqual(pokemon.IVs[PKMN.Stat.ATTACK], 15); Assert.AreEqual(pokemon.IVs[PKMN.Stat.DEFENSE], 10); Assert.AreEqual(pokemon.IVs[PKMN.Stat.SPEED], 10); Assert.AreEqual(pokemon.IVs[PKMN.Stat.SPECIAL], 10); }
static public void PokemonTest( PKMN.Game game, PKMN.Species species ) { PKMN.Pokemon pokemon = new PKMN.Pokemon(species, game, "", 30); PokemonTestParams testParams; bool isGamecube = (game == PKMN.Game.COLOSSEUM) || (game == PKMN.Game.XD); if (isGamecube) { testParams = new PokemonTestParams( PKMN.Ball.GREAT_BALL, new PKMN.Ball[] { PKMN.Ball.FRIEND_BALL, PKMN.Ball.HEAL_BALL }, PKMN.Item.RAZZ_BERRY, new PKMN.Item[] { PKMN.Item.BERRY, PKMN.Item.MACH_BIKE }, "Distant land", new string[] { "Phenac City", "Orre Colosseum" }, new string[] { "New Bark Town", "Twinleaf Town" }, new PKMN.Move[] { PKMN.Move.SWALLOW, PKMN.Move.FLAMETHROWER, PKMN.Move.RETURN, PKMN.Move.FIRE_BLAST }, new PKMN.Move[] { PKMN.Move.ROOST, PKMN.Move.FLAME_BURST }, new PKMN.Game[] { PKMN.Game.RUBY, PKMN.Game.SAPPHIRE, PKMN.Game.EMERALD, PKMN.Game.FIRERED, PKMN.Game.LEAFGREEN, PKMN.Game.COLOSSEUM, PKMN.Game.XD }, new PKMN.Game[] { PKMN.Game.GOLD, PKMN.Game.HEARTGOLD } ); } else { testParams = new PokemonTestParams( PKMN.Ball.GREAT_BALL, new PKMN.Ball[] { PKMN.Ball.FRIEND_BALL, PKMN.Ball.HEAL_BALL }, PKMN.Item.RAZZ_BERRY, new PKMN.Item[] { PKMN.Item.BERRY, PKMN.Item.MACH_BIKE }, "Fateful encounter", new string[] { "Petalburg Woods", "Viridian Forest" }, new string[] { "New Bark Town", "Twinleaf Town" }, new PKMN.Move[] { PKMN.Move.SWALLOW, PKMN.Move.FLAMETHROWER, PKMN.Move.RETURN, PKMN.Move.FIRE_BLAST }, new PKMN.Move[] { PKMN.Move.SHADOW_SKY, PKMN.Move.ROOST }, new PKMN.Game[] { PKMN.Game.RUBY, PKMN.Game.SAPPHIRE, PKMN.Game.EMERALD, PKMN.Game.FIRERED, PKMN.Game.LEAFGREEN, PKMN.Game.COLOSSEUM, PKMN.Game.XD }, new PKMN.Game[] { PKMN.Game.GOLD, PKMN.Game.HEARTGOLD } ); } PokemonTestCommon.TestCommon(pokemon, testParams); CheckInitialRibbonMap(pokemon); TestContestRibbons(pokemon); TestRibbons(pokemon); // Gender and personality are tied, so make sure they affect each other. pokemon.Gender = PKMN.Gender.FEMALE; Assert.Less((pokemon.Personality & 0xFF), 0xFF); pokemon.Gender = PKMN.Gender.MALE; Assert.AreEqual((pokemon.Personality & 0xFF), 0xFF); pokemon.Personality = 0x1234AB00; Assert.AreEqual(pokemon.Gender, PKMN.Gender.FEMALE); pokemon.Personality = 0xCD5678FF; Assert.AreEqual(pokemon.Gender, PKMN.Gender.MALE); // Setting shininess should affect personality. pokemon.IsShiny = false; uint nonShinyPersonality = pokemon.Personality; pokemon.IsShiny = true; Assert.AreNotEqual(pokemon.Personality, nonShinyPersonality); // Shadow Pokémon should only work in Gamecube games. if (isGamecube) { PKMN.Species shadowSpecies = (game == PKMN.Game.COLOSSEUM) ? PKMN.Species.LEDIAN : PKMN.Species.LEDYBA; PKMN.Pokemon shadowPokemon = new PKMN.Pokemon(shadowSpecies, game, "", 50); Assert.AreEqual(shadowPokemon.Form, "Standard"); shadowPokemon.Form = "Shadow"; Assert.AreEqual(shadowPokemon.Form, "Shadow"); } else { Assert.Throws <ArgumentOutOfRangeException>( delegate { new PKMN.Pokemon(PKMN.Species.LEDYBA, game, "Shadow", 50); } ); } }