Skip to content

Commit

Permalink
优化战斗退出检查, 优先检查倒计时
Browse files Browse the repository at this point in the history
  • Loading branch information
ok-oldking committed Jul 22, 2024
1 parent 9c3813a commit 6637575
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/char/Calcharo.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
class Calcharo(BaseChar):
def do_perform(self):
if self.has_intro:
self.logger.debug('Calcharo wait intro animation')
self.sleep(1)
self.task.wait_in_team_and_world(time_out=3, raise_if_not_found=False)
self.check_combat()
Expand Down
4 changes: 2 additions & 2 deletions src/combat/CombatCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,13 @@ def in_combat(self, rechecked=False):
in_team = self.in_team()[0]
if not in_team:
return self.reset_to_false(recheck=False, reason="not in team")
if self.check_count_down():
return True
if self.boss_lv_template is not None:
if self.check_boss(in_team):
return True
else:
return self.reset_to_false(recheck=False, reason="boss disappear")
if self.check_count_down():
return True
if not self.check_health_bar():
logger.debug('not in team or no health bar')
if not self.target_enemy():
Expand Down
4 changes: 2 additions & 2 deletions src/task/BaseCombatTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def click(self, x=-1, y=-1, move_back=False, name=None, interval=-1):
y = self.height_of_screen(0.5)
return super().click(x, y, move_back, name, interval)

def wait_in_team_and_world(self, time_out=10):
return self.wait_until(self.in_team_and_world, time_out=time_out, raise_if_not_found=True)
def wait_in_team_and_world(self, time_out=10, raise_if_not_found=True):
return self.wait_until(self.in_team_and_world, time_out=time_out, raise_if_not_found=raise_if_not_found)

def in_team_and_world(self):
return self.in_team()[
Expand Down

0 comments on commit 6637575

Please sign in to comment.