diff --git a/assets/cn/coalition/DATEALANE_AREA1.png b/assets/cn/coalition/DATEALANE_AREA1.png new file mode 100644 index 000000000..585f2a267 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_AREA1.png differ diff --git a/assets/cn/coalition/DATEALANE_AREA2.png b/assets/cn/coalition/DATEALANE_AREA2.png new file mode 100644 index 000000000..37015ee79 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_AREA2.png differ diff --git a/assets/cn/coalition/DATEALANE_AREA3.png b/assets/cn/coalition/DATEALANE_AREA3.png new file mode 100644 index 000000000..b2e46ff65 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_AREA3.png differ diff --git a/assets/cn/coalition/DATEALANE_AREA4.png b/assets/cn/coalition/DATEALANE_AREA4.png new file mode 100644 index 000000000..a3e17ec04 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_AREA4.png differ diff --git a/assets/cn/coalition/DATEALANE_AREA5.png b/assets/cn/coalition/DATEALANE_AREA5.png new file mode 100644 index 000000000..ca028de14 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_AREA5.png differ diff --git a/assets/cn/coalition/DATEALANE_AREA6.png b/assets/cn/coalition/DATEALANE_AREA6.png new file mode 100644 index 000000000..0ee3ebbe7 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_AREA6.png differ diff --git a/assets/cn/coalition/DATEALANE_COALITION_CHECK.png b/assets/cn/coalition/DATEALANE_COALITION_CHECK.png new file mode 100644 index 000000000..d5c4cb709 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_COALITION_CHECK.png differ diff --git a/assets/cn/coalition/DATEALANE_FLEET_PREPARATION.png b/assets/cn/coalition/DATEALANE_FLEET_PREPARATION.png new file mode 100644 index 000000000..40ff8512e Binary files /dev/null and b/assets/cn/coalition/DATEALANE_FLEET_PREPARATION.png differ diff --git a/assets/cn/coalition/DATEALANE_MODE_HARD.png b/assets/cn/coalition/DATEALANE_MODE_HARD.png new file mode 100644 index 000000000..6a4b020c0 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_MODE_HARD.png differ diff --git a/assets/cn/coalition/DATEALANE_MODE_NORMAL.png b/assets/cn/coalition/DATEALANE_MODE_NORMAL.png new file mode 100644 index 000000000..76699dd13 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_MODE_NORMAL.png differ diff --git a/assets/cn/coalition/DATEALANE_PREPARATION_EXIT.png b/assets/cn/coalition/DATEALANE_PREPARATION_EXIT.png new file mode 100644 index 000000000..3e7f959d8 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_PREPARATION_EXIT.png differ diff --git a/assets/cn/coalition/DATEALANE_PT_OCR.png b/assets/cn/coalition/DATEALANE_PT_OCR.png new file mode 100644 index 000000000..2b982399d Binary files /dev/null and b/assets/cn/coalition/DATEALANE_PT_OCR.png differ diff --git a/assets/cn/coalition/DATEALANE_SWITCH_MULTI.png b/assets/cn/coalition/DATEALANE_SWITCH_MULTI.png new file mode 100644 index 000000000..a9cd328d9 Binary files /dev/null and b/assets/cn/coalition/DATEALANE_SWITCH_MULTI.png differ diff --git a/assets/cn/coalition/DATEALANE_SWITCH_SINGLE.png b/assets/cn/coalition/DATEALANE_SWITCH_SINGLE.png new file mode 100644 index 000000000..9621d109c Binary files /dev/null and b/assets/cn/coalition/DATEALANE_SWITCH_SINGLE.png differ diff --git a/config/template.json b/config/template.json index 29d78707d..3b3efb77b 100644 --- a/config/template.json +++ b/config/template.json @@ -766,7 +766,8 @@ "AmbushEvade": true }, "Coalition": { - "Mode": "hard", + "Mode": "AREA-1", + "MapMode": "normal", "Fleet": "single" }, "StopCondition": { @@ -1353,7 +1354,8 @@ "AmbushEvade": true }, "Coalition": { - "Mode": "sp", + "Mode": "AREA-1", + "MapMode": "normal", "Fleet": "single" }, "StopCondition": { diff --git a/module/coalition/assets.py b/module/coalition/assets.py index 28c8f5325..da1649f35 100644 --- a/module/coalition/assets.py +++ b/module/coalition/assets.py @@ -21,6 +21,20 @@ COALITION_ACADEMY_GOTO_CAMPAIGN = Button(area={'cn': (1123, 615, 1159, 651), 'en COALITION_ACADEMY_HOME = Button(area={'cn': (1221, 48, 1244, 73), 'en': (1221, 48, 1244, 73), 'jp': (1221, 48, 1244, 73), 'tw': (1221, 48, 1244, 73)}, color={'cn': (182, 197, 203), 'en': (182, 197, 203), 'jp': (182, 197, 203), 'tw': (182, 197, 203)}, button={'cn': (1221, 48, 1244, 73), 'en': (1221, 48, 1244, 73), 'jp': (1221, 48, 1244, 73), 'tw': (1221, 48, 1244, 73)}, file={'cn': './assets/cn/coalition/COALITION_ACADEMY_HOME.png', 'en': './assets/en/coalition/COALITION_ACADEMY_HOME.png', 'jp': './assets/jp/coalition/COALITION_ACADEMY_HOME.png', 'tw': './assets/tw/coalition/COALITION_ACADEMY_HOME.png'}) COALITION_ACADEMY_MAIN_CHECK = Button(area={'cn': (132, 57, 163, 92), 'en': (164, 57, 221, 78), 'jp': (112, 44, 145, 86), 'tw': (346, 48, 427, 89)}, color={'cn': (143, 202, 205), 'en': (205, 189, 166), 'jp': (142, 155, 153), 'tw': (178, 145, 124)}, button={'cn': (132, 57, 163, 92), 'en': (164, 57, 221, 78), 'jp': (112, 44, 145, 86), 'tw': (346, 48, 427, 89)}, file={'cn': './assets/cn/coalition/COALITION_ACADEMY_MAIN_CHECK.png', 'en': './assets/en/coalition/COALITION_ACADEMY_MAIN_CHECK.png', 'jp': './assets/jp/coalition/COALITION_ACADEMY_MAIN_CHECK.png', 'tw': './assets/tw/coalition/COALITION_ACADEMY_MAIN_CHECK.png'}) COALITION_REWARD_CONFIRM = Button(area={'cn': (814, 611, 877, 637), 'en': (788, 612, 902, 634), 'jp': (814, 611, 876, 637), 'tw': (814, 611, 877, 637)}, color={'cn': (155, 186, 227), 'en': (162, 189, 226), 'jp': (143, 176, 219), 'tw': (150, 181, 221)}, button={'cn': (814, 611, 877, 637), 'en': (788, 612, 902, 634), 'jp': (814, 611, 876, 637), 'tw': (814, 611, 877, 637)}, file={'cn': './assets/cn/coalition/COALITION_REWARD_CONFIRM.png', 'en': './assets/en/coalition/COALITION_REWARD_CONFIRM.png', 'jp': './assets/jp/coalition/COALITION_REWARD_CONFIRM.png', 'tw': './assets/tw/coalition/COALITION_REWARD_CONFIRM.png'}) +DATEALANE_AREA1 = Button(area={'cn': (170, 478, 265, 573), 'en': (170, 478, 265, 573), 'jp': (170, 478, 265, 573), 'tw': (170, 478, 265, 573)}, color={'cn': (37, 90, 92), 'en': (37, 90, 92), 'jp': (37, 90, 92), 'tw': (37, 90, 92)}, button={'cn': (170, 478, 265, 573), 'en': (170, 478, 265, 573), 'jp': (170, 478, 265, 573), 'tw': (170, 478, 265, 573)}, file={'cn': './assets/cn/coalition/DATEALANE_AREA1.png', 'en': './assets/cn/coalition/DATEALANE_AREA1.png', 'jp': './assets/cn/coalition/DATEALANE_AREA1.png', 'tw': './assets/cn/coalition/DATEALANE_AREA1.png'}) +DATEALANE_AREA2 = Button(area={'cn': (420, 360, 515, 455), 'en': (420, 360, 515, 455), 'jp': (420, 360, 515, 455), 'tw': (420, 360, 515, 455)}, color={'cn': (52, 85, 88), 'en': (52, 85, 88), 'jp': (52, 85, 88), 'tw': (52, 85, 88)}, button={'cn': (420, 360, 515, 455), 'en': (420, 360, 515, 455), 'jp': (420, 360, 515, 455), 'tw': (420, 360, 515, 455)}, file={'cn': './assets/cn/coalition/DATEALANE_AREA2.png', 'en': './assets/cn/coalition/DATEALANE_AREA2.png', 'jp': './assets/cn/coalition/DATEALANE_AREA2.png', 'tw': './assets/cn/coalition/DATEALANE_AREA2.png'}) +DATEALANE_AREA3 = Button(area={'cn': (770, 471, 865, 566), 'en': (770, 471, 865, 566), 'jp': (770, 471, 865, 566), 'tw': (770, 471, 865, 566)}, color={'cn': (51, 78, 81), 'en': (51, 78, 81), 'jp': (51, 78, 81), 'tw': (51, 78, 81)}, button={'cn': (770, 471, 865, 566), 'en': (770, 471, 865, 566), 'jp': (770, 471, 865, 566), 'tw': (770, 471, 865, 566)}, file={'cn': './assets/cn/coalition/DATEALANE_AREA3.png', 'en': './assets/cn/coalition/DATEALANE_AREA3.png', 'jp': './assets/cn/coalition/DATEALANE_AREA3.png', 'tw': './assets/cn/coalition/DATEALANE_AREA3.png'}) +DATEALANE_AREA4 = Button(area={'cn': (902, 228, 997, 323), 'en': (902, 228, 997, 323), 'jp': (902, 228, 997, 323), 'tw': (902, 228, 997, 323)}, color={'cn': (50, 83, 85), 'en': (50, 83, 85), 'jp': (50, 83, 85), 'tw': (50, 83, 85)}, button={'cn': (902, 228, 997, 323), 'en': (902, 228, 997, 323), 'jp': (902, 228, 997, 323), 'tw': (902, 228, 997, 323)}, file={'cn': './assets/cn/coalition/DATEALANE_AREA4.png', 'en': './assets/cn/coalition/DATEALANE_AREA4.png', 'jp': './assets/cn/coalition/DATEALANE_AREA4.png', 'tw': './assets/cn/coalition/DATEALANE_AREA4.png'}) +DATEALANE_AREA5 = Button(area={'cn': (535, 113, 630, 208), 'en': (535, 113, 630, 208), 'jp': (535, 113, 630, 208), 'tw': (535, 113, 630, 208)}, color={'cn': (49, 89, 88), 'en': (49, 89, 88), 'jp': (49, 89, 88), 'tw': (49, 89, 88)}, button={'cn': (535, 113, 630, 208), 'en': (535, 113, 630, 208), 'jp': (535, 113, 630, 208), 'tw': (535, 113, 630, 208)}, file={'cn': './assets/cn/coalition/DATEALANE_AREA5.png', 'en': './assets/cn/coalition/DATEALANE_AREA5.png', 'jp': './assets/cn/coalition/DATEALANE_AREA5.png', 'tw': './assets/cn/coalition/DATEALANE_AREA5.png'}) +DATEALANE_AREA6 = Button(area={'cn': (644, 283, 739, 378), 'en': (644, 283, 739, 378), 'jp': (644, 283, 739, 378), 'tw': (644, 283, 739, 378)}, color={'cn': (51, 89, 90), 'en': (51, 89, 90), 'jp': (51, 89, 90), 'tw': (51, 89, 90)}, button={'cn': (644, 283, 739, 378), 'en': (644, 283, 739, 378), 'jp': (644, 283, 739, 378), 'tw': (644, 283, 739, 378)}, file={'cn': './assets/cn/coalition/DATEALANE_AREA6.png', 'en': './assets/cn/coalition/DATEALANE_AREA6.png', 'jp': './assets/cn/coalition/DATEALANE_AREA6.png', 'tw': './assets/cn/coalition/DATEALANE_AREA6.png'}) +DATEALANE_COALITION_CHECK = Button(area={'cn': (117, 12, 172, 40), 'en': (117, 12, 172, 40), 'jp': (117, 12, 172, 40), 'tw': (117, 12, 172, 40)}, color={'cn': (143, 161, 204), 'en': (143, 161, 204), 'jp': (143, 161, 204), 'tw': (143, 161, 204)}, button={'cn': (117, 12, 172, 40), 'en': (117, 12, 172, 40), 'jp': (117, 12, 172, 40), 'tw': (117, 12, 172, 40)}, file={'cn': './assets/cn/coalition/DATEALANE_COALITION_CHECK.png', 'en': './assets/cn/coalition/DATEALANE_COALITION_CHECK.png', 'jp': './assets/cn/coalition/DATEALANE_COALITION_CHECK.png', 'tw': './assets/cn/coalition/DATEALANE_COALITION_CHECK.png'}) +DATEALANE_FLEET_PREPARATION = Button(area={'cn': (1016, 529, 1100, 550), 'en': (1016, 529, 1100, 550), 'jp': (1016, 529, 1100, 550), 'tw': (1016, 529, 1100, 550)}, color={'cn': (135, 215, 236), 'en': (135, 215, 236), 'jp': (135, 215, 236), 'tw': (135, 215, 236)}, button={'cn': (1016, 529, 1100, 550), 'en': (1016, 529, 1100, 550), 'jp': (1016, 529, 1100, 550), 'tw': (1016, 529, 1100, 550)}, file={'cn': './assets/cn/coalition/DATEALANE_FLEET_PREPARATION.png', 'en': './assets/cn/coalition/DATEALANE_FLEET_PREPARATION.png', 'jp': './assets/cn/coalition/DATEALANE_FLEET_PREPARATION.png', 'tw': './assets/cn/coalition/DATEALANE_FLEET_PREPARATION.png'}) +DATEALANE_MODE_HARD = Button(area={'cn': (925, 587, 999, 607), 'en': (925, 587, 999, 607), 'jp': (925, 587, 999, 607), 'tw': (925, 587, 999, 607)}, color={'cn': (239, 170, 188), 'en': (239, 170, 188), 'jp': (239, 170, 188), 'tw': (239, 170, 188)}, button={'cn': (925, 587, 999, 607), 'en': (925, 587, 999, 607), 'jp': (925, 587, 999, 607), 'tw': (925, 587, 999, 607)}, file={'cn': './assets/cn/coalition/DATEALANE_MODE_HARD.png', 'en': './assets/cn/coalition/DATEALANE_MODE_HARD.png', 'jp': './assets/cn/coalition/DATEALANE_MODE_HARD.png', 'tw': './assets/cn/coalition/DATEALANE_MODE_HARD.png'}) +DATEALANE_MODE_NORMAL = Button(area={'cn': (634, 587, 706, 606), 'en': (634, 587, 706, 606), 'jp': (634, 587, 706, 606), 'tw': (634, 587, 706, 606)}, color={'cn': (150, 218, 193), 'en': (150, 218, 193), 'jp': (150, 218, 193), 'tw': (150, 218, 193)}, button={'cn': (634, 587, 706, 606), 'en': (634, 587, 706, 606), 'jp': (634, 587, 706, 606), 'tw': (634, 587, 706, 606)}, file={'cn': './assets/cn/coalition/DATEALANE_MODE_NORMAL.png', 'en': './assets/cn/coalition/DATEALANE_MODE_NORMAL.png', 'jp': './assets/cn/coalition/DATEALANE_MODE_NORMAL.png', 'tw': './assets/cn/coalition/DATEALANE_MODE_NORMAL.png'}) +DATEALANE_PREPARATION_EXIT = Button(area={'cn': (1208, 71, 1244, 107), 'en': (1208, 71, 1244, 107), 'jp': (1208, 71, 1244, 107), 'tw': (1208, 71, 1244, 107)}, color={'cn': (121, 158, 173), 'en': (121, 158, 173), 'jp': (121, 158, 173), 'tw': (121, 158, 173)}, button={'cn': (1208, 71, 1244, 107), 'en': (1208, 71, 1244, 107), 'jp': (1208, 71, 1244, 107), 'tw': (1208, 71, 1244, 107)}, file={'cn': './assets/cn/coalition/DATEALANE_PREPARATION_EXIT.png', 'en': './assets/cn/coalition/DATEALANE_PREPARATION_EXIT.png', 'jp': './assets/cn/coalition/DATEALANE_PREPARATION_EXIT.png', 'tw': './assets/cn/coalition/DATEALANE_PREPARATION_EXIT.png'}) +DATEALANE_PT_OCR = Button(area={'cn': (1188, 135, 1272, 157), 'en': (1188, 135, 1272, 157), 'jp': (1188, 135, 1272, 157), 'tw': (1188, 135, 1272, 157)}, color={'cn': (100, 101, 70), 'en': (100, 101, 70), 'jp': (100, 101, 70), 'tw': (100, 101, 70)}, button={'cn': (1188, 135, 1272, 157), 'en': (1188, 135, 1272, 157), 'jp': (1188, 135, 1272, 157), 'tw': (1188, 135, 1272, 157)}, file={'cn': './assets/cn/coalition/DATEALANE_PT_OCR.png', 'en': './assets/cn/coalition/DATEALANE_PT_OCR.png', 'jp': './assets/cn/coalition/DATEALANE_PT_OCR.png', 'tw': './assets/cn/coalition/DATEALANE_PT_OCR.png'}) +DATEALANE_SWITCH_MULTI = Button(area={'cn': (1060, 473, 1204, 500), 'en': (1060, 473, 1204, 500), 'jp': (1060, 473, 1204, 500), 'tw': (1060, 473, 1204, 500)}, color={'cn': (225, 225, 225), 'en': (225, 225, 225), 'jp': (225, 225, 225), 'tw': (225, 225, 225)}, button={'cn': (1060, 473, 1204, 500), 'en': (1060, 473, 1204, 500), 'jp': (1060, 473, 1204, 500), 'tw': (1060, 473, 1204, 500)}, file={'cn': './assets/cn/coalition/DATEALANE_SWITCH_MULTI.png', 'en': './assets/cn/coalition/DATEALANE_SWITCH_MULTI.png', 'jp': './assets/cn/coalition/DATEALANE_SWITCH_MULTI.png', 'tw': './assets/cn/coalition/DATEALANE_SWITCH_MULTI.png'}) +DATEALANE_SWITCH_SINGLE = Button(area={'cn': (910, 473, 1055, 500), 'en': (910, 473, 1055, 500), 'jp': (910, 473, 1055, 500), 'tw': (910, 473, 1055, 500)}, color={'cn': (223, 223, 223), 'en': (223, 223, 223), 'jp': (223, 223, 223), 'tw': (223, 223, 223)}, button={'cn': (910, 473, 1055, 500), 'en': (910, 473, 1055, 500), 'jp': (910, 473, 1055, 500), 'tw': (910, 473, 1055, 500)}, file={'cn': './assets/cn/coalition/DATEALANE_SWITCH_SINGLE.png', 'en': './assets/cn/coalition/DATEALANE_SWITCH_SINGLE.png', 'jp': './assets/cn/coalition/DATEALANE_SWITCH_SINGLE.png', 'tw': './assets/cn/coalition/DATEALANE_SWITCH_SINGLE.png'}) EMPTY_FLAGSHIP = Button(area={'cn': (247, 237, 277, 267), 'en': (247, 237, 277, 267), 'jp': (247, 237, 277, 267), 'tw': (247, 237, 277, 267)}, color={'cn': (76, 64, 56), 'en': (76, 64, 56), 'jp': (76, 64, 56), 'tw': (76, 64, 56)}, button={'cn': (247, 237, 277, 267), 'en': (247, 237, 277, 267), 'jp': (247, 237, 277, 267), 'tw': (247, 237, 277, 267)}, file={'cn': './assets/cn/coalition/EMPTY_FLAGSHIP.png', 'en': './assets/cn/coalition/EMPTY_FLAGSHIP.png', 'jp': './assets/cn/coalition/EMPTY_FLAGSHIP.png', 'tw': './assets/cn/coalition/EMPTY_FLAGSHIP.png'}) EMPTY_VANGUARD = Button(area={'cn': (515, 237, 545, 267), 'en': (515, 237, 545, 267), 'jp': (515, 237, 545, 267), 'tw': (515, 237, 545, 267)}, color={'cn': (52, 52, 53), 'en': (52, 52, 53), 'jp': (52, 52, 53), 'tw': (52, 52, 53)}, button={'cn': (515, 237, 545, 267), 'en': (515, 237, 545, 267), 'jp': (515, 237, 545, 267), 'tw': (515, 237, 545, 267)}, file={'cn': './assets/cn/coalition/EMPTY_VANGUARD.png', 'en': './assets/cn/coalition/EMPTY_VANGUARD.png', 'jp': './assets/cn/coalition/EMPTY_VANGUARD.png', 'tw': './assets/cn/coalition/EMPTY_VANGUARD.png'}) FLEET_NOT_PREPARED = Button(area={'cn': (1008, 310, 1110, 334), 'en': (1008, 310, 1110, 334), 'jp': (1008, 310, 1110, 334), 'tw': (1008, 310, 1110, 334)}, color={'cn': (106, 106, 112), 'en': (106, 106, 112), 'jp': (106, 106, 112), 'tw': (108, 107, 112)}, button={'cn': (1008, 310, 1110, 334), 'en': (1008, 310, 1110, 334), 'jp': (1008, 310, 1110, 334), 'tw': (1008, 310, 1110, 334)}, file={'cn': './assets/cn/coalition/FLEET_NOT_PREPARED.png', 'en': './assets/cn/coalition/FLEET_NOT_PREPARED.png', 'jp': './assets/cn/coalition/FLEET_NOT_PREPARED.png', 'tw': './assets/tw/coalition/FLEET_NOT_PREPARED.png'}) diff --git a/module/coalition/coalition.py b/module/coalition/coalition.py index 3a16dfd2f..9e98fe296 100644 --- a/module/coalition/coalition.py +++ b/module/coalition/coalition.py @@ -44,6 +44,8 @@ class Coalition(CoalitionCombat, CampaignEvent): elif event == 'coalition_20250626': # use generic ocr model ocr = Digit(NEONCITY_PT_OCR, name='OCR_PT', lang='cnocr', letter=(208, 208, 208), threshold=128) + elif event == 'coalition_20251120': + ocr = Digit(DATEALANE_PT_OCR, name='OCR_PT', letter=(250, 213, 69), threshold=128) else: logger.error(f'ocr object is not defined in event {event}') raise ScriptError @@ -101,12 +103,13 @@ class Coalition(CoalitionCombat, CampaignEvent): return False - def coalition_execute_once(self, event, stage, fleet): + def coalition_execute_once(self, event, stage, fleet, map_mode): """ Args: event: stage: fleet: + map_mode: Pages: in: in_coalition @@ -132,27 +135,29 @@ class Coalition(CoalitionCombat, CampaignEvent): self.coalition_map_exit(event) raise - self.enter_map(event=event, stage=stage, mode=fleet) - oil_check_boolean=True if self.config.SERVER not in ['tw'] else False - if self.triggered_stop_condition(oil_check=oil_check_boolean): - self.coalition_map_exit(event) - raise ScriptEnd + + self.enter_map(event=event, stage=stage, mode=fleet, map_mode=map_mode) + oil_check_boolean = True if self.config.SERVER not in ['tw'] else False + # if self.triggered_stop_condition(oil_check=oil_check_boolean): + # self.coalition_map_exit(event) + # raise ScriptEnd self.coalition_combat() @staticmethod def handle_stage_name(event, stage): stage = re.sub('[ \t\n]', '', str(stage)).lower() - if event == 'coalition_20230323': + if event in ['coalition_20230323', 'coalition_20251120']: stage = stage.replace('-', '') return event, stage - def run(self, event='', mode='', fleet='', total=0): + def run(self, event='', mode='', fleet='', map_mode='normal', total=0): event = event if event else self.config.Campaign_Event mode = mode if mode else self.config.Coalition_Mode fleet = fleet if fleet else self.config.Coalition_Fleet - if not event or not mode or not fleet: - raise ScriptError(f'Coalition arguments unfilled. name={event}, mode={mode}, fleet={fleet}') + map_mode = self.config.Coalition_MapMode + if not event or not mode or not fleet or not map_mode: + raise ScriptError(f'Coalition arguments unfilled. name={event}, mode={mode}, fleet={fleet}, map_mode={map_mode}') event, mode = self.handle_stage_name(event, mode) self.run_count = 0 @@ -189,7 +194,7 @@ class Coalition(CoalitionCombat, CampaignEvent): self.device.stuck_record_clear() self.device.click_record_clear() try: - self.coalition_execute_once(event=event, stage=mode, fleet=fleet) + self.coalition_execute_once(event=event, stage=mode, fleet=fleet, map_mode=map_mode) except ScriptEnd as e: logger.hr('Script end') logger.info(str(e)) diff --git a/module/coalition/ui.py b/module/coalition/ui.py index 5570735a0..26bd792af 100644 --- a/module/coalition/ui.py +++ b/module/coalition/ui.py @@ -46,6 +46,9 @@ class CoalitionUI(Combat): mode_switch = NeoncitySwitch('CoalitionMode', offset=(20, 20)) mode_switch.add_state('story', NEONCITY_MODE_STORY) mode_switch.add_state('battle', NEONCITY_MODE_BATTLE) + elif event == 'coalition_20251120': + # coalition 20251120 has no story mode + return True else: logger.error(f'MODE_SWITCH is not defined in event {event}') raise ScriptError @@ -76,6 +79,9 @@ class CoalitionUI(Combat): elif event == 'coalition_20250626': fleet_switch.add_state('single', NEONCITY_SWITCH_SINGLE) fleet_switch.add_state('multi', NEONCITY_SWITCH_MULTI) + elif event == 'coalition_20251120': + fleet_switch.add_state('single', DATEALANE_SWITCH_SINGLE) + fleet_switch.add_state('multi', DATEALANE_SWITCH_MULTI) else: logger.error(f'FLEET_SWITCH is not defined in event {event}') raise ScriptError @@ -115,6 +121,13 @@ class CoalitionUI(Combat): ('coalition_20250626', 'hard'): NEONCITY_HARD, ('coalition_20250626', 'sp'): NEONCITY_SP, ('coalition_20250626', 'ex'): NEONCITY_EX, + + ('coalition_20251120', 'area1'): DATEALANE_AREA1, + ('coalition_20251120', 'area2'): DATEALANE_AREA2, + ('coalition_20251120', 'area3'): DATEALANE_AREA3, + ('coalition_20251120', 'area4'): DATEALANE_AREA4, + ('coalition_20251120', 'area5'): DATEALANE_AREA5, + ('coalition_20251120', 'area6'): DATEALANE_AREA6, } stage = stage.lower() try: @@ -151,6 +164,13 @@ class CoalitionUI(Combat): ('coalition_20250626', 'hard'): 3, ('coalition_20250626', 'sp'): 4, ('coalition_20250626', 'ex'): 5, + + ('coalition_20251120', 'area1'): 2, + ('coalition_20251120', 'area2'): 3, + ('coalition_20251120', 'area3'): 3, + ('coalition_20251120', 'area4'): 3, + ('coalition_20251120', 'area5'): 3, + ('coalition_20251120', 'area6'): 4, } stage = stage.lower() try: @@ -174,10 +194,33 @@ class CoalitionUI(Combat): return ACEDEMY_FLEET_PREPARATION elif event == 'coalition_20250626': return NEONCITY_FLEET_PREPARATION + elif event == 'coalition_20251120': + return DATEALANE_FLEET_PREPARATION else: logger.error(f'FLEET_PREPARATION is not defined in event {event}') raise ScriptError + def coalition_get_mode_switch(self, event, mode): + """ + Args: + event (str): Event name. + mode (str): 'normal' or 'hard' + + Returns: + Button: + """ + if event == 'coalition_20251120': + if mode == 'normal': + return DATEALANE_MODE_NORMAL + elif mode == 'hard': + return DATEALANE_MODE_HARD + else: + logger.error(f'Mode switch is not defined in event {event}') + raise ScriptError + else: + logger.error(f'Mode switch is not defined in event {event}') + raise ScriptError + def handle_fleet_preparation(self, event, stage, mode): """ Args: @@ -222,17 +265,16 @@ class CoalitionUI(Combat): logger.info(f'{BATTLE_PREPARATION} -> {BACK_ARROW}') self.device.click(BACK_ARROW) continue - if self.appear(fleet_preparation, offset=(20, 20), interval=3): - logger.info(f'{fleet_preparation} -> {NEONCITY_PREPARATION_EXIT}') - self.device.click(NEONCITY_PREPARATION_EXIT) + if self.appear_then_click(DATEALANE_PREPARATION_EXIT, offset=(50, 100), interval=1): continue - def enter_map(self, event, stage, mode, skip_first_screenshot=True): + def enter_map(self, event, stage, mode, map_mode='normal', skip_first_screenshot=True): """ Args: event (str): Event name such as 'coalition_20230323' stage (str): Stage name such as 'TC3' mode (str): 'single' or 'multi' + map_mode (str): 'normal' or 'hard' skip_first_screenshot: Pages: @@ -241,10 +283,13 @@ class CoalitionUI(Combat): """ button = self.coalition_get_entrance(event, stage) fleet_preparation = self.coalition_get_fleet_preparation(event) + mode_switch = self.coalition_get_mode_switch(event, map_mode) campaign_timer = Timer(5) + mode_timer = Timer(5) fleet_timer = Timer(5) campaign_click = 0 fleet_click = 0 + mode_click = 0 while 1: if skip_first_screenshot: skip_first_screenshot = False @@ -264,6 +309,9 @@ class CoalitionUI(Combat): "This stage can only be farmed once a day, " "but it's the second time that you are entering") raise RequestHumanTakeover + if mode_click > 5: + logger.critical(f"Failed to enter {button}, too many click on {mode_switch}") + raise RequestHumanTakeover if self.appear(FLEET_NOT_PREPARED, offset=(20, 20)): logger.critical('FLEET_NOT_PREPARED') logger.critical('Please prepare you fleets before running coalition battles') @@ -289,6 +337,14 @@ class CoalitionUI(Combat): campaign_timer.reset() continue + # Stage mode + if mode_timer.reached() and self.appear(mode_switch, offset=(20, 20)): + self.device.click(mode_switch) + mode_click += 1 + mode_timer.reset() + campaign_timer.reset() + continue + # Fleet preparation if fleet_timer.reached() and self.appear(fleet_preparation, offset=(20, 50)): self.handle_fleet_preparation(event, stage, mode) diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 88accb124..c0f23c438 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -3833,12 +3833,22 @@ "Coalition": { "Mode": { "type": "select", - "value": "hard", + "value": "AREA-1", + "option": [ + "AREA-1", + "AREA-2", + "AREA-3", + "AREA-4", + "AREA-5", + "AREA-6" + ] + }, + "MapMode": { + "type": "select", + "value": "normal", "option": [ - "easy", "normal", - "hard", - "ex" + "hard" ] }, "Fleet": { @@ -7085,15 +7095,23 @@ "Coalition": { "Mode": { "type": "select", - "value": "sp", + "value": "AREA-1", + "option": [ + "AREA-1", + "AREA-2", + "AREA-3", + "AREA-4", + "AREA-5", + "AREA-6" + ] + }, + "MapMode": { + "type": "select", + "value": "normal", "option": [ - "easy", "normal", - "hard", - "sp", - "ex" - ], - "display": "hide" + "hard" + ] }, "Fleet": { "type": "select", diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 886b537a2..770da4f87 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -337,8 +337,11 @@ MaritimeEscort: Enable: true Coalition: Mode: - value: hard - option: [ easy, normal, hard, sp, ex ] + value: AREA-1 + option: [ AREA-1, AREA-2, AREA-3, AREA-4, AREA-5, AREA-6 ] + MapMode: + value: normal + option: [ normal, hard ] Fleet: value: single option: [ single, multi ] diff --git a/module/config/argument/override.yaml b/module/config/argument/override.yaml index 1bdffbd22..d2db5454c 100644 --- a/module/config/argument/override.yaml +++ b/module/config/argument/override.yaml @@ -261,9 +261,6 @@ Coalition: UseAutoSearch: false Use2xBook: false AmbushEvade: true - Coalition: - Mode: - option: [ easy, normal, hard, ex ] StopCondition: MapAchievement: non_stop StageIncrease: false diff --git a/module/config/config_generated.py b/module/config/config_generated.py index 91ce85c34..278fe700a 100644 --- a/module/config/config_generated.py +++ b/module/config/config_generated.py @@ -195,7 +195,8 @@ class GeneratedConfig: MaritimeEscort_Enable = True # Group `Coalition` - Coalition_Mode = 'hard' # easy, normal, hard, sp, ex + Coalition_Mode = 'AREA-1' # AREA-1, AREA-2, AREA-3, AREA-4, AREA-5, AREA-6 + Coalition_MapMode = 'normal' # normal, hard Coalition_Fleet = 'single' # single, multi # Group `Commission` diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 577ba482c..348b64df3 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -1402,11 +1402,18 @@ "Mode": { "name": "Mode", "help": "SP needs to use event daily SP to run", - "easy": "Easy", - "normal": "Normal", - "hard": "Hard", - "sp": "SP", - "ex": "EX" + "AREA-1": "AREA-1", + "AREA-2": "AREA-2", + "AREA-3": "AREA-3", + "AREA-4": "AREA-4", + "AREA-5": "AREA-5", + "AREA-6": "AREA-6" + }, + "MapMode": { + "name": "Coalition.MapMode.name", + "help": "Coalition.MapMode.help", + "normal": "normal", + "hard": "hard" }, "Fleet": { "name": "Fleet", diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index 3b564d3a2..c9a141b3b 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -1402,11 +1402,18 @@ "Mode": { "name": "Coalition.Mode.name", "help": "Coalition.Mode.help", - "easy": "easy", + "AREA-1": "AREA-1", + "AREA-2": "AREA-2", + "AREA-3": "AREA-3", + "AREA-4": "AREA-4", + "AREA-5": "AREA-5", + "AREA-6": "AREA-6" + }, + "MapMode": { + "name": "Coalition.MapMode.name", + "help": "Coalition.MapMode.help", "normal": "normal", - "hard": "hard", - "sp": "sp", - "ex": "ex" + "hard": "hard" }, "Fleet": { "name": "Coalition.Fleet.name", diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index 5dd623ad3..2cee1659b 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -87,7 +87,7 @@ "help": "" }, "Coalition": { - "name": "迷彩都市的寻踪者", + "name": "DATE A LANE", "help": "" }, "MaritimeEscort": { @@ -123,7 +123,7 @@ "help": "" }, "CoalitionSp": { - "name": "迷彩都市的寻踪者SP", + "name": "DATE A LANE SP", "help": "" }, "Commission": { @@ -1400,13 +1400,20 @@ "help": "出击前必须在游戏内手动配队" }, "Mode": { + "name": "关卡名称", + "help": "", + "AREA-1": "AREA-1", + "AREA-2": "AREA-2", + "AREA-3": "AREA-3", + "AREA-4": "AREA-4", + "AREA-5": "AREA-5", + "AREA-6": "AREA-6" + }, + "MapMode": { "name": "难度", - "help": "SP图需要使用活动每日SP运行", - "easy": "简单", + "help": "", "normal": "普通", - "hard": "困难", - "sp": "SP", - "ex": "EX" + "hard": "困难" }, "Fleet": { "name": "出击队伍", diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index 2a6683e77..47d0020e4 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -1402,11 +1402,18 @@ "Mode": { "name": "難度", "help": "SP圖需要使用活動每日SP運行", - "easy": "簡單", - "normal": "普通", - "hard": "困難", - "sp": "sp", - "ex": "EX" + "AREA-1": "AREA-1", + "AREA-2": "AREA-2", + "AREA-3": "AREA-3", + "AREA-4": "AREA-4", + "AREA-5": "AREA-5", + "AREA-6": "AREA-6" + }, + "MapMode": { + "name": "Coalition.MapMode.name", + "help": "Coalition.MapMode.help", + "normal": "normal", + "hard": "hard" }, "Fleet": { "name": "出擊隊伍", diff --git a/module/ui/page.py b/module/ui/page.py index eddc77d76..b634c0a12 100644 --- a/module/ui/page.py +++ b/module/ui/page.py @@ -145,9 +145,14 @@ page_campaign.link(button=CAMPAIGN_GOTO_EVENT, destination=page_sp) # page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) # page_coalition_menu.link(button=COALITION_ACADEMY_GOTO_CAMPAIGN, destination=page_coalition) # NEONCITY -page_coalition = Page(NEONCITY_COALITION_CHECK) -page_coalition.link(button=NEONCITY_UI_HOME, destination=page_main) -page_coalition.link(button=NEONCITY_UI_BACK, destination=page_campaign) +# page_coalition = Page(NEONCITY_COALITION_CHECK) +# page_coalition.link(button=NEONCITY_UI_HOME, destination=page_main) +# page_coalition.link(button=NEONCITY_UI_BACK, destination=page_campaign) +# page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) +# DATEALANE +page_coalition = Page(DATEALANE_COALITION_CHECK) +page_coalition.link(button=GOTO_MAIN, destination=page_main) +page_coalition.link(button=BACK_ARROW, destination=page_campaign) page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) # Operation Siren