From cb934fcff4488f626586e36789d6c0bd65a16b13 Mon Sep 17 00:00:00 2001 From: thatguy11325 <148832074+thatguy11325@users.noreply.github.com> Date: Sat, 15 Jun 2024 01:57:25 -0400 Subject: [PATCH] solve strength puzzles config --- config.yaml | 1 + pokemonred_puffer/environment.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index b11b1ad..a1790e3 100644 --- a/config.yaml +++ b/config.yaml @@ -57,6 +57,7 @@ env: auto_use_surf: True auto_teach_surf: True auto_teach_strength: True + auto_solve_strength_puzzles: True auto_remove_all_nonuseful_items: True auto_pokeflute: True infinite_money: True diff --git a/pokemonred_puffer/environment.py b/pokemonred_puffer/environment.py index 4fde0f2..bf13f17 100644 --- a/pokemonred_puffer/environment.py +++ b/pokemonred_puffer/environment.py @@ -98,6 +98,7 @@ def __init__(self, env_config: pufferlib.namespace): self.auto_teach_strength = env_config.auto_teach_strength self.auto_use_cut = env_config.auto_use_cut self.auto_use_surf = env_config.auto_use_surf + self.auto_solve_strength_puzzles = env_config.auto_solve_strength_puzzles self.auto_remove_all_nonuseful_items = env_config.auto_remove_all_nonuseful_items self.auto_pokeflute = env_config.auto_pokeflute self.infinite_money = env_config.infinite_money @@ -585,8 +586,9 @@ def run_action_on_emulator(self, action): if self.read_bit(0xD857, 0): if self.auto_teach_strength and not self.check_if_party_has_hm(0x46): self.teach_hm(0x46, 15, STRENGTH_SPECIES_IDS) - self.solve_missable_strength_puzzle() - self.solve_switch_strength_puzzle() + if self.auto_solve_strength_puzzles: + self.solve_missable_strength_puzzle() + self.solve_switch_strength_puzzle() if self.read_bit(0xD76C, 0) and self.auto_pokeflute: self.use_pokeflute()