+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+ name = Column(Unicode(8), nullable=False,
+ info=dict(description="An English name of the nature", official=True, format='plaintext'))
+ decreased_stat_id = Column(Integer, ForeignKey('stats.id'), nullable=False,
+ info=dict(description="ID of the stat that this nature decreases by 10% (if decreased_stat_id is the same, the effects cancel out)"))
+ increased_stat_id = Column(Integer, ForeignKey('stats.id'), nullable=False,
+ info=dict(description="ID of the stat that this nature increases by 10% (if decreased_stat_id is the same, the effects cancel out)"))
+ hates_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False,
+ info=dict(description=u"ID of the Berry flavor the Pokémon hates (if likes_flavor_id is the same, the effects cancel out)"))
+ likes_flavor_id = Column(Integer, ForeignKey('contest_types.id'), nullable=False,
+ info=dict(description=u"ID of the Berry flavor the Pokémon likes (if hates_flavor_id is the same, the effects cancel out)"))
+
+ @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):
+ u"""Battle Palace move preference
+
+ Specifies how likely a pokémon with a specific Nature is to use a move of
+ a particular battl style in Battle Palace or Battle Tent
+ """
+ __tablename__ = 'nature_battle_style_preferences'
+ nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False,
+ info=dict(description=u"ID of the pokémon's nature"))
+ move_battle_style_id = Column(Integer, ForeignKey('move_battle_styles.id'), primary_key=True, nullable=False,
+ info=dict(description="ID of the battle style"))
+ low_hp_preference = Column(Integer, nullable=False,
+ info=dict(description=u"Chance of using the move, in percent, if HP is under ½"))
+ high_hp_preference = Column(Integer, nullable=False,
+ info=dict(description=u"Chance of using the move, in percent, if HP is over ½"))
+
+class NatureName(TableBase):
+ u"""Non-english name of a Nature
+ """
+ __tablename__ = 'nature_names'
+ nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the nature"))
+ language_id = Column(Integer, ForeignKey('languages.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the language"))
+ name = Column(Unicode(8), nullable=False,
+ info=dict(description="The nature's foreign name", foreign=True, format='plaintext'))
+
+class NaturePokeathlonStat(TableBase):
+ u"""Specifies how a Nature affects a Pokéathlon stat
+ """
+ __tablename__ = 'nature_pokeathlon_stats'
+ nature_id = Column(Integer, ForeignKey('natures.id'), primary_key=True, nullable=False,
+ info=dict(description="ID of the nature"))
+ pokeathlon_stat_id = Column(Integer, ForeignKey('pokeathlon_stats.id'), primary_key=True, nullable=False,
+ info=dict(description="ID of the stat"))
+ max_change = Column(Integer, nullable=False,
+ info=dict(description="Maximum change"))
+
+class PokeathlonStat(TableBase):
+ u"""A Pokéathlon stat, such as "Stamina" or "Jump".
+ """
+ __tablename__ = 'pokeathlon_stats'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+ name = Column(Unicode(8), nullable=False,
+ info=dict(description="The English name of the stat", official=True, format='plaintext'))