Restored Item.appears_underground and added location support to rst.

This commit is contained in:
Eevee 2010-05-02 16:07:45 -07:00
parent d98632aa50
commit f8145b87e4
3 changed files with 16 additions and 10 deletions

View file

@ -1,9 +1,9 @@
id,name
1,Has a count in the bag
2,Consumed when used
3,Usable outside battle
4,Usable in battle
5,Can be held by a Pokémon
6,Works passively when held
7,Usable by a Pokémon when held
8,Appears in Sinnoh Underground
id,identifier,name
1,countable,Has a count in the bag
2,consumable,Consumed when used
3,usable_overworld,Usable outside battle
4,usable_in_battle,Usable in battle
5,holdable,Can be held by a Pokémon
6,holdable_passive,Works passively when held
7,holdable_active,Usable by a Pokémon when held
8,underground,Appears in Sinnoh Underground

1 id identifier name
2 1 countable Has a count in the bag
3 2 consumable Consumed when used
4 3 usable_overworld Usable outside battle
5 4 usable_in_battle Usable in battle
6 5 holdable Can be held by a Pokémon
7 6 holdable_passive Works passively when held
8 7 holdable_active Usable by a Pokémon when held
9 8 underground Appears in Sinnoh Underground

View file

@ -120,6 +120,7 @@ def generic_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
roles.register_local_role('ability', generic_role)
roles.register_local_role('item', generic_role)
roles.register_local_role('location', generic_role)
roles.register_local_role('move', generic_role)
roles.register_local_role('type', generic_role)
roles.register_local_role('pokemon', generic_role)

View file

@ -201,7 +201,11 @@ class Item(TableBase):
cost = Column(Integer, nullable=False)
fling_power = Column(Integer, nullable=True)
fling_effect_id = Column(Integer, ForeignKey('item_fling_effects.id'), nullable=True)
effect = Column(Unicode(5120), nullable=False)
effect = Column(rst.RstTextColumn(5120), nullable=False)
@property
def appears_underground(self):
return any(flag.identifier == u'underground' for flag in self.flags)
class ItemCategory(TableBase):
__tablename__ = 'item_categories'
@ -212,6 +216,7 @@ class ItemCategory(TableBase):
class ItemFlag(TableBase):
__tablename__ = 'item_flags'
id = Column(Integer, primary_key=True, nullable=False)
identifier = Column(Unicode(24), nullable=False)
name = Column(Unicode(64), nullable=False)
class ItemFlagMap(TableBase):