Skip to content
This repository has been archived by the owner on Dec 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #3 from emelrad12/master
Browse files Browse the repository at this point in the history
Added boss fleet fix
  • Loading branch information
God-Zalo committed May 22, 2020
2 parents 5f0c922 + f44119d commit 5023a95
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions modules/combat.py
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,24 @@ def clear_boss(self, boss_info):
#handle boss' coordinates
if not self.unable_handler(boss_info[0:2], boss=True):
return
swipes = {
0: lambda: Utils.swipe(960, 240, 960, 940, 300),
1: lambda: Utils.swipe(1560, 540, 260, 540, 300),
2: lambda: Utils.swipe(960, 940, 960, 240, 300),
3: lambda: Utils.swipe(260, 540, 1560, 540, 300)
}

Utils.touch_randomly(self.region['button_switch_fleet'])
Utils.wait_update_screen(2)
boss_region = Utils.find_in_scaling_range("enemy/fleet_boss", similarity=0.9)
s = 0
while not boss_region:
if s > 3: s = 0
swipes.get(s)()
Utils.wait_update_screen(0.5)
boss_region = Utils.find_in_scaling_range("enemy/fleet_boss", similarity=0.9)
s += 1
boss_info = [boss_region.x + 50, boss_region.y + 25, "boss"]
continue
else:
self.movement_handler(boss_info)
Expand Down

0 comments on commit 5023a95

Please sign in to comment.