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

FireRed / LeafGreen : Add Safari Mode #593

Merged
merged 16 commits into from
Dec 27, 2024

Conversation

ThibaultLassiaz
Copy link
Collaborator

Description

This PR introduces a new mode for FireRed/LeafGreen: the Safari Mode.

Safari Mode is an automated catching mode designed to hunt a specific target Pokémon on a predefined tile in the Safari Zone.
The mode supports multiple hunting methods, including:

  • Fishing: Automatically selects the optimal rod based on the target and ensures all requirements are met.
  • Spinning.
  • Surfing.
  • Sweet Scent (currently unused).

How It Works

  • Starting Requirements:

    • You must begin the mode at the Safari Zone entrance map in FireRed/LeafGreen. The mode cannot be initiated from within the Safari Zone.
    • Once the mode is running, the bot will handle navigation, encounters, and catching attempts.
  • Inside Safari Zone:

    • Encounter modes and auto-catching can still be used within the Safari Zone independently.
    • The bot will automatically stop if fewer than 15 Safari Balls remain.

Key Features

  • Repel Management: Automatically uses Repels to optimize encounters.

  • Money management with Soft Resets:

    • After every 5 Safari runs, if no Pokémon have been caught, the bot performs a soft reset to conserve funds and resumes hunting.
    • If at least one Pokémon is caught during these runs, the bot exits Safari Mode, switches to manual, and notifies the user to save their game.
  • Shiny and CCF Pokémon Handling:

    • When encountering a Shiny Pokémon or one that matches a Custom Catch Filter (CCF), the mode uses the FireRed/LeafGreen Safari auto-catch strategy.
    • If auto-catch is disabled, the bot switches to manual mode for user input.
  • Safari Re-Entry:

    • If any Safari Balls are used, the bot automatically exits and re-enters the Safari Zone to continue hunting.
    • After completing 5 runs (4 re-entries), the bot evaluates progress:
      • If Pokémon were caught, it notifies the user to save and exits Safari Mode.
      • If no Pokémon were caught, it performs a soft reset and resumes hunting for another cycle.

Safari Mode UI


This mode is currently designed for FireRed and LeafGreen, with potential future support for Ruby, Sapphire, and Emerald once an auto-catching strategy is implemented.

Supported Languages

Safari Mode is supported in all languages for FireRed and LeafGreen:

🔥 FireRed 🌿 LeafGreen
English Supported ✅ Supported ✅
German Supported ✅ Supported ✅
Spanish Supported ✅ Supported ✅
French Supported ✅ Supported ✅
Italian Supported ✅ Supported ✅
Japanese Supported ✅ Supported ✅

Fixes

This PR also includes the following fixes and improvements:

  • Scrolling window: Updated to accept width, height, and number of rows as parameters.
  • Added a utility function to check if a Repel is active.
  • Fixed an issue in the Rock Smash mode where it didn’t check if player has PokéBalls before starting in Granite Cave.
  • Fixed the Rock Smash documentation icon.
  • Added a stop condition to the Fish action.

Checklist

  • Ran Black Linter with the --line-length 120 argument.
  • Updated the wiki (if relevant).

@ThibaultLassiaz ThibaultLassiaz force-pushed the add-safari-mode branch 2 times, most recently from 565af7d to 8d7609b Compare December 23, 2024 22:43
@ThibaultLassiaz
Copy link
Collaborator Author

  • Changed number of runs from 5 to 50 (25.000$)
  • Added early exit when target is caught
  • Added better use of utility function to load the sprites
  • Safari Pokémon now uses Species instead of just a name

@hanzi hanzi merged commit 67b6ba2 into 40Cakes:main Dec 27, 2024
1 check passed
@ThibaultLassiaz ThibaultLassiaz deleted the add-safari-mode branch December 27, 2024 21:52
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