+ __singlename__ = 'move_effect'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+
+create_translation_table('move_effect_prose', MoveEffect, 'prose',
+ short_effect = Column(Unicode(256), nullable=False,
+ info=dict(description="A short summary of the effect", format='plaintext')),
+ effect = Column(Unicode(5120), nullable=False,
+ info=dict(description="A detailed description of the effect", format='plaintext')),
+)
+
+class MoveEffectCategory(TableBase):
+ u"""Category of a move effect
+ """
+ __tablename__ = 'move_effect_categories'
+ __singlename__ = 'move_effect_category'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+ identifier = Column(Unicode(64), nullable=False,
+ info=dict(description="An identifier", format='identifier'))
+ can_affect_user = Column(Boolean, nullable=False,
+ info=dict(description="Set if the user can be affected"))
+
+create_translation_table('move_effect_category_prose', MoveEffectCategory, 'prose',
+ name = Column(Unicode(64), nullable=False, index=True,
+ info=dict(description="The name", format='plaintext', official=False)),
+)
+
+class MoveEffectCategoryMap(TableBase):
+ u"""Maps a move effect category to a move effect
+ """
+ __tablename__ = 'move_effect_category_map'
+ move_effect_id = Column(Integer, ForeignKey('move_effects.id'), primary_key=True, nullable=False,
+ info=dict(description="ID of the move effect"))
+ move_effect_category_id = Column(Integer, ForeignKey('move_effect_categories.id'), primary_key=True, nullable=False,
+ info=dict(description="ID of the category"))
+ affects_user = Column(Boolean, primary_key=True, nullable=False,
+ info=dict(description="Set if the user is affected"))
+
+class MoveEffectChangelog(TableBase):
+ """History of changes to move effects across main game versions."""
+ __tablename__ = 'move_effect_changelog'
+ __singlename__ = 'move_effect_changelog'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+ effect_id = Column(Integer, ForeignKey('move_effects.id'), nullable=False,
+ info=dict(description="The ID of the effect that changed"))
+ changed_in_version_group_id = Column(Integer, ForeignKey('version_groups.id'), nullable=False,
+ info=dict(description="The ID of the version group in which the effect changed"))
+
+ __table_args__ = (
+ UniqueConstraint(effect_id, changed_in_version_group_id),
+ {},
+ )
+
+create_translation_table('move_effect_changelog_prose', MoveEffectChangelog, 'prose',
+ effect = Column(markdown.MarkdownColumn(512), nullable=False,
+ info=dict(description="A description of the old behavior", format='markdown')),
+)
+
+class MoveFlag(TableBase):
+ u"""Maps a move flag to a move
+ """
+ # XXX: Other flags have a ___Flag class for the actual flag and ___FlagMap for the map,
+ # these, somewhat confusingly, have MoveFlagType and MoveFlag
+ __tablename__ = 'move_flags'
+ move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the move"))
+ move_flag_type_id = Column(Integer, ForeignKey('move_flag_types.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the flag"))
+
+class MoveFlagType(TableBase):
+ u"""A Move attribute such as "snatchable" or "contact".
+ """
+ __tablename__ = 'move_flag_types'
+ __singlename__ = 'move_flag_type'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+ identifier = Column(Unicode(32), nullable=False,
+ info=dict(description="A short identifier for the flag", format='identifier'))
+
+create_translation_table('move_flag_type_prose', MoveFlagType, 'prose',
+ relation_lazy='joined',
+ name = Column(Unicode(32), nullable=False, index=True,
+ info=dict(description="The name", format='plaintext', official=False)),
+ description = Column(markdown.MarkdownColumn(128), nullable=False,
+ info=dict(description="A short description of the flag", format='markdown')),
+)
+
+class MoveFlavorText(TableBase):
+ u"""In-game description of a move
+ """
+ __tablename__ = 'move_flavor_text'
+ move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the move"))
+ version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the version group this text appears in"))
+ language_id = Column(Integer, ForeignKey('languages.id'), primary_key=True, nullable=False,
+ info=dict(description="The language"))
+ flavor_text = Column(Unicode(255), nullable=False,
+ info=dict(description="The flavor text", official=True, format='gametext'))
+
+class MoveMeta(TableBase):
+ u"""Metadata for move effects, sorta-kinda ripped straight from the game"""
+ __tablename__ = 'move_meta'
+ move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="A numeric ID"))
+ meta_category_id = Column(Integer, ForeignKey('move_meta_categories.id'), nullable=False,
+ info=dict(description="ID of the move category"))
+ meta_ailment_id = Column(Integer, ForeignKey('move_meta_ailments.id'), nullable=False,
+ info=dict(description="ID of the caused ailment"))
+ min_hits = Column(Integer, nullable=True, index=True,
+ info=dict(description="Minimum number of hits per use"))
+ max_hits = Column(Integer, nullable=True, index=True,
+ info=dict(description="Maximum number of hits per use"))
+ min_turns = Column(Integer, nullable=True, index=True,
+ info=dict(description="Minimum number of turns the user is forced to use the move"))
+ max_turns = Column(Integer, nullable=True, index=True,
+ info=dict(description="Maximum number of turns the user is forced to use the move"))
+ recoil = Column(Integer, nullable=False, index=True,
+ info=dict(description="Recoil damage, in percent of damage done"))
+ healing = Column(Integer, nullable=False, index=True,
+ info=dict(description="Healing, in percent of user's max HP"))
+ crit_rate = Column(Integer, nullable=False, index=True,
+ info=dict(description="Critical hit rate bonus"))
+ ailment_chance = Column(Integer, nullable=False, index=True,
+ info=dict(description="Chance to cause an ailment, in percent"))
+ flinch_chance = Column(Integer, nullable=False, index=True,
+ info=dict(description="Chance to cause flinching, in percent"))
+ stat_chance = Column(Integer, nullable=False, index=True,
+ info=dict(description="Chance to cause a stat change, in percent"))
+
+class MoveMetaAilment(TableBase):
+ u"""Common status ailments moves can inflict on a single Pokémon, including
+ major ailments like paralysis and minor ailments like trapping.
+ """
+ __tablename__ = 'move_meta_ailments'
+ __singlename__ = 'move_meta_ailment'
+ id = Column(Integer, primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="A numeric ID"))
+ identifier = Column(Unicode(24), nullable=False,
+ info=dict(description="An identifier", format='identifier'))
+
+create_translation_table('move_meta_ailment_names', MoveMetaAilment, 'names',
+ relation_lazy='joined',
+ name = Column(Unicode(24), nullable=False, index=True,
+ info=dict(description="The name", format='plaintext', official=True)),
+)
+
+class MoveMetaCategory(TableBase):
+ u"""Very general categories that loosely group move effects."""
+ __tablename__ = 'move_meta_categories'
+ __singlename__ = 'move_meta_category'
+ id = Column(Integer, primary_key=True, nullable=False,
+ info=dict(description="A numeric ID"))
+
+create_translation_table('move_meta_category_prose', MoveMetaCategory, 'prose',
+ relation_lazy='joined',
+ description = Column(Unicode(64), nullable=False,
+ info=dict(description="A description of the category", format="plaintext", official=False)),
+)
+
+class MoveMetaStatChange(TableBase):
+ u"""Stat changes moves (may) make."""
+ __tablename__ = 'move_meta_stat_changes'
+ move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the move"))
+ stat_id = Column(Integer, ForeignKey('stats.id'), primary_key=True, nullable=False, autoincrement=False,
+ info=dict(description="ID of the stat"))
+ change = Column(Integer, nullable=False, index=True,
+ info=dict(description="Amount of increase/decrease, in stages"))