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

poke_env max_pp is lower than PokemonShowdown #355

Closed
quadraticmuffin opened this issue Feb 9, 2023 · 2 comments
Closed

poke_env max_pp is lower than PokemonShowdown #355

quadraticmuffin opened this issue Feb 9, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@quadraticmuffin
Copy link

Currently the value of Move.max_pp is being populated from data/genx_moves.json, but this file uses default PP values. This is a problem because Pokemon Showdown does not use the default PP; rather, it uses the highest possible PP. For example, the move Agility has 30 (max 48) PP; poke_env thinks it has 30, but Pokemon Showdown uses 48.

This leads to Move.current_pp sometimes returning a negative value, as Move.use() does not check whether the current_pp is 0 before subtracting from it.

@hsahovic hsahovic self-assigned this Feb 9, 2023
@hsahovic hsahovic added the bug Something isn't working label Feb 9, 2023
@hsahovic
Copy link
Owner

Thanks, that's a good catch! Fixed in 5c09dde.

@quadraticmuffin
Copy link
Author

return self.entry["pp"] * 8 / 5
Some moves in later gens have 1 PP, which is not divisible by 5. You might want to add a floor function, or use integer division:
return self.entry["pp"] * 8 // 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants