diff --git a/pokedex/data/csv/pokemon.csv b/pokedex/data/csv/pokemon.csv index 1f64012..662be32 100644 --- a/pokedex/data/csv/pokemon.csv +++ b/pokedex/data/csv/pokemon.csv @@ -384,7 +384,7 @@ id,name,forme_name,forme_base_pokemon_id,generation_id,evolution_chain_id,evolut 383,Groudon,,,3,199,,,,35,9500,Continent,8,6,6,-1,5,218,0,0,0,0 384,Rayquaza,,,3,200,,,,70,2065,Sky High,5,2,5,-1,3,220,0,0,0,0 385,Jirachi,,,3,201,,,,3,11,Wish,10,12,4,-1,3,215,100,0,0,0 -386,Deoxys,,,3,202,,,,17,608,DNA,8,12,5,-1,3,215,0,0,0,0 +386,Deoxys,normal,,3,202,,,,17,608,DNA,8,12,5,-1,3,215,0,0,0,0 387,Turtwig,,,4,203,,,,4,102,Tiny Leaf,5,8,,1,45,64,70,0,0,0 388,Grotle,,,4,203,387,1,18,11,970,Grove,5,8,,1,45,141,70,0,0,0 389,Torterra,,,4,203,388,1,32,22,3100,Continent,5,8,,1,45,208,70,0,0,0 @@ -477,7 +477,7 @@ id,name,forme_name,forme_base_pokemon_id,generation_id,evolution_chain_id,evolut 476,Probopass,,,4,147,299,4,Mt. Coronet,14,3400,Compass,4,11,,4,60,198,70,0,0,0 477,Dusknoir,,,4,182,356,5,Reaper Cloth,22,1066,Gripper,1,4,,4,45,210,35,0,0,0 478,Froslass,,,4,186,361,8,Dawn Stone,13,266,Snow Land,9,4,,8,75,187,70,0,0,0 -479,Rotom,,,4,240,,,,3,3,Plasma,8,1,,-1,45,132,70,0,0,0 +479,Rotom,normal,,4,240,,,,3,3,Plasma,8,1,,-1,45,132,70,0,0,0 480,Uxie,,,4,241,,,,3,3,Knowledge,10,6,,-1,3,210,140,0,0,0 481,Mesprit,,,4,242,,,,3,3,Emotion,6,6,,-1,3,210,140,0,0,0 482,Azelf,,,4,243,,,,3,3,Willpower,2,6,,-1,3,210,140,0,0,0 diff --git a/pokedex/data/csv/pokemon_form_groups.csv b/pokedex/data/csv/pokemon_form_groups.csv index 35c59ef..70c3352 100644 --- a/pokedex/data/csv/pokemon_form_groups.csv +++ b/pokedex/data/csv/pokemon_form_groups.csv @@ -1,14 +1,14 @@ -pokemon_id,description -172,Forms only affect appearance. All wild Pichu are normal Pichu and cannot be converted into spiky-eared Pichu. Spiky-eared Pichu can only be encountered by taking the shiny Pichu from an official promotion to Celebi's shrine in Ilex Forest. Spiky-eared Pichu cannot evolve or be taken into Pokémon Center trade area. -201,Forms only affect appearance. A form is selected at random before a wild encounter and cannot be changed. -351,Form changes to match the current weather. -386,"Forms have different stats and movepools. Form changes depending on the game: normal form in Ruby/Sapphire, Attack form in Fire Red, Defense form in Leaf Green, and Speed form in Emerald. Every form exists in Diamond/Pearl/Platinum, and form is preserved when transferring from an older game. Meteorites in the south end of Veilstone City can be used to switch between forms." -412,"Cloaks only affect appearance, although they become permanent upon evolution. Cloak changes to match the current terrain after a battle (or when an egg hatches), if possible: Plant Cloak for grassy areas, Sandy Cloak for beaches and caves, or Trash Cloak for buildings." -413,"Forms have different stats and movepools. During evolution, the current cloak becomes the new form, and can no longer be changed." -421,"Sunshine form is active only during Sunny Day, due to Flower Gift." -422,Forms only affect appearance. A form is selected before a wild encounter based on whether the battle is in Western or Eastern Sinnoh and cannot be changed. -423,Forms only affect appearance. A form is selected before a wild encounter based on whether the battle is in Western or Eastern Sinnoh and cannot be changed. -479,"Forms have different signature moves. When switching forms, the old signature move is removed and the new one, if any, is learned immediately. In a secret room in the Galactic Eterna Building, accessible only with a Secret Key, there are appliances that can be used to switch between forms." -487,"Forms have different stats. Giratina becomes Origin form in Distortion World or while holding a Griseous Orb. Otherwise, or during a link battle, Giratina will be in Altered form." -492,"Forms have different stats and movepools. After using a Gracidea, Shaymin will transform into Sky form during the daytime. If a Gracidea is not used, it is currently nighttime, during a link battle, or Sky form is Frozen, Shaymin will be in Land form. Gracidea only works on an official event Shaymin." -493,"Form always reflects type, which may be changed by attaching a Plate and activating Multitype." +pokemon_id,is_battle_only,description +172,0,Forms only affect appearance. All wild Pichu are normal Pichu and cannot be converted into spiky-eared Pichu. Spiky-eared Pichu can only be encountered by taking the shiny Pichu from an official promotion to Celebi's shrine in Ilex Forest. Spiky-eared Pichu cannot evolve or be taken into Pokémon Center trade area. +201,0,Forms only affect appearance. A form is selected at random before a wild encounter and cannot be changed. +351,1,Form changes to match the current weather. +386,0,"Forms have different stats and movepools. Form changes depending on the game: normal form in Ruby/Sapphire, Attack form in Fire Red, Defense form in Leaf Green, and Speed form in Emerald. Every form exists in Diamond/Pearl/Platinum, and form is preserved when transferring from an older game. Meteorites in the south end of Veilstone City can be used to switch between forms." +412,0,"Cloaks only affect appearance, although they become permanent upon evolution. Cloak changes to match the current terrain after a battle (or when an egg hatches), if possible: Plant Cloak for grassy areas, Sandy Cloak for beaches and caves, or Trash Cloak for buildings." +413,0,"Forms have different stats and movepools. During evolution, the current cloak becomes the new form, and can no longer be changed." +421,1,"Sunshine form is active only during Sunny Day, due to Flower Gift." +422,0,Forms only affect appearance. A form is selected before a wild encounter based on whether the battle is in Western or Eastern Sinnoh and cannot be changed. +423,0,Forms only affect appearance. A form is selected before a wild encounter based on whether the battle is in Western or Eastern Sinnoh and cannot be changed. +479,0,"Forms have different signature moves. When switching forms, the old signature move is removed and the new one, if any, is learned immediately. In a secret room in the Galactic Eterna Building, accessible only with a Secret Key, there are appliances that can be used to switch between forms." +487,0,"Forms have different stats. Giratina becomes Origin form in Distortion World or while holding a Griseous Orb. Otherwise, or during a link battle, Giratina will be in Altered form." +492,0,"Forms have different stats and movepools. After using a Gracidea, Shaymin will transform into Sky form during the daytime. If a Gracidea is not used, it is currently nighttime, during a link battle, or Sky form is Frozen, Shaymin will be in Land form. Gracidea only works on an official event Shaymin." +493,0,"Form always reflects type, which may be changed by attaching a Plate and activating Multitype." diff --git a/pokedex/data/csv/pokemon_form_sprites.csv b/pokedex/data/csv/pokemon_form_sprites.csv index 82dda85..b659c49 100644 --- a/pokedex/data/csv/pokemon_form_sprites.csv +++ b/pokedex/data/csv/pokemon_form_sprites.csv @@ -1,79 +1,79 @@ -id,pokemon_id,introduced_in_version_group_id,name -1,201,3,a -2,201,3,b -3,201,3,c -4,201,3,d -5,201,3,e -6,201,3,f -7,201,3,g -8,201,3,h -9,201,3,i -10,201,3,j -11,201,3,k -12,201,3,l -13,201,3,m -14,201,3,n -15,201,3,o -16,201,3,p -17,201,3,q -18,201,3,r -19,201,3,s -20,201,3,t -21,201,3,u -22,201,3,v -23,201,3,w -24,201,3,x -25,201,3,y -26,201,3,z -27,201,5,? -28,201,5,! -29,351,5, -30,351,5,sunny -31,351,5,rain -32,351,5,snow-cloud -33,386,5, -34,386,7,attack -35,386,7,defense -36,386,6,speed -37,412,8,plant -38,412,8,sandy -39,412,8,trash -40,413,8,plant -41,413,8,sandy -42,413,8,trash -43,421,8,overcast -44,421,8,sunshine -45,422,8,east -46,422,8,west -47,423,8,east -48,423,8,west -49,479,8, -50,479,9,fan -51,479,9,frost -52,479,9,heat -53,479,9,mow -54,479,9,wash -55,487,8, -56,487,9,origin -57,492,8, -58,492,9,sky -59,493,8,bug -60,493,8,dark -61,493,8,dragon -62,493,8,electric -63,493,8,fighting -64,493,8,fire -65,493,8,flying -66,493,8,ghost -67,493,8,grass -68,493,8,ground -69,493,8,ice -70,493,8,normal -71,493,8,??? -72,493,8,poison -73,493,8,psychic -74,493,8,rock -75,493,8,steel -76,493,8,water -77,172,3, -78,172,10,spiky-eared +id,pokemon_id,introduced_in_version_group_id,name,is_default +1,201,3,a,0 +2,201,3,b,0 +3,201,3,c,0 +4,201,3,d,0 +5,201,3,e,0 +6,201,3,f,0 +7,201,3,g,0 +8,201,3,h,0 +9,201,3,i,0 +10,201,3,j,1 +11,201,3,k,0 +12,201,3,l,0 +13,201,3,m,0 +14,201,3,n,0 +15,201,3,o,0 +16,201,3,p,0 +17,201,3,q,0 +18,201,3,r,0 +19,201,3,s,0 +20,201,3,t,0 +21,201,3,u,0 +22,201,3,v,0 +23,201,3,w,0 +24,201,3,x,0 +25,201,3,y,0 +26,201,3,z,0 +27,201,5,?,0 +28,201,5,!,0 +29,351,5,,1 +30,351,5,sunny,0 +31,351,5,rain,0 +32,351,5,snow-cloud,0 +33,386,5,normal,1 +34,386,7,attack,0 +35,386,7,defense,0 +36,386,6,speed,0 +37,412,8,plant,1 +38,412,8,sandy,0 +39,412,8,trash,0 +40,413,8,plant,1 +41,413,8,sandy,0 +42,413,8,trash,0 +43,421,8,overcast,1 +44,421,8,sunshine,0 +45,422,8,east,0 +46,422,8,west,1 +47,423,8,east,0 +48,423,8,west,1 +49,479,8,normal,1 +50,479,9,fan,0 +51,479,9,frost,0 +52,479,9,heat,0 +53,479,9,mow,0 +54,479,9,wash,0 +55,487,8,another,1 +56,487,9,origin,0 +57,492,8,land,1 +58,492,9,sky,0 +59,493,8,bug,0 +60,493,8,dark,0 +61,493,8,dragon,0 +62,493,8,electric,0 +63,493,8,fighting,0 +64,493,8,fire,0 +65,493,8,flying,0 +66,493,8,ghost,0 +67,493,8,grass,0 +68,493,8,ground,0 +69,493,8,ice,0 +70,493,8,normal,1 +71,493,8,???,0 +72,493,8,poison,0 +73,493,8,psychic,0 +74,493,8,rock,0 +75,493,8,steel,0 +76,493,8,water,0 +77,172,3,,1 +78,172,10,spiky-eared,0 diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 3eb8151..07e816f 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -326,7 +326,7 @@ class Pokemon(TableBase): """Returns the name of this Pokémon, including its Forme, if any.""" if self.forme_name: - return "%s %s" % (self.forme_name.capitalize(), self.name) + return "%s %s" % (self.forme_name.title(), self.name) return self.name @property @@ -371,6 +371,7 @@ class PokemonFlavorText(TableBase): class PokemonFormGroup(TableBase): __tablename__ = 'pokemon_form_groups' pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False) + is_battle_only = Column(Boolean, nullable=False) description = Column(Unicode(512), nullable=False) class PokemonFormSprite(TableBase): @@ -379,6 +380,7 @@ class PokemonFormSprite(TableBase): pokemon_id = Column(Integer, ForeignKey('pokemon.id'), primary_key=True, nullable=False, autoincrement=False) introduced_in_version_group_id = Column(Integer, ForeignKey('version_groups.id'), primary_key=True, nullable=False, autoincrement=False) name = Column(Unicode(16), nullable=True) + is_default = Column(Boolean, nullable=True) class PokemonHabitat(TableBase): __tablename__ = 'pokemon_habitats' @@ -564,6 +566,12 @@ Pokemon.formes = relation(Pokemon, primaryjoin=Pokemon.id==Pokemon.forme_base_po Pokemon.pokemon_color = relation(PokemonColor, backref='pokemon') Pokemon.color = association_proxy('pokemon_color', 'name') Pokemon.dex_numbers = relation(PokemonDexNumber, backref='pokemon') +Pokemon.default_form_sprite = relation(PokemonFormSprite, + primaryjoin=and_( + Pokemon.id==PokemonFormSprite.pokemon_id, + PokemonFormSprite.is_default==True, + ), + uselist=False) Pokemon.egg_groups = relation(EggGroup, secondary=PokemonEggGroup.__table__, order_by=PokemonEggGroup.egg_group_id, backref='pokemon')