diff --git a/assets/cn/handler/MAP_WALK_SPEEDUP.png b/assets/cn/handler/MAP_WALK_SPEEDUP.png new file mode 100644 index 000000000..f96c2db6e Binary files /dev/null and b/assets/cn/handler/MAP_WALK_SPEEDUP.png differ diff --git a/assets/en/handler/MAP_WALK_SPEEDUP.png b/assets/en/handler/MAP_WALK_SPEEDUP.png new file mode 100644 index 000000000..f96c2db6e Binary files /dev/null and b/assets/en/handler/MAP_WALK_SPEEDUP.png differ diff --git a/assets/jp/handler/MAP_WALK_SPEEDUP.png b/assets/jp/handler/MAP_WALK_SPEEDUP.png new file mode 100644 index 000000000..f96c2db6e Binary files /dev/null and b/assets/jp/handler/MAP_WALK_SPEEDUP.png differ diff --git a/assets/tw/handler/MAP_WALK_SPEEDUP.png b/assets/tw/handler/MAP_WALK_SPEEDUP.png new file mode 100644 index 000000000..f96c2db6e Binary files /dev/null and b/assets/tw/handler/MAP_WALK_SPEEDUP.png differ diff --git a/campaign/event_20230803_cn/sp1.py b/campaign/event_20230803_cn/sp1.py index d6bfeb155..2c92e5099 100644 --- a/campaign/event_20230803_cn/sp1.py +++ b/campaign/event_20230803_cn/sp1.py @@ -51,6 +51,7 @@ class Config: MAP_HAS_MYSTERY = False # ===== End of generated config ===== + MAP_HAS_WALK_SPEEDUP = True MAP_HAS_MOVABLE_NORMAL_ENEMY = True MOVABLE_NORMAL_ENEMY_TURN = (2,) MAP_SIREN_MOVE_WAIT = 0.5 diff --git a/module/config/config_manual.py b/module/config/config_manual.py index b2613991b..30eac7837 100644 --- a/module/config/config_manual.py +++ b/module/config/config_manual.py @@ -110,6 +110,7 @@ class ManualConfig: module.map.fleet """ MAP_HAS_CLEAR_PERCENTAGE = True + MAP_HAS_WALK_SPEEDUP = False MAP_HAS_AMBUSH = True MAP_HAS_FLEET_STEP = False MAP_HAS_MOVABLE_ENEMY = False diff --git a/module/handler/assets.py b/module/handler/assets.py index 2cabfdf20..dadb61934 100644 --- a/module/handler/assets.py +++ b/module/handler/assets.py @@ -63,6 +63,7 @@ MAP_STAR_1 = Button(area={'cn': (245, 377, 254, 384), 'en': (232, 381, 240, 389) MAP_STAR_2 = Button(area={'cn': (532, 377, 540, 384), 'en': (518, 382, 526, 389), 'jp': (532, 377, 540, 384), 'tw': (532, 377, 540, 384)}, color={'cn': (251, 233, 144), 'en': (252, 234, 144), 'jp': (251, 233, 144), 'tw': (251, 233, 144)}, button={'cn': (532, 377, 540, 384), 'en': (518, 382, 526, 389), 'jp': (532, 377, 540, 384), 'tw': (532, 377, 540, 384)}, file={'cn': './assets/cn/handler/MAP_STAR_2.png', 'en': './assets/en/handler/MAP_STAR_2.png', 'jp': './assets/jp/handler/MAP_STAR_2.png', 'tw': './assets/tw/handler/MAP_STAR_2.png'}) MAP_STAR_3 = Button(area={'cn': (818, 377, 827, 384), 'en': (804, 382, 812, 389), 'jp': (818, 377, 827, 384), 'tw': (818, 377, 827, 384)}, color={'cn': (251, 233, 143), 'en': (252, 234, 144), 'jp': (251, 233, 143), 'tw': (251, 233, 143)}, button={'cn': (818, 377, 827, 384), 'en': (804, 382, 812, 389), 'jp': (818, 377, 827, 384), 'tw': (818, 377, 827, 384)}, file={'cn': './assets/cn/handler/MAP_STAR_3.png', 'en': './assets/en/handler/MAP_STAR_3.png', 'jp': './assets/jp/handler/MAP_STAR_3.png', 'tw': './assets/tw/handler/MAP_STAR_3.png'}) MAP_WALK_OUT_OF_STEP = Button(area={'cn': (654, 312, 704, 335), 'en': (454, 314, 698, 338), 'jp': (736, 312, 783, 336), 'tw': (653, 309, 705, 334)}, color={'cn': (109, 113, 120), 'en': (108, 109, 116), 'jp': (137, 135, 143), 'tw': (118, 124, 132)}, button={'cn': (654, 312, 704, 335), 'en': (454, 314, 698, 338), 'jp': (736, 312, 783, 336), 'tw': (653, 309, 705, 334)}, file={'cn': './assets/cn/handler/MAP_WALK_OUT_OF_STEP.png', 'en': './assets/en/handler/MAP_WALK_OUT_OF_STEP.png', 'jp': './assets/jp/handler/MAP_WALK_OUT_OF_STEP.png', 'tw': './assets/tw/handler/MAP_WALK_OUT_OF_STEP.png'}) +MAP_WALK_SPEEDUP = Button(area={'cn': (1025, 406, 1055, 436), 'en': (1025, 406, 1055, 436), 'jp': (1025, 406, 1055, 436), 'tw': (1025, 406, 1055, 436)}, color={'cn': (62, 97, 72), 'en': (62, 97, 72), 'jp': (62, 97, 72), 'tw': (62, 97, 72)}, button={'cn': (1025, 406, 1055, 436), 'en': (1025, 406, 1055, 436), 'jp': (1025, 406, 1055, 436), 'tw': (1025, 406, 1055, 436)}, file={'cn': './assets/cn/handler/MAP_WALK_SPEEDUP.png', 'en': './assets/en/handler/MAP_WALK_SPEEDUP.png', 'jp': './assets/jp/handler/MAP_WALK_SPEEDUP.png', 'tw': './assets/tw/handler/MAP_WALK_SPEEDUP.png'}) MISSION_POPUP_ACK = Button(area={'cn': (413, 489, 566, 532), 'en': (413, 489, 566, 532), 'jp': (410, 482, 574, 539), 'tw': (413, 489, 566, 532)}, color={'cn': (169, 170, 172), 'en': (169, 170, 172), 'jp': (162, 164, 167), 'tw': (169, 170, 172)}, button={'cn': (413, 489, 566, 532), 'en': (413, 489, 566, 532), 'jp': (410, 482, 574, 539), 'tw': (413, 489, 566, 532)}, file={'cn': './assets/cn/handler/MISSION_POPUP_ACK.png', 'en': './assets/en/handler/MISSION_POPUP_ACK.png', 'jp': './assets/jp/handler/MISSION_POPUP_ACK.png', 'tw': './assets/tw/handler/MISSION_POPUP_ACK.png'}) MISSION_POPUP_GO = Button(area={'cn': (716, 488, 869, 533), 'en': (716, 488, 869, 533), 'jp': (711, 482, 874, 539), 'tw': (716, 488, 869, 533)}, color={'cn': (89, 138, 201), 'en': (89, 138, 201), 'jp': (93, 142, 204), 'tw': (89, 138, 201)}, button={'cn': (716, 488, 869, 533), 'en': (716, 488, 869, 533), 'jp': (711, 482, 874, 539), 'tw': (716, 488, 869, 533)}, file={'cn': './assets/cn/handler/MISSION_POPUP_GO.png', 'en': './assets/en/handler/MISSION_POPUP_GO.png', 'jp': './assets/jp/handler/MISSION_POPUP_GO.png', 'tw': './assets/tw/handler/MISSION_POPUP_GO.png'}) MONTHLY_PASS_NOTICE = Button(area={'cn': (554, 505, 726, 561), 'en': (716, 488, 869, 533), 'jp': (554, 505, 726, 561), 'tw': (554, 505, 726, 561)}, color={'cn': (109, 153, 208), 'en': (89, 138, 201), 'jp': (109, 153, 208), 'tw': (109, 153, 208)}, button={'cn': (872, 152, 939, 196), 'en': (863, 173, 929, 217), 'jp': (872, 152, 939, 196), 'tw': (872, 152, 939, 196)}, file={'cn': './assets/cn/handler/MONTHLY_PASS_NOTICE.png', 'en': './assets/en/handler/MONTHLY_PASS_NOTICE.png', 'jp': './assets/cn/handler/MONTHLY_PASS_NOTICE.png', 'tw': './assets/cn/handler/MONTHLY_PASS_NOTICE.png'}) diff --git a/module/handler/fast_forward.py b/module/handler/fast_forward.py index 85c710ffb..ccc6c7a88 100644 --- a/module/handler/fast_forward.py +++ b/module/handler/fast_forward.py @@ -475,3 +475,30 @@ class FastForwardHandler(AutoSearchHandler): return True return False + + def handle_map_walk_speedup(self, skip_first_screenshot=True): + """ + Turn on walk speedup, no reason to turn it off + """ + if not self.config.MAP_HAS_WALK_SPEEDUP: + return False + + timeout = Timer(2, count=4).start() + interval = Timer(1, count=2) + while 1: + if skip_first_screenshot: + skip_first_screenshot = False + else: + self.device.screenshot() + + if self.image_color_count(MAP_WALK_SPEEDUP, color=(132, 255, 148), threshold=180, count=50): + logger.attr('Walk_Speedup', 'on') + return True + if timeout.reached(): + logger.warning(f'Wait time has expired; Cannot set map walk speedup') + return False + + if interval.reached(): + self.device.click(MAP_WALK_SPEEDUP) + interval.reset() + continue diff --git a/module/map/map_operation.py b/module/map/map_operation.py index 1f1fa28df..e665279c4 100644 --- a/module/map/map_operation.py +++ b/module/map/map_operation.py @@ -148,6 +148,7 @@ class MapOperation(MysteryHandler, FleetPreparation, Retirement, FastForwardHand # Map preparation if map_timer.reached() and self.handle_map_preparation(): self.map_get_info() + self.handle_map_walk_speedup() self.handle_fast_forward() self.handle_auto_search() if self.triggered_map_stop():