0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-04-24 08:25:16 +00:00

去除一些debug模式截图, 优化洛可可

This commit is contained in:
firedcto@gmail.com 2025-04-03 23:55:43 +08:00
parent 565d9b7c3a
commit a3783da2e9
5 changed files with 28 additions and 23 deletions

View File

@ -31,7 +31,8 @@ class Roccia(BaseChar):
self.can_plunge = True
return self.switch_next_char()
self.plunge()
self.click_echo()
if not self.click_resonance()[0]:
self.click_echo()
self.switch_next_char()
def switch_next_char(self, post_action=None, free_intro=False, target_low_con=False):
@ -70,14 +71,9 @@ class Roccia(BaseChar):
start = time.time()
starting_count = 0
while (self.is_forte_full() and time.time() - start < 0.6) or (starting_count > 0 and time.time() - start < 5):
current_count = self.get_plunge_count()
if current_count == 1:
self.logger.debug(f'plunge count: {current_count}, end plunge')
self.click()
break
self.click(interval=0.1)
if starting_count == 0:
starting_count = current_count
starting_count = self.get_plunge_count()
if starting_count > 0 and not self.is_forte_full():
self.can_plunge = False
break

View File

@ -46,8 +46,8 @@ class CombatCheck(BaseWWTask):
return True
if recheck:
logger.info('out of combat start double check')
if self.debug:
self.screenshot('out of combat start double check')
# if self.debug:
# self.screenshot('out of combat start double check')
if self.wait_until(self.check_health_bar, time_out=1.2):
return True
self.out_of_combat_reason = reason

View File

@ -38,8 +38,8 @@ class AutoCombatTask(BaseCombatTask, TriggerTask):
break
except NotInCombatException as e:
logger.info(f'auto_combat_task_out_of_combat {e}')
if self.debug:
self.screenshot(f'auto_combat_task_out_of_combat {e}')
# if self.debug:
# self.screenshot(f'auto_combat_task_out_of_combat {e}')
break
if ret:
self.combat_end()

View File

@ -185,8 +185,8 @@ class BaseCombatTask(CombatCheck):
in_team, current_index, size = self.in_team()
if not in_team:
logger.info(f'not in team while switching chars_{current_char}_to_{switch_to} {now - start}')
if self.debug:
self.screenshot(f'not in team while switching chars_{current_char}_to_{switch_to} {now - start}')
# if self.debug:
# self.screenshot(f'not in team while switching chars_{current_char}_to_{switch_to} {now - start}')
confirm = self.wait_feature('revive_confirm_hcenter_vcenter', threshold=0.8, time_out=2)
if confirm:
self.log_info(f'char dead')
@ -293,8 +293,8 @@ class BaseCombatTask(CombatCheck):
def check_combat(self):
if not self.in_combat():
if self.debug:
self.screenshot('not_in_combat_calling_check_combat')
# if self.debug:
# self.screenshot('not_in_combat_calling_check_combat')
self.raise_not_in_combat('combat check not in combat')
def load_hotkey(self, force=False):

View File

@ -345,6 +345,7 @@ class BaseWWTask(BaseTask):
highest_percent = 0
highest_index = 0
threshold = 0.02
highest_frame = None
for i in range(4):
self.middle_click_relative(0.5, 0.5, down_time=0.2)
self.sleep(1)
@ -352,11 +353,16 @@ class BaseWWTask(BaseTask):
if color_percent > highest_percent:
highest_percent = color_percent
highest_index = i
if self.debug:
highest_frame = self.frame.copy()
if color_percent > threshold:
found = self.walk_find_echo(backward_time=0.5)
if found and self.debug and highest_frame is not None:
self.screenshot('echo_picked', frame=highest_frame)
self.log_debug(f'found color_percent {color_percent} > {threshold}, walk now')
return self.walk_find_echo(backward_time=0.5)
if self.debug:
self.screenshot(f'find_echo_{highest_index}_{float(color_percent):.3f}_{float(highest_percent):.3f}')
return found
# if self.debug:
# self.screenshot(f'find_echo_{highest_index}_{float(color_percent):.3f}_{float(highest_percent):.3f}')
logger.debug(f'searching for echo {i} {float(color_percent):.3f} {float(highest_percent):.3f}')
# self.click_relative(0.25, 0.25)
self.send_key('a', down_time=0.05)
@ -368,10 +374,13 @@ class BaseWWTask(BaseTask):
self.sleep(0.5)
self.send_key('a', down_time=0.05)
self.sleep(0.5)
if self.debug:
self.screenshot(f'pick_echo_{highest_index}')
# if self.debug:
# self.screenshot(f'pick_echo_{highest_index}')
logger.info(f'found echo {highest_index} walk')
return self.walk_find_echo(backward_time=0)
found = self.walk_find_echo(backward_time=0)
if found and self.debug and highest_frame is not None:
self.screenshot('echo_picked', frame=highest_frame)
return found
def incr_drop(self, dropped):
if dropped:
@ -574,8 +583,8 @@ class BaseWWTask(BaseTask):
threshold=0.3),
time_out=3, settle_time=2)
logger.info(f'found gray_book_boss {gray_book_boss}')
if self.debug:
self.screenshot(feature)
# if self.debug:
# self.screenshot(feature)
return gray_book_boss
def check_main(self):