1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-22 14:03:44 +08:00

merge LmeSzinc/AzurLaneAutoScript:dev

This commit is contained in:
sui-feng-cb
2024-06-25 01:18:17 +08:00
parent 8c16e15c9d
commit 1f5a779328
9 changed files with 45 additions and 27 deletions

View File

@@ -247,11 +247,15 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
return success
def _dock_reset(self):
self.dock_filter_set()
self.dock_favourite_set(False)
self.dock_sort_method_dsc_set()
def _ship_change_confirm(self, button):
self.dock_select_one(button)
self.dock_filter_set()
self.dock_sort_method_dsc_set()
self._dock_reset()
self.dock_select_confirm(check_button=self.page_fleet_check_button)
def get_common_rarity_cv(self, lv=31, emotion=16):
@@ -342,8 +346,9 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
return ships
scanner.set_limitation(fleet=0)
self.dock_favourite_set(self.config.GemsFarming_CommonDD == 'favourite')
if self.config.GemsFarming_CommonDD == 'any':
if self.config.GemsFarming_CommonDD in ['any', 'favourite', 'z20_or_z21']:
return scanner.scan(self.device.image, output=False)
candidates = self.find_candidates(self.get_templates(self.config.GemsFarming_CommonDD), scanner)
@@ -376,14 +381,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
"""
Returns the corresponding template list based on CommonDD
"""
if common_dd == 'any':
return [
TEMPLATE_CASSIN_1, TEMPLATE_CASSIN_2,
TEMPLATE_DOWNES_1, TEMPLATE_DOWNES_2,
TEMPLATE_AULICK,
TEMPLATE_FOOTE
]
elif common_dd == 'aulick_or_foote':
if common_dd == 'aulick_or_foote':
return [
TEMPLATE_AULICK,
TEMPLATE_FOOTE
@@ -448,7 +446,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
else:
if self.hard_mode:
raise RequestHumanTakeover
self.dock_filter_set()
self._dock_reset()
self.ui_back(check_button=self.page_fleet_check_button)
if self.hard_mode:
self.FLEET_ENTER_FLAGSHIP = self._FLEET_ENTER_FLAGSHIP
@@ -480,8 +478,19 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
self.solve_hard_vanguard_black()
self.ui_click(self.FLEET_ENTER,
appear_button=self.page_fleet_check_button, check_button=DOCK_CHECK, skip_first_screenshot=True)
if self.config.GemsFarming_CommonDD == 'any':
faction = ['eagle', 'iron']
elif self.config.GemsFarming_CommonDD == 'favourite':
faction = 'all'
elif self.config.GemsFarming_CommonDD == 'z20_or_z21':
faction = 'iron'
elif self.config.GemsFarming_CommonDD in ['aulick_or_foote', 'cassin_or_downes']:
faction = 'eagle'
else:
logger.error(f'Invalid CommonDD setting: {self.config.GemsFarming_CommonDD}')
raise ScriptError('Invalid GemsFarming_CommonDD')
self.dock_filter_set(
index='dd', rarity='common', faction='eagle', extra='can_limit_break')
index='dd', rarity='common', faction=faction, extra='can_limit_break')
self.dock_favourite_set(False)
ship = self.get_common_rarity_dd()
@@ -501,7 +510,7 @@ class GemsFarming(CampaignRun, Dock, EquipmentChange):
else:
if self.hard_mode:
raise RequestHumanTakeover
self.dock_filter_set()
self._dock_reset()
self.ui_back(check_button=self.page_fleet_check_button)
if self.hard_mode:
self.FLEET_ENTER = self._FLEET_ENTER