Implement an ability changelog; add a few changes. #78

This commit is contained in:
Zhorken 2010-12-06 17:45:43 -05:00
parent 11adedaea8
commit 4e5415ac56
2 changed files with 31 additions and 3 deletions

View file

@ -0,0 +1,12 @@
ability_id,changed_in_version_group_id,effect
1,11,Has no effect in battle.
16,11,Triggers on every hit of multiple-hit moves.
24,8,Inflicts only 1/16 of the attacker's maximum [HP]{mechanic} in damage.
28,11,Passes back toxic [poison]{mechanic} as regular poison.
31,8,"Does not absorb non-damaging [Electric]{type} moves, i.e. [Thunder Wave]{move}."
31,11,Grants no [Electric]{type} immunity or [Special Attack]{mechanic} boosts.
53,11,Has no effect in battle.
98,11,"Paralysis cannot prevent the Pokémon from moving, though the [Speed]{mechanic} cut is unaffected."
102,11,[Rest]{move} works as normal during [strong sunlight]{mechanic}.
103,11,[Fling]{move} can be used as normal.
114,11,Grants no [Water]{type} immunity or [Special Attack]{mechanic} boosts.
1 ability_id changed_in_version_group_id effect
2 1 11 Has no effect in battle.
3 16 11 Triggers on every hit of multiple-hit moves.
4 24 8 Inflicts only 1/16 of the attacker's maximum [HP]{mechanic} in damage.
5 28 11 Passes back toxic [poison]{mechanic} as regular poison.
6 31 8 Does not absorb non-damaging [Electric]{type} moves, i.e. [Thunder Wave]{move}.
7 31 11 Grants no [Electric]{type} immunity or [Special Attack]{mechanic} boosts.
8 53 11 Has no effect in battle.
9 98 11 Paralysis cannot prevent the Pokémon from moving, though the [Speed]{mechanic} cut is unaffected.
10 102 11 [Rest]{move} works as normal during [strong sunlight]{mechanic}.
11 103 11 [Fling]{move} can be used as normal.
12 114 11 Grants no [Water]{type} immunity or [Special Attack]{mechanic} boosts.

View file

@ -53,6 +53,16 @@ class Ability(TableBase):
short_effect = Column(markdown.MarkdownColumn(255), nullable=False,
info=dict(description="Short summary of this ability's effect", format='markdown'))
class AbilityChangelog(TableBase):
"""History of changes to abilities across main game versions."""
__tablename__ = 'ability_changelog'
ability_id = Column(Integer, ForeignKey('abilities.id'), primary_key=True, nullable=False,
info=dict(description="The ID of the ability that changed"))
changed_in_version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False,
info=dict(description="The ID of the version group in which the ability changed"))
effect = Column(markdown.MarkdownColumn(255), nullable=False,
info=dict(description="A description of the old behavior", format='markdown'))
class AbilityFlavorText(TableBase):
u"""In-game flavor text of an ability
"""
@ -1261,18 +1271,22 @@ class VersionGroupRegion(TableBase):
info=dict(description=u"ID of the region"))
class Version(TableBase):
u"""A version of a mainline pokémon game
u"""An individual main-series Pokémon game
"""
__tablename__ = 'versions'
id = Column(Integer, primary_key=True, nullable=False,
info=dict(description=u"A numeric ID"))
info=dict(description=u"A unique ID for this version"))
version_group_id = Column(Integer, ForeignKey('version_groups.id'), nullable=False,
info=dict(description=u"ID of the version group this game belongs to"))
info=dict(description=u"The ID of the version group this game belongs to"))
name = Column(Unicode(32), nullable=False,
info=dict(description=u'The English name of the game, without the "Pokémon" prefix', official=True, format='plaintext'))
### Relations down here, to avoid ordering problems
Ability.changelog = relation(AbilityChangelog,
order_by=AbilityChangelog.changed_in_version_group_id.desc(),
backref='ability',
)
Ability.flavor_text = relation(AbilityFlavorText, order_by=AbilityFlavorText.version_group_id, backref='ability')
Ability.foreign_names = relation(AbilityName, backref='ability')
Ability.generation = relation(Generation, backref='abilities')
@ -1280,6 +1294,8 @@ Ability.pokemon = relation(Pokemon,
secondary=PokemonAbility.__table__,
)
AbilityChangelog.changed_in = relation(VersionGroup, backref='ability_changelog')
AbilityFlavorText.version_group = relation(VersionGroup)
AbilityName.language = relation(Language)