2023-09-23 22:54:04 +00:00
|
|
|
from module.logger import logger
|
|
|
|
from tasks.combat.combat import Combat
|
2023-09-25 04:28:18 +00:00
|
|
|
from tasks.daily.assets.assets_daily_trial import INFO_CLOSE, START_TRIAL
|
2023-09-23 22:54:04 +00:00
|
|
|
from tasks.daily.trail import CharacterTrial
|
|
|
|
from tasks.map.control.waypoint import Waypoint
|
|
|
|
from tasks.map.keywords.plane import Jarilo_BackwaterPass
|
|
|
|
from tasks.map.route.base import RouteBase
|
|
|
|
|
|
|
|
|
|
|
|
class Route(RouteBase, Combat, CharacterTrial):
|
|
|
|
def handle_combat_state(self, auto=True, speed_2x=True):
|
|
|
|
# No auto in character trial
|
|
|
|
auto = False
|
|
|
|
return super().handle_combat_state(auto=auto, speed_2x=speed_2x)
|
|
|
|
|
|
|
|
def wait_next_skill(self, expected_end=None, skip_first_screenshot=True):
|
|
|
|
# Ended at START_TRIAL
|
|
|
|
def combat_end():
|
|
|
|
return self.match_template_color(START_TRIAL)
|
|
|
|
|
|
|
|
return super().wait_next_skill(expected_end=combat_end, skip_first_screenshot=skip_first_screenshot)
|
|
|
|
|
2023-09-25 04:28:18 +00:00
|
|
|
def walk_additional(self) -> bool:
|
|
|
|
if self.appear_then_click(INFO_CLOSE, interval=2):
|
|
|
|
return True
|
|
|
|
return super().walk_additional()
|
|
|
|
|
2023-09-23 22:54:04 +00:00
|
|
|
def combat_execute(self, expected_end=None):
|
|
|
|
# Battle 1/3
|
|
|
|
# Enemy cleared by follow up
|
|
|
|
self.wait_next_skill()
|
|
|
|
|
|
|
|
# Battle 2/3
|
|
|
|
# Himeko E
|
|
|
|
# Rest are cleared by follow up
|
|
|
|
self.use_E()
|
|
|
|
self.wait_next_skill()
|
|
|
|
|
|
|
|
# Battle 3/3
|
|
|
|
# Himeko E
|
|
|
|
self.use_E()
|
|
|
|
self.wait_next_skill()
|
|
|
|
# Herta A, or Natasha A, depends on who wasn't being attacked
|
|
|
|
self.use_A()
|
2023-10-01 08:30:34 +00:00
|
|
|
if not self.wait_next_skill():
|
|
|
|
return
|
2023-09-23 22:54:04 +00:00
|
|
|
# Natasha A, this will also cause weakness break
|
|
|
|
# To achieve In_a_single_battle_inflict_3_Weakness_Break_of_different_Types
|
|
|
|
self.use_A()
|
2023-10-01 08:30:34 +00:00
|
|
|
if not self.wait_next_skill():
|
|
|
|
return
|
2023-09-25 15:00:52 +00:00
|
|
|
# Just whoever user A, in case Himeko Q didn't kill it, usually to be Herta
|
|
|
|
self.use_A()
|
2023-10-01 08:30:34 +00:00
|
|
|
if not self.wait_next_skill():
|
|
|
|
return
|
2023-09-23 22:54:04 +00:00
|
|
|
# Himeko Q
|
|
|
|
# To achieve Use_an_Ultimate_to_deal_the_final_blow_1_time
|
|
|
|
# May kill the enemy
|
|
|
|
self.use_Q(1)
|
|
|
|
if not self.wait_next_skill():
|
|
|
|
return
|
|
|
|
# Herta Q
|
|
|
|
# To achieve Use_an_Ultimate_to_deal_the_final_blow_1_time
|
|
|
|
# May kill the enemy
|
|
|
|
self.use_Q(2)
|
|
|
|
if not self.wait_next_skill():
|
|
|
|
return
|
|
|
|
|
|
|
|
# Combat should end here, just incase
|
|
|
|
logger.warning(f'Himeko trial is not going as expected')
|
2023-09-25 15:00:52 +00:00
|
|
|
for _ in range(2):
|
2023-09-23 22:54:04 +00:00
|
|
|
self.use_E()
|
|
|
|
if not self.wait_next_skill():
|
|
|
|
return
|
2023-09-25 15:00:52 +00:00
|
|
|
for _ in range(10):
|
|
|
|
self.use_A()
|
|
|
|
if not self.wait_next_skill():
|
|
|
|
return
|
2023-09-23 22:54:04 +00:00
|
|
|
|
|
|
|
def route_item_enemy(self):
|
|
|
|
self.enter_himeko_trial()
|
|
|
|
self.map_init(plane=Jarilo_BackwaterPass, position=(519.9, 361.5))
|
|
|
|
|
|
|
|
# Visit 3 items
|
|
|
|
self.clear_item(
|
|
|
|
Waypoint((587.6, 366.9)).run_2x(),
|
|
|
|
)
|
|
|
|
self.clear_item(
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((575.5, 377.4)).straight_run(),
|
2023-09-23 22:54:04 +00:00
|
|
|
)
|
|
|
|
self.clear_item(
|
|
|
|
# Go through arched door
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((581.5, 383.3)).set_threshold(3),
|
|
|
|
Waypoint((575.7, 417.2)),
|
2023-09-23 22:54:04 +00:00
|
|
|
)
|
|
|
|
# Goto boss
|
|
|
|
self.clear_enemy(
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((613.5, 427.3)).straight_run(),
|
2023-09-23 22:54:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
def route_item(self):
|
|
|
|
self.enter_himeko_trial()
|
|
|
|
self.map_init(plane=Jarilo_BackwaterPass, position=(519.9, 361.5))
|
|
|
|
|
|
|
|
# Visit 3 items
|
|
|
|
self.clear_item(
|
|
|
|
Waypoint((587.6, 366.9)).run_2x(),
|
|
|
|
)
|
|
|
|
self.clear_item(
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((575.5, 377.4)).straight_run(),
|
2023-09-23 22:54:04 +00:00
|
|
|
)
|
|
|
|
self.clear_item(
|
|
|
|
# Go through arched door
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((581.5, 383.3)).set_threshold(3),
|
|
|
|
Waypoint((575.7, 417.2)),
|
2023-09-23 22:54:04 +00:00
|
|
|
)
|
|
|
|
# Exit
|
|
|
|
self.exit_trial()
|
|
|
|
|
|
|
|
def route_enemy(self):
|
|
|
|
self.enter_himeko_trial()
|
|
|
|
self.map_init(plane=Jarilo_BackwaterPass, position=(519.9, 361.5))
|
|
|
|
|
|
|
|
# Goto boss
|
|
|
|
self.clear_enemy(
|
|
|
|
# Before the corner, turn right
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((571.7, 371.3)),
|
2023-09-23 22:54:04 +00:00
|
|
|
# Go through arched door
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((581.5, 383.3)),
|
2023-09-23 22:54:04 +00:00
|
|
|
# Boss
|
2023-09-30 10:37:37 +00:00
|
|
|
Waypoint((613.5, 427.3)).straight_run(),
|
2023-09-23 22:54:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
def exit(self):
|
|
|
|
# Fake map_init to expose this method
|
|
|
|
# self.map_init(plane=Jarilo_BackwaterPass, position=(519.9, 361.5))
|
|
|
|
self.exit_trial_to_main()
|