Skip to content

FRLG Elite Four Farmer: move cursor detection, opponent name reading, early reset on faint - #1544

Open
thewhitewolfking wants to merge 1 commit into
PokemonAutomation:mainfrom
thewhitewolfking:frlg-e4-move-cursor
Open

thewhitewolfking wants to merge 1 commit into
PokemonAutomation:mainfrom
thewhitewolfking:frlg-e4-move-cursor

Conversation

@thewhitewolfking

Copy link
Copy Markdown
Contributor

Follow-up to #1536, addressing review feedback.

  • Move selection: the move cursor is detected (new BattleMoveSelectionArrow boxes plus a unit test) and moved with move_cursor_to_option instead of blind d-pad presses. It falls back to the old presses if the arrow isn't found.
  • Opponent reading: each turn the opponent's name is read (WildEncounterReader, new Game Language option) and checked against every species in the attacker's move table. This handles survivors, and trainer switch-outs, which happen in rematches.
  • Early reset: if the attacker faints (HP box gone, or the party screen opens after a fade), the run counts as a loss and the game soft resets right away. The program stops after 5 losses in a row with a setup message.

Tested on Switch with Mewtwo (full loops) and an under-built Lapras. The Lapras test showed trainer switching, survivors, and a faint followed by a reset.

Test images: PokemonAutomation/CommandLineTests#27

@Dalton-V

Dalton-V commented Oct 8, 2026

Copy link
Copy Markdown
Member

Thanks for getting these suggestions added so quickly!

If you have the time.. I've added a few more test images for the E4 rooms that need to get added to the tests. If not, no worries. I'll probably have time to update the tests this weekend.

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.

2 participants