info=dict(description="Description of the effect", format='plaintext')),
)
-class ItemInternalID(TableBase):
+class ItemGameIndex(TableBase):
u"""The internal ID number a game uses for an item
"""
- __tablename__ = 'item_internal_ids'
+ __tablename__ = 'item_game_indices'
item_id = Column(Integer, ForeignKey('items.id'), primary_key=True, autoincrement=False, nullable=False,
info=dict(description="The database ID of the item"))
generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, autoincrement=False, nullable=False,
info=dict(description="ID of the generation of games"))
- internal_id = Column(Integer, nullable=False,
+ game_index = Column(Integer, nullable=False,
info=dict(description="Internal ID of the item in the generation"))
class ItemPocket(TableBase):
info=dict(description="A numeric ID"))
location_id = Column(Integer, ForeignKey('locations.id'), nullable=False,
info=dict(description="ID of the location this area is part of"))
- internal_id = Column(Integer, nullable=False,
+ game_index = Column(Integer, nullable=False,
info=dict(description="ID the games ude for this area"))
identifier = Column(Unicode(64), nullable=True,
info=dict(description="An identifier", format='identifier'))
rate = Column(Integer, nullable=True,
info=dict(description="The encounter rate")) # units?
-class LocationInternalID(TableBase):
+class LocationGameIndex(TableBase):
u"""IDs the games use internally for locations
"""
- __tablename__ = 'location_internal_ids'
+ __tablename__ = 'location_game_indices'
location_id = Column(Integer, ForeignKey('locations.id'), nullable=False, primary_key=True,
info=dict(description="Database ID of the locaion"))
generation_id = Column(Integer, ForeignKey('generations.id'), nullable=False, primary_key=True,
info=dict(description="ID of the generation this entry to"))
- internal_id = Column(Integer, nullable=False,
+ game_index = Column(Integer, nullable=False,
info=dict(description="Internal game ID of the location"))
class Machine(TableBase):
info=dict(description="The name", format='plaintext', official=True)),
)
-class PokemonInternalID(TableBase):
+class PokemonGameIndex(TableBase):
u"""The number of a Pokémon a game uses internally
"""
- __tablename__ = 'pokemon_internal_ids'
+ __tablename__ = 'pokemon_game_indices'
pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, autoincrement=False, nullable=False,
info=dict(description=u"Database ID of the Pokémon"))
generation_id = Column(Integer, ForeignKey('generations.id'), primary_key=True, autoincrement=False, nullable=False,
info=dict(description=u"Database ID of the generation"))
- internal_id = Column(Integer, nullable=False,
+ game_index = Column(Integer, nullable=False,
info=dict(description=u"Internal ID the generation's games use for the Pokémon"))
class PokemonItem(TableBase):
ItemFlavorText.version_group = relation(VersionGroup)
ItemFlavorText.language = relation(Language)
-ItemInternalID.item = relation(Item, backref='internal_ids')
-ItemInternalID.generation = relation(Generation)
+ItemGameIndex.item = relation(Item, backref='game_indices')
+ItemGameIndex.generation = relation(Generation)
ItemPocket.categories = relation(ItemCategory, order_by=ItemCategory.identifier)
LocationArea.location = relation(Location, backref='areas')
-LocationInternalID.location = relation(Location, backref='internal_ids')
-LocationInternalID.generation = relation(Generation)
+LocationGameIndex.location = relation(Location, backref='game_indices')
+LocationGameIndex.generation = relation(Generation)
Machine.item = relation(Item)
Machine.version_group = relation(VersionGroup)
self._held_item = None
if st.held_item_id:
- self._held_item = session.query(tables.ItemInternalID) \
- .filter_by(generation_id = 4, internal_id = st.held_item_id).one().item
+ self._held_item = session.query(tables.ItemGameIndex) \
+ .filter_by(generation_id = 4, game_index = st.held_item_id).one().item
self._stats = []
for pokemon_stat in self._pokemon.stats:
pokeball_id = st.hgss_pokeball - 17 + 492
else:
pokeball_id = st.dppt_pokeball
- self._pokeball = session.query(tables.ItemInternalID) \
- .filter_by(generation_id = 4, internal_id = pokeball_id).one().item
+ self._pokeball = session.query(tables.ItemGameIndex) \
+ .filter_by(generation_id = 4, game_index = pokeball_id).one().item
egg_loc_id = st.pt_egg_location_id or st.dp_egg_location_id
met_loc_id = st.pt_met_location_id or st.dp_met_location_id
self._egg_location = None
if egg_loc_id:
- self._egg_location = session.query(tables.LocationInternalID) \
- .filter_by(generation_id = 4, internal_id = egg_loc_id).one().location
+ self._egg_location = session.query(tables.LocationGameIndex) \
+ .filter_by(generation_id = 4, game_index = egg_loc_id).one().location
- self._met_location = session.query(tables.LocationInternalID) \
- .filter_by(generation_id = 4, internal_id = met_loc_id).one().location
+ self._met_location = session.query(tables.LocationGameIndex) \
+ .filter_by(generation_id = 4, game_index = met_loc_id).one().location
@property
def species(self):