mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Add a SaveFilePokemon accessor to get the form.
This commit is contained in:
parent
334a578133
commit
2f11f0b81f
1 changed files with 8 additions and 0 deletions
|
@ -105,6 +105,10 @@ class SaveFilePokemon(object):
|
||||||
|
|
||||||
st = self.structure
|
st = self.structure
|
||||||
self._pokemon = session.query(tables.Pokemon).get(st.national_id)
|
self._pokemon = session.query(tables.Pokemon).get(st.national_id)
|
||||||
|
self._pokemon_form = session.query(tables.PokemonForm) \
|
||||||
|
.with_parent(self._pokemon) \
|
||||||
|
.filter_by(name=st.alternate_form) \
|
||||||
|
.one()
|
||||||
self._ability = self._session.query(tables.Ability).get(st.ability_id)
|
self._ability = self._session.query(tables.Ability).get(st.ability_id)
|
||||||
|
|
||||||
growth_rate = self._pokemon.evolution_chain.growth_rate
|
growth_rate = self._pokemon.evolution_chain.growth_rate
|
||||||
|
@ -188,6 +192,10 @@ class SaveFilePokemon(object):
|
||||||
# XXX forme!
|
# XXX forme!
|
||||||
return self._pokemon
|
return self._pokemon
|
||||||
|
|
||||||
|
@property
|
||||||
|
def species_form(self):
|
||||||
|
return self._pokemon_form
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def pokeball(self):
|
def pokeball(self):
|
||||||
return self._pokeball
|
return self._pokeball
|
||||||
|
|
Loading…
Reference in a new issue