forked from PokemonGoF/PokemonGo-Bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Evolve only if evolvable candidates no less than a certain number.
Previously, when user configured use_lucky_egg as true, the bot will use lucky egg even evolvale candidates is zero. That's kinda of waste. Meanwhile, if user didn't configured use_lucky_egg, the bot will try to evolve after sort by cp&iv, but sometimes no good potential pokemon in that batch, it's better delay the evolution after a while. By adding a config item evovle_num_min can cope above two problems. The bot evolves only if evolvable candidates no less than a certain number. 1. Evolve only if evolvable candidates no less than a certain number. 2. Dragoniar's configuration is abnormal in pokemon.json, which lack of "Previous evolution(s)" attribute, while the other middle-tier pokemon has. Fixed some issues after: Refactor evolve_all worker PokemonGoF#2244 1. The refactoring try to sort by pokemon index desc which is not good. For example, why Venusaur which is PokemonGoF#3 should be with lower priority than Pidgey(PokemonGoF#16)? 2. The refactoring always use dict.get(key, {}).get(key, {}) which will eventually return a {} which will cause side effect. It's better fail fast when the dict has no attribute which is unexpected by the developer. 3. The reafctoring try to use cache when the pokemon is not evovlable. That developer doesn't know previously we didn't caculate the candy before evovling, thus caused a lot of failure when evovling. After caculating candy requirements by the refactoring and this patch, the failure rarely happens. Thus cache is not necessary when the pokemon is not evovlable.
- Loading branch information
Zhou
committed
Aug 3, 2016
1 parent
c2a3f7b
commit 5edbf47
Showing
6 changed files
with
129 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters