diff --git a/assets/cn/template/TEMPLATE_ENEMY_Carrier20221222.png b/assets/cn/template/TEMPLATE_ENEMY_Carrier20221222.png new file mode 100644 index 0000000000..6c9adbf07b Binary files /dev/null and b/assets/cn/template/TEMPLATE_ENEMY_Carrier20221222.png differ diff --git a/assets/cn/template/TEMPLATE_ENEMY_Light20221222.png b/assets/cn/template/TEMPLATE_ENEMY_Light20221222.png new file mode 100644 index 0000000000..0dd94be64f Binary files /dev/null and b/assets/cn/template/TEMPLATE_ENEMY_Light20221222.png differ diff --git a/assets/cn/template/TEMPLATE_ENEMY_Main20221222.png b/assets/cn/template/TEMPLATE_ENEMY_Main20221222.png new file mode 100644 index 0000000000..cc07886390 Binary files /dev/null and b/assets/cn/template/TEMPLATE_ENEMY_Main20221222.png differ diff --git a/campaign/event_20200917_cn/campaign_base.py b/campaign/event_20200917_cn/campaign_base.py index fb6371b57d..1eee0e4851 100644 --- a/campaign/event_20200917_cn/campaign_base.py +++ b/campaign/event_20200917_cn/campaign_base.py @@ -27,7 +27,7 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter.isdigit(): self.ui_goto_campaign() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') @@ -39,11 +39,11 @@ def campaign_set_chapter(self, name, mode='normal'): self.campaign_ensure_mode('hard') elif chapter == 'ex_sp': self.campaign_ensure_mode('ex') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter == 'sp': self.ui_goto_sp() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter in ['t', 'ts', 'ht', 'hts']: self.ui_goto_event() @@ -60,7 +60,7 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter == 'ex_sp': self.campaign_ensure_mode('ex') # Get stage - self.campaign_ensure_chapter(index=1) + self.campaign_ensure_chapter(1) else: logger.warning(f'Unknown campaign chapter: {name}') diff --git a/campaign/event_20201029_cn/campaign_base.py b/campaign/event_20201029_cn/campaign_base.py index fb2102c707..845be7574d 100644 --- a/campaign/event_20201029_cn/campaign_base.py +++ b/campaign/event_20201029_cn/campaign_base.py @@ -44,10 +44,10 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter.isdigit(): self.ui_goto_campaign() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter in 'abcd' or chapter == 'ex_sp': self.ui_goto_event() @@ -57,11 +57,11 @@ def campaign_set_chapter(self, name, mode='normal'): self.campaign_ensure_mode('hard') elif chapter == 'ex_sp': pass # Difference - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter == 'sp': self.ui_goto_event() # Difference - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) else: logger.warning(f'Unknown campaign chapter: {name}') diff --git a/campaign/event_20201126_cn/campaign_base.py b/campaign/event_20201126_cn/campaign_base.py index 987753757c..705ee7f5fc 100644 --- a/campaign/event_20201126_cn/campaign_base.py +++ b/campaign/event_20201126_cn/campaign_base.py @@ -54,7 +54,7 @@ def _campaign_get_chapter_index(name): def campaign_set_chapter_event(self, chapter, mode='normal'): self.ui_goto_event() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True def campaign_get_entrance(self, name): diff --git a/campaign/event_20210121_cn/campaign_base.py b/campaign/event_20210121_cn/campaign_base.py index 7bc5fe4f4a..51bdc0fe0f 100644 --- a/campaign/event_20210121_cn/campaign_base.py +++ b/campaign/event_20210121_cn/campaign_base.py @@ -15,10 +15,10 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter.isdigit(): self.ui_weigh_anchor() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter in 'abcd' or chapter == 'ex_sp' or chapter in ['as', 'cs']: self.ui_goto_event() @@ -28,11 +28,11 @@ def campaign_set_chapter(self, name, mode='normal'): self.campaign_ensure_mode('hard') elif chapter == 'ex_sp': self.campaign_ensure_mode('ex') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter == 'sp': self.ui_goto_sp() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) else: logger.warning(f'Unknown campaign chapter: {name}') diff --git a/campaign/event_20210722_cn/campaign_base.py b/campaign/event_20210722_cn/campaign_base.py index c0400be601..747f97ba86 100644 --- a/campaign/event_20210722_cn/campaign_base.py +++ b/campaign/event_20210722_cn/campaign_base.py @@ -72,10 +72,10 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter.isdigit(): self.ui_goto_campaign() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter in ['a', 'b', 'c', 'd', 'ex_sp', 'as', 'bs', 'cs', 'ds']: self.ui_goto_event() @@ -86,12 +86,12 @@ def campaign_set_chapter(self, name, mode='normal'): elif chapter == 'ex_sp': # self.campaign_ensure_mode('ex') pass # Difference - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter == 'sp': # self.ui_goto_sp() self.ui_goto_event() # Difference - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) else: logger.warning(f'Unknown campaign chapter: {name}') diff --git a/campaign/event_20220324_cn/campaign_base.py b/campaign/event_20220324_cn/campaign_base.py index 9e82fae4c6..178bb8ef33 100644 --- a/campaign/event_20220324_cn/campaign_base.py +++ b/campaign/event_20220324_cn/campaign_base.py @@ -5,7 +5,7 @@ class CampaignBase(CampaignBase_): def campaign_set_chapter_sp(self, chapter, mode='normal'): if chapter == 'sp': self.ui_goto_event() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True else: return False diff --git a/campaign/event_20220818_cn/campaign_base.py b/campaign/event_20220818_cn/campaign_base.py index 9b2408a57b..925e18acb8 100644 --- a/campaign/event_20220818_cn/campaign_base.py +++ b/campaign/event_20220818_cn/campaign_base.py @@ -8,7 +8,7 @@ def campaign_set_chapter_sp(self, chapter, mode='normal'): logger.info('Set chapter SP') if chapter in ['sp', 'sp_sp']: self.ui_goto_event() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True else: return False diff --git a/campaign/event_20221124_cn/campaign_base.py b/campaign/event_20221124_cn/campaign_base.py index 29fd7794cc..5589ae80c7 100644 --- a/campaign/event_20221124_cn/campaign_base.py +++ b/campaign/event_20221124_cn/campaign_base.py @@ -15,7 +15,7 @@ class CampaignBase(CampaignBase_): def campaign_set_chapter_event(self, chapter, mode='normal'): if chapter.startswith('t'): self.ui_goto_event() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True return super().campaign_set_chapter_event(chapter, mode=mode) diff --git a/campaign/event_20221222_cn/a1.py b/campaign/event_20221222_cn/a1.py index 3b2c8f854c..9bccd1b2d8 100644 --- a/campaign/event_20221222_cn/a1.py +++ b/campaign/event_20221222_cn/a1.py @@ -58,6 +58,7 @@ class Config: # ===== End of generated config ===== MAP_SIREN_HAS_BOSS_ICON_SMALL = True + MAP_ENEMY_TEMPLATE = ['Light20221222', 'Main20221222', 'Carrier20221222'] INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (80, 255 - 33), 'width': (1.5, 10), @@ -80,9 +81,10 @@ class Config: class Campaign(CampaignBase): MAP = MAP - ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' + ENEMY_FILTER = '1L > 1M > 2L > 2M > 3L > 3M > 1E > 2E > 3E > 1C > 2C > 3C' def battle_0(self): + self.config.override(EnemyPriority_EnemyScaleBalanceWeight='default_mode') if self.clear_siren(): return True if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0): diff --git a/campaign/event_20221222_cn/a2.py b/campaign/event_20221222_cn/a2.py index a422c69612..6404e60371 100644 --- a/campaign/event_20221222_cn/a2.py +++ b/campaign/event_20221222_cn/a2.py @@ -62,9 +62,10 @@ class Config(ConfigBase): class Campaign(CampaignBase): MAP = MAP - ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' + ENEMY_FILTER = '1L > 1M > 2L > 2M > 3L > 3M > 1E > 2E > 3E > 1C > 2C > 3C' def battle_0(self): + self.config.override(EnemyPriority_EnemyScaleBalanceWeight='default_mode') if self.clear_siren(): return True if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0): diff --git a/campaign/event_20221222_cn/a3.py b/campaign/event_20221222_cn/a3.py index 12fee3ea63..757c7323ba 100644 --- a/campaign/event_20221222_cn/a3.py +++ b/campaign/event_20221222_cn/a3.py @@ -65,9 +65,10 @@ class Config(ConfigBase): class Campaign(CampaignBase): MAP = MAP - ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' + ENEMY_FILTER = '1L > 1M > 2L > 2M > 3L > 3M > 1E > 2E > 3E > 1C > 2C > 3C' def battle_0(self): + self.config.override(EnemyPriority_EnemyScaleBalanceWeight='default_mode') if self.clear_siren(): return True if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0): diff --git a/campaign/event_20221222_cn/b1.py b/campaign/event_20221222_cn/b1.py index bcae61ae5f..1616f8cddb 100644 --- a/campaign/event_20221222_cn/b1.py +++ b/campaign/event_20221222_cn/b1.py @@ -59,6 +59,7 @@ class Config: # ===== End of generated config ===== MAP_SIREN_HAS_BOSS_ICON_SMALL = True + MAP_ENEMY_TEMPLATE = ['Light20221222', 'Main20221222', 'Carrier20221222'] INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (80, 255 - 33), 'width': (1.5, 10), @@ -81,9 +82,10 @@ class Config: class Campaign(CampaignBase): MAP = MAP - ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' + ENEMY_FILTER = '1L > 1M > 2L > 2M > 3L > 3M > 1E > 2E > 3E > 1C > 2C > 3C' def battle_0(self): + self.config.override(EnemyPriority_EnemyScaleBalanceWeight='default_mode') if self.clear_siren(): return True if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0): diff --git a/campaign/event_20221222_cn/b2.py b/campaign/event_20221222_cn/b2.py index 9c3b5aeb46..3cdb5e7b42 100644 --- a/campaign/event_20221222_cn/b2.py +++ b/campaign/event_20221222_cn/b2.py @@ -70,9 +70,10 @@ class Config(ConfigBase): class Campaign(CampaignBase): MAP = MAP - ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' + ENEMY_FILTER = '1L > 1M > 2L > 2M > 3L > 3M > 1E > 2E > 3E > 1C > 2C > 3C' def battle_0(self): + self.config.override(EnemyPriority_EnemyScaleBalanceWeight='default_mode') if self.clear_siren(): return True if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0): diff --git a/campaign/event_20221222_cn/b3.py b/campaign/event_20221222_cn/b3.py index 8466b14b4e..8881fa1312 100644 --- a/campaign/event_20221222_cn/b3.py +++ b/campaign/event_20221222_cn/b3.py @@ -6,7 +6,7 @@ MAP = CampaignMap('B3') MAP.shape = 'I9' -MAP.camera_data = ['D2', 'D5', 'D7', 'F2', 'F5', 'F7'] +MAP.camera_data = ['D3', 'F3', 'F5', 'F7'] MAP.camera_data_spawn_point = ['D7'] MAP.map_data = """ -- ++ ++ ME -- ME -- ++ ++ @@ -48,6 +48,9 @@ A8, B8, C8, D8, E8, F8, G8, H8, I8, \ A9, B9, C9, D9, E9, F9, G9, H9, I9, \ = MAP.flatten() +MAP.ignore_prediction(C5, is_siren=True) +MAP.ignore_prediction(E7, is_siren=True) +MAP.ignore_prediction(G4, is_siren=True) class Config(ConfigBase): @@ -62,6 +65,7 @@ class Config(ConfigBase): MAP_HAS_MYSTERY = False # ===== End of generated config ===== + MAP_SIREN_HAS_BOSS_ICON_SMALL = False MAP_SWIPE_MULTIPLY = (0.997, 1.015) MAP_SWIPE_MULTIPLY_MINITOUCH = (0.964, 0.982) MAP_SWIPE_MULTIPLY_MAATOUCH = (0.936, 0.953) @@ -69,9 +73,10 @@ class Config(ConfigBase): class Campaign(CampaignBase): MAP = MAP - ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' + ENEMY_FILTER = '1L > 1M > 2L > 2M > 3L > 3M > 1E > 2E > 3E > 1C > 2C > 3C' def battle_0(self): + self.config.override(EnemyPriority_EnemyScaleBalanceWeight='default_mode') if self.clear_siren(): return True if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0): diff --git a/campaign/event_20221222_cn/d3.py b/campaign/event_20221222_cn/d3.py index f4bff9369b..9eca21e79f 100644 --- a/campaign/event_20221222_cn/d3.py +++ b/campaign/event_20221222_cn/d3.py @@ -6,7 +6,7 @@ MAP = CampaignMap('D3') MAP.shape = 'I9' -MAP.camera_data = ['D2', 'D5', 'D7', 'F2', 'F5', 'F7'] +MAP.camera_data = ['D3', 'F3', 'F5', 'F7'] MAP.camera_data_spawn_point = ['D7'] MAP.map_data = """ -- ++ ++ ME -- ME -- ++ ++ @@ -49,6 +49,9 @@ A8, B8, C8, D8, E8, F8, G8, H8, I8, \ A9, B9, C9, D9, E9, F9, G9, H9, I9, \ = MAP.flatten() +MAP.ignore_prediction(C5, is_siren=True) +MAP.ignore_prediction(E7, is_siren=True) +MAP.ignore_prediction(G4, is_siren=True) class Config(ConfigBase): @@ -63,6 +66,7 @@ class Config(ConfigBase): MAP_HAS_MYSTERY = False # ===== End of generated config ===== + MAP_SIREN_HAS_BOSS_ICON_SMALL = False MAP_SWIPE_MULTIPLY = (0.997, 1.015) MAP_SWIPE_MULTIPLY_MINITOUCH = (0.964, 0.982) MAP_SWIPE_MULTIPLY_MAATOUCH = (0.936, 0.953) diff --git a/campaign/event_20230525_cn/campaign_base.py b/campaign/event_20230525_cn/campaign_base.py index c52e464b3b..71873058a4 100644 --- a/campaign/event_20230525_cn/campaign_base.py +++ b/campaign/event_20230525_cn/campaign_base.py @@ -29,7 +29,7 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter.isdigit(): self.ui_goto_campaign() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') @@ -41,11 +41,11 @@ def campaign_set_chapter(self, name, mode='normal'): self.campaign_ensure_mode('hard') elif chapter == 'ex_sp': self.campaign_ensure_mode('ex') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter == 'sp': self.ui_goto_sp() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter in ['t', 'ts', 'ht', 'hts']: self.ui_goto_event() @@ -68,7 +68,7 @@ def campaign_set_chapter(self, name, mode='normal'): else: self._campaign_ball_set('red') # Get stage - self.campaign_ensure_chapter(index=1) + self.campaign_ensure_chapter(1) else: logger.warning(f'Unknown campaign chapter: {name}') diff --git a/campaign/event_20231026_cn/campaign_base.py b/campaign/event_20231026_cn/campaign_base.py index 420866ae7c..9e29f6088d 100644 --- a/campaign/event_20231026_cn/campaign_base.py +++ b/campaign/event_20231026_cn/campaign_base.py @@ -13,7 +13,7 @@ class CampaignBase(CampaignBase_): def campaign_set_chapter_event(self, chapter, mode='normal'): self.ui_goto_event() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True def _campaign_get_chapter_index(self, name): diff --git a/campaign/event_20231123_cn/campaign_base.py b/campaign/event_20231123_cn/campaign_base.py index 808f9ead5b..312a5380ad 100644 --- a/campaign/event_20231123_cn/campaign_base.py +++ b/campaign/event_20231123_cn/campaign_base.py @@ -13,7 +13,7 @@ class CampaignBase(CampaignBase_): def campaign_set_chapter_event(self, chapter, mode='normal'): self.ui_goto_event() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True def _campaign_get_chapter_index(self, name): diff --git a/campaign/event_20240425_cn/campaign_base.py b/campaign/event_20240425_cn/campaign_base.py index 9c59c5aa7b..00f05b6ccd 100644 --- a/campaign/event_20240425_cn/campaign_base.py +++ b/campaign/event_20240425_cn/campaign_base.py @@ -14,7 +14,7 @@ class CampaignBase(CampaignBase_): def campaign_set_chapter_event(self, chapter, mode='normal'): self.ui_goto_event() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True def _campaign_get_chapter_index(self, name): diff --git a/campaign/event_20241024_cn/campaign_base.py b/campaign/event_20241024_cn/campaign_base.py index b67c773ad6..7ab2a5b0d7 100644 --- a/campaign/event_20241024_cn/campaign_base.py +++ b/campaign/event_20241024_cn/campaign_base.py @@ -42,6 +42,6 @@ def campaign_set_chapter_20241219(self, chapter, stage, mode='combat'): ASIDE_SWITCH_20241219.set('part2', main=self) else: logger.warning(f'Stage {chapter}{stage} is not in event_20241024') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return super().campaign_set_chapter_20241219(chapter, stage, mode) diff --git a/campaign/event_20241121_cn/campaign_base.py b/campaign/event_20241121_cn/campaign_base.py index cbf57f1828..b6edbed384 100644 --- a/campaign/event_20241121_cn/campaign_base.py +++ b/campaign/event_20241121_cn/campaign_base.py @@ -26,11 +26,11 @@ def campaign_set_chapter_20241219(self, chapter, stage, mode='combat'): self.ui_goto_event() MODE_SWITCH_20241219.set('combat', main=self) ASIDE_SWITCH_20241219.set('part1', main=self) - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if chapter == 'ttl': self.ui_goto_event() MODE_SWITCH_20241219.set('combat', main=self) ASIDE_SWITCH_20241219.set('part2', main=self) - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return super().campaign_set_chapter_20241219(chapter, stage, mode) diff --git a/campaign/war_archives_20190911_cn/campaign_base.py b/campaign/war_archives_20190911_cn/campaign_base.py index 0007c58390..397ee6e872 100644 --- a/campaign/war_archives_20190911_cn/campaign_base.py +++ b/campaign/war_archives_20190911_cn/campaign_base.py @@ -25,10 +25,10 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter.isdigit(): self.ui_goto_campaign() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter in 'abcd' or chapter == 'ex_sp' or chapter in ['as', 'cs']: self.ui_goto_event() @@ -38,11 +38,11 @@ def campaign_set_chapter(self, name, mode='normal'): self.campaign_ensure_mode('hard') elif chapter == 'ex_sp': self.campaign_ensure_mode('ex') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter == 'sp': self.ui_goto_sp() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) else: logger.warning(f'Unknown campaign chapter: {name}') diff --git a/campaign/war_archives_20200917_cn/campaign_base.py b/campaign/war_archives_20200917_cn/campaign_base.py index 97465d2d86..678fc143e5 100644 --- a/campaign/war_archives_20200917_cn/campaign_base.py +++ b/campaign/war_archives_20200917_cn/campaign_base.py @@ -27,7 +27,7 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter.isdigit(): self.ui_goto_campaign() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') @@ -39,11 +39,11 @@ def campaign_set_chapter(self, name, mode='normal'): self.campaign_ensure_mode('hard') elif chapter == 'ex_sp': self.campaign_ensure_mode('ex') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter == 'sp': self.ui_goto_sp() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) elif chapter in ['t', 'ts', 'ht', 'hts']: self.ui_goto_event() @@ -60,7 +60,7 @@ def campaign_set_chapter(self, name, mode='normal'): if chapter == 'ex_sp': self.campaign_ensure_mode('ex') # Get stage - self.campaign_ensure_chapter(index=1) + self.campaign_ensure_chapter(1) else: logger.warning(f'Unknown campaign chapter: {name}') diff --git a/module/campaign/campaign_ocr.py b/module/campaign/campaign_ocr.py index 103787453c..9dc04193e5 100644 --- a/module/campaign/campaign_ocr.py +++ b/module/campaign/campaign_ocr.py @@ -13,7 +13,7 @@ class CampaignOcr(ModuleBase): stage_entrance = {} - campaign_chapter = 0 + campaign_chapter: str = '0' # An approximate area where stages will appear for faster template matching _stage_detect_area = (87, 117, 1151, 636) diff --git a/module/campaign/campaign_ui.py b/module/campaign/campaign_ui.py index c83373f32f..13cbf285bf 100644 --- a/module/campaign/campaign_ui.py +++ b/module/campaign/campaign_ui.py @@ -36,16 +36,33 @@ def handle_additional(self, main): ASIDE_SWITCH_20241219.add_state('ex', CHAPTER_20241219_EX) +def is_digit_chapter(chapter): + """ + Args: + chapter (int, str): Chapter. Such as 7, 'd', 'sp'. + + Returns: + bool: + """ + if isinstance(chapter, int): + return True + try: + return chapter[0].isdigit() + except IndexError: + return False + + class CampaignUI(MapOperation, CampaignEvent, CampaignOcr): ENTRANCE = Button(area=(), color=(), button=(), name='default_button') - def campaign_ensure_chapter(self, index, skip_first_screenshot=True): + def campaign_ensure_chapter(self, chapter, skip_first_screenshot=True): """ Args: - index (int, str): Chapter. Such as 7, 'd', 'sp'. + chapter (int, str): Chapter. Such as 7, 'd', 'sp'. skip_first_screenshot: """ - index = self._campaign_get_chapter_index(index) + index = self._campaign_get_chapter_index(chapter) + isdigit = is_digit_chapter(chapter) # A copy of use ui_ensure_index. logger.hr("UI ensure index") @@ -61,12 +78,17 @@ def campaign_ensure_chapter(self, index, skip_first_screenshot=True): continue current = self.get_chapter_index() + current_isdigit = is_digit_chapter(self.campaign_chapter) logger.attr("Index", current) diff = index - current if diff == 0: break + # Getting 3-7 when looking for D3 + if not (isdigit == current_isdigit): + continue + # 14-4 may be OCR as 4-1 due to slow animation, confirm if it is 4-1 if index >= 11 and index % 10 == current: error_confirm.start() @@ -214,13 +236,13 @@ def campaign_set_chapter_main(self, chapter, mode='normal'): if chapter.isdigit(): self.ui_goto_campaign() self.campaign_ensure_mode('normal') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) if mode == 'hard': self.campaign_ensure_mode('hard') # info_bar shows: Hard mode for this map is not available yet. # There's also a game bug in EN, HM12 shows not available but it's actually available. self.handle_info_bar() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True else: return False @@ -234,7 +256,7 @@ def campaign_set_chapter_event(self, chapter, mode='normal'): self.campaign_ensure_mode('hard') elif chapter == 'ex_sp': self.campaign_ensure_mode('ex') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True else: return False @@ -242,7 +264,7 @@ def campaign_set_chapter_event(self, chapter, mode='normal'): def campaign_set_chapter_sp(self, chapter, mode='normal'): if chapter == 'sp': self.ui_goto_sp() - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True else: return False @@ -261,25 +283,25 @@ def campaign_set_chapter_20241219(self, chapter, stage, mode='combat'): self.ui_goto_event() self.campaign_ensure_mode_20241219('combat') self.campaign_ensure_aside_20241219('part1') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True if chapter in ['b', 'd', 'ttl']: self.ui_goto_event() self.campaign_ensure_mode_20241219('combat') self.campaign_ensure_aside_20241219('part2') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True if chapter in ['ex_sp']: self.ui_goto_event() self.campaign_ensure_mode_20241219('combat') self.campaign_ensure_aside_20241219('sp') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True if chapter in ['ex_ex']: self.ui_goto_event() self.campaign_ensure_mode_20241219('combat') self.campaign_ensure_aside_20241219('ex') - self.campaign_ensure_chapter(index=chapter) + self.campaign_ensure_chapter(chapter) return True else: return False diff --git a/module/combat/combat.py b/module/combat/combat.py index 5593ccfb67..5306fb5acc 100644 --- a/module/combat/combat.py +++ b/module/combat/combat.py @@ -237,7 +237,7 @@ def handle_emergency_repair_use(self): if not self.config.HpControl_UseEmergencyRepair: return False - if self.appear_then_click(EMERGENCY_REPAIR_CONFIRM, offset=True): + if self.appear_then_click(EMERGENCY_REPAIR_CONFIRM, offset=True, interval=3): return True if self.appear(BATTLE_PREPARATION, offset=(20, 20)) and self.appear(EMERGENCY_REPAIR_AVAILABLE): # When entering battle_preparation page (or after emergency repairing), @@ -251,16 +251,22 @@ def handle_emergency_repair_use(self): self.wait_until_stable(stable_checker) if not self.appear(EMERGENCY_REPAIR_AVAILABLE): return False + logger.info('EMERGENCY_REPAIR_AVAILABLE') if not len(self.hp): return False + if max(self.hp[:3]) <= 0.001 or max(self.hp[3:]) <= 0.001: + logger.warning(f'Invalid HP to use emergency repair: {self.hp}') + return False + hp = np.array(self.hp) hp = hp[hp > 0.001] if (len(hp) and np.min(hp) < self.config.HpControl_RepairUseSingleThreshold) \ - or np.max(self.hp[:3]) < self.config.HpControl_RepairUseMultiThreshold \ - or np.max(self.hp[3:]) < self.config.HpControl_RepairUseMultiThreshold: + or max(self.hp[:3]) < self.config.HpControl_RepairUseMultiThreshold \ + or max(self.hp[3:]) < self.config.HpControl_RepairUseMultiThreshold: logger.info('Use emergency repair') self.device.click(EMERGENCY_REPAIR_AVAILABLE) + self.interval_clear(EMERGENCY_REPAIR_CONFIRM) return True return False diff --git a/module/config/argument/args.json b/module/config/argument/args.json index 64c1797fc4..f5c3a551f5 100644 --- a/module/config/argument/args.json +++ b/module/config/argument/args.json @@ -118,7 +118,6 @@ "aScreenCap_nc", "DroidCast", "DroidCast_raw", - "scrcpy", "nemu_ipc", "ldopengl" ] diff --git a/module/config/argument/argument.yaml b/module/config/argument/argument.yaml index 6bbfd5ff81..56635fb0d4 100644 --- a/module/config/argument/argument.yaml +++ b/module/config/argument/argument.yaml @@ -41,7 +41,6 @@ Emulator: aScreenCap_nc, DroidCast, DroidCast_raw, - scrcpy, nemu_ipc, ldopengl, ] diff --git a/module/config/i18n/en-US.json b/module/config/i18n/en-US.json index 0c2d782f28..26ba158b82 100644 --- a/module/config/i18n/en-US.json +++ b/module/config/i18n/en-US.json @@ -415,7 +415,6 @@ "aScreenCap_nc": "aScreenCap_nc", "DroidCast": "DroidCast", "DroidCast_raw": "DroidCast_raw", - "scrcpy": "scrcpy", "nemu_ipc": "nemu_ipc", "ldopengl": "ldopengl" }, diff --git a/module/config/i18n/ja-JP.json b/module/config/i18n/ja-JP.json index ccfcd1b0c2..612204a15f 100644 --- a/module/config/i18n/ja-JP.json +++ b/module/config/i18n/ja-JP.json @@ -415,7 +415,6 @@ "aScreenCap_nc": "aScreenCap_nc", "DroidCast": "DroidCast", "DroidCast_raw": "DroidCast_raw", - "scrcpy": "scrcpy", "nemu_ipc": "nemu_ipc", "ldopengl": "ldopengl" }, diff --git a/module/config/i18n/zh-CN.json b/module/config/i18n/zh-CN.json index a0ee028037..40a14e369b 100644 --- a/module/config/i18n/zh-CN.json +++ b/module/config/i18n/zh-CN.json @@ -415,7 +415,6 @@ "aScreenCap_nc": "aScreenCap_nc", "DroidCast": "DroidCast", "DroidCast_raw": "DroidCast_raw", - "scrcpy": "scrcpy", "nemu_ipc": "nemu_ipc", "ldopengl": "ldopengl" }, diff --git a/module/config/i18n/zh-TW.json b/module/config/i18n/zh-TW.json index e65202472c..a568df1fc0 100644 --- a/module/config/i18n/zh-TW.json +++ b/module/config/i18n/zh-TW.json @@ -415,7 +415,6 @@ "aScreenCap_nc": "aScreenCap_nc", "DroidCast": "DroidCast", "DroidCast_raw": "DroidCast_raw", - "scrcpy": "scrcpy", "nemu_ipc": "nemu_ipc", "ldopengl": "ldopengl" }, diff --git a/module/template/assets.py b/module/template/assets.py index bc4c505bb8..e4f19d3a4d 100644 --- a/module/template/assets.py +++ b/module/template/assets.py @@ -12,14 +12,17 @@ TEMPLATE_DORM_LOVE = Template(file={'cn': './assets/cn/template/TEMPLATE_DORM_LOVE.gif', 'en': './assets/en/template/TEMPLATE_DORM_LOVE.gif', 'jp': './assets/jp/template/TEMPLATE_DORM_LOVE.gif', 'tw': './assets/tw/template/TEMPLATE_DORM_LOVE.gif'}) TEMPLATE_ENEMY_BOSS = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_BOSS.png', 'en': './assets/en/template/TEMPLATE_ENEMY_BOSS.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_BOSS.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_BOSS.png'}) TEMPLATE_ENEMY_Carrier = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_Carrier.png', 'en': './assets/en/template/TEMPLATE_ENEMY_Carrier.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_Carrier.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_Carrier.png'}) +TEMPLATE_ENEMY_Carrier20221222 = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_Carrier20221222.png', 'en': './assets/cn/template/TEMPLATE_ENEMY_Carrier20221222.png', 'jp': './assets/cn/template/TEMPLATE_ENEMY_Carrier20221222.png', 'tw': './assets/cn/template/TEMPLATE_ENEMY_Carrier20221222.png'}) TEMPLATE_ENEMY_CarrierInvertedOrthant = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_CarrierInvertedOrthant.png', 'en': './assets/en/template/TEMPLATE_ENEMY_CarrierInvertedOrthant.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_CarrierInvertedOrthant.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_CarrierInvertedOrthant.png'}) TEMPLATE_ENEMY_CarrierPurple = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_CarrierPurple.png', 'en': './assets/en/template/TEMPLATE_ENEMY_CarrierPurple.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_CarrierPurple.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_CarrierPurple.png'}) TEMPLATE_ENEMY_CarrierSpecial = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_CarrierSpecial.gif', 'en': './assets/cn/template/TEMPLATE_ENEMY_CarrierSpecial.gif', 'jp': './assets/cn/template/TEMPLATE_ENEMY_CarrierSpecial.gif', 'tw': './assets/cn/template/TEMPLATE_ENEMY_CarrierSpecial.gif'}) TEMPLATE_ENEMY_L = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_L.png', 'en': './assets/en/template/TEMPLATE_ENEMY_L.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_L.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_L.png'}) TEMPLATE_ENEMY_Light = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_Light.png', 'en': './assets/en/template/TEMPLATE_ENEMY_Light.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_Light.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_Light.png'}) +TEMPLATE_ENEMY_Light20221222 = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_Light20221222.png', 'en': './assets/cn/template/TEMPLATE_ENEMY_Light20221222.png', 'jp': './assets/cn/template/TEMPLATE_ENEMY_Light20221222.png', 'tw': './assets/cn/template/TEMPLATE_ENEMY_Light20221222.png'}) TEMPLATE_ENEMY_LightInvertedOrthant = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_LightInvertedOrthant.png', 'en': './assets/en/template/TEMPLATE_ENEMY_LightInvertedOrthant.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_LightInvertedOrthant.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_LightInvertedOrthant.png'}) TEMPLATE_ENEMY_M = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_M.png', 'en': './assets/en/template/TEMPLATE_ENEMY_M.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_M.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_M.png'}) TEMPLATE_ENEMY_Main = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_Main.png', 'en': './assets/en/template/TEMPLATE_ENEMY_Main.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_Main.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_Main.png'}) +TEMPLATE_ENEMY_Main20221222 = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_Main20221222.png', 'en': './assets/cn/template/TEMPLATE_ENEMY_Main20221222.png', 'jp': './assets/cn/template/TEMPLATE_ENEMY_Main20221222.png', 'tw': './assets/cn/template/TEMPLATE_ENEMY_Main20221222.png'}) TEMPLATE_ENEMY_MainInvertedOrthant = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_MainInvertedOrthant.png', 'en': './assets/en/template/TEMPLATE_ENEMY_MainInvertedOrthant.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_MainInvertedOrthant.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_MainInvertedOrthant.png'}) TEMPLATE_ENEMY_MainPurple = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_MainPurple.png', 'en': './assets/en/template/TEMPLATE_ENEMY_MainPurple.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_MainPurple.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_MainPurple.png'}) TEMPLATE_ENEMY_S = Template(file={'cn': './assets/cn/template/TEMPLATE_ENEMY_S.png', 'en': './assets/en/template/TEMPLATE_ENEMY_S.png', 'jp': './assets/jp/template/TEMPLATE_ENEMY_S.png', 'tw': './assets/tw/template/TEMPLATE_ENEMY_S.png'})