1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-09 18:39:04 +08:00

Add: FASHION Coalition assets

This commit is contained in:
LmeSzinc 2026-01-23 02:36:07 +08:00
parent c37a52bf9c
commit b65a951ce4
16 changed files with 87 additions and 28 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@ -36,6 +36,17 @@ DAL_SWITCH_MULTI = Button(area={'cn': (1060, 473, 1204, 500), 'en': (1061, 474,
DAL_SWITCH_SINGLE = Button(area={'cn': (910, 473, 1055, 500), 'en': (915, 475, 1051, 499), 'jp': (917, 474, 1035, 499), 'tw': (945, 478, 1013, 495)}, color={'cn': (223, 223, 223), 'en': (193, 193, 193), 'jp': (215, 215, 215), 'tw': (168, 168, 168)}, button={'cn': (910, 473, 1055, 500), 'en': (915, 475, 1051, 499), 'jp': (917, 474, 1035, 499), 'tw': (945, 478, 1013, 495)}, file={'cn': './assets/cn/coalition/DAL_SWITCH_SINGLE.png', 'en': './assets/en/coalition/DAL_SWITCH_SINGLE.png', 'jp': './assets/jp/coalition/DAL_SWITCH_SINGLE.png', 'tw': './assets/tw/coalition/DAL_SWITCH_SINGLE.png'}) DAL_SWITCH_SINGLE = Button(area={'cn': (910, 473, 1055, 500), 'en': (915, 475, 1051, 499), 'jp': (917, 474, 1035, 499), 'tw': (945, 478, 1013, 495)}, color={'cn': (223, 223, 223), 'en': (193, 193, 193), 'jp': (215, 215, 215), 'tw': (168, 168, 168)}, button={'cn': (910, 473, 1055, 500), 'en': (915, 475, 1051, 499), 'jp': (917, 474, 1035, 499), 'tw': (945, 478, 1013, 495)}, file={'cn': './assets/cn/coalition/DAL_SWITCH_SINGLE.png', 'en': './assets/en/coalition/DAL_SWITCH_SINGLE.png', 'jp': './assets/jp/coalition/DAL_SWITCH_SINGLE.png', 'tw': './assets/tw/coalition/DAL_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_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'}) 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'})
FASHION_COALITION_CHECK = Button(area={'cn': (102, 19, 177, 51), 'en': (102, 19, 177, 51), 'jp': (102, 19, 177, 51), 'tw': (102, 19, 177, 51)}, color={'cn': (109, 104, 89), 'en': (109, 104, 89), 'jp': (109, 104, 89), 'tw': (109, 104, 89)}, button={'cn': (102, 19, 177, 51), 'en': (102, 19, 177, 51), 'jp': (102, 19, 177, 51), 'tw': (102, 19, 177, 51)}, file={'cn': './assets/cn/coalition/FASHION_COALITION_CHECK.png', 'en': './assets/cn/coalition/FASHION_COALITION_CHECK.png', 'jp': './assets/cn/coalition/FASHION_COALITION_CHECK.png', 'tw': './assets/cn/coalition/FASHION_COALITION_CHECK.png'})
FASHION_EASY = Button(area={'cn': (136, 223, 199, 263), 'en': (136, 223, 199, 263), 'jp': (136, 223, 199, 263), 'tw': (136, 223, 199, 263)}, color={'cn': (225, 199, 197), 'en': (225, 199, 197), 'jp': (225, 199, 197), 'tw': (225, 199, 197)}, button={'cn': (136, 223, 199, 263), 'en': (136, 223, 199, 263), 'jp': (136, 223, 199, 263), 'tw': (136, 223, 199, 263)}, file={'cn': './assets/cn/coalition/FASHION_EASY.png', 'en': './assets/cn/coalition/FASHION_EASY.png', 'jp': './assets/cn/coalition/FASHION_EASY.png', 'tw': './assets/cn/coalition/FASHION_EASY.png'})
FASHION_EX = Button(area={'cn': (844, 246, 923, 301), 'en': (844, 246, 923, 301), 'jp': (844, 246, 923, 301), 'tw': (844, 246, 923, 301)}, color={'cn': (140, 115, 114), 'en': (140, 115, 114), 'jp': (140, 115, 114), 'tw': (140, 115, 114)}, button={'cn': (844, 246, 923, 301), 'en': (844, 246, 923, 301), 'jp': (844, 246, 923, 301), 'tw': (844, 246, 923, 301)}, file={'cn': './assets/cn/coalition/FASHION_EX.png', 'en': './assets/cn/coalition/FASHION_EX.png', 'jp': './assets/cn/coalition/FASHION_EX.png', 'tw': './assets/cn/coalition/FASHION_EX.png'})
FASHION_HARD = Button(area={'cn': (485, 167, 554, 215), 'en': (485, 167, 554, 215), 'jp': (485, 167, 554, 215), 'tw': (485, 167, 554, 215)}, color={'cn': (152, 136, 129), 'en': (152, 136, 129), 'jp': (152, 136, 129), 'tw': (152, 136, 129)}, button={'cn': (485, 167, 554, 215), 'en': (485, 167, 554, 215), 'jp': (485, 167, 554, 215), 'tw': (485, 167, 554, 215)}, file={'cn': './assets/cn/coalition/FASHION_HARD.png', 'en': './assets/cn/coalition/FASHION_HARD.png', 'jp': './assets/cn/coalition/FASHION_HARD.png', 'tw': './assets/cn/coalition/FASHION_HARD.png'})
FASHION_MODE_BATTLE = Button(area={'cn': (152, 635, 213, 669), 'en': (152, 635, 213, 669), 'jp': (152, 635, 213, 669), 'tw': (152, 635, 213, 669)}, color={'cn': (140, 133, 117), 'en': (140, 133, 117), 'jp': (140, 133, 117), 'tw': (140, 133, 117)}, button={'cn': (152, 635, 213, 669), 'en': (152, 635, 213, 669), 'jp': (152, 635, 213, 669), 'tw': (152, 635, 213, 669)}, file={'cn': './assets/cn/coalition/FASHION_MODE_BATTLE.png', 'en': './assets/cn/coalition/FASHION_MODE_BATTLE.png', 'jp': './assets/cn/coalition/FASHION_MODE_BATTLE.png', 'tw': './assets/cn/coalition/FASHION_MODE_BATTLE.png'})
FASHION_MODE_STORY = Button(area={'cn': (154, 629, 220, 666), 'en': (154, 629, 220, 666), 'jp': (154, 629, 220, 666), 'tw': (154, 629, 220, 666)}, color={'cn': (141, 134, 116), 'en': (141, 134, 116), 'jp': (141, 134, 116), 'tw': (141, 134, 116)}, button={'cn': (154, 629, 220, 666), 'en': (154, 629, 220, 666), 'jp': (154, 629, 220, 666), 'tw': (154, 629, 220, 666)}, file={'cn': './assets/cn/coalition/FASHION_MODE_STORY.png', 'en': './assets/cn/coalition/FASHION_MODE_STORY.png', 'jp': './assets/cn/coalition/FASHION_MODE_STORY.png', 'tw': './assets/cn/coalition/FASHION_MODE_STORY.png'})
FASHION_NORMAL = Button(area={'cn': (322, 295, 392, 334), 'en': (322, 295, 392, 334), 'jp': (322, 295, 392, 334), 'tw': (322, 295, 392, 334)}, color={'cn': (219, 196, 198), 'en': (219, 196, 198), 'jp': (219, 196, 198), 'tw': (219, 196, 198)}, button={'cn': (322, 295, 392, 334), 'en': (322, 295, 392, 334), 'jp': (322, 295, 392, 334), 'tw': (322, 295, 392, 334)}, file={'cn': './assets/cn/coalition/FASHION_NORMAL.png', 'en': './assets/cn/coalition/FASHION_NORMAL.png', 'jp': './assets/cn/coalition/FASHION_NORMAL.png', 'tw': './assets/cn/coalition/FASHION_NORMAL.png'})
FASHION_PT_OCR = Button(area={'cn': (881, 658, 937, 674), 'en': (881, 658, 937, 674), 'jp': (881, 658, 937, 674), 'tw': (881, 658, 937, 674)}, color={'cn': (136, 127, 122), 'en': (136, 127, 122), 'jp': (136, 127, 122), 'tw': (136, 127, 122)}, button={'cn': (881, 658, 937, 674), 'en': (881, 658, 937, 674), 'jp': (881, 658, 937, 674), 'tw': (881, 658, 937, 674)}, file={'cn': './assets/cn/coalition/FASHION_PT_OCR.png', 'en': './assets/cn/coalition/FASHION_PT_OCR.png', 'jp': './assets/cn/coalition/FASHION_PT_OCR.png', 'tw': './assets/cn/coalition/FASHION_PT_OCR.png'})
FASHION_SP = Button(area={'cn': (704, 194, 762, 242), 'en': (704, 194, 762, 242), 'jp': (704, 194, 762, 242), 'tw': (704, 194, 762, 242)}, color={'cn': (146, 133, 135), 'en': (146, 133, 135), 'jp': (146, 133, 135), 'tw': (146, 133, 135)}, button={'cn': (704, 194, 762, 242), 'en': (704, 194, 762, 242), 'jp': (704, 194, 762, 242), 'tw': (704, 194, 762, 242)}, file={'cn': './assets/cn/coalition/FASHION_SP.png', 'en': './assets/cn/coalition/FASHION_SP.png', 'jp': './assets/cn/coalition/FASHION_SP.png', 'tw': './assets/cn/coalition/FASHION_SP.png'})
FASHION_SWITCH_MULTI = Button(area={'cn': (1075, 457, 1206, 485), 'en': (1075, 457, 1206, 485), 'jp': (1075, 457, 1206, 485), 'tw': (1075, 457, 1206, 485)}, color={'cn': (233, 183, 63), 'en': (233, 183, 63), 'jp': (233, 183, 63), 'tw': (233, 183, 63)}, button={'cn': (1075, 457, 1206, 485), 'en': (1075, 457, 1206, 485), 'jp': (1075, 457, 1206, 485), 'tw': (1075, 457, 1206, 485)}, file={'cn': './assets/cn/coalition/FASHION_SWITCH_MULTI.png', 'en': './assets/cn/coalition/FASHION_SWITCH_MULTI.png', 'jp': './assets/cn/coalition/FASHION_SWITCH_MULTI.png', 'tw': './assets/cn/coalition/FASHION_SWITCH_MULTI.png'})
FASHION_SWITCH_SINGLE = Button(area={'cn': (929, 457, 1059, 485), 'en': (929, 457, 1059, 485), 'jp': (929, 457, 1059, 485), 'tw': (929, 457, 1059, 485)}, color={'cn': (230, 181, 62), 'en': (230, 181, 62), 'jp': (230, 181, 62), 'tw': (230, 181, 62)}, button={'cn': (929, 457, 1059, 485), 'en': (929, 457, 1059, 485), 'jp': (929, 457, 1059, 485), 'tw': (929, 457, 1059, 485)}, file={'cn': './assets/cn/coalition/FASHION_SWITCH_SINGLE.png', 'en': './assets/cn/coalition/FASHION_SWITCH_SINGLE.png', 'jp': './assets/cn/coalition/FASHION_SWITCH_SINGLE.png', 'tw': './assets/cn/coalition/FASHION_SWITCH_SINGLE.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'}) 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'})
FROSTFALL_COALITION_CHECK = Button(area={'cn': (118, 14, 227, 39), 'en': (118, 16, 221, 36), 'jp': (118, 14, 227, 39), 'tw': (118, 14, 227, 39)}, color={'cn': (145, 161, 200), 'en': (116, 130, 168), 'jp': (150, 166, 204), 'tw': (152, 168, 206)}, button={'cn': (118, 14, 227, 39), 'en': (118, 16, 221, 36), 'jp': (118, 14, 227, 39), 'tw': (118, 14, 227, 39)}, file={'cn': './assets/cn/coalition/FROSTFALL_COALITION_CHECK.png', 'en': './assets/en/coalition/FROSTFALL_COALITION_CHECK.png', 'jp': './assets/jp/coalition/FROSTFALL_COALITION_CHECK.png', 'tw': './assets/tw/coalition/FROSTFALL_COALITION_CHECK.png'}) FROSTFALL_COALITION_CHECK = Button(area={'cn': (118, 14, 227, 39), 'en': (118, 16, 221, 36), 'jp': (118, 14, 227, 39), 'tw': (118, 14, 227, 39)}, color={'cn': (145, 161, 200), 'en': (116, 130, 168), 'jp': (150, 166, 204), 'tw': (152, 168, 206)}, button={'cn': (118, 14, 227, 39), 'en': (118, 16, 221, 36), 'jp': (118, 14, 227, 39), 'tw': (118, 14, 227, 39)}, file={'cn': './assets/cn/coalition/FROSTFALL_COALITION_CHECK.png', 'en': './assets/en/coalition/FROSTFALL_COALITION_CHECK.png', 'jp': './assets/jp/coalition/FROSTFALL_COALITION_CHECK.png', 'tw': './assets/tw/coalition/FROSTFALL_COALITION_CHECK.png'})
FROSTFALL_EX = Button(area={'cn': (622, 372, 649, 384), 'en': (622, 372, 649, 384), 'jp': (622, 372, 649, 384), 'tw': (622, 372, 649, 384)}, color={'cn': (198, 152, 252), 'en': (198, 152, 252), 'jp': (198, 152, 252), 'tw': (182, 127, 252)}, button={'cn': (622, 372, 649, 384), 'en': (622, 372, 649, 384), 'jp': (622, 372, 649, 384), 'tw': (622, 372, 649, 384)}, file={'cn': './assets/cn/coalition/FROSTFALL_EX.png', 'en': './assets/en/coalition/FROSTFALL_EX.png', 'jp': './assets/jp/coalition/FROSTFALL_EX.png', 'tw': './assets/tw/coalition/FROSTFALL_EX.png'}) FROSTFALL_EX = Button(area={'cn': (622, 372, 649, 384), 'en': (622, 372, 649, 384), 'jp': (622, 372, 649, 384), 'tw': (622, 372, 649, 384)}, color={'cn': (198, 152, 252), 'en': (198, 152, 252), 'jp': (198, 152, 252), 'tw': (182, 127, 252)}, button={'cn': (622, 372, 649, 384), 'en': (622, 372, 649, 384), 'jp': (622, 372, 649, 384), 'tw': (622, 372, 649, 384)}, file={'cn': './assets/cn/coalition/FROSTFALL_EX.png', 'en': './assets/en/coalition/FROSTFALL_EX.png', 'jp': './assets/jp/coalition/FROSTFALL_EX.png', 'tw': './assets/tw/coalition/FROSTFALL_EX.png'})

View File

@ -6,6 +6,7 @@ from module.coalition.combat import CoalitionCombat
from module.exception import ScriptEnd, ScriptError from module.exception import ScriptEnd, ScriptError
from module.logger import logger from module.logger import logger
from module.ocr.ocr import Digit from module.ocr.ocr import Digit
from module.ui.page import page_campaign_menu
class AcademyPtOcr(Digit): class AcademyPtOcr(Digit):
@ -22,6 +23,7 @@ class AcademyPtOcr(Digit):
pass pass
return super().after_process(result) return super().after_process(result)
class DALPtOcr(Digit): class DALPtOcr(Digit):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs) super().__init__(*args, **kwargs)
@ -55,7 +57,9 @@ class Coalition(CoalitionCombat, CampaignEvent):
# use generic ocr model # use generic ocr model
ocr = Digit(NEONCITY_PT_OCR, name='OCR_PT', lang='cnocr', letter=(208, 208, 208), threshold=128) ocr = Digit(NEONCITY_PT_OCR, name='OCR_PT', lang='cnocr', letter=(208, 208, 208), threshold=128)
elif event == 'coalition_20251120': elif event == 'coalition_20251120':
ocr = DALPtOcr(DAL_PT_OCR, name='OCR_PT' ,letter=(255, 213, 69), threshold=128) ocr = DALPtOcr(DAL_PT_OCR, name='OCR_PT', letter=(255, 213, 69), threshold=128)
elif event == 'coalition_20260122':
ocr = Digit(FASHION_PT_OCR, name='OCR_PT', letter=(41, 40, 40), threshold=128)
else: else:
logger.error(f'ocr object is not defined in event {event}') logger.error(f'ocr object is not defined in event {event}')
raise ScriptError raise ScriptError
@ -71,6 +75,16 @@ class Coalition(CoalitionCombat, CampaignEvent):
return pt return pt
@property
def _coalition_has_oil_icon(self):
"""
Game devs are too asshole to drop oil display for UI design
https://github.com/LmeSzinc/AzurLaneAutoScript/issues/5214
"""
if self.config.Campaign_Event == 'coalition_20260122':
return False
return True
def triggered_stop_condition(self, oil_check=False, pt_check=False): def triggered_stop_condition(self, oil_check=False, pt_check=False):
""" """
Returns: Returns:
@ -83,7 +97,7 @@ class Coalition(CoalitionCombat, CampaignEvent):
self.config.Scheduler_Enable = False self.config.Scheduler_Enable = False
return True return True
# Oil limit # Oil limit
if oil_check: if oil_check and self._coalition_has_oil_icon:
if self.get_oil() < max(500, self.config.StopCondition_OilLimit): if self.get_oil() < max(500, self.config.StopCondition_OilLimit):
logger.hr('Triggered stop condition: Oil limit') logger.hr('Triggered stop condition: Oil limit')
self.config.task_delay(minute=(120, 240)) self.config.task_delay(minute=(120, 240))
@ -173,10 +187,10 @@ class Coalition(CoalitionCombat, CampaignEvent):
logger.info(f'Count: {self.run_count}') logger.info(f'Count: {self.run_count}')
# UI switches # UI switches
# if self.config.SERVER in ['tw']: if not self._coalition_has_oil_icon:
# self.ui_goto(page_campaign_menu) self.ui_goto(page_campaign_menu)
# if self.triggered_stop_condition(oil_check=True): if self.triggered_stop_condition(oil_check=True):
# break break
self.device.stuck_record_clear() self.device.stuck_record_clear()
self.device.click_record_clear() self.device.click_record_clear()
self.ui_goto_coalition() self.ui_goto_coalition()
@ -206,3 +220,9 @@ class Coalition(CoalitionCombat, CampaignEvent):
# Scheduler # Scheduler
if self.config.task_switched(): if self.config.task_switched():
self.config.task_stop() self.config.task_stop()
if __name__ == '__main__':
self = Coalition('alas5', task='Coalition')
self.device.screenshot()
self.get_event_pt()

View File

@ -52,6 +52,10 @@ class CoalitionUI(Combat):
elif event == 'coalition_20251120': elif event == 'coalition_20251120':
logger.info('Coalition event coalition_20251120 has no mode switch') logger.info('Coalition event coalition_20251120 has no mode switch')
return return
elif event == 'coalition_20260122':
mode_switch = Switch('CoalitionMode', offset=(20, 20))
mode_switch.add_state('story', FASHION_MODE_STORY)
mode_switch.add_state('battle', FASHION_MODE_BATTLE)
else: else:
logger.error(f'MODE_SWITCH is not defined in event {event}') logger.error(f'MODE_SWITCH is not defined in event {event}')
raise ScriptError raise ScriptError
@ -85,6 +89,9 @@ class CoalitionUI(Combat):
elif event == 'coalition_20251120': elif event == 'coalition_20251120':
fleet_switch.add_state('single', DAL_SWITCH_SINGLE) fleet_switch.add_state('single', DAL_SWITCH_SINGLE)
fleet_switch.add_state('multi', DAL_SWITCH_MULTI) fleet_switch.add_state('multi', DAL_SWITCH_MULTI)
elif event == 'coalition_20260122':
fleet_switch.add_state('single', FASHION_SWITCH_SINGLE)
fleet_switch.add_state('multi', FASHION_SWITCH_MULTI)
else: else:
logger.error(f'FLEET_SWITCH is not defined in event {event}') logger.error(f'FLEET_SWITCH is not defined in event {event}')
raise ScriptError raise ScriptError
@ -107,24 +114,25 @@ class CoalitionUI(Combat):
Button: Entrance button Button: Entrance button
""" """
dic = { dic = {
# FROSTFALL
('coalition_20230323', 'tc1'): FROSTFALL_TC1, ('coalition_20230323', 'tc1'): FROSTFALL_TC1,
('coalition_20230323', 'tc2'): FROSTFALL_TC2, ('coalition_20230323', 'tc2'): FROSTFALL_TC2,
('coalition_20230323', 'tc3'): FROSTFALL_TC3, ('coalition_20230323', 'tc3'): FROSTFALL_TC3,
('coalition_20230323', 'sp'): FROSTFALL_SP, ('coalition_20230323', 'sp'): FROSTFALL_SP,
('coalition_20230323', 'ex'): FROSTFALL_EX, ('coalition_20230323', 'ex'): FROSTFALL_EX,
# ACADEMY
('coalition_20240627', 'easy'): ACADEMY_EASY, ('coalition_20240627', 'easy'): ACADEMY_EASY,
('coalition_20240627', 'normal'): ACADEMY_NORMAL, ('coalition_20240627', 'normal'): ACADEMY_NORMAL,
('coalition_20240627', 'hard'): ACADEMY_HARD, ('coalition_20240627', 'hard'): ACADEMY_HARD,
('coalition_20240627', 'sp'): ACADEMY_SP, ('coalition_20240627', 'sp'): ACADEMY_SP,
('coalition_20240627', 'ex'): ACADEMY_EX, ('coalition_20240627', 'ex'): ACADEMY_EX,
# NEONCITY
('coalition_20250626', 'easy'): NEONCITY_EASY, ('coalition_20250626', 'easy'): NEONCITY_EASY,
('coalition_20250626', 'normal'): NEONCITY_NORMAL, ('coalition_20250626', 'normal'): NEONCITY_NORMAL,
('coalition_20250626', 'hard'): NEONCITY_HARD, ('coalition_20250626', 'hard'): NEONCITY_HARD,
('coalition_20250626', 'sp'): NEONCITY_SP, ('coalition_20250626', 'sp'): NEONCITY_SP,
('coalition_20250626', 'ex'): NEONCITY_EX, ('coalition_20250626', 'ex'): NEONCITY_EX,
# DAL
('coalition_20251120', 'area1-normal'): DAL_AREA1, ('coalition_20251120', 'area1-normal'): DAL_AREA1,
('coalition_20251120', 'area2-normal'): DAL_AREA2, ('coalition_20251120', 'area2-normal'): DAL_AREA2,
('coalition_20251120', 'area3-normal'): DAL_AREA3, ('coalition_20251120', 'area3-normal'): DAL_AREA3,
@ -137,6 +145,12 @@ class CoalitionUI(Combat):
('coalition_20251120', 'area4-hard'): DAL_AREA4, ('coalition_20251120', 'area4-hard'): DAL_AREA4,
('coalition_20251120', 'area5-hard'): DAL_AREA5, ('coalition_20251120', 'area5-hard'): DAL_AREA5,
('coalition_20251120', 'area6-hard'): DAL_AREA6, ('coalition_20251120', 'area6-hard'): DAL_AREA6,
# FASHION
('coalition_20260122', 'easy'): FASHION_EASY,
('coalition_20260122', 'normal'): FASHION_NORMAL,
('coalition_20260122', 'hard'): FASHION_HARD,
('coalition_20260122', 'sp'): FASHION_SP,
('coalition_20260122', 'ex'): FASHION_EX,
} }
stage = stage.lower() stage = stage.lower()
try: try:
@ -149,12 +163,14 @@ class CoalitionUI(Combat):
def coalition_20251120_get_entrance_difficulty(event, stage): def coalition_20251120_get_entrance_difficulty(event, stage):
""" """
Args: Args:
event (str): Event name.
stage (str): Stage name. stage (str): Stage name.
Returns: Returns:
Button: Entrance difficulty button Button: Entrance difficulty button
""" """
dic = { dic = {
# DAL
('coalition_20251120', 'area1-normal'): DAL_NORMAL, ('coalition_20251120', 'area1-normal'): DAL_NORMAL,
('coalition_20251120', 'area2-normal'): DAL_NORMAL, ('coalition_20251120', 'area2-normal'): DAL_NORMAL,
('coalition_20251120', 'area3-normal'): DAL_NORMAL, ('coalition_20251120', 'area3-normal'): DAL_NORMAL,
@ -186,24 +202,25 @@ class CoalitionUI(Combat):
int: Number of battles int: Number of battles
""" """
dic = { dic = {
# FROSTFALL
('coalition_20230323', 'tc1'): 1, ('coalition_20230323', 'tc1'): 1,
('coalition_20230323', 'tc2'): 2, ('coalition_20230323', 'tc2'): 2,
('coalition_20230323', 'tc3'): 3, ('coalition_20230323', 'tc3'): 3,
('coalition_20230323', 'sp'): 1, ('coalition_20230323', 'sp'): 1,
('coalition_20230323', 'ex'): 1, ('coalition_20230323', 'ex'): 1,
# ACADEMY
('coalition_20240627', 'easy'): 1, ('coalition_20240627', 'easy'): 1,
('coalition_20240627', 'normal'): 2, ('coalition_20240627', 'normal'): 2,
('coalition_20240627', 'hard'): 3, ('coalition_20240627', 'hard'): 3,
('coalition_20240627', 'sp'): 4, ('coalition_20240627', 'sp'): 4,
('coalition_20240627', 'ex'): 5, ('coalition_20240627', 'ex'): 5,
# NEONCITY
('coalition_20250626', 'easy'): 1, ('coalition_20250626', 'easy'): 1,
('coalition_20250626', 'normal'): 2, ('coalition_20250626', 'normal'): 2,
('coalition_20250626', 'hard'): 3, ('coalition_20250626', 'hard'): 3,
('coalition_20250626', 'sp'): 4, ('coalition_20250626', 'sp'): 4,
('coalition_20250626', 'ex'): 5, ('coalition_20250626', 'ex'): 5,
# DAL
('coalition_20251120', 'area1-normal'): 2, ('coalition_20251120', 'area1-normal'): 2,
('coalition_20251120', 'area2-normal'): 3, ('coalition_20251120', 'area2-normal'): 3,
('coalition_20251120', 'area3-normal'): 3, ('coalition_20251120', 'area3-normal'): 3,
@ -216,6 +233,12 @@ class CoalitionUI(Combat):
('coalition_20251120', 'area4-hard'): 3, ('coalition_20251120', 'area4-hard'): 3,
('coalition_20251120', 'area5-hard'): 3, ('coalition_20251120', 'area5-hard'): 3,
('coalition_20251120', 'area6-hard'): 4, ('coalition_20251120', 'area6-hard'): 4,
# FASHION
('coalition_20260122', 'easy'): 1,
('coalition_20260122', 'normal'): 2,
('coalition_20260122', 'hard'): 3,
('coalition_20260122', 'sp'): 4,
('coalition_20260122', 'ex'): 5,
} }
stage = stage.lower() stage = stage.lower()
try: try:
@ -241,6 +264,9 @@ class CoalitionUI(Combat):
return NEONCITY_FLEET_PREPARATION return NEONCITY_FLEET_PREPARATION
elif event == 'coalition_20251120': elif event == 'coalition_20251120':
return DAL_FLEET_PREPARATION return DAL_FLEET_PREPARATION
elif event == 'coalition_20260122':
# FASHION reuses NEONCITY, just (-12, -12) shifted
return NEONCITY_FLEET_PREPARATION
else: else:
logger.error(f'FLEET_PREPARATION is not defined in event {event}') logger.error(f'FLEET_PREPARATION is not defined in event {event}')
raise ScriptError raise ScriptError
@ -261,10 +287,12 @@ class CoalitionUI(Combat):
# No fleet switch in TC1 # No fleet switch in TC1
if stage in ['tc1', 'sp']: if stage in ['tc1', 'sp']:
return False return False
if event == 'coalition_20240627': if event in [
if stage in ['easy', 'sp', 'ex']: 'coalition_20240627',
return False 'coalition_20250626',
if event == 'coalition_20250626': 'coalition_20260122',
]:
# easy is single fleet, SP and EX must must multiple fleets
if stage in ['easy', 'sp', 'ex']: if stage in ['easy', 'sp', 'ex']:
return False return False
@ -297,13 +325,12 @@ class CoalitionUI(Combat):
logger.info(f'{DAL_DIFFICULTY_EXIT} -> {DAL_DIFFICULTY_EXIT}') logger.info(f'{DAL_DIFFICULTY_EXIT} -> {DAL_DIFFICULTY_EXIT}')
continue continue
def enter_map(self, event, stage, mode, skip_first_screenshot=True): def enter_map(self, event, stage, mode):
""" """
Args: Args:
event (str): Event name such as 'coalition_20230323' event (str): Event name such as 'coalition_20230323'
stage (str): Stage name such as 'TC3' stage (str): Stage name such as 'TC3'
mode (str): 'single' or 'multi' mode (str): 'single' or 'multi'
skip_first_screenshot:
Pages: Pages:
in: in_coalition in: in_coalition
@ -321,12 +348,8 @@ class CoalitionUI(Combat):
campaign_click = 0 campaign_click = 0
campaign_difficulty_click = 0 campaign_difficulty_click = 0
fleet_click = 0 fleet_click = 0
while 1:
if skip_first_screenshot:
skip_first_screenshot = False
else:
self.device.screenshot()
for _ in self.loop():
# Check errors # Check errors
if campaign_click > 5: if campaign_click > 5:
logger.critical(f"Failed to enter {button}, too many click on {button}") logger.critical(f"Failed to enter {button}, too many click on {button}")

View File

@ -180,7 +180,7 @@ class GeneratedConfig:
MaritimeEscort_Enable = True MaritimeEscort_Enable = True
# Group `Coalition` # Group `Coalition`
Coalition_Mode = 'area1-normal' # area1-normal, area1-hard, area2-normal, area2-hard, area3-normal, area3-hard, area4-normal, area4-hard, area5-normal, area5-hard, area6-normal, area6-hard Coalition_Mode = 'hard' # easy, normal, hard, sp
Coalition_Fleet = 'single' # single, multi Coalition_Fleet = 'single' # single, multi
# Group `Commission` # Group `Commission`

View File

@ -134,7 +134,7 @@ page_campaign.link(button=CAMPAIGN_GOTO_EVENT, destination=page_sp)
# FROSTFALL # FROSTFALL
# page_coalition = Page(FROSTFALL_COALITION_CHECK) # page_coalition = Page(FROSTFALL_COALITION_CHECK)
# page_coalition.link(button=GOTO_MAIN, destination=page_main) # page_coalition.link(button=GOTO_MAIN, destination=page_main)
# page_coalition.link(button=BACK_ARROW, destination=page_campaign) # page_coalition.link(button=BACK_ARROW, destination=page_campaign_menu)
# page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) # page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition)
# ACADEMY # ACADEMY
# page_coalition_menu = Page(COALITION_ACADEMY_MAIN_CHECK) # page_coalition_menu = Page(COALITION_ACADEMY_MAIN_CHECK)
@ -147,12 +147,17 @@ page_campaign.link(button=CAMPAIGN_GOTO_EVENT, destination=page_sp)
# NEONCITY # NEONCITY
# page_coalition = Page(NEONCITY_COALITION_CHECK) # page_coalition = Page(NEONCITY_COALITION_CHECK)
# page_coalition.link(button=NEONCITY_UI_HOME, destination=page_main) # page_coalition.link(button=NEONCITY_UI_HOME, destination=page_main)
# page_coalition.link(button=NEONCITY_UI_BACK, destination=page_campaign) # page_coalition.link(button=NEONCITY_UI_BACK, destination=page_campaign_menu)
# page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) # page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition)
# DAL # DAL
page_coalition = Page(FROSTFALL_COALITION_CHECK) # page_coalition = Page(FROSTFALL_COALITION_CHECK)
# page_coalition.link(button=GOTO_MAIN, destination=page_main)
# page_coalition.link(button=BACK_ARROW, destination=page_campaign_menu)
# page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition)
# FASHION
page_coalition = Page(FASHION_COALITION_CHECK)
page_coalition.link(button=GOTO_MAIN, destination=page_main) page_coalition.link(button=GOTO_MAIN, destination=page_main)
page_coalition.link(button=BACK_ARROW, destination=page_campaign) page_coalition.link(button=BACK_ARROW, destination=page_campaign_menu)
page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition) page_campaign_menu.link(button=CAMPAIGN_MENU_GOTO_EVENT, destination=page_coalition)
# Operation Siren # Operation Siren