"Characteristic" text, here called stat hints.
[zzz-pokedex.git] / pokedex / db / tables.py
index 812fdc2..adac6f1 100644 (file)
@@ -628,6 +628,44 @@ class MoveFlavorText(TableBase):
     flavor_text = Column(Unicode(255), nullable=False,
         info=dict(description="The English 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)
+    meta_category_id = Column(Integer, ForeignKey('move_meta_categories.id'), nullable=False)
+    meta_ailment_id = Column(Integer, ForeignKey('move_meta_ailments.id'), nullable=False)
+    min_hits = Column(Integer, nullable=True, index=True)
+    max_hits = Column(Integer, nullable=True, index=True)
+    min_turns = Column(Integer, nullable=True, index=True)
+    max_turns = Column(Integer, nullable=True, index=True)
+    recoil = Column(Integer, nullable=False, index=True)
+    healing = Column(Integer, nullable=False, index=True)
+    crit_rate = Column(Integer, nullable=False, index=True)
+    ailment_chance = Column(Integer, nullable=False, index=True)
+    flinch_chance = Column(Integer, nullable=False, index=True)
+    stat_chance = Column(Integer, nullable=False, index=True)
+
+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'
+    id = Column(Integer, primary_key=True, nullable=False)
+    name = Column(Unicode(24), nullable=False)
+
+class MoveMetaCategory(TableBase):
+    u"""Very general categories that loosely group move effects."""
+    __tablename__ = 'move_meta_categories'
+    id = Column(Integer, primary_key=True, nullable=False)
+    description = Column(Unicode(64), nullable=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)
+    stat_id = Column(Integer, ForeignKey('stats.id'), primary_key=True, nullable=False, autoincrement=False)
+    change = Column(Integer, nullable=False, index=True)
+
 class MoveName(TableBase):
     u"""Non-English name of a move
     """
@@ -1220,6 +1258,17 @@ class Stat(TableBase):
     name = Column(Unicode(16), nullable=False,
         info=dict(description=u"The English name of the stat", official=True, format='plaintext'))
 
+class StatHint(TableBase):
+    u"""Flavor text for genes that appears in a Pokémon's summary.  Sometimes
+    called "characteristics".
+    """
+    __tablename__ = 'stat_hints'
+    id = Column(Integer, primary_key=True, nullable=False)
+    stat_id = Column(Integer, ForeignKey('stats.id'), nullable=False)
+    gene_mod_5 = Column(Integer, nullable=False, index=True)
+    text = Column(Unicode(24), nullable=False, index=True, unique=True,
+        info=dict(description=u"The English text displayed", official=True, format='plaintext'))
+
 class SuperContestCombo(TableBase):
     u"""Combo of two moves in a Super Contest.
     """
@@ -1431,6 +1480,8 @@ Move.flavor_text = relation(MoveFlavorText, order_by=MoveFlavorText.version_grou
 Move.foreign_names = relation(MoveName, backref='move')
 Move.generation = relation(Generation, backref='moves')
 Move.machines = relation(Machine, backref='move')
+Move.meta = relation(MoveMeta, uselist=False, backref='move')
+Move.meta_stat_changes = relation(MoveMetaStatChange)
 Move.move_effect = relation(MoveEffect, backref='moves')
 Move.move_flags = relation(MoveFlag, backref='move')
 Move.super_contest_effect = relation(SuperContestEffect, backref='moves')
@@ -1463,6 +1514,11 @@ MoveFlag.flag = relation(MoveFlagType)
 
 MoveFlavorText.version_group = relation(VersionGroup)
 
+MoveMeta.category = relation(MoveMetaCategory, backref='move_meta')
+MoveMeta.ailment = relation(MoveMetaAilment, backref='move_meta')
+
+MoveMetaStatChange.stat = relation(Stat, backref='move_meta_stat_changes')
+
 MoveName.language = relation(Language)
 
 Nature.foreign_names = relation(NatureName, backref='nature')
@@ -1617,6 +1673,8 @@ Region.version_groups = association_proxy('version_group_regions', 'version_grou
 
 Stat.damage_class = relation(MoveDamageClass, backref='stats')
 
+StatHint.stat = relation(Stat, backref='hints')
+
 SuperContestCombo.first = relation(Move, primaryjoin=SuperContestCombo.first_move_id==Move.id,
                                         backref='super_contest_combo_first')
 SuperContestCombo.second = relation(Move, primaryjoin=SuperContestCombo.second_move_id==Move.id,