(self)
| 179 | |
| 180 | # 探索战斗流程 |
| 181 | def do_battle(self): |
| 182 | while 1: |
| 183 | self.screenshot() |
| 184 | # 战后奖励 |
| 185 | if self.appear(self.I_BATTLE_REWARD) and not self.appear(self.I_GET_REWARD): |
| 186 | self.click(self.I_BATTLE_REWARD) |
| 187 | # boss 战 |
| 188 | if self.appear_then_click(self.I_BOSS_BATTLE_BUTTON): |
| 189 | if self.wait_until_appear(self.I_BATTLE_START, wait_time=5): |
| 190 | self.run_general_battle(self.config.exploration.general_battle_config) |
| 191 | else: |
| 192 | continue |
| 193 | # 小怪 战 |
| 194 | if self.appear_then_click(self.I_NORMAL_BATTLE_BUTTON): |
| 195 | if self.wait_until_appear(self.I_BATTLE_START, wait_time=5): |
| 196 | self.run_general_battle(self.config.exploration.general_battle_config) |
| 197 | else: |
| 198 | continue |
| 199 | # 滑动 |
| 200 | elif self.appear(self.I_E_AUTO_ROTATE_ON) or self.appear(self.I_GET_REWARD): |
| 201 | self.swipe(self.S_SWIPE_BACKGROUND_RIGHT) |
| 202 | # 结束流程 |
| 203 | if self.appear(self.I_E_EXPLORATION_CLICK) or self.appear(self.I_EXPLORATION_TITLE): |
| 204 | break |
| 205 | |
| 206 | # 战斗流程 |
| 207 | def battle_process(self): |
no test coverage detected