The python code is easy to use and can easyly be extended. For easy creation of Pokémons a sqlite3 database is created with various stats. Many objects are based on enum usage, which avoids usage of strings.
It is very easy to create a Pokémon object.
pokemon = Pokemon(PokemonType.Pidgey, state = State.asleep)
# or
pokemon = Pokemon(PokemonType.Pidgey) # for normal state
BTW, this project is not finished yet, so bugs may appear.
Use any Pokémon to simulate the catch rate of generation I Pokémon.
Use any Pokémon and Pokémon ball to simulate catch rate of Pokémon generation II.
Plot the stats of any Pokémon in a spider net plot.
The following code snippet will also plot the Pokémon-figure to the right of the plot.
import pokemon_plot # other imports are omitted here, see pokemon_tests.py for imports
pokemon = Pokemon(PokemonType.Electabuzz, State.normal)
pokemon_plot.plotPokemon(pokemon)
For only plotting the stats:
import pokemon_plot
pokemon = Pokemon(PokemonType.Electabuzz)
pokemon_plot.plotPokemons([pokemon])
Compare Pokémons in a spider net plot.
The code needed for generating the plot below is simple:
import pokemon_plot
pokemon1 = Pokemon(PokemonType.Bulbasaur)
pokemon2 = Pokemon(PokemonType.Squirtle)
pokemon3 = Pokemon(PokemonType.Charmander)
pokemonList = [pokemon1, pokemon2, pokemon3]
pokemon_plot.plotPokemons(pokemonList)
Compare different Pokémon classes in a spider net plot. Just get the Pokémon class/type and compare them with:
import pokemon_plot
pokemon_plot.compare_classes([PokemonClass.Grass, PokemonClass.Electric])
Retrieve pokemons by some attribute and logic operator.
# Get all pokemons with attack larger than 140
pokemons = pokemon.find_pokemons_by(PokeAttribute.attack, PokeLogic.largerThan, 140)
for p in pokemons:
print p.name
Output:
Deoxys_A
Deoxys_N
Groudon
Haxorus
Rampardos
Rayquaza
Regigigas
Slaking
Zekrom
# Get all pokemons with mass less than 0.4
pokemons = pokemon.find_pokemons_by(PokeAttribute.mass_kilo, PokeLogic.lessThan, 0.4)
for p in pokemons:
print p.name
Output:
Azelf
Gastly
Haunter
Mesprit
Rotom
Rotom_Cut
Rotom_Frost
Rotom_Heat
Rotom_Spin
Rotom_Wash
Tynamo
Uxie