+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+ name = Column(Unicode(24), nullable=False,
+ info=dict(description="The English name of the move", official=True, format='plaintext'))
+ generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False,
+ info=dict(description="ID of the generation this move first appeared in"))
+ type_id = Column(Integer, ForeignKey('types.id'), nullable=False,
+ info=dict(description="ID of the move's elemental type"))
+ power = Column(SmallInteger, nullable=False,
+ info=dict(description="Base power of the move"))
+ pp = Column(SmallInteger, nullable=False,
+ info=dict(description="Base PP (Power Points) of the move"))
+ accuracy = Column(SmallInteger, nullable=True,
+ info=dict(description="Accuracy of the move; NULL means it never misses"))
+ priority = Column(SmallInteger, nullable=False,
+ info=dict(description="The move's priority bracket"))
+ target_id = Column(Integer, ForeignKey('move_targets.id'), nullable=False,
+ info=dict(description="ID of the target (range) of the move"))
+ damage_class_id = Column(Integer, ForeignKey('move_damage_classes.id'), nullable=False,
+ info=dict(description="ID of the damage class (physical/special) of the move"))
+ effect_id = Column(Integer, ForeignKey('move_effects.id'), nullable=False,
+ info=dict(description="ID of the move's effect"))
+ effect_chance = Column(Integer,
+ info=dict(description="The chance for a secondary effect. What this is a chance of is specified by the move's effect."))
+ contest_type_id = Column(Integer, ForeignKey('contest_types.id'), nullable=True,
+ info=dict(description="ID of the move's Contest type (e.g. cool or smart)"))
+ contest_effect_id = Column(Integer, ForeignKey('contest_effects.id'), nullable=True,
+ info=dict(description="ID of the move's Contest effect"))
+ super_contest_effect_id = Column(Integer, ForeignKey('super_contest_effects.id'), nullable=True,
+ info=dict(description="ID of the move's Super Contest effect"))
+
+class Nature(TableBase):
+ u"""A nature a pokémon can have, such as Calm or Brave
+ """
+ __tablename__ = 'natures'
+ __singlename__ = 'nature'
+ 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'))