1
0
mirror of https://github.com/sui-feng-cb/AzurLaneAutoScript1.git synced 2026-07-13 02:54:25 +08:00

Upd: GemsFarming

This commit is contained in:
2026-07-10 01:38:27 +08:00
parent ac473abac0
commit 313793dab5
13 changed files with 24 additions and 23 deletions

View File

@@ -14,6 +14,8 @@ from module.map.assets import FLEET_PREPARATION, MAP_PREPARATION
from module.ocr.ocr import Digit
from module.retire.assets import *
from module.retire.dock import Dock
# TEMPLATE_COMMON_CV and TEMPLATE_COMMON_DD are both used in function find_custom_candidates
from module.retire.retirement import TEMPLATE_COMMON_CV, TEMPLATE_COMMON_DD
from module.retire.scanner import ShipScanner
from module.ui.assets import BACK_ARROW
from module.ui.page import page_fleet
@@ -311,7 +313,7 @@ class GemsFarming(CampaignRun, Dock):
common_ship_candidates = {}
for name in common_ship:
template = templates[name.upper()]
candidates = self.find_candidates(template, scanner)
candidates = self.find_candidates([template], scanner, output=False)
if find_first:
find_first = False
@@ -326,7 +328,7 @@ class GemsFarming(CampaignRun, Dock):
for name in common_ship:
template = templates[name.upper()]
candidates = self.find_candidates(template, scanner)
candidates = self.find_candidates([template], scanner, output=False)
if candidates:
logger.info(f'Find Common DD {name}.')
@@ -554,14 +556,18 @@ class GemsFarming(CampaignRun, Dock):
scanner = ShipScanner(level=(min_level, max_level), emotion=(min_emotion, 150), fleet=[0, self.fleet_to_attack_index], status='free')
scanner.disable('rarity')
candidates = self.find_candidates(templates, scanner, output=True)
if candidates or templates == []:
if self.config.GemsFarming_CommonDD == 'custom':
candidates = self.find_custom_candidates(scanner, ship_type='dd')
return candidates
else:
candidates = self.find_candidates(templates, scanner, output=True)
if candidates or templates == []:
return candidates
logger.info('No specific DD was found, try reversed order.')
self.dock_sort_method_dsc_set(False)
candidates = self.find_candidates(templates, scanner, output=True)
return candidates
logger.info('No specific DD was found, try reversed order.')
self.dock_sort_method_dsc_set(False)
candidates = self.find_candidates(templates, scanner, output=True)
return candidates
@Config.when(Campaign_Mode='normal')
def vanguard_change_execute(self):
@@ -673,7 +679,7 @@ class GemsFarming(CampaignRun, Dock):
def triggered_stop_condition(self, oil_check=True):
# Lv32 limit
if self.campaign.config.LV32_TRIGGERED:
if self.campaign.config.LV32_TRIGGERED and not self.allow_high_flagship_level:
self._trigger_lv32 = True
logger.hr('TRIGGERED LV32 LIMIT')
return True
@@ -714,7 +720,10 @@ class GemsFarming(CampaignRun, Dock):
if self.change_vanguard:
success = success and self.vanguard_change()
self.campaign.config.set_record(Emotion_Fleet1Value=self._new_fleet_emotion)
if self.fleet_to_attack == 2:
self.campaign.config.set_record(Emotion_Fleet2Value=self._new_fleet_emotion)
else:
self.campaign.config.set_record(Emotion_Fleet1Value=self._new_fleet_emotion)
if is_limit and self.config.StopCondition_RunCount <= 0:
logger.hr('Triggered stop condition: Run count')
@@ -723,19 +732,22 @@ class GemsFarming(CampaignRun, Dock):
break
self._trigger_lv32 = False
self._trigger_emotion = False
self.campaign.config.LV32_TRIGGERED = False
self.campaign.config.GEMS_EMOTION_TRIGGERED = False
# Scheduler
if self.config.task_switched():
self._trigger_emotion = False
self.campaign.ensure_auto_search_exit()
self.config.task_stop()
elif not success:
elif not success and (self.config.GemsFarming_DelayTaskIFNoFlagship \
or self._trigger_emotion):
self._trigger_emotion = False
self.campaign.ensure_auto_search_exit()
self.config.task_delay(minute=30)
self.config.task_stop()
self._trigger_emotion = False
continue
else:
break