mirror of
https://github.com/veekun/pokedex.git
synced 2024-08-20 18:16:34 +00:00
Overhauled evolution. #42
This commit is contained in:
parent
f19ad81b76
commit
78b6a68cd5
4 changed files with 823 additions and 512 deletions
5
pokedex/data/csv/evolution_triggers.csv
Normal file
5
pokedex/data/csv/evolution_triggers.csv
Normal file
|
@ -0,0 +1,5 @@
|
|||
id,identifier
|
||||
1,level_up
|
||||
2,trade
|
||||
3,use_item
|
||||
4,shed
|
|
File diff suppressed because it is too large
Load diff
249
pokedex/data/csv/pokemon_evolution.csv
Normal file
249
pokedex/data/csv/pokemon_evolution.csv
Normal file
|
@ -0,0 +1,249 @@
|
|||
from_pokemon_id,to_pokemon_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_pokemon_id
|
||||
1,2,1,,16,,,,,,,,,
|
||||
2,3,1,,32,,,,,,,,,
|
||||
4,5,1,,16,,,,,,,,,
|
||||
5,6,1,,36,,,,,,,,,
|
||||
7,8,1,,16,,,,,,,,,
|
||||
8,9,1,,36,,,,,,,,,
|
||||
10,11,1,,7,,,,,,,,,
|
||||
11,12,1,,10,,,,,,,,,
|
||||
13,14,1,,7,,,,,,,,,
|
||||
14,15,1,,10,,,,,,,,,
|
||||
16,17,1,,18,,,,,,,,,
|
||||
17,18,1,,36,,,,,,,,,
|
||||
19,20,1,,20,,,,,,,,,
|
||||
21,22,1,,20,,,,,,,,,
|
||||
23,24,1,,22,,,,,,,,,
|
||||
172,25,1,,,,,,,,200,,,
|
||||
25,26,3,83,,,,,,,,,,
|
||||
27,28,1,,22,,,,,,,,,
|
||||
29,30,1,,16,,,,,,,,,
|
||||
30,31,3,81,,,,,,,,,,
|
||||
32,33,1,,16,,,,,,,,,
|
||||
33,34,3,81,,,,,,,,,,
|
||||
173,35,1,,,,,,,,200,,,
|
||||
35,36,3,81,,,,,,,,,,
|
||||
37,38,3,82,,,,,,,,,,
|
||||
174,39,1,,,,,,,,200,,,
|
||||
39,40,3,81,,,,,,,,,,
|
||||
41,42,1,,22,,,,,,,,,
|
||||
43,44,1,,21,,,,,,,,,
|
||||
44,45,3,85,,,,,,,,,,
|
||||
46,47,1,,24,,,,,,,,,
|
||||
48,49,1,,31,,,,,,,,,
|
||||
50,51,1,,26,,,,,,,,,
|
||||
52,53,1,,28,,,,,,,,,
|
||||
54,55,1,,33,,,,,,,,,
|
||||
56,57,1,,28,,,,,,,,,
|
||||
58,59,3,82,,,,,,,,,,
|
||||
60,61,1,,25,,,,,,,,,
|
||||
61,62,3,84,,,,,,,,,,
|
||||
63,64,1,,16,,,,,,,,,
|
||||
64,65,2,,,,,,,,,,,
|
||||
66,67,1,,28,,,,,,,,,
|
||||
67,68,2,,,,,,,,,,,
|
||||
69,70,1,,21,,,,,,,,,
|
||||
70,71,3,85,,,,,,,,,,
|
||||
72,73,1,,30,,,,,,,,,
|
||||
74,75,1,,25,,,,,,,,,
|
||||
75,76,2,,,,,,,,,,,
|
||||
77,78,1,,40,,,,,,,,,
|
||||
79,80,1,,37,,,,,,,,,
|
||||
81,82,1,,30,,,,,,,,,
|
||||
84,85,1,,31,,,,,,,,,
|
||||
86,87,1,,34,,,,,,,,,
|
||||
88,89,1,,38,,,,,,,,,
|
||||
90,91,3,84,,,,,,,,,,
|
||||
92,93,1,,25,,,,,,,,,
|
||||
93,94,2,,,,,,,,,,,
|
||||
96,97,1,,26,,,,,,,,,
|
||||
98,99,1,,28,,,,,,,,,
|
||||
100,101,1,,30,,,,,,,,,
|
||||
102,103,3,85,,,,,,,,,,
|
||||
104,105,1,,28,,,,,,,,,
|
||||
236,106,1,,20,,,,,,,,-1,
|
||||
236,107,1,,20,,,,,,,,0,
|
||||
109,110,1,,35,,,,,,,,,
|
||||
111,112,1,,42,,,,,,,,,
|
||||
440,113,1,,,,,110,day,,,,,
|
||||
116,117,1,,32,,,,,,,,,
|
||||
118,119,1,,33,,,,,,,,,
|
||||
120,121,3,84,,,,,,,,,,
|
||||
439,122,1,,,,,,,102,,,,
|
||||
238,124,1,,30,,,,,,,,,
|
||||
239,125,1,,30,,,,,,,,,
|
||||
240,126,1,,30,,,,,,,,,
|
||||
129,130,1,,20,,,,,,,,,
|
||||
133,134,3,84,,,,,,,,,,
|
||||
133,135,3,83,,,,,,,,,,
|
||||
133,136,3,82,,,,,,,,,,
|
||||
138,139,1,,40,,,,,,,,,
|
||||
140,141,1,,40,,,,,,,,,
|
||||
446,143,1,,,,,,,,200,,,
|
||||
147,148,1,,30,,,,,,,,,
|
||||
148,149,1,,55,,,,,,,,,
|
||||
152,153,1,,16,,,,,,,,,
|
||||
153,154,1,,32,,,,,,,,,
|
||||
155,156,1,,14,,,,,,,,,
|
||||
156,157,1,,36,,,,,,,,,
|
||||
158,159,1,,18,,,,,,,,,
|
||||
159,160,1,,30,,,,,,,,,
|
||||
161,162,1,,15,,,,,,,,,
|
||||
163,164,1,,20,,,,,,,,,
|
||||
165,166,1,,18,,,,,,,,,
|
||||
167,168,1,,22,,,,,,,,,
|
||||
42,169,1,,,,,,,,200,,,
|
||||
170,171,1,,27,,,,,,,,,
|
||||
175,176,1,,,,,,,,200,,,
|
||||
177,178,1,,25,,,,,,,,,
|
||||
179,180,1,,15,,,,,,,,,
|
||||
180,181,1,,30,,,,,,,,,
|
||||
44,182,3,80,,,,,,,,,,
|
||||
298,183,1,,,,,,,,200,,,
|
||||
183,184,1,,18,,,,,,,,,
|
||||
438,185,1,,,,,,,102,,,,
|
||||
61,186,2,,,,,198,,,,,,
|
||||
187,188,1,,18,,,,,,,,,
|
||||
188,189,1,,27,,,,,,,,,
|
||||
191,192,3,80,,,,,,,,,,
|
||||
194,195,1,,20,,,,,,,,,
|
||||
133,196,1,,,,,,day,,200,,,
|
||||
133,197,1,,,,,,night,,200,,,
|
||||
79,199,2,,,,,198,,,,,,
|
||||
360,202,1,,15,,,,,,,,,
|
||||
204,205,1,,31,,,,,,,,,
|
||||
95,208,2,,,,,210,,,,,,
|
||||
209,210,1,,23,,,,,,,,,
|
||||
123,212,2,,,,,210,,,,,,
|
||||
216,217,1,,30,,,,,,,,,
|
||||
218,219,1,,38,,,,,,,,,
|
||||
220,221,1,,33,,,,,,,,,
|
||||
223,224,1,,25,,,,,,,,,
|
||||
458,226,1,,,,,,,,,,,223
|
||||
228,229,1,,24,,,,,,,,,
|
||||
117,230,2,,,,,212,,,,,,
|
||||
231,232,1,,25,,,,,,,,,
|
||||
137,233,2,,,,,229,,,,,,
|
||||
236,237,1,,20,,,,,,,,1,
|
||||
113,242,1,,,,,,,,200,,,
|
||||
246,247,1,,30,,,,,,,,,
|
||||
247,248,1,,55,,,,,,,,,
|
||||
252,253,1,,16,,,,,,,,,
|
||||
253,254,1,,36,,,,,,,,,
|
||||
255,256,1,,16,,,,,,,,,
|
||||
256,257,1,,36,,,,,,,,,
|
||||
258,259,1,,16,,,,,,,,,
|
||||
259,260,1,,36,,,,,,,,,
|
||||
261,262,1,,18,,,,,,,,,
|
||||
263,264,1,,20,,,,,,,,,
|
||||
265,266,1,,7,,,,,,,,,
|
||||
266,267,1,,10,,,,,,,,,
|
||||
265,268,1,,7,,,,,,,,,
|
||||
268,269,1,,10,,,,,,,,,
|
||||
270,271,1,,14,,,,,,,,,
|
||||
271,272,3,84,,,,,,,,,,
|
||||
273,274,1,,14,,,,,,,,,
|
||||
274,275,3,85,,,,,,,,,,
|
||||
276,277,1,,22,,,,,,,,,
|
||||
278,279,1,,25,,,,,,,,,
|
||||
280,281,1,,20,,,,,,,,,
|
||||
281,282,1,,30,,,,,,,,,
|
||||
283,284,1,,22,,,,,,,,,
|
||||
285,286,1,,23,,,,,,,,,
|
||||
287,288,1,,18,,,,,,,,,
|
||||
288,289,1,,36,,,,,,,,,
|
||||
290,291,1,,20,,,,,,,,,
|
||||
290,292,4,,,,,,,,,,,
|
||||
293,294,1,,20,,,,,,,,,
|
||||
294,295,1,,40,,,,,,,,,
|
||||
296,297,1,,24,,,,,,,,,
|
||||
300,301,3,81,,,,,,,,,,
|
||||
304,305,1,,32,,,,,,,,,
|
||||
305,306,1,,42,,,,,,,,,
|
||||
307,308,1,,37,,,,,,,,,
|
||||
309,310,1,,26,,,,,,,,,
|
||||
406,315,1,,,,,,day,,200,,,
|
||||
316,317,1,,26,,,,,,,,,
|
||||
318,319,1,,30,,,,,,,,,
|
||||
320,321,1,,40,,,,,,,,,
|
||||
322,323,1,,33,,,,,,,,,
|
||||
325,326,1,,32,,,,,,,,,
|
||||
328,329,1,,35,,,,,,,,,
|
||||
329,330,1,,45,,,,,,,,,
|
||||
331,332,1,,32,,,,,,,,,
|
||||
333,334,1,,35,,,,,,,,,
|
||||
339,340,1,,30,,,,,,,,,
|
||||
341,342,1,,30,,,,,,,,,
|
||||
343,344,1,,36,,,,,,,,,
|
||||
345,346,1,,40,,,,,,,,,
|
||||
347,348,1,,40,,,,,,,,,
|
||||
349,350,1,,,,,,,,,171,,
|
||||
353,354,1,,37,,,,,,,,,
|
||||
355,356,1,,37,,,,,,,,,
|
||||
433,358,1,,,,,,night,,200,,,
|
||||
361,362,1,,42,,,,,,,,,
|
||||
363,364,1,,32,,,,,,,,,
|
||||
364,365,1,,44,,,,,,,,,
|
||||
366,367,2,,,,,203,,,,,,
|
||||
366,368,2,,,,,204,,,,,,
|
||||
371,372,1,,30,,,,,,,,,
|
||||
372,373,1,,50,,,,,,,,,
|
||||
374,375,1,,20,,,,,,,,,
|
||||
375,376,1,,45,,,,,,,,,
|
||||
387,388,1,,18,,,,,,,,,
|
||||
388,389,1,,32,,,,,,,,,
|
||||
390,391,1,,14,,,,,,,,,
|
||||
391,392,1,,36,,,,,,,,,
|
||||
393,394,1,,16,,,,,,,,,
|
||||
394,395,1,,36,,,,,,,,,
|
||||
396,397,1,,14,,,,,,,,,
|
||||
397,398,1,,34,,,,,,,,,
|
||||
399,400,1,,15,,,,,,,,,
|
||||
401,402,1,,10,,,,,,,,,
|
||||
403,404,1,,15,,,,,,,,,
|
||||
404,405,1,,30,,,,,,,,,
|
||||
315,407,3,107,,,,,,,,,,
|
||||
408,409,1,,30,,,,,,,,,
|
||||
410,411,1,,30,,,,,,,,,
|
||||
412,413,1,,20,female,,,,,,,,
|
||||
412,414,1,,20,male,,,,,,,,
|
||||
415,416,1,,21,female,,,,,,,,
|
||||
418,419,1,,26,,,,,,,,,
|
||||
420,421,1,,25,,,,,,,,,
|
||||
422,423,1,,30,,,,,,,,,
|
||||
190,424,1,,,,,,,458,,,,
|
||||
425,426,1,,28,,,,,,,,,
|
||||
427,428,1,,,,,,,,200,,,
|
||||
200,429,3,108,,,,,,,,,,
|
||||
198,430,3,108,,,,,,,,,,
|
||||
431,432,1,,38,,,,,,,,,
|
||||
434,435,1,,34,,,,,,,,,
|
||||
436,437,1,,33,,,,,,,,,
|
||||
443,444,1,,24,,,,,,,,,
|
||||
444,445,1,,48,,,,,,,,,
|
||||
447,448,1,,,,,,day,,200,,,
|
||||
449,450,1,,34,,,,,,,,,
|
||||
451,452,1,,40,,,,,,,,,
|
||||
453,454,1,,37,,,,,,,,,
|
||||
456,457,1,,31,,,,,,,,,
|
||||
459,460,1,,40,,,,,,,,,
|
||||
215,461,1,,,,,303,night,,,,,
|
||||
82,462,1,,,,10,,,,,,,
|
||||
108,463,1,,,,,,,205,,,,
|
||||
112,464,2,,,,,298,,,,,,
|
||||
114,465,1,,,,,,,246,,,,
|
||||
125,466,2,,,,,299,,,,,,
|
||||
126,467,2,,,,,300,,,,,,
|
||||
176,468,3,107,,,,,,,,,,
|
||||
193,469,1,,,,,,,246,,,,
|
||||
133,470,1,,,,8,,,,,,,
|
||||
133,471,1,,,,48,,,,,,,
|
||||
207,472,1,,,,,304,night,,,,,
|
||||
221,473,1,,,,,,,246,,,,
|
||||
233,474,2,,,,,301,,,,,,
|
||||
281,475,3,109,,male,,,,,,,,
|
||||
299,476,1,,,,10,,,,,,,
|
||||
356,477,2,,,,,302,,,,,,
|
||||
361,478,3,109,,female,,,,,,,,
|
||||
412,499,1,,20,female,,,,,,,,
|
||||
412,500,1,,20,female,,,,,,,,
|
|
|
@ -180,6 +180,11 @@ class EvolutionMethod(TableBase):
|
|||
name = Column(Unicode(64), nullable=False)
|
||||
description = Column(Unicode(255), nullable=False)
|
||||
|
||||
class EvolutionTrigger(TableBase):
|
||||
__tablename__ = 'evolution_triggers'
|
||||
id = Column(Integer, primary_key=True, nullable=False)
|
||||
identifier = Column(Unicode(16), nullable=False)
|
||||
|
||||
class Experience(TableBase):
|
||||
__tablename__ = 'experience'
|
||||
growth_rate_id = Column(Integer, ForeignKey('growth_rates.id'), primary_key=True, nullable=False)
|
||||
|
@ -428,9 +433,6 @@ class Pokemon(TableBase):
|
|||
forme_base_pokemon_id = Column(Integer, ForeignKey('pokemon.id'))
|
||||
generation_id = Column(Integer, ForeignKey('generations.id'))
|
||||
evolution_chain_id = Column(Integer, ForeignKey('evolution_chains.id'))
|
||||
evolution_parent_pokemon_id = Column(Integer, ForeignKey('pokemon.id'))
|
||||
evolution_method_id = Column(Integer, ForeignKey('evolution_methods.id'))
|
||||
evolution_parameter = Column(Unicode(32))
|
||||
height = Column(Integer, nullable=False)
|
||||
weight = Column(Integer, nullable=False)
|
||||
species = Column(Unicode(16), nullable=False)
|
||||
|
@ -514,6 +516,23 @@ class PokemonEggGroup(TableBase):
|
|||
pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False)
|
||||
egg_group_id = Column(Integer, ForeignKey('egg_groups.id'), primary_key=True, nullable=False, autoincrement=False)
|
||||
|
||||
class PokemonEvolution(TableBase):
|
||||
__tablename__ = 'pokemon_evolution'
|
||||
from_pokemon_id = Column(Integer, ForeignKey('pokemon.id'), nullable=False)
|
||||
to_pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False)
|
||||
evolution_trigger_id = Column(Integer, ForeignKey('evolution_triggers.id'), nullable=False)
|
||||
trigger_item_id = Column(Integer, ForeignKey('items.id'), nullable=True)
|
||||
minimum_level = Column(Integer, nullable=True)
|
||||
gender = Column(Enum('male', 'female', name='pokemon_evolution_gender'), nullable=True)
|
||||
location_id = Column(Integer, ForeignKey('locations.id'), nullable=True)
|
||||
held_item_id = Column(Integer, ForeignKey('items.id'), nullable=True)
|
||||
time_of_day = Column(Enum('morning', 'day', 'night', name='pokemon_evolution_time_of_day'), nullable=True)
|
||||
known_move_id = Column(Integer, ForeignKey('moves.id'), nullable=True)
|
||||
minimum_happiness = Column(Integer, nullable=True)
|
||||
minimum_beauty = Column(Integer, nullable=True)
|
||||
relative_physical_stats = Column(Integer, nullable=True)
|
||||
party_pokemon_id = Column(Integer, ForeignKey('pokemon.id'), nullable=True)
|
||||
|
||||
class PokemonFlavorText(TableBase):
|
||||
__tablename__ = 'pokemon_flavor_text'
|
||||
pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False)
|
||||
|
@ -782,9 +801,15 @@ Pokemon.egg_groups = relation(EggGroup, secondary=PokemonEggGroup.__table__,
|
|||
backref='pokemon')
|
||||
Pokemon.evolution_chain = relation(EvolutionChain, backref='pokemon')
|
||||
Pokemon.evolution_method = relation(EvolutionMethod)
|
||||
Pokemon.evolution_children = relation(Pokemon, primaryjoin=Pokemon.id==Pokemon.evolution_parent_pokemon_id,
|
||||
backref=backref('evolution_parent',
|
||||
remote_side=[Pokemon.id]))
|
||||
Pokemon.evolution_children = relation(Pokemon,
|
||||
secondary=PokemonEvolution.__table__,
|
||||
primaryjoin=Pokemon.id==PokemonEvolution.from_pokemon_id,
|
||||
secondaryjoin=PokemonEvolution.to_pokemon_id==Pokemon.id,
|
||||
backref=backref('evolution_parent',
|
||||
remote_side=[Pokemon.id],
|
||||
uselist=False,
|
||||
),
|
||||
)
|
||||
Pokemon.flavor_text = relation(PokemonFlavorText, order_by=PokemonFlavorText.version_id.asc(), backref='pokemon')
|
||||
Pokemon.foreign_names = relation(PokemonName, backref='pokemon')
|
||||
Pokemon.pokemon_habitat = relation(PokemonHabitat, backref='pokemon')
|
||||
|
@ -797,6 +822,38 @@ Pokemon.types = relation(Type, secondary=PokemonType.__table__, order_by=Pokemon
|
|||
|
||||
PokemonDexNumber.pokedex = relation(Pokedex)
|
||||
|
||||
PokemonEvolution.from_pokemon = relation(Pokemon,
|
||||
primaryjoin=PokemonEvolution.from_pokemon_id==Pokemon.id,
|
||||
backref='child_evolutions',
|
||||
)
|
||||
PokemonEvolution.to_pokemon = relation(Pokemon,
|
||||
primaryjoin=PokemonEvolution.to_pokemon_id==Pokemon.id,
|
||||
backref=backref('parent_evolution', uselist=False),
|
||||
)
|
||||
PokemonEvolution.child_evolutions = relation(PokemonEvolution,
|
||||
primaryjoin=PokemonEvolution.from_pokemon_id==PokemonEvolution.to_pokemon_id,
|
||||
foreign_keys=[PokemonEvolution.to_pokemon_id],
|
||||
backref=backref('parent_evolution',
|
||||
remote_side=[PokemonEvolution.from_pokemon_id],
|
||||
uselist=False,
|
||||
),
|
||||
)
|
||||
PokemonEvolution.trigger = relation(EvolutionTrigger, backref='evolutions')
|
||||
PokemonEvolution.trigger_item = relation(Item,
|
||||
primaryjoin=PokemonEvolution.trigger_item_id==Item.id,
|
||||
backref='triggered_evolutions',
|
||||
)
|
||||
PokemonEvolution.held_item = relation(Item,
|
||||
primaryjoin=PokemonEvolution.held_item_id==Item.id,
|
||||
backref='required_for_evolutions',
|
||||
)
|
||||
PokemonEvolution.location = relation(Location, backref='triggered_evolutions')
|
||||
PokemonEvolution.known_move = relation(Move, backref='triggered_evolutions')
|
||||
PokemonEvolution.party_pokemon = relation(Pokemon,
|
||||
primaryjoin=PokemonEvolution.party_pokemon_id==Pokemon.id,
|
||||
backref='triggered_evolutions',
|
||||
)
|
||||
|
||||
PokemonFlavorText.version = relation(Version)
|
||||
|
||||
PokemonItem.item = relation(Item, backref='pokemon')
|
||||
|
|
Loading…
Reference in a new issue