RSE : Implement catching strategy & Safari mode #637
Merged
+1,077
−191
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR add support for auto catching in RSE and support for Safari mode in RSE
How flee system works
There's a grade from 0 to 20 for the flee chance, which 0 is 0% and 20 equals 100%.
On the start of a fight the Pokémon flee chance is 3 (15%).
So we can NEVER avoid that flee chance of 15% at the end of the first turn, whatever we do.
Flee chance variation depending on the Pokéblock thrown :
Throwing a liked Pokeblock will get him to -2 (3 - 5). But if the value is negative the game will put the cursor to 1 (5% flee chance). And once it's at 1 it can NEVER go lower.
BUT, if we stat at 3 and we throw a neutral Pokéblock (not liked/disliked) then it can go to zero, and our Pokémon flee chance is now reduce to 0%.
Since we don't read the Pokémon nature to mimic a real user behavior we will follow this pattern :
If the Pokémon's catch rate is higher than 200, throw Safari Balls. Otherwise, we throw the lowest feel Pokéblock (aka a random one).
2a) If the Pokémon is enthralled (escape factor = 0), throw Safari Balls.
2b) If the Pokémon is curious (escape factor = 1), throw Safari Balls.
If we don't have any Pokeblock in our case, just throw balls
Just like FR/LG, if you're using catching modes such as
spin
,fishing
orsweet scent
, the bot will auto catch shinies if yourauto_catch
config is set to true, but will stop if your safari ball counter is less than 15.Safari mode
Safari mode works the same as Safari mode in FR/LG, I just reduced the number of run from 50 to 30.
As we can only have 40 Pokéblocks in our Pokeblock case, and we can use 1-2 Pokéblocks (or 0 depending on the encounter), 30 runs will guarantee that we almost never run out of Pokéblocks when hunting.
Warning
Rock smash mode for Shuckle or geodude (route not implemented) is not supported on safari mode. For Shuckle people will still have to use Rock Smash mode for now, that works on Emerald for every languages.
Safari Mode is supported in all languages for RSE :
Notes
I updated the master sets with Safari mode test states
Checklist
--line-length 120
argument