diff --git a/README.md b/README.md index 7343d9e57..803fd8328 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ EN support, Thanks **[@whoamikyo](https://github.com/whoamikyo)** - **主线图出击** 暂时仅支持前六章和7-2 -- **活动图出击** 支持「穹顶下的圣咏曲」(event_20200521_cn), 针对D1D3有优化, 支持处理光之壁(舰队无法在有光之壁的格子进行通行), 支持开荒 +- **活动图出击** 支持「峡湾间的反击」(event_20200603_cn), 针对SP1-SP3有优化, 支持开荒 - **每日任务** 半小时左右一套做完, 重复运行时会跳过当天做过的 diff --git a/assets/cn/handler/LOGIN_CONFIRM.png b/assets/cn/handler/LOGIN_CONFIRM.png new file mode 100644 index 000000000..bb6b94060 Binary files /dev/null and b/assets/cn/handler/LOGIN_CONFIRM.png differ diff --git a/assets/cn/template/TEMPLATE_SIREN_Z18.png b/assets/cn/template/TEMPLATE_SIREN_Z18.png new file mode 100644 index 000000000..4035a0d03 Binary files /dev/null and b/assets/cn/template/TEMPLATE_SIREN_Z18.png differ diff --git a/assets/cn/template/TEMPLATE_SIREN_Z19.png b/assets/cn/template/TEMPLATE_SIREN_Z19.png new file mode 100644 index 000000000..cb58a4430 Binary files /dev/null and b/assets/cn/template/TEMPLATE_SIREN_Z19.png differ diff --git a/assets/cn/template/TEMPLATE_SIREN_Z2.png b/assets/cn/template/TEMPLATE_SIREN_Z2.png new file mode 100644 index 000000000..c518d611d Binary files /dev/null and b/assets/cn/template/TEMPLATE_SIREN_Z2.png differ diff --git a/assets/en/handler/LOGIN_CONFIRM.png b/assets/en/handler/LOGIN_CONFIRM.png new file mode 100644 index 000000000..bb6b94060 Binary files /dev/null and b/assets/en/handler/LOGIN_CONFIRM.png differ diff --git a/assets/en/template/TEMPLATE_SIREN_Z18.png b/assets/en/template/TEMPLATE_SIREN_Z18.png new file mode 100644 index 000000000..4035a0d03 Binary files /dev/null and b/assets/en/template/TEMPLATE_SIREN_Z18.png differ diff --git a/assets/en/template/TEMPLATE_SIREN_Z19.png b/assets/en/template/TEMPLATE_SIREN_Z19.png new file mode 100644 index 000000000..cb58a4430 Binary files /dev/null and b/assets/en/template/TEMPLATE_SIREN_Z19.png differ diff --git a/assets/en/template/TEMPLATE_SIREN_Z2.png b/assets/en/template/TEMPLATE_SIREN_Z2.png new file mode 100644 index 000000000..c518d611d Binary files /dev/null and b/assets/en/template/TEMPLATE_SIREN_Z2.png differ diff --git a/campaign/campaign_main/campaign_2_1.py b/campaign/campaign_main/campaign_2_1.py index 04950bd7f..f825deb13 100644 --- a/campaign/campaign_main/campaign_2_1.py +++ b/campaign/campaign_main/campaign_2_1.py @@ -32,8 +32,8 @@ A4, B4, C4, D4, E4, F4, \ class Config: - FLEET_2 = 0 - SUBMARINE = 0 + FLEET_BOSS = 1 + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (120, 255 - 40), 'width': (1.5, 10), @@ -59,7 +59,7 @@ class Campaign(CampaignBase): def battle_2(self): self.clear_all_mystery() - if not self.check_accessibility(D4): + if not self.check_accessibility(D4, fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_2_2.py b/campaign/campaign_main/campaign_2_2.py index 40b4a502d..25b44806e 100644 --- a/campaign/campaign_main/campaign_2_2.py +++ b/campaign/campaign_main/campaign_2_2.py @@ -48,7 +48,7 @@ class Campaign(CampaignBase): def battle_3(self): self.clear_all_mystery() - if not self.check_accessibility(D1): + if not self.check_accessibility(D1, fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_2_3.py b/campaign/campaign_main/campaign_2_3.py index e5458632f..69c90455e 100644 --- a/campaign/campaign_main/campaign_2_3.py +++ b/campaign/campaign_main/campaign_2_3.py @@ -48,7 +48,7 @@ class Campaign(CampaignBase): def battle_3(self): self.clear_all_mystery() - if not self.check_accessibility(E1): + if not self.check_accessibility(E1, fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_2_4.py b/campaign/campaign_main/campaign_2_4.py index f6f1fff85..785496dde 100644 --- a/campaign/campaign_main/campaign_2_4.py +++ b/campaign/campaign_main/campaign_2_4.py @@ -41,7 +41,7 @@ class Campaign(CampaignBase): return self.battle_default() def battle_3(self): - if not self.check_accessibility(G1): + if not self.check_accessibility(G1, fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_3_1.py b/campaign/campaign_main/campaign_3_1.py index 68f638cfc..29980b8b1 100644 --- a/campaign/campaign_main/campaign_3_1.py +++ b/campaign/campaign_main/campaign_3_1.py @@ -33,8 +33,8 @@ A4, B4, C4, D4, E4, F4, G4, \ class Config: - FLEET_2 = 0 - SUBMARINE = 0 + FLEET_BOSS = 1 + MAP_MYSTERY_HAS_CARRIER = True INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (120, 255 - 40), @@ -61,7 +61,7 @@ class Campaign(CampaignBase): def battle_3(self): self.clear_all_mystery() - if not self.check_accessibility(G2): - return self.battle_default() + if not self.check_accessibility(G2, fleet='boss'): + return self.fleet_boss.battle_default() return self.clear_boss() diff --git a/campaign/campaign_main/campaign_3_2.py b/campaign/campaign_main/campaign_3_2.py index e14eb2697..7d35d6e33 100644 --- a/campaign/campaign_main/campaign_3_2.py +++ b/campaign/campaign_main/campaign_3_2.py @@ -45,7 +45,7 @@ class Campaign(CampaignBase): def battle_3(self): self.clear_all_mystery() - if not self.check_accessibility(H1): + if not self.check_accessibility(H1, fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_3_3.py b/campaign/campaign_main/campaign_3_3.py index 21b343f44..dbddd0c7f 100644 --- a/campaign/campaign_main/campaign_3_3.py +++ b/campaign/campaign_main/campaign_3_3.py @@ -47,7 +47,7 @@ class Campaign(CampaignBase): def battle_3(self): self.clear_all_mystery() - if not self.check_accessibility(A4): + if not self.check_accessibility(A4, fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_3_4.py b/campaign/campaign_main/campaign_3_4.py index 47a8c83e2..d1348f4a9 100644 --- a/campaign/campaign_main/campaign_3_4.py +++ b/campaign/campaign_main/campaign_3_4.py @@ -50,10 +50,10 @@ class Campaign(CampaignBase): return self.battle_default() def battle_3(self): - if not self.check_accessibility(H3): + if not self.check_accessibility(H3, fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() def handle_boss_appear_refocus(self): for data in self.map.spawn_data: diff --git a/campaign/campaign_main/campaign_4_1.py b/campaign/campaign_main/campaign_4_1.py index d325662e6..edf3f7f47 100644 --- a/campaign/campaign_main/campaign_4_1.py +++ b/campaign/campaign_main/campaign_4_1.py @@ -39,8 +39,8 @@ A6, B6, C6, D6, E6, F6, \ class Config: - FLEET_2 = 0 - SUBMARINE = 0 + FLEET_BOSS = 1 + MAP_MYSTERY_HAS_CARRIER = True INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (120, 255 - 40), @@ -72,7 +72,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_4_2.py b/campaign/campaign_main/campaign_4_2.py index 419635618..8139fa6c2 100644 --- a/campaign/campaign_main/campaign_4_2.py +++ b/campaign/campaign_main/campaign_4_2.py @@ -58,7 +58,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_4_3.py b/campaign/campaign_main/campaign_4_3.py index de0c507f6..4d6ef8aa5 100644 --- a/campaign/campaign_main/campaign_4_3.py +++ b/campaign/campaign_main/campaign_4_3.py @@ -54,7 +54,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_4_4.py b/campaign/campaign_main/campaign_4_4.py index 6e1714e61..7c7389318 100644 --- a/campaign/campaign_main/campaign_4_4.py +++ b/campaign/campaign_main/campaign_4_4.py @@ -65,10 +65,10 @@ class Campaign(CampaignBase): def battle_4(self): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): if self.clear_roadblocks([road_main]): return True if self.clear_potential_roadblocks([road_main]): return True - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_5_1.py b/campaign/campaign_main/campaign_5_1.py index ada07b882..5c66dc724 100644 --- a/campaign/campaign_main/campaign_5_1.py +++ b/campaign/campaign_main/campaign_5_1.py @@ -41,9 +41,9 @@ A6, B6, C6, D6, E6, F6, G6, H6, \ class Config: - FLEET_2 = 0 - SUBMARINE = 0 + FLEET_BOSS = 1 MAP_MYSTERY_HAS_CARRIER = True + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (120, 255 - 40), 'width': (1.5, 10), @@ -71,7 +71,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_5_2.py b/campaign/campaign_main/campaign_5_2.py index cd9e34a55..7a730f51c 100644 --- a/campaign/campaign_main/campaign_5_2.py +++ b/campaign/campaign_main/campaign_5_2.py @@ -51,7 +51,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_5_3.py b/campaign/campaign_main/campaign_5_3.py index 1cc464d0a..1911057c4 100644 --- a/campaign/campaign_main/campaign_5_3.py +++ b/campaign/campaign_main/campaign_5_3.py @@ -51,7 +51,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): return self.battle_default() - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_5_4.py b/campaign/campaign_main/campaign_5_4.py index b97e959d4..43c220b92 100644 --- a/campaign/campaign_main/campaign_5_4.py +++ b/campaign/campaign_main/campaign_5_4.py @@ -62,10 +62,10 @@ class Campaign(CampaignBase): def battle_4(self): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0]): + if not self.check_accessibility(boss[0], fleet='boss'): if self.clear_roadblocks([road_center]): return True if self.clear_potential_roadblocks([road_ring]): return True - return self.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_6_1.py b/campaign/campaign_main/campaign_6_1.py index 362dca4da..8d9bdaf36 100644 --- a/campaign/campaign_main/campaign_6_1.py +++ b/campaign/campaign_main/campaign_6_1.py @@ -42,7 +42,7 @@ road_mystery = RoadGrids([[C4, D5], D4, G2, [G1, H2]]) class Config: - SUBMARINE = 0 + FLEET_BOSS = 1 MAP_MYSTERY_HAS_CARRIER = True @@ -70,7 +70,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0], fleet=2): + if not self.check_accessibility(boss[0], fleet='boss'): return self.clear_roadblocks([road_boss]) - return self.fleet_2.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_6_2.py b/campaign/campaign_main/campaign_6_2.py index ca7093447..dc03fd34f 100644 --- a/campaign/campaign_main/campaign_6_2.py +++ b/campaign/campaign_main/campaign_6_2.py @@ -64,7 +64,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0], fleet=2): + if not self.check_accessibility(boss[0], fleet='boss'): return self.clear_roadblocks([road_boss]) - return self.fleet_2.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_6_3.py b/campaign/campaign_main/campaign_6_3.py index fab3c4e97..219643b60 100644 --- a/campaign/campaign_main/campaign_6_3.py +++ b/campaign/campaign_main/campaign_6_3.py @@ -77,7 +77,7 @@ class Campaign(CampaignBase): boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0], fleet=2): + if not self.check_accessibility(boss[0], fleet='boss'): return self.clear_roadblocks([road_boss]) - return self.fleet_2.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/campaign_main/campaign_6_4.py b/campaign/campaign_main/campaign_6_4.py index 8d56d61b6..fc99d9c1c 100644 --- a/campaign/campaign_main/campaign_6_4.py +++ b/campaign/campaign_main/campaign_6_4.py @@ -68,9 +68,12 @@ class Campaign(CampaignBase): def battle_5(self): self.clear_all_mystery() + if not self.config.FLEET_2: + self.pick_up_ammo() + boss = self.map.select(is_boss=True) if boss: - if not self.check_accessibility(boss[0], fleet=2): + if not self.check_accessibility(boss[0], fleet='boss'): return self.clear_roadblocks([road_boss]) - return self.fleet_2.clear_boss() + return self.fleet_boss.clear_boss() diff --git a/campaign/event_20200603_cn/sp1.py b/campaign/event_20200603_cn/sp1.py new file mode 100644 index 000000000..0b7949989 --- /dev/null +++ b/campaign/event_20200603_cn/sp1.py @@ -0,0 +1,73 @@ +from module.campaign.campaign_base import CampaignBase +from module.map.map_base import CampaignMap + +MAP = CampaignMap() +MAP.map_data = ''' + ++ ++ ++ -- ME -- -- -- -- ++ -- + -- ME -- ++ -- ++ ++ ME -- ++ ME + ME -- -- ME -- ME ++ -- ME ++ -- + -- -- -- -- -- ++ ME -- -- -- SP + ME -- -- ME -- -- -- __ -- -- SP + -- -- ME ++ -- MS -- ME -- -- -- + -- -- -- ++ MB -- MB ++ ++ ++ ++ +''' +MAP.camera_data = ['D3', 'D5', 'H3', 'H5'] +MAP.weight_data = ''' + 10 10 10 10 40 10 10 10 10 10 50 + 10 30 10 10 10 10 10 20 10 10 50 + 30 10 10 10 10 20 10 10 10 10 50 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 30 10 20 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 +''' +MAP.spawn_data = [ + {'battle': 0, 'enemy': 3, 'siren': 1}, + {'battle': 1, 'enemy': 1}, + {'battle': 2, 'enemy': 1}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'boss': 1}, +] + + +class Config: + SUBMARINE = 0 + + POOR_MAP_DATA = True + MAP_HAS_AMBUSH = False + MAP_HAS_FLEET_STEP = True + MAP_HAS_MOVABLE_ENEMY = True + MAP_HAS_SIREN = True + MAP_HAS_DYNAMIC_RED_BORDER = False + MAP_HAS_MAP_STORY = True + MAP_SIREN_TEMPLATE = ['Z18'] + MAP_SIREN_COUNT = 1 + + TRUST_EDGE_LINES = False + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { + 'height': (100, 255 - 24), + 'width': 1, + 'prominence': 10, + 'distance': 35, + } + EDGE_LINES_FIND_PEAKS_PARAMETERS = { + 'height': (255 - 24, 255), + 'prominence': 2, + 'distance': 50, + 'wlen': 1000 + } + + +class Campaign(CampaignBase): + MAP = MAP + + def battle_0(self): + if self.clear_siren(): + return True + if self.fleet_2_break_siren_caught(): + return True + + return self.battle_default() + + def battle_4(self): + return self.fleet_boss.clear_boss() diff --git a/campaign/event_20200603_cn/sp2.py b/campaign/event_20200603_cn/sp2.py new file mode 100644 index 000000000..71e984d15 --- /dev/null +++ b/campaign/event_20200603_cn/sp2.py @@ -0,0 +1,55 @@ +from module.campaign.campaign_base import CampaignBase +from module.map.map_base import CampaignMap +from campaign.event_20200603_cn.sp1 import Config as ConfigBase + +MAP = CampaignMap() +MAP.map_data = ''' + -- -- ++ ++ SP -- SP ++ ++ ++ ++ + -- ME ++ ++ -- -- -- -- -- ME ME + ME -- -- MS -- -- -- ME -- -- MB + ++ -- -- -- ME -- ME ++ __ -- MB + -- -- ++ ++ ++ MS -- ++ -- -- ME + -- ME -- ME ++ -- -- -- -- ME ++ + -- -- -- -- -- ME ME ME ME -- ++ +''' +MAP.camera_data = ['D3', 'D5', 'H3', 'H5'] +MAP.weight_data = ''' + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 +''' +MAP.spawn_data = [ + {'battle': 0, 'enemy': 3, 'siren': 2}, + {'battle': 1, 'enemy': 2}, + {'battle': 2, 'enemy': 1}, + {'battle': 3, 'enemy': 1}, + {'battle': 4}, + {'battle': 5, 'boss': 1}, +] + + +class Config(ConfigBase): + FLEET_BOSS = 2 + + # POOR_MAP_DATA = True + MAP_SIREN_TEMPLATE = ['Z2'] + MAP_SIREN_COUNT = 2 + + +class Campaign(CampaignBase): + MAP = MAP + + def battle_0(self): + if self.clear_siren(): + return True + if self.fleet_2_break_siren_caught(): + return True + + return self.battle_default() + + def battle_5(self): + return self.fleet_2.clear_boss() diff --git a/campaign/event_20200603_cn/sp3.py b/campaign/event_20200603_cn/sp3.py new file mode 100644 index 000000000..ef8fb67ba --- /dev/null +++ b/campaign/event_20200603_cn/sp3.py @@ -0,0 +1,55 @@ +from module.campaign.campaign_base import CampaignBase +from module.map.map_base import CampaignMap +from campaign.event_20200603_cn.sp1 import Config as ConfigBase + +MAP = CampaignMap() +MAP.map_data = ''' + ++ ++ ++ MS ++ ME -- ME ++ ++ ++ + SP -- -- -- -- -- MS -- ME ME -- + SP -- -- -- -- ME -- __ -- -- ME + ++ ++ ++ MS -- ++ ++ -- ME ++ -- + MB MB ++ -- ME ++ ++ -- -- ++ ++ + -- -- -- -- -- -- -- -- -- ME -- + ME ME -- ME -- ME ++ ME -- ME -- +''' +MAP.camera_data = ['D3', 'D5', 'G3', 'G5'] +MAP.weight_data = ''' + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 10 10 +''' +MAP.spawn_data = [ + {'battle': 0, 'enemy': 3, 'siren': 2}, + {'battle': 1, 'enemy': 2, 'siren': 1}, + {'battle': 2, 'enemy': 1}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 1}, + {'battle': 5, 'boss': 1}, +] + + +class Config(ConfigBase): + FLEET_BOSS = 2 + + # POOR_MAP_DATA = True + MAP_SIREN_TEMPLATE = ['Z19'] + MAP_SIREN_COUNT = 2 + + +class Campaign(CampaignBase): + MAP = MAP + + def battle_0(self): + if self.clear_siren(): + return True + if self.fleet_2_break_siren_caught(): + return True + + return self.battle_default() + + def battle_5(self): + return self.fleet_2.clear_boss() diff --git a/module/config/argparser.py b/module/config/argparser.py index ac85524f0..fba088a33 100644 --- a/module/config/argparser.py +++ b/module/config/argparser.py @@ -5,6 +5,7 @@ import shutil from gooey import Gooey, GooeyParser +import module.config.server as server from alas import AzurLaneAutoScript from module.config.dictionary import dic_chi_to_eng, dic_eng_to_chi from module.logger import logger, pyw_name @@ -81,7 +82,10 @@ def main(ini_name=''): config = update_config_from_template(config, file=config_file) - event_folder = [dic_eng_to_chi.get(f, f) for f in os.listdir('./campaign') if f.startswith('event_')][::-1] + event_folder = [f for f in os.listdir('./campaign') if f.startswith('event_') and f.split('_')[-1] == server.server] + event_latest = sorted([f for f in event_folder], reverse=True)[0] + event_folder = [dic_eng_to_chi.get(f, f) for f in event_folder][::-1] + event_latest = dic_eng_to_chi.get(event_latest, event_latest) saved_config = {} for opt, option in config.items(): @@ -141,12 +145,12 @@ def main(ini_name=''): f1.add_argument('--舰队步长1', default=default('--舰队步长1'), choices=['1', '2', '3', '4', '5', '6']) f2 = fleet.add_argument_group('BOSS队') - f2.add_argument('--舰队编号2', default=default('--舰队编号2'), choices=['1', '2', '3', '4', '5', '6']) + f2.add_argument('--舰队编号2', default=default('--舰队编号2'), choices=['不使用', '1', '2', '3', '4', '5', '6']) f2.add_argument('--舰队阵型2', default=default('--舰队阵型2'), choices=['单纵阵', '复纵阵', '轮形阵']) f2.add_argument('--舰队步长2', default=default('--舰队步长2'), choices=['1', '2', '3', '4', '5', '6']) f3 = fleet.add_argument_group('备用道中队') - f3.add_argument('--舰队编号3', default=default('--舰队编号3'), choices=['1', '2', '3', '4', '5', '6']) + f3.add_argument('--舰队编号3', default=default('--舰队编号3'), choices=['不使用', '1', '2', '3', '4', '5', '6']) f3.add_argument('--舰队阵型3', default=default('--舰队阵型3'), choices=['单纵阵', '复纵阵', '轮形阵']) f3.add_argument('--舰队步长3', default=default('--舰队步长3'), choices=['1', '2', '3', '4', '5', '6']) @@ -316,7 +320,7 @@ def main(ini_name=''): # ==========每日活动图三倍PT========== event_ab_parser = subs.add_parser('每日活动图三倍PT') event_name = event_ab_parser.add_argument_group('选择活动', '') - event_name.add_argument('--活动名称ab', default=default('--活动名称ab'), choices=event_folder, help='例如 event_20200326_cn') + event_name.add_argument('--活动名称ab', default=event_latest, choices=event_folder, help='例如 event_20200326_cn') # ==========主线图========== main_parser = subs.add_parser('主线图') @@ -328,8 +332,7 @@ def main(ini_name=''): event_parser = subs.add_parser('活动图') description = """ - 支持「穹顶下的圣咏曲」(event_20200521_cn), 针对D1D3有优化 - D3第一次进图和100%通关时均有剧情战斗, 会导致报错 + 支持「峡湾间的反击」(event_20200603_cn), 针对SP1-SP3有优化 出击未优化关卡或地图未达到安全海域时, 使用开荒模式运行(较慢) """ event = event_parser.add_argument_group( @@ -340,7 +343,7 @@ def main(ini_name=''): event.add_argument('--sp地图', default=default('--sp地图'), choices=['sp1', 'sp2', 'sp3'], help='例如 sp3') - event.add_argument('--活动名称', default=default('--活动名称'), choices=event_folder, help='例如 event_20200312_cn') + event.add_argument('--活动名称', default=event_latest, choices=event_folder, help='例如 event_20200312_cn') # ==========半自动========== semi_parser = subs.add_parser('半自动辅助点击') diff --git a/module/config/argparser_en.py b/module/config/argparser_en.py index a5d77c3ff..13b902a4f 100644 --- a/module/config/argparser_en.py +++ b/module/config/argparser_en.py @@ -5,6 +5,7 @@ import shutil from gooey import Gooey, GooeyParser +import module.config.server as server from alas import AzurLaneAutoScript from module.config.dictionary import dic_true_eng_to_eng, dic_eng_to_true_eng from module.logger import logger, pyw_name @@ -79,7 +80,10 @@ def main(ini_name=''): config = update_config_from_template(config, file=config_file) - event_folder = [dic_eng_to_true_eng.get(f, f) for f in os.listdir('./campaign') if f.startswith('event_')][::-1] + event_folder = [f for f in os.listdir('./campaign') if f.startswith('event_') and f.split('_')[-1] == server.server] + event_latest = sorted([f for f in event_folder], reverse=True)[0] + event_folder = [dic_eng_to_true_eng.get(f, f) for f in event_folder][::-1] + event_latest = dic_eng_to_true_eng.get(event_latest, event_latest) saved_config = {} for opt, option in config.items(): @@ -139,12 +143,12 @@ def main(ini_name=''): f1.add_argument('--fleet_step_1', default=default('--fleet_step_1'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored') f2 = fleet.add_argument_group('Boss Fleet') - f2.add_argument('--fleet_index_2', default=default('--fleet_index_2'), choices=['1', '2', '3', '4', '5', '6']) + f2.add_argument('--fleet_index_2', default=default('--fleet_index_2'), choices=['do_not_use', '1', '2', '3', '4', '5', '6']) f2.add_argument('--fleet_formation_2', default=default('--fleet_formation_2'), choices=['Line Ahead', 'Double Line', 'Diamond']) f2.add_argument('--fleet_step_2', default=default('--fleet_step_2'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored') f3 = fleet.add_argument_group('Alternate Mob Fleet') - f3.add_argument('--fleet_index_3', default=default('--fleet_index_3'), choices=['1', '2', '3', '4', '5', '6']) + f3.add_argument('--fleet_index_3', default=default('--fleet_index_3'), choices=['do_not_use', '1', '2', '3', '4', '5', '6']) f3.add_argument('--fleet_formation_3', default=default('--fleet_formation_3'), choices=['Line Ahead', 'Double Line', 'Diamond']) f3.add_argument('--fleet_step_3', default=default('--fleet_step_3'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored') @@ -314,7 +318,7 @@ def main(ini_name=''): # ==========event_daily_ab========== event_ab_parser = subs.add_parser('event_daily_bonus') event_name = event_ab_parser.add_argument_group('Choose an event', 'bonus for first clear each day') - event_name.add_argument('--event_name_ab', default=default('--event_name_ab'), choices=event_folder, help='There a dropdown menu with many options') + event_name.add_argument('--event_name_ab', default=event_latest, choices=event_folder, help='There a dropdown menu with many options') # event_name.add_argument('--enable_hard_bonus', default=default('--enable_hard_bonus'), choices=['yes', 'no'], help='Will enable Daily bonus for Event hard maps') # Trying implement all event maps # ==========main========== @@ -337,7 +341,7 @@ def main(ini_name=''): event.add_argument('--sp_stage', default=default('--sp_stage'), choices=['sp1', 'sp2', 'sp3'], help='E.g sp3') - event.add_argument('--event_name', default=default('--event_name'), choices=event_folder, help='There a dropdown menu with many options') + event.add_argument('--event_name', default=event_latest, choices=event_folder, help='There a dropdown menu with many options') # ==========半自动========== semi_parser = subs.add_parser('semi_auto') diff --git a/module/config/config.py b/module/config/config.py index e4efe1db3..6760073f8 100644 --- a/module/config/config.py +++ b/module/config/config.py @@ -419,7 +419,7 @@ class AzurLaneConfig: self.ENABLE_FLEET_CONTROL = to_bool(option['enable_fleet_control']) self.ENABLE_MAP_FLEET_LOCK = to_bool(option['enable_map_fleet_lock']) for n in ['1', '2', '3']: - self.__setattr__(f'FLEET_{n}', int(option[f'fleet_index_{n}'])) + self.__setattr__(f'FLEET_{n}', int(option[f'fleet_index_{n}']) if to_bool(option[f'fleet_index_{n}']) else 0) self.__setattr__(f'FLEET_{n}_FORMATION', int(option[f'fleet_formation_{n}'].split('_')[1])) self.__setattr__(f'FLEET_{n}_STEP', int(option[f'fleet_step_{n}'])) self.COMBAT_AUTO_MODE = option['combat_auto_mode'] diff --git a/module/config/dictionary.py b/module/config/dictionary.py index 2f6cfa03f..0c3729245 100644 --- a/module/config/dictionary.py +++ b/module/config/dictionary.py @@ -387,6 +387,7 @@ dic_chi_to_eng = { '复刻苍红的回响': 'event_20200423_cn', '夜幕下的归途': 'event_20200507_cn', '穹顶下的圣咏曲': 'event_20200521_cn', + '峡湾间的反击': 'event_20200603_cn', } dic_eng_to_chi = {v: k for k, v in dic_chi_to_eng.items()} diff --git a/module/handler/assets.py b/module/handler/assets.py index 13c726ace..dfbc8b1f5 100644 --- a/module/handler/assets.py +++ b/module/handler/assets.py @@ -22,7 +22,8 @@ IN_MAP = Button(area={'cn': (749, 654, 921, 707), 'en': (748, 652, 922, 702)}, c IN_STAGE = Button(area={'cn': (122, 16, 172, 39), 'en': (120, 18, 208, 40)}, color={'cn': (149, 167, 207), 'en': (104, 118, 157)}, button={'cn': (122, 16, 172, 39), 'en': (120, 18, 208, 40)}, file={'cn': './assets/cn/handler/IN_STAGE.png', 'en': './assets/en/handler/IN_STAGE.png'}) LOGIN_ANNOUNCE = Button(area={'cn': (1160, 45, 1227, 90), 'en': (1159, 44, 1228, 91)}, color={'cn': (174, 61, 56), 'en': (193, 79, 73)}, button={'cn': (1160, 45, 1227, 90), 'en': (1159, 44, 1228, 91)}, file={'cn': './assets/cn/handler/LOGIN_ANNOUNCE.png', 'en': './assets/en/handler/LOGIN_ANNOUNCE.png'}) LOGIN_CHECK = Button(area={'cn': (77, 655, 154, 711), 'en': (77, 655, 154, 711)}, color={'cn': (33, 36, 33), 'en': (33, 36, 33)}, button={'cn': (416, 294, 534, 400), 'en': (416, 294, 534, 400)}, file={'cn': './assets/cn/handler/LOGIN_CHECK.png', 'en': './assets/en/handler/LOGIN_CHECK.png'}) -LOGIN_GAME_UPDATE = Button(area={'cn': (700, 471, 873, 529), 'en': (699, 470, 874, 530)}, color={'cn': (238, 170, 78), 'en': (236, 167, 74)}, button={'cn': (700, 471, 873, 529), 'en': (699, 470, 874, 530)}, file={'cn': './assets/cn/handler/LOGIN_GAME_UPDATE.png', 'en': './assets/en/handler/LOGIN_GAME_UPDATE.png'}) +LOGIN_CONFIRM = Button(area={'cn': (464, 372, 814, 426), 'en': (464, 372, 814, 426)}, color={'cn': (39, 174, 229), 'en': (39, 174, 229)}, button={'cn': (464, 372, 814, 426), 'en': (464, 372, 814, 426)}, file={'cn': './assets/cn/handler/LOGIN_CONFIRM.png', 'en': './assets/en/handler/LOGIN_CONFIRM.png'}) +LOGIN_GAME_UPDATE = Button(area={'cn': (700, 471, 873, 529), 'en': (700, 471, 873, 529)}, color={'cn': (238, 170, 78), 'en': (238, 170, 78)}, button={'cn': (700, 471, 873, 529), 'en': (700, 471, 873, 529)}, file={'cn': './assets/cn/handler/LOGIN_GAME_UPDATE.png', 'en': './assets/en/handler/LOGIN_GAME_UPDATE.png'}) LOGIN_RETURN_SIGN = Button(area={'cn': (1, 7, 104, 47), 'en': (1195, 524, 1272, 547)}, color={'cn': (158, 214, 229), 'en': (202, 202, 203)}, button={'cn': (1, 7, 104, 47), 'en': (1195, 524, 1272, 547)}, file={'cn': './assets/cn/handler/LOGIN_RETURN_SIGN.png', 'en': './assets/en/handler/LOGIN_RETURN_SIGN.png'}) MAP_AIR_RAID = Button(area={'cn': (350, 447, 1280, 472), 'en': (350, 447, 1280, 472)}, color={'cn': (154, 43, 46), 'en': (154, 43, 46)}, button={'cn': (350, 447, 1280, 472), 'en': (350, 447, 1280, 472)}, file={'cn': './assets/cn/handler/MAP_AIR_RAID.png', 'en': './assets/en/handler/MAP_AIR_RAID.png'}) MAP_AMBUSH = Button(area={'cn': (261, 433, 1280, 449), 'en': (261, 433, 1280, 449)}, color={'cn': (161, 41, 43), 'en': (161, 41, 43)}, button={'cn': (261, 433, 1280, 449), 'en': (261, 433, 1280, 449)}, file={'cn': './assets/cn/handler/MAP_AMBUSH.png', 'en': './assets/en/handler/MAP_AMBUSH.png'}) diff --git a/module/handler/login.py b/module/handler/login.py index 3877ce269..1cb79c865 100644 --- a/module/handler/login.py +++ b/module/handler/login.py @@ -26,6 +26,8 @@ class LoginHandler(Combat): continue if self.appear_then_click(LOGIN_RETURN_SIGN, offset=(30, 30), interval=1): continue + if self.appear_then_click(LOGIN_CONFIRM, offset=(30, 30), interval=1): + continue if self.info_bar_count() and self.appear_then_click(LOGIN_CHECK, interval=0.5): logger.info('Login success') diff --git a/module/map/fleet.py b/module/map/fleet.py index 996124cd3..421cca48b 100644 --- a/module/map/fleet.py +++ b/module/map/fleet.py @@ -50,11 +50,18 @@ class Fleet(Camera, MapOperation, AmbushHandler): @property def fleet_boss(self): - if self.config.FLEET_BOSS == 2 and self.config.FLEET_2: + if self.config.FLEET_BOSS == 2 or self.config.FLEET_2: return self.fleet_2 else: return self.fleet_1 + @property + def fleet_boss_index(self): + if self.config.FLEET_BOSS == 2 or self.config.FLEET_2: + return 1 + else: + return 1 + @property def fleet_step(self): if not self.config.MAP_HAS_FLEET_STEP: @@ -84,6 +91,7 @@ class Fleet(Camera, MapOperation, AmbushHandler): location (tuple, str, GridInfo): Destination. """ location = location_ensure(location) + siren_count = self.map.select(is_siren=True).count result_mystery = '' while 1: @@ -99,7 +107,7 @@ class Fleet(Camera, MapOperation, AmbushHandler): self.device.click(grid) arrived = False # Wait to confirm fleet arrived. It does't appear immediately if fleet in combat . - add = self.config.MAP_SIREN_MOVE_WAIT * self.config.MAP_SIREN_COUNT \ + add = self.config.MAP_SIREN_MOVE_WAIT * min(self.config.MAP_SIREN_COUNT, siren_count) \ if self.config.MAP_HAS_MOVABLE_ENEMY and not self.config.ENABLE_FAST_FORWARD else 0 arrive_timer = Timer(0.3 + add) arrive_unexpected_timer = Timer(1.5 + add) @@ -409,13 +417,18 @@ class Fleet(Camera, MapOperation, AmbushHandler): """ Args: grid (Grid): - fleet (int): 1, 2 + fleet (int, str): 1, 2, 'boss' Returns: bool: If accessible. """ if fleet is None: return grid.is_accessible + if isinstance(fleet, str) and fleet.isdigit(): + fleet = int(fleet) + if fleet == 'boss': + fleet = self.fleet_boss_index + if fleet == self.fleet_current_index: return grid.is_accessible else: diff --git a/module/template/assets.py b/module/template/assets.py index 01dd13943..6000000af 100644 --- a/module/template/assets.py +++ b/module/template/assets.py @@ -27,5 +27,8 @@ TEMPLATE_SIREN_Algerie = Template(file={'cn': './assets/cn/template/TEMPLATE_SIR TEMPLATE_SIREN_DD = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_DD.png', 'en': './assets/en/template/TEMPLATE_SIREN_DD.png'}) TEMPLATE_SIREN_LaGalissonniere = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_LaGalissonniere.png', 'en': './assets/en/template/TEMPLATE_SIREN_LaGalissonniere.png'}) TEMPLATE_SIREN_Vauquelin = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Vauquelin.png', 'en': './assets/en/template/TEMPLATE_SIREN_Vauquelin.png'}) +TEMPLATE_SIREN_Z18 = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Z18.png', 'en': './assets/cn/template/TEMPLATE_SIREN_Z18.png'}) +TEMPLATE_SIREN_Z19 = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Z19.png', 'en': './assets/cn/template/TEMPLATE_SIREN_Z19.png'}) +TEMPLATE_SIREN_Z2 = Template(file={'cn': './assets/cn/template/TEMPLATE_SIREN_Z2.png', 'en': './assets/cn/template/TEMPLATE_SIREN_Z2.png'}) TEMPLATE_STAGE_CLEAR = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_CLEAR.png', 'en': './assets/en/template/TEMPLATE_STAGE_CLEAR.png'}) TEMPLATE_STAGE_PERCENT = Template(file={'cn': './assets/cn/template/TEMPLATE_STAGE_PERCENT.png', 'en': './assets/en/template/TEMPLATE_STAGE_PERCENT.png'})