0
0
mirror of https://github.com/ok-oldking/ok-wuthering-waves.git synced 2025-06-05 08:25:28 +00:00

优化今武门

修复今汐有时候不喷
This commit is contained in:
firedcto@gmail.com 2024-08-19 03:36:39 +08:00
parent 088d4fd721
commit 4b7b969ba8
7 changed files with 28 additions and 15 deletions

View File

@ -6,6 +6,9 @@ class Baizhi(BaseChar):
def count_base_priority(self):
return -1
def count_echo_priority(self):
return 0
def do_perform(self):
if self.has_intro:
self.logger.debug('has_intro wait click 1.2 sec')

View File

@ -316,6 +316,8 @@ class BaseChar:
priority += self.count_resonance_priority()
if self.count_forte_priority() and self._is_forte_full:
priority += self.count_forte_priority()
if self.echo_available():
priority += self.count_echo_priority()
if priority > 0:
priority += Priority.SKILL_AVAILABLE
priority += self.count_liberation_priority()

View File

@ -20,7 +20,7 @@ class Jinhsi(BaseChar):
elif self.has_intro or self.incarnation_cd:
self.handle_intro()
return self.switch_next_char()
if self.time_elapsed_accounting_for_freeze(self.task.combat_start) < 5:
if self.time_elapsed_accounting_for_freeze(self.task.combat_start) < 5 or self.last_fly_e_time == 0:
self.click_liberation()
self.click_echo()
return self.switch_next_char()
@ -50,7 +50,7 @@ class Jinhsi(BaseChar):
return 0
def count_echo_priority(self):
return 0
return 10
def count_liberation_priority(self):
return 0
@ -63,12 +63,9 @@ class Jinhsi(BaseChar):
last_op = 'resonance'
self.task.in_liberation = False
while True:
if time.time() - start > 5:
if time.time() - start > 6:
self.logger.info(f'handle incarnation too long')
break
if time.time() - animation_start < 1.5:
continue
self.task.next_frame()
if self.task.in_team()[0]:
if last_op == 'resonance':
self.task.click(interval=0.1)
@ -85,7 +82,7 @@ class Jinhsi(BaseChar):
animation_start = time.time()
self.task.in_liberation = True
self.check_combat()
self.task.next_frame()
self.task.in_liberation = False
if not self.click_echo():
@ -98,7 +95,8 @@ class Jinhsi(BaseChar):
# self.task.screenshot(f'handle_intro start')
self.logger.info(f'handle_intro start')
start = time.time()
if self.time_elapsed_accounting_for_freeze(self.last_fly_e_time) < 10.5:
if (self.time_elapsed_accounting_for_freeze(self.last_fly_e_time) < 10.5 or self.has_cd(
'resonance')) and not self.incarnation_cd:
self.incarnation_cd = True
self.click_echo()
self.logger.info(f'handle_intro in cd switch {start - self.last_fly_e_time}')
@ -114,8 +112,13 @@ class Jinhsi(BaseChar):
clicked_resonance = True
self.last_fly_e_time = time.time()
continue
if time.time() - start < 3 and not clicked_resonance:
self.task.click(interval=0.1)
if time.time() - self.last_fly_e_time > 2.5:
break
if time.time() - start < 4:
if not clicked_resonance:
self.task.click(interval=0.1)
else:
clicked_resonance = False
continue
if self.task.debug:
self.task.screenshot(f'handle_intro e end {time.time() - start}')

View File

@ -11,8 +11,8 @@ class Verina(BaseChar):
if self.click_resonance(send_click=False)[0]:
return self.switch_next_char()
self.click_echo()
# if self.is_forte_full():
# self.heavy_attack()
if self.is_forte_full():
self.heavy_attack()
# self.normal_attack()
self.switch_next_char()

View File

@ -10,7 +10,7 @@ class Yuanwu(BaseChar):
return 0
def count_base_priority(self):
return -2
return -1
def do_perform(self):
self.click_liberation(con_less_than=1)

View File

@ -109,7 +109,7 @@ class CombatCheck:
self.screenshot_boss_lv(current, f'boss lv not detected by edge {max_val}')
logger.debug(f'boss lv not detected by edge')
if not self.find_boss_lv_text(): # double check by text
if not self.check_health_bar() and not self.check_count_down() and not self.find_target_enemy():
if not self.check_health_bar() and not self.find_target_enemy():
if self.debug:
self.screenshot_boss_lv(current, 'out_of combat boss_health disappeared')
logger.info(f'out of combat because of boss_health disappeared, res:{max_val}')

View File

@ -111,6 +111,7 @@ class BaseCombatTask(BaseWWTask, FindFeature, OCR, CombatCheck):
if current_con == 1:
has_intro = True
low_con = 200
for i, char in enumerate(self.chars):
if char == current_char:
priority = Priority.CURRENT_CHAR
@ -122,6 +123,10 @@ class BaseCombatTask(BaseWWTask, FindFeature, OCR, CombatCheck):
if char.current_con < low_con and char != current_char:
low_con = char.current_con
switch_to = char
elif priority == max_priority:
if char.last_perform < switch_to.last_perform:
logger.debug(f'switch priority equal, determine by last perform')
switch_to = char
elif priority > max_priority:
max_priority = priority
switch_to = char
@ -208,7 +213,7 @@ class BaseCombatTask(BaseWWTask, FindFeature, OCR, CombatCheck):
else:
# self.logger.debug(f"{box_name} has invalid return False")
invalid_count += 1
# return False
return False
# Draw the connected component with a random color
# mask = labels == i