mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Add a Nature.is_neutral helper property.
This commit is contained in:
parent
6cba215352
commit
0fcdb6bcc9
1 changed files with 7 additions and 0 deletions
|
@ -398,6 +398,13 @@ class Nature(TableBase):
|
||||||
hates_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False)
|
hates_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False)
|
||||||
likes_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False)
|
likes_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def is_neutral(self):
|
||||||
|
u"""Returns True iff this nature doesn't alter a Pokémon's stats,
|
||||||
|
bestow taste preferences, etc.
|
||||||
|
"""
|
||||||
|
return self.increased_stat_id == self.decreased_stat_id
|
||||||
|
|
||||||
class NatureBattleStylePreference(TableBase):
|
class NatureBattleStylePreference(TableBase):
|
||||||
__tablename__ = 'nature_battle_style_preferences'
|
__tablename__ = 'nature_battle_style_preferences'
|
||||||
nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False)
|
nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False)
|
||||||
|
|
Loading…
Reference in a new issue