Skip to content

Commit

Permalink
Opt: use fation to filter Z20 or Z21
Browse files Browse the repository at this point in the history
  • Loading branch information
Air111 committed Jun 2, 2024
1 parent f4b89f0 commit 7bc0fdf
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 18 deletions.
Binary file removed assets/cn/retire/TEMPLATE_Z20.png
Binary file not shown.
Binary file removed assets/cn/retire/TEMPLATE_Z21.png
Binary file not shown.
Binary file removed assets/en/retire/TEMPLATE_Z20.png
Binary file not shown.
Binary file removed assets/en/retire/TEMPLATE_Z21.png
Binary file not shown.
Binary file removed assets/jp/retire/TEMPLATE_Z20.png
Binary file not shown.
Binary file removed assets/jp/retire/TEMPLATE_Z21.png
Binary file not shown.
Binary file removed assets/tw/retire/TEMPLATE_Z20.png
Binary file not shown.
Binary file removed assets/tw/retire/TEMPLATE_Z21.png
Binary file not shown.
27 changes: 11 additions & 16 deletions module/campaign/gems_farming.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
DOCK_CHECK,
TEMPLATE_BOGUE, TEMPLATE_HERMES, TEMPLATE_LANGLEY, TEMPLATE_RANGER,
TEMPLATE_CASSIN_1, TEMPLATE_CASSIN_2, TEMPLATE_DOWNES_1, TEMPLATE_DOWNES_2,
TEMPLATE_AULICK, TEMPLATE_FOOTE, TEMPLATE_Z20, TEMPLATE_Z21
TEMPLATE_AULICK, TEMPLATE_FOOTE
)

from module.retire.dock import Dock
Expand Down Expand Up @@ -261,7 +261,7 @@ def get_common_rarity_dd(self):
scanner.set_limitation(fleet=0)
self.dock_favourite_set(self.config.GemsFarming_CommonDD == 'favourite')

if self.config.GemsFarming_CommonDD == 'any' or self.config.GemsFarming_CommonDD == 'favourite':
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)
Expand Down Expand Up @@ -294,14 +294,7 @@ def get_templates(common_dd):
"""
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
Expand All @@ -311,11 +304,6 @@ def get_templates(common_dd):
TEMPLATE_CASSIN_1, TEMPLATE_CASSIN_2,
TEMPLATE_DOWNES_1, TEMPLATE_DOWNES_2
]
elif common_dd == 'z20_or_z21':
return [
TEMPLATE_Z20,
TEMPLATE_Z21
]
else:
logger.error(f'Invalid CommonDD setting: {common_dd}')
raise ScriptError(f'Invalid CommonDD setting: {common_dd}')
Expand Down Expand Up @@ -358,8 +346,15 @@ def vanguard_change_execute(self):
"""
self.ui_click(FLEET_ENTER,
appear_button=page_fleet.check_button, check_button=DOCK_CHECK, skip_first_screenshot=True)

if self.config.GemsFarming_CommonDD == 'z20_or_z21':
faction = 'iron'
elif self.config.GemsFarming_CommonDD in ['aulick_or_foote', 'cassin_or_downes']:
faction = 'eagle'
else:
faction = ['eagle', 'iron']
self.dock_filter_set(
index='dd', rarity='common', faction=['eagle', 'iron'], 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()
Expand Down
2 changes: 0 additions & 2 deletions module/retire/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,3 @@
TEMPLATE_IN_EVENT_FLEET = Template(file={'cn': './assets/cn/retire/TEMPLATE_IN_EVENT_FLEET.png', 'en': './assets/cn/retire/TEMPLATE_IN_EVENT_FLEET.png', 'jp': './assets/cn/retire/TEMPLATE_IN_EVENT_FLEET.png', 'tw': './assets/cn/retire/TEMPLATE_IN_EVENT_FLEET.png'})
TEMPLATE_LANGLEY = Template(file={'cn': './assets/cn/retire/TEMPLATE_LANGLEY.png', 'en': './assets/en/retire/TEMPLATE_LANGLEY.png', 'jp': './assets/jp/retire/TEMPLATE_LANGLEY.png', 'tw': './assets/tw/retire/TEMPLATE_LANGLEY.png'})
TEMPLATE_RANGER = Template(file={'cn': './assets/cn/retire/TEMPLATE_RANGER.png', 'en': './assets/en/retire/TEMPLATE_RANGER.png', 'jp': './assets/jp/retire/TEMPLATE_RANGER.png', 'tw': './assets/tw/retire/TEMPLATE_RANGER.png'})
TEMPLATE_Z20 = Template(file={'cn': './assets/cn/retire/TEMPLATE_Z20.png', 'en': './assets/en/retire/TEMPLATE_Z20.png', 'jp': './assets/jp/retire/TEMPLATE_Z20.png', 'tw': './assets/tw/retire/TEMPLATE_Z20.png'})
TEMPLATE_Z21 = Template(file={'cn': './assets/cn/retire/TEMPLATE_Z21.png', 'en': './assets/en/retire/TEMPLATE_Z21.png', 'jp': './assets/jp/retire/TEMPLATE_Z21.png', 'tw': './assets/tw/retire/TEMPLATE_Z21.png'})

0 comments on commit 7bc0fdf

Please sign in to comment.