Skip to content

Level Grind: Go heal if lead Pokémon ran out of PP #659

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

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

hanzi
Copy link
Collaborator

@hanzi hanzi commented Feb 10, 2025

Description

In Level-balancing mode, once the lead Pokémon ran out of PP the bot would keep spinning for encounters but run away from them immediately.

That's because it was set up to only go heal once the entire party was unable to battle (since we're not just focussing on the lead) which wasn't the case, but it also wouldn't switch in other Pokémon.

On second thought, that didn't make all that much sense anyway. In Level-balancing mode, we want to get as much Exp. for the weakest Pokémon as possible, which is guaranteed to be the lead by the battle strategy's rotation logic.

So it makes sense to go and heal once the lead cannot fight anymore.

I've added an exception for the special case where the lead is not able to battle on its own anyway (Magikarp, Abra, ...) because in that case we want to switch in another Pokémon anyway.

This also fixes some bugs with debug_create_pokemon() that cause the Edit Party menu to (a) not set the remaining PP correctly, and (b) crash if creating a Pokémon with less than 4 moves.

Fixes #656

Checklist

  • Black Linter has been ran, using --line-length 120 argument
  • Wiki has been updated (if relevant)

In Level-balancing mode, once the lead Pokémon ran out of PP the bot would keep spinning for encounters but run away from them immediately.

That's because it was set up to only go heal once the entire party was unable to battle (since we're not just focussing on the lead) which wasn't the case, but it also wouldn't switch in other Pokémon.

On second thought, that didn't make all that much sense anyway. In Level-balancing mode, we want to get as much Exp. for the weakest Pokémon as possible, which is guaranteed to be the lead by the battle strategy's rotation logic.

So it makes sense to go and heal once the lead cannot fight anymore.

I've added an exception for the special case where the lead is not able to battle on its own anyway (Magikarp, Abra, ...) because in that case we want to switch in another Pokémon anyway.

This also fixes some bugs with `debug_create_pokemon()` that cause the `Edit Party` menu to (a) not set the remaining PP correctly, and (b) crash if creating a Pokémon with less than 4 moves.
@hanzi hanzi merged commit 7621421 into 40Cakes:main Feb 11, 2025
1 check passed
@hanzi hanzi deleted the level-grind-fix branch February 11, 2025 15:29
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.

Level Grind: Bot keeps spinning and running once lead has no PP left
2 participants