EvolutionChain -> PokemonFamily. gh #21

Prep for combining the Nidoran and Volbeat/Illumise families.

This isn't strictly necessary, but it makes sense for the evolution
tables to be "Pokemon"-prefixed since, hey, evolution is a Pokemon
thing.
This commit is contained in:
Andrew Ekstedt 2012-06-08 21:16:24 -07:00
parent 5ddb7911a2
commit 6c82e74611
8 changed files with 44 additions and 44 deletions

View file

@ -36,7 +36,7 @@ Pokémon
.. dex-table:: PokemonSpecies .. dex-table:: PokemonSpecies
.. dex-table:: Pokemon .. dex-table:: Pokemon
.. dex-table:: PokemonForm .. dex-table:: PokemonForm
.. dex-table:: EvolutionChain .. dex-table:: PokemonFamily
.. dex-table:: PokemonEvolution .. dex-table:: PokemonEvolution
Moves Moves
@ -103,7 +103,6 @@ Enum tables
.. dex-table:: BerryFirmness .. dex-table:: BerryFirmness
.. dex-table:: ContestType .. dex-table:: ContestType
.. dex-table:: EggGroup .. dex-table:: EggGroup
.. dex-table:: EvolutionTrigger
.. dex-table:: GrowthRate .. dex-table:: GrowthRate
.. dex-table:: ItemCategory .. dex-table:: ItemCategory
.. dex-table:: ItemFlingEffect .. dex-table:: ItemFlingEffect
@ -116,6 +115,7 @@ Enum tables
.. dex-table:: Nature .. dex-table:: Nature
.. dex-table:: PalParkArea .. dex-table:: PalParkArea
.. dex-table:: PokemonColor .. dex-table:: PokemonColor
.. dex-table:: PokemonEvolutionTrigger
.. dex-table:: PokemonMoveMethod .. dex-table:: PokemonMoveMethod
.. dex-table:: PokemonShape .. dex-table:: PokemonShape
.. dex-table:: Stat .. dex-table:: Stat

View file

@ -1,5 +0,0 @@
evolution_trigger_id,local_language_id,name
1,9,Level up
2,9,Trade
3,9,Use item
4,9,Shed
1 evolution_trigger_id local_language_id name
2 1 9 Level up
3 2 9 Trade
4 3 9 Use item
5 4 9 Shed

View file

@ -1,4 +1,4 @@
id,evolved_species_id,evolution_trigger_id,trigger_item_id,minimum_level,gender,location_id,held_item_id,time_of_day,known_move_id,minimum_happiness,minimum_beauty,relative_physical_stats,party_species_id,trade_species_id id,evolved_species_id,trigger_id,trigger_item_id,minimum_level,gender,location_id,held_item_id,time_of_day,known_move_id,minimum_happiness,minimum_beauty,relative_physical_stats,party_species_id,trade_species_id
1,2,1,,16,,,,,,,,,, 1,2,1,,16,,,,,,,,,,
2,3,1,,32,,,,,,,,,, 2,3,1,,32,,,,,,,,,,
3,5,1,,16,,,,,,,,,, 3,5,1,,16,,,,,,,,,,

1 id evolved_species_id evolution_trigger_id trigger_id trigger_item_id minimum_level gender location_id held_item_id time_of_day known_move_id minimum_happiness minimum_beauty relative_physical_stats party_species_id trade_species_id
2 1 2 1 16
3 2 3 1 32
4 3 5 1 16

View file

@ -0,0 +1,5 @@
pokemon_evolution_trigger_id,local_language_id,name
1,9,Level up
2,9,Trade
3,9,Use item
4,9,Shed
1 pokemon_evolution_trigger_id local_language_id name
2 1 9 Level up
3 2 9 Trade
4 3 9 Use item
5 4 9 Shed

View file

@ -1,4 +1,4 @@
id,identifier,generation_id,evolves_from_species_id,evolution_chain_id,color_id,shape_id,habitat_id,gender_rate,capture_rate,base_happiness,is_baby,hatch_counter,has_gender_differences,growth_rate_id,forms_switchable id,identifier,generation_id,evolves_from_species_id,family_id,color_id,shape_id,habitat_id,gender_rate,capture_rate,base_happiness,is_baby,hatch_counter,has_gender_differences,growth_rate_id,forms_switchable
1,bulbasaur,1,,1,5,8,3,1,45,70,0,20,0,4,0 1,bulbasaur,1,,1,5,8,3,1,45,70,0,20,0,4,0
2,ivysaur,1,1,1,5,8,3,1,45,70,0,20,0,4,0 2,ivysaur,1,1,1,5,8,3,1,45,70,0,20,0,4,0
3,venusaur,1,2,1,5,8,3,1,45,70,0,20,1,4,0 3,venusaur,1,2,1,5,8,3,1,45,70,0,20,1,4,0

1 id identifier generation_id evolves_from_species_id evolution_chain_id family_id color_id shape_id habitat_id gender_rate capture_rate base_happiness is_baby hatch_counter has_gender_differences growth_rate_id forms_switchable
2 1 bulbasaur 1 1 5 8 3 1 45 70 0 20 0 4 0
3 2 ivysaur 1 1 1 5 8 3 1 45 70 0 20 0 4 0
4 3 venusaur 1 2 1 5 8 3 1 45 70 0 20 1 4 0

View file

@ -403,30 +403,6 @@ class EncounterSlot(TableBase):
rarity = Column(Integer, nullable=True, rarity = Column(Integer, nullable=True,
info=dict(description="The chance of the encounter as a percentage")) info=dict(description="The chance of the encounter as a percentage"))
class EvolutionChain(TableBase):
u"""A family of Pokémon that are linked by evolution
"""
__tablename__ = 'evolution_chains'
id = Column(Integer, primary_key=True, nullable=False,
info=dict(description="A numeric ID"))
baby_trigger_item_id = Column(Integer, ForeignKey('items.id'), nullable=True,
info=dict(description="Item that a parent must hold while breeding to produce a baby"))
class EvolutionTrigger(TableBase):
u"""An evolution type, such as "level" or "trade".
"""
__tablename__ = 'evolution_triggers'
__singlename__ = 'evolution_trigger'
id = Column(Integer, primary_key=True, nullable=False,
info=dict(description="A numeric ID"))
identifier = Column(Unicode(16), nullable=False,
info=dict(description="An identifier", format='identifier'))
create_translation_table('evolution_trigger_prose', EvolutionTrigger, 'prose',
name = Column(Unicode(16), nullable=False, index=True,
info=dict(description="The name", format='plaintext', official=False)),
)
class Experience(TableBase): class Experience(TableBase):
u"""EXP needed for a certain level with a certain growth rate u"""EXP needed for a certain level with a certain growth rate
""" """
@ -1220,7 +1196,7 @@ class PokemonEvolution(TableBase):
info=dict(description=u"A numeric ID")) info=dict(description=u"A numeric ID"))
evolved_species_id = Column(Integer, ForeignKey('pokemon_species.id'), nullable=False, evolved_species_id = Column(Integer, ForeignKey('pokemon_species.id'), nullable=False,
info=dict(description=u"The ID of the post-evolution species.")) info=dict(description=u"The ID of the post-evolution species."))
evolution_trigger_id = Column(Integer, ForeignKey('evolution_triggers.id'), nullable=False, trigger_id = Column(Integer, ForeignKey('pokemon_evolution_triggers.id'), nullable=False,
info=dict(description=u"The ID of the evolution trigger.")) info=dict(description=u"The ID of the evolution trigger."))
trigger_item_id = Column(Integer, ForeignKey('items.id'), nullable=True, trigger_item_id = Column(Integer, ForeignKey('items.id'), nullable=True,
info=dict(description=u"The ID of the item that must be used on the Pokémon.")) info=dict(description=u"The ID of the item that must be used on the Pokémon."))
@ -1247,6 +1223,31 @@ class PokemonEvolution(TableBase):
trade_species_id = Column(Integer, ForeignKey('pokemon_species.id'), nullable=True, trade_species_id = Column(Integer, ForeignKey('pokemon_species.id'), nullable=True,
info=dict(description=u"The ID of the species for which this one must be traded.")) info=dict(description=u"The ID of the species for which this one must be traded."))
class PokemonEvolutionTrigger(TableBase):
u"""An evolution type, such as "level" or "trade".
"""
__tablename__ = 'pokemon_evolution_triggers'
__singlename__ = 'pokemon_evolution_trigger'
id = Column(Integer, primary_key=True, nullable=False,
info=dict(description="A numeric ID"))
identifier = Column(Unicode(16), nullable=False,
info=dict(description="An identifier", format='identifier'))
create_translation_table('pokemon_evolution_trigger_prose', PokemonEvolutionTrigger, 'prose',
name = Column(Unicode(16), nullable=False, index=True,
info=dict(description="The name", format='plaintext', official=False)),
)
class PokemonFamily(TableBase):
u"""A group of Pokémon that are linked by evolution or breeding
"""
__tablename__ = 'pokemon_families'
__singlename__ = 'pokemon_family'
id = Column(Integer, primary_key=True, nullable=False,
info=dict(description="A numeric ID"))
baby_trigger_item_id = Column(Integer, ForeignKey('items.id'), nullable=True,
info=dict(description="Item that a parent must hold while breeding to produce a baby"))
class PokemonForm(TableBase): class PokemonForm(TableBase):
u"""An individual form of a Pokémon. This includes *every* variant (except u"""An individual form of a Pokémon. This includes *every* variant (except
color differences) of every Pokémon, regardless of how the games treat color differences) of every Pokémon, regardless of how the games treat
@ -1419,8 +1420,8 @@ class PokemonSpecies(TableBase):
info=dict(description=u"ID of the generation this species first appeared in")) info=dict(description=u"ID of the generation this species first appeared in"))
evolves_from_species_id = Column(Integer, ForeignKey('pokemon_species.id'), nullable=True, evolves_from_species_id = Column(Integer, ForeignKey('pokemon_species.id'), nullable=True,
info=dict(description=u"The species from which this one evolves")) info=dict(description=u"The species from which this one evolves"))
evolution_chain_id = Column(Integer, ForeignKey('evolution_chains.id'), family_id = Column(Integer, ForeignKey('pokemon_families.id'),
info=dict(description=u"ID of the species' evolution chain (a.k.a. family)")) info=dict(description=u"ID of the species' evolution family"))
color_id = Column(Integer, ForeignKey('pokemon_colors.id'), nullable=False, color_id = Column(Integer, ForeignKey('pokemon_colors.id'), nullable=False,
info=dict(description=u"ID of this Pokémon's Pokédex color, as used for a gimmick search function in the games.")) info=dict(description=u"ID of this Pokémon's Pokédex color, as used for a gimmick search function in the games."))
shape_id = Column(Integer, ForeignKey('pokemon_shapes.id'), nullable=False, shape_id = Column(Integer, ForeignKey('pokemon_shapes.id'), nullable=False,
@ -1440,7 +1441,7 @@ class PokemonSpecies(TableBase):
has_gender_differences = Column(Boolean, nullable=False, has_gender_differences = Column(Boolean, nullable=False,
info=dict(description=u"Set iff the species exhibits enough sexual dimorphism to have separate sets of sprites in Gen IV and beyond.")) info=dict(description=u"Set iff the species exhibits enough sexual dimorphism to have separate sets of sprites in Gen IV and beyond."))
growth_rate_id = Column(Integer, ForeignKey('growth_rates.id'), nullable=False, growth_rate_id = Column(Integer, ForeignKey('growth_rates.id'), nullable=False,
info=dict(description="ID of the growth rate for this family")) info=dict(description="ID of the growth rate for this species"))
forms_switchable = Column(Boolean, nullable=False, forms_switchable = Column(Boolean, nullable=False,
info=dict(description=u"True iff a particular individual of this species can switch beween its different forms.")) info=dict(description=u"True iff a particular individual of this species can switch beween its different forms."))
@ -1735,10 +1736,6 @@ EncounterSlot.method = relationship(EncounterMethod,
EncounterSlot.version_group = relationship(VersionGroup, innerjoin=True) EncounterSlot.version_group = relationship(VersionGroup, innerjoin=True)
EvolutionChain.baby_trigger_item = relationship(Item,
backref='evolution_chains')
Experience.growth_rate = relationship(GrowthRate, Experience.growth_rate = relationship(GrowthRate,
innerjoin=True, lazy='joined', innerjoin=True, lazy='joined',
backref='experience_table') backref='experience_table')
@ -2004,7 +2001,7 @@ Pokemon.types = relationship(Type,
PokemonDexNumber.pokedex = relationship(Pokedex, PokemonDexNumber.pokedex = relationship(Pokedex,
innerjoin=True, lazy='joined') innerjoin=True, lazy='joined')
PokemonEvolution.trigger = relationship(EvolutionTrigger, PokemonEvolution.trigger = relationship(PokemonEvolutionTrigger,
innerjoin=True, lazy='joined', innerjoin=True, lazy='joined',
backref='evolutions') backref='evolutions')
PokemonEvolution.trigger_item = relationship(Item, PokemonEvolution.trigger_item = relationship(Item,
@ -2023,6 +2020,9 @@ PokemonEvolution.party_species = relationship(PokemonSpecies,
PokemonEvolution.trade_species = relationship(PokemonSpecies, PokemonEvolution.trade_species = relationship(PokemonSpecies,
primaryjoin=PokemonEvolution.trade_species_id==PokemonSpecies.id) primaryjoin=PokemonEvolution.trade_species_id==PokemonSpecies.id)
PokemonFamily.baby_trigger_item = relationship(Item,
backref='pokemon_families')
PokemonForm.pokemon = relationship(Pokemon, PokemonForm.pokemon = relationship(Pokemon,
primaryjoin=PokemonForm.pokemon_id==Pokemon.id, primaryjoin=PokemonForm.pokemon_id==Pokemon.id,
innerjoin=True, lazy='joined') innerjoin=True, lazy='joined')
@ -2084,7 +2084,7 @@ PokemonSpecies.flavor_text = relationship(PokemonSpeciesFlavorText,
backref='species') backref='species')
PokemonSpecies.growth_rate = relationship(GrowthRate, PokemonSpecies.growth_rate = relationship(GrowthRate,
innerjoin=True, innerjoin=True,
backref='evolution_chains') backref='species')
PokemonSpecies.habitat = relationship(PokemonHabitat, PokemonSpecies.habitat = relationship(PokemonHabitat,
backref='species') backref='species')
PokemonSpecies.color = relationship(PokemonColor, PokemonSpecies.color = relationship(PokemonColor,
@ -2113,7 +2113,7 @@ PokemonSpecies.default_pokemon = relationship(Pokemon,
PokemonSpecies.id==Pokemon.species_id, PokemonSpecies.id==Pokemon.species_id,
Pokemon.is_default==True), Pokemon.is_default==True),
uselist=False, lazy='joined') uselist=False, lazy='joined')
PokemonSpecies.evolution_chain = relationship(EvolutionChain, PokemonSpecies.family = relationship(PokemonFamily,
innerjoin=True, innerjoin=True,
backref=backref('species', order_by=PokemonSpecies.id.asc())) backref=backref('species', order_by=PokemonSpecies.id.asc()))
PokemonSpecies.dex_numbers = relationship(PokemonDexNumber, PokemonSpecies.dex_numbers = relationship(PokemonDexNumber,