Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BDSP learnsets #915

Merged
merged 1 commit into from
Aug 21, 2023
Merged

Add BDSP learnsets #915

merged 1 commit into from
Aug 21, 2023

Conversation

penelopeysm
Copy link
Contributor

@penelopeysm penelopeysm commented Aug 19, 2023

(Closes #914)

This PR adds in data for BDSP learnsets (including moves learnt via level-up, evolution, move tutor, breeding, and TMs). Data were obtained by scraping PokemonDB.

The data can be checked with the following Python script (assuming that the API is being served locally with make serve):

import requests
import sys

POKEAPI = "http://localhost:8000/api/v2"

def get_bdsp_learn_levels(move):
    return [vgd["level_learned_at"] for vgd in move["version_group_details"]
                        if vgd["version_group"]["name"] == "brilliant-diamond-and-shining-pearl"
                        and vgd["move_learn_method"]["name"] == "level-up"]

def show_bdsp_moves(pokemon_name):
    moves = requests.get(f"{POKEAPI}/pokemon/{pokemon_name}").json()["moves"]

    levelup_moves_in_bdsp = sorted([
        (move["move"]["name"], get_bdsp_learn_levels(move))
        for move in moves
        if len(get_bdsp_learn_levels(move)) > 0
    ], key=lambda x: x[1])

    print("Level up moves in BDSP")
    print("----------------------")
    print(levelup_moves_in_bdsp)

    egg_moves_in_bdsp = sorted([
        move["move"]["name"]
        for move in moves
        if any(vgd["version_group"]["name"] == "brilliant-diamond-and-shining-pearl"
               and vgd["move_learn_method"]["name"] == "egg"
               for vgd in move["version_group_details"])
    ])

    print()
    print("Egg moves in BDSP")
    print("-----------------")
    print(egg_moves_in_bdsp)

    tutor_moves_in_bdsp = sorted([
        move["move"]["name"]
        for move in moves
        if any(vgd["version_group"]["name"] == "brilliant-diamond-and-shining-pearl"
               and vgd["move_learn_method"]["name"] == "tutor"
               for vgd in move["version_group_details"])
    ])

    print()
    print("Tutor moves in BDSP")
    print("-------------------")
    print(tutor_moves_in_bdsp)

    tm_moves_in_bdsp = sorted([
        move["move"]["name"]
        for move in moves
        if any(vgd["version_group"]["name"] == "brilliant-diamond-and-shining-pearl"
               and vgd["move_learn_method"]["name"] == "machine"
               for vgd in move["version_group_details"])
    ])

    print()
    print("TM moves in BDSP")
    print("----------------")
    print(tm_moves_in_bdsp)


try:
    show_bdsp_moves(sys.argv[1])
except IndexError:
    print("Usage: python test_bdsp.py <pokemon_name>", file=sys.stderr)
except KeyError:
    print("Pokemon not found", file=sys.stderr)

Usage:

$ python test_bdsp.py bulbasaur
Level up moves in BDSP
----------------------
[('tackle', [1]), ('growl', [1]), ('vine-whip', [3]), ('growth', [6]), ('leech-seed', [9]), ('razor-leaf', [12]), ('poison-powder', [15]), ('sleep-powder', [15]), ('seed-bomb', [18]), ('take-down', [21]), ('sweet-scent', [24]), ('synthesis', [27]), ('worry-seed', [30]), ('double-edge', [33]), ('solar-beam', [36])]

Egg moves in BDSP
-----------------
['amnesia', 'charm', 'curse', 'grassy-terrain', 'ingrain', 'leaf-storm', 'magical-leaf', 'nature-power', 'petal-dance', 'power-whip', 'skull-bash', 'sludge']

Tutor moves in BDSP
-------------------
[]

TM moves in BDSP
----------------
['attract', 'bullet-seed', 'cut', 'double-team', 'endure', 'energy-ball', 'facade', 'false-swipe', 'flash', 'giga-drain', 'grass-knot', 'light-screen', 'protect', 'rest', 'rock-smash', 'safeguard', 'sleep-talk', 'sludge-bomb', 'solar-beam', 'strength', 'substitute', 'sunny-day', 'swagger', 'swords-dance', 'toxic', 'work-up']

Or a typical case where a mon learns a move twice:

$ python test_bdsp.py beedrill
Level up moves in BDSP
----------------------
[('fury-attack', [0, 1]), ('string-shot', [1]), ('harden', [1]), ('bug-bite', [1]), ('poison-sting', [1, 17]), ('fury-cutter', [11]), ('laser-focus', [14]), ('focus-energy', [20]), ('venoshock', [23]), ('assurance', [26]), ('toxic-spikes', [29]), ('pin-missile', [32]), ('poison-jab', [35]), ('agility', [38]), ('endeavor', [41]), ('fell-stinger', [44])]

Egg moves in BDSP
-----------------
[]

Tutor moves in BDSP
-------------------
[]

TM moves in BDSP
----------------
['aerial-ace', 'attract', 'brick-break', 'cut', 'defog', 'double-team', 'endure', 'facade', 'false-swipe', 'flash', 'giga-drain', 'giga-impact', 'hyper-beam', 'payback', 'poison-jab', 'protect', 'rest', 'rock-smash', 'roost', 'sleep-talk', 'sludge-bomb', 'solar-beam', 'substitute', 'sunny-day', 'swagger', 'swords-dance', 'thief', 'u-turn', 'x-scissor']

@Naramsim Naramsim merged commit 3eac2ac into PokeAPI:master Aug 21, 2023
@pokeapi-machine-user
Copy link

A PokeAPI/api-data refresh has started. In 45 minutes the staging branch of PokeAPI/api-data will be pushed with the new generated data.

The staging branch will be deployed in our staging environment and you will be able to review the entire API.

A Pull Request (master<-staging) will be also created at PokeAPI/api-data and assigned to the PokeAPI Core team to be reviewed. If approved and merged new data will soon be available worldwide at pokeapi.co.

@pokeapi-machine-user
Copy link

The updater script has finished its job and has now opened a Pull Request towards PokeAPI/api-data with the updated data.

You can see the Pull Request deployed at our staging environment when CircleCI deploy will be finished (check the started time of the last build).

Naramsim pushed a commit to PokeAPI/api-data that referenced this pull request Aug 22, 2023
penelopeysm added a commit to penelopeysm/apribot that referenced this pull request Aug 28, 2023
(data was added upstream, cf. PokeAPI/pokeapi#915)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BDSP egg moves
3 participants