Implement catching strategy in safari for RSE #477
+217
−29
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
Handle catching Strategy in Safari for RSE
SRE Safari zone unlike FR/LG is kinda straight forward.
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%.
Throwing a disliked Pokeblock doesn't have any effect so we don't want that.
Also some natures doesn't have some liked/disliked Pokeblock, so we can throw whatever we want, it will always be a neutral Pokeblock
At last, the "Go near" option increase the catch rate, but also increase the flee rate of the Pokémon, which is a very risky and mathematically not worth it strategy since we can reduce the flee rate to zero.
Implemented strategy
Changes
Updated nature JSON and class with Pokeblock like/dislike
Implemented the
decide_turn_in_safari_zone
in catch modeNotes
Checklist
--line-length 120
argument