pokeapi icon indicating copy to clipboard operation
pokeapi copied to clipboard

Gymleaders

Open WorldwideErrors opened this issue 3 years ago • 8 comments

Hi, maybe it's an idea to add the gymleaders of the different generations. You can then fetch their names, types, team and badges. This would be really helpful!

WorldwideErrors avatar Mar 01 '21 16:03 WorldwideErrors

Hi, thanks for the idea. https://pokeapi.co/api/v2/

Currently, we lack altogether of this data. We don't have any CSV nor python code. So if there is a volunteer @WorldwideErrors he should start from the ground up.

But I don't think that would be necessarily difficult.

Naramsim avatar Mar 01 '21 21:03 Naramsim

I might be interested in taking this on. Would an interface like this under /gym-leader/{id or name} be reasonable?

interface GymLeader {
  id: number;
  name: string;
  version: { name; url };
  team: {
    pokemon: { name; url };
    level: number;
    move: { name; url }[];
    ability: { name; url };
    held_item: { name; url };
  }[];
  reward: number;
}

The data can be found at pages like https://bulbapedia.bulbagarden.net/wiki/Wallace#Pok.C3.A9mon_Emerald.

jmorag avatar Mar 22 '21 01:03 jmorag

If this is added it should be for all trainers, not just gym leaders. Also you'll need to account for rematches.

magical avatar Mar 22 '21 01:03 magical

Do you mean all trainers in the entire game or just the trainers in the gym before the leader? In either case, the interface would have to be slightly different, as I don't know where to get movesets for the pokemon belonging to non-leader trainers. Maybe it would make sense to do gym leaders and normal trainers separately since normal trainers don't change pokemon on rematch (that I know of).

jmorag avatar Mar 22 '21 01:03 jmorag

Do you mean all trainers in the entire game or just the trainers in the gym before the leader?

The former. Gym leaders are just a special type of trainer (they're literally stored the same way in the game). Whether or not to add the data all at once or in piecemeal is a separate question, but I think the API should be designed with both in mind.

normal trainers don't change pokemon on rematch (that I know of).

There were plenty of trainers in gen 3 (at least) that would rematch you with a better team. https://bulbapedia.bulbagarden.net/wiki/Hoenn_Route_117#Trainers

magical avatar Mar 22 '21 02:03 magical

You're right. I've found the ROM data for trainers (emerald) here. For non-custom learnsets, the code here suggests that pokemon always know the four most recent moves they could have learned. Am I reading that correctly?

jmorag avatar Mar 22 '21 15:03 jmorag

This would be an awesome data set to integrate but definitely a massive undertaking!

phalt avatar Mar 22 '21 23:03 phalt

I was able to find data for trainers' pokemon movesets on Serebii at links like here or here. For Emerald on Serebii though, the movesets are left blank. It seems like data from older gens may not be able to be scraped from Serebii. That data may need to be scraped from the ROM, like @jmorag suggested.

laurenarnett avatar Mar 23 '21 14:03 laurenarnett