PokeAPI / pokedex

PokeAPI's fork for adding gen-8 data.
https://github.com/PokeAPI/pokedex/tree/master-pokeapi/pokeapi
MIT License
43 stars 40 forks source link

Mega Evolutions in pokemon_evolution #106

Open merfed opened 2 years ago

merfed commented 2 years ago

pokemon_evolution only tracks evolutions by their species. There is currently no way to track evolutions that change forms. Before I go ahead and make a pull request for this, I'd like to bring it up for discussion.

The proposal is, we add an additional column after evolved_species_id in pokemon_evolution named evolved_form_id. As well as an additional trigger in evolution_triggers:

12,mega-evolution

Note: I've skipped 11 (our last id is 10 - other), since I'm using that for pokemon-go, and handling Meltan's evolution.

So the proposed additions to pokemon_evolution would be:

<id>,,10133,12,,,,698,,,,,,,,,,,,, // Venusaur
<id>,,10134,12,,,,699,,,,,,,,,,,,, // Charizard X
<id>,,10135,12,,,,717,,,,,,,,,,,,, // Charizard Y
<id>,,10136,12,,,,700,,,,,,,,,,,,, // Blastoise
<id>,,10137,12,,,,718,,,,,,,,,,,,, // Alakazam
<id>,,10138,12,,,,695,,,,,,,,,,,,, // Genegar
<id>,,10139,12,,,,714,,,,,,,,,,,,, // Khangaskhan
<id>,,10140,12,,,,710,,,,,,,,,,,,, // Pinsir
<id>,,10141,12,,,,715,,,,,,,,,,,,, // Gyarados
<id>,,10142,12,,,,711,,,,,,,,,,,,, // Aerodactyl
<id>,,10143,12,,,,701,,,,,,,,,,,,, // Mewtwo X
<id>,,10144,12,,,,702,,,,,,,,,,,,, // Mewtwo Y
<id>,,10145,12,,,,697,,,,,,,,,,,,, // Ampharos
<id>,,10146,12,,,,709,,,,,,,,,,,,, // Scizor
<id>,,10147,12,,,,719,,,,,,,,,,,,, // Heracross
<id>,,10148,12,,,,705,,,,,,,,,,,,, // Houndoom
<id>,,10149,12,,,,708,,,,,,,,,,,,, // Tyranitar
<id>,,10150,12,,,,703,,,,,,,,,,,,, // Blazikenite
<id>,,10151,12,,,,696,,,,,,,,,,,,, // Gardevoir
<id>,,10152,12,,,,720,,,,,,,,,,,,, // Mawilite
<id>,,10153,12,,,,706,,,,,,,,,,,,, // Aggron
<id>,,10154,12,,,,704,,,,,,,,,,,,, // Medicham
<id>,,10155,12,,,,721,,,,,,,,,,,,, // Manectric
<id>,,10156,12,,,,707,,,,,,,,,,,,, // Banette
<id>,,10157,12,,,,716,,,,,,,,,,,,, // Absol
<id>,,10164,12,,,,760,,,,,,,,,,,,, // Latias
<id>,,10165,12,,,,761,,,,,,,,,,,,, // Latios
<id>,,10158,12,,,,722,,,,,,,,,,,,, // Garchomp
<id>,,10159,12,,,,712,,,,,,,,,,,,, // Lucario
<id>,,10160,12,,,,713,,,,,,,,,,,,, // Abomasnow
<id>,,10192,12,,,,811,,,,,,,,,,,,, // Beedrill
<id>,,10175,12,,,,803,,,,,,,,,,,,, // Pidgeot
<id>,,10173,12,,,,801,,,,,,,,,,,,, // Slowbro
<id>,,10174,12,,,,802,,,,,,,,,,,,, // Steelix
<id>,,10167,12,,,,794,,,,,,,,,,,,, // Sceptile
<id>,,10166,12,,,,793,,,,,,,,,,,,, // Swampert
<id>,,10168,12,,,,796,,,,,,,,,,,,, // Sableye
<id>,,10172,12,,,,800,,,,,,,,,,,,, // Sharpedo
<id>,,10189,12,,,,808,,,,,,,,,,,,, // Camerupt
<id>,,10169,12,,,,796,,,,,,,,,,,,, // Altaria
<id>,,10176,12,,,,804,,,,,,,,,,,,, // Glalie
<id>,,10191,12,,,,810,,,,,,,,,,,,, // Salamence
<id>,,10178,12,,,,799,,,,,,,,,,,,, // Metagross
<id>,,10190,12,,,,809,,,,,,,,,,,,, // Lopunny
<id>,,10170,12,,,,797,,,,,,,,,,,,, // Gallade
<id>,,10171,12,,,,798,,,,,,,,,,,,, // Audino
<id>,,10177,12,,,,805,,,,,,,,,,,,, // Diancie

With Mega-Rayquaza being excluded for one reason that the mega evolution occurs after completing the delta-episode and knowing Dragon Ascent. Now, I don't want to tag Mega-Rayquaza's evolution trigger as other, because that wouldn't be clear. So possibly adding another trigger for completion of the delta-episode, would be more clear.

Should we go that route:

evolution_triggers

13,delta-episode-complete

pokemon_evolution

<id>,,10181,12,,,,,,620,,,,,,,,,,, // Rayquaza

This will open up some issues as to how the evolution_chain endpoint handles Pokemon forms, and their form rather than species (or both).

joseph-bayer commented 1 year ago

This would be amazing, especially if it included regional variants as well!

Is there a reason to use a Form id instead of a Pokemon Id? Just wondering - I'm not sure if one would be preferable to the other.

phcs93 commented 1 year ago

What do you guys think about, in addition to the form/variety id, add the version groups ids in which that evolution occurs?

For example: Probopass, it evolves when leveling up in a magnetic field zone, but in Legends Arceus, it evolves with a thunder stone.

You could deduce the version groups since the "pokemon_evolution" has the location_id pointing to those "magnetic field zones" (which are linked to a region, which are linked to version_groups). But how would you know that the "thunder stone" evolution is tied only to Legends Arceus in this case?

BTW, I'm basing myself on Bulbapedia. The evolution data for Magnezone falls on the same problem. But instead of tying the "thunder stone" option to Legends Arceus, it ties to Gen VIII, so I'm not really sure if those should be tied to a version group or a generation.