diff --git a/assets/en/handler/MAP_WALK_OUT_OF_STEP.png b/assets/en/handler/MAP_WALK_OUT_OF_STEP.png index 8af403340..da19ed4c1 100644 Binary files a/assets/en/handler/MAP_WALK_OUT_OF_STEP.png and b/assets/en/handler/MAP_WALK_OUT_OF_STEP.png differ diff --git a/assets/en/reward/MISSION_MULTI.png b/assets/en/reward/MISSION_MULTI.png index bdfaadd3d..a1741f727 100644 Binary files a/assets/en/reward/MISSION_MULTI.png and b/assets/en/reward/MISSION_MULTI.png differ diff --git a/assets/en/reward/MISSION_SINGLE.png b/assets/en/reward/MISSION_SINGLE.png index 564ccb1bf..23599df74 100644 Binary files a/assets/en/reward/MISSION_SINGLE.png and b/assets/en/reward/MISSION_SINGLE.png differ diff --git a/assets/en/template/TEMPLATE_MAP_WALK_OUT_OF_STEP.png b/assets/en/template/TEMPLATE_MAP_WALK_OUT_OF_STEP.png index b9d6d2019..9a2bdd7e1 100644 Binary files a/assets/en/template/TEMPLATE_MAP_WALK_OUT_OF_STEP.png and b/assets/en/template/TEMPLATE_MAP_WALK_OUT_OF_STEP.png differ diff --git a/campaign/event_20200521_en/b1.py b/campaign/event_20200521_en/b1.py index b0b21ef8d..ae2156a8b 100644 --- a/campaign/event_20200521_en/b1.py +++ b/campaign/event_20200521_en/b1.py @@ -24,8 +24,8 @@ A6, B6, C6, D6, E6, F6, G6, H6, \ = MAP.flatten() class Config: - SUBMARINE = 1 - FLEET_BOSS = 1 + SUBMARINE = 0 + FLEET_BOSS = 0 POOR_MAP_DATA = True MAP_HAS_AMBUSH = False diff --git a/campaign/event_20200521_en/b2.py b/campaign/event_20200521_en/b2.py index 376a9a211..f8a088fbe 100644 --- a/campaign/event_20200521_en/b2.py +++ b/campaign/event_20200521_en/b2.py @@ -25,9 +25,18 @@ A6, B6, C6, D6, E6, F6, G6, H6, I6, \ A7, B7, C7, D7, E7, F7, G7, H7, I7, \ = MAP.flatten() +MAP.spawn_data = [ + {'battle': 0, 'enemy': 2, 'siren': 2}, + {'battle': 1, 'enemy': 1}, + {'battle': 2, 'enemy': 2}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 1}, + {'battle': 5, 'boss': 1}, +] + class Config: - SUBMARINE = 1 - FLEET_BOSS = 1 + SUBMARINE = 0 + FLEET_BOSS = 0 POOR_MAP_DATA = True MAP_HAS_AMBUSH = False @@ -56,3 +65,14 @@ class Config: class Campaign(CampaignBase): MAP = MAP + def battle_0(self): + if self.clear_siren(): + return True + if self.clear_enemy(scale=(2, 3)): + return True + + return self.battle_default() + + def battle_5(self): + return self.clear_boss() + diff --git a/campaign/event_20200521_en/b3.py b/campaign/event_20200521_en/b3.py index f1f7446d9..c1d2dd764 100644 --- a/campaign/event_20200521_en/b3.py +++ b/campaign/event_20200521_en/b3.py @@ -17,18 +17,71 @@ MAP.map_data = ''' SP -- -- -- ++ -- -- ME -- SP -- MS -- -- ME -- -- -- ''' +A1, B1, C1, D1, E1, F1, G1, H1, I1, \ +A2, B2, C2, D2, E2, F2, G2, H2, I2, \ +A3, B3, C3, D3, E3, F3, G3, H3, I3, \ +A4, B4, C4, D4, E4, F4, G4, H4, I4, \ +A5, B5, C5, D5, E5, F5, G5, H5, I5, \ +A6, B6, C6, D6, E6, F6, G6, H6, I6, \ +A7, B7, C7, D7, E7, F7, G7, H7, I7, \ +A8, B8, C8, D8, E8, F8, G8, H8, I8, \ +A9, B9, C9, D9, E9, F9, G9, H9, I9, \ + = MAP.flatten() + +MAP.spawn_data = [ + {'battle': 0, 'enemy': 2, 'siren': 2}, + {'battle': 1, 'enemy': 1}, + {'battle': 2, 'enemy': 2}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 1}, + {'battle': 5, 'boss': 1}, +] class Config: POOR_MAP_DATA = True MAP_HAS_AMBUSH = False - MAP_HAS_FLEET_STEP = False - MAP_HAS_MOVABLE_ENEMY = False + MAP_HAS_FLEET_STEP = True + MAP_HAS_MOVABLE_ENEMY = True MAP_HAS_SIREN = True - MAP_HAS_DYNAMIC_RED_BORDER = False MAP_SIREN_COUNT = 2 + MAP_HAS_DYNAMIC_RED_BORDER = True + MAP_GRID_CENTER_TOLERANCE = 0.3 + MAP_SIREN_TEMPLATE = ['1', '2', '3', 'DD'] + + INTERNAL_LINES_HOUGHLINES_THRESHOLD = 50 + MID_DIFF_RANGE_H = (45, 70) + MID_DIFF_RANGE_V = (97 - 3, 97 + 3) + TRUST_EDGE_LINES = True + + VANISH_POINT_RANGE = ((540, 740), (-4000, -2000)) + DISTANCE_POINT_X_RANGE = ((-2000, -1000),) + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { + 'height': (80, 255 - 40), + 'width': (0.9, 10), + 'prominence': 10, + 'distance': 35, + 'wlen': 100, + } + EDGE_LINES_FIND_PEAKS_PARAMETERS = { + 'height': (255 - 40, 255), + 'prominence': 10, + 'distance': 50, + 'wlen': 1000 + } class Campaign(CampaignBase): MAP = MAP + def battle_0(self): + if self.clear_siren(): + return True + if self.clear_enemy(scale=(2, 3)): + return True + + return self.battle_default() + + def battle_5(self): + return self.clear_boss() + diff --git a/campaign/event_20200521_en/c1.py b/campaign/event_20200521_en/c1.py index b5c2b1453..1cf1420a3 100644 --- a/campaign/event_20200521_en/c1.py +++ b/campaign/event_20200521_en/c1.py @@ -13,10 +13,22 @@ MAP.map_data = ''' -- ME -- -- ++ ME -- ME -- SP -- -- ME ++ -- ME -- MB ''' +A1, B1, C1, D1, E1, F1, G1, H1, I1, \ +A2, B2, C2, D2, E2, F2, G2, H2, I2, \ +A3, B3, C3, D3, E3, F3, G3, H3, I3, \ +A4, B4, C4, D4, E4, F4, G4, H4, I4, \ +A5, B5, C5, D5, E5, F5, G5, H5, I5, \ + = MAP.flatten() +MAP.spawn_data = [ + {'battle': 0, 'enemy': 2, 'siren': 2}, + {'battle': 1, 'enemy': 1}, + {'battle': 2, 'enemy': 2}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'boss': 1}, +] class Config: - SUBMARINE = 1 POOR_MAP_DATA = True MAP_HAS_AMBUSH = False MAP_HAS_FLEET_STEP = True @@ -44,3 +56,14 @@ class Config: class Campaign(CampaignBase): MAP = MAP + def battle_0(self): + if self.clear_siren(): + return True + if self.clear_enemy(scale=(2, 3)): + return True + + return self.battle_default() + + def battle_4(self): + return self.clear_boss() + diff --git a/campaign/event_20200521_en/d2.py b/campaign/event_20200521_en/d2.py index 6420edfb3..89378fd09 100644 --- a/campaign/event_20200521_en/d2.py +++ b/campaign/event_20200521_en/d2.py @@ -36,8 +36,8 @@ class Config: SUBMARINE = 0 FLEET_BOSS = 0 MAP_HAS_AMBUSH = False - MAP_HAS_FLEET_STEP = False - MAP_HAS_MOVABLE_ENEMY = False + MAP_HAS_FLEET_STEP = True + MAP_HAS_MOVABLE_ENEMY = True MAP_HAS_SIREN = True MAP_HAS_DYNAMIC_RED_BORDER = False MAP_SIREN_COUNT = 3 diff --git a/campaign/event_20200521_en/d3.py b/campaign/event_20200521_en/d3.py index 271cd03ab..6558f2cbd 100644 --- a/campaign/event_20200521_en/d3.py +++ b/campaign/event_20200521_en/d3.py @@ -7,7 +7,7 @@ from module.logger import logger MAP = CampaignMap('d3') MAP.shape = 'I9' MAP.map_data = ''' - SP -- ++ ++ -- MS -- ME -- + SP -- ++ ++ -- -- -- ME -- -- ME ++ ++ -- ME -- -- -- -- -- -- -- -- -- ME ME -- ME -- ME ME -- ME ++ ++ ++ @@ -17,27 +17,51 @@ MAP.map_data = ''' SP -- -- -- ++ -- -- ME -- SP -- MS -- -- ME -- -- -- ''' +A1, B1, C1, D1, E1, F1, G1, H1, I1, \ +A2, B2, C2, D2, E2, F2, G2, H2, I2, \ +A3, B3, C3, D3, E3, F3, G3, H3, I3, \ +A4, B4, C4, D4, E4, F4, G4, H4, I4, \ +A5, B5, C5, D5, E5, F5, G5, H5, I5, \ +A6, B6, C6, D6, E6, F6, G6, H6, I6, \ +A7, B7, C7, D7, E7, F7, G7, H7, I7, \ +A8, B8, C8, D8, E8, F8, G8, H8, I8, \ +A9, B9, C9, D9, E9, F9, G9, H9, I9, \ + = MAP.flatten() +MAP.spawn_data = [ + {'battle': 0, 'enemy': 2, 'siren': 2}, + {'battle': 1, 'enemy': 1}, + {'battle': 2, 'enemy': 2, 'siren': 1}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 1}, + {'battle': 5}, + {'battle': 6, 'boss': 1}, +] class Config: - SUBMARINE = 1 - FLEET_BOSS = 2 - POOR_MAP_DATA = True MAP_HAS_AMBUSH = False MAP_HAS_FLEET_STEP = True MAP_HAS_MOVABLE_ENEMY = True MAP_HAS_SIREN = True - MAP_HAS_DYNAMIC_RED_BORDER = True MAP_SIREN_COUNT = 3 + MAP_HAS_DYNAMIC_RED_BORDER = True + MAP_GRID_CENTER_TOLERANCE = 0.3 + MAP_SIREN_TEMPLATE = ['1', '2', '3', 'DD'] + INTERNAL_LINES_HOUGHLINES_THRESHOLD = 50 + MID_DIFF_RANGE_H = (45, 70) + MID_DIFF_RANGE_V = (97 - 3, 97 + 3) TRUST_EDGE_LINES = True + VANISH_POINT_RANGE = ((540, 740), (-4000, -2000)) + DISTANCE_POINT_X_RANGE = ((-2000, -1000),) INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (80, 255 - 40), 'width': (0.9, 10), 'prominence': 10, 'distance': 35, + 'wlen': 100, } EDGE_LINES_FIND_PEAKS_PARAMETERS = { 'height': (255 - 40, 255), @@ -50,3 +74,22 @@ class Config: class Campaign(CampaignBase): MAP = MAP + def battle_0(self): + if self.clear_siren(): + return True + if self.clear_enemy(scale=(2, 3)): + return True + + return self.battle_default() + + def battle_5(self): + if self.clear_enemy(scale=(1,)): + return True + if self.clear_enemy(scale=(2,)): + return True + + return self.battle_default() + + def battle_6(self): + return self.fleet_2.clear_boss() + diff --git a/module/campaign/campaign_ocr.py b/module/campaign/campaign_ocr.py index f36465486..c4e56b5a2 100644 --- a/module/campaign/campaign_ocr.py +++ b/module/campaign/campaign_ocr.py @@ -162,7 +162,7 @@ class CampaignOcr: self.stage_entrance = {} buttons = self.campaign_extract_name_image(image) - ocr = Ocr(buttons, lang='stage', letter=(255, 255, 255), back=(102, 102, 102), threshold=180) + ocr = Ocr(buttons, lang='stage', letter=(255, 255, 255), back=(102, 102, 102), threshold=120) result = ocr.ocr(image) if not isinstance(result, list): result = [result] diff --git a/module/config/argparser_en.py b/module/config/argparser_en.py index f495f06e0..683625550 100644 --- a/module/config/argparser_en.py +++ b/module/config/argparser_en.py @@ -53,7 +53,7 @@ def update_config_from_template(config, file): sidebar_title='Function', terminal_font_family='Consolas', language='english', - default_size=(1000, 720), + default_size=(1110, 720), navigation='SIDEBAR', tabbed_groups=True, show_success_modal=False, diff --git a/module/handler/assets.py b/module/handler/assets.py index b9112a755..b9d7c434f 100644 --- a/module/handler/assets.py +++ b/module/handler/assets.py @@ -34,7 +34,7 @@ MAP_GREEN = Button(area={'cn': (195, 260, 349, 292), 'en': (201, 259, 341, 290)} MAP_STAR_1 = Button(area={'cn': (245, 377, 254, 384), 'en': (232, 381, 240, 389)}, color={'cn': (251, 233, 143), 'en': (252, 234, 146)}, button={'cn': (245, 377, 254, 384), 'en': (232, 381, 240, 389)}, file={'cn': './assets/cn/handler/MAP_STAR_1.png', 'en': './assets/en/handler/MAP_STAR_1.png'}) MAP_STAR_2 = Button(area={'cn': (532, 377, 540, 384), 'en': (518, 382, 526, 389)}, color={'cn': (251, 233, 144), 'en': (252, 234, 144)}, button={'cn': (532, 377, 540, 384), 'en': (518, 382, 526, 389)}, file={'cn': './assets/cn/handler/MAP_STAR_2.png', 'en': './assets/en/handler/MAP_STAR_2.png'}) MAP_STAR_3 = Button(area={'cn': (818, 377, 827, 384), 'en': (804, 382, 812, 389)}, color={'cn': (251, 233, 143), 'en': (252, 234, 144)}, button={'cn': (818, 377, 827, 384), 'en': (804, 382, 812, 389)}, file={'cn': './assets/cn/handler/MAP_STAR_3.png', 'en': './assets/en/handler/MAP_STAR_3.png'}) -MAP_WALK_OUT_OF_STEP = Button(area={'cn': (654, 312, 704, 335), 'en': (654, 312, 704, 335)}, color={'cn': (109, 113, 120), 'en': (109, 113, 120)}, button={'cn': (654, 312, 704, 335), 'en': (654, 312, 704, 335)}, file={'cn': './assets/cn/handler/MAP_WALK_OUT_OF_STEP.png', 'en': './assets/en/handler/MAP_WALK_OUT_OF_STEP.png'}) +MAP_WALK_OUT_OF_STEP = Button(area={'cn': (654, 312, 704, 335), 'en': (654, 312, 704, 335)}, color={'cn': (109, 113, 120), 'en': (112, 113, 120)}, button={'cn': (654, 312, 704, 335), 'en': (654, 312, 704, 335)}, file={'cn': './assets/cn/handler/MAP_WALK_OUT_OF_STEP.png', 'en': './assets/en/handler/MAP_WALK_OUT_OF_STEP.png'}) MYSTERY_ITEM = Button(area={'cn': (589, 294, 691, 427), 'en': (589, 294, 691, 427)}, color={'cn': (144, 127, 83), 'en': (144, 127, 83)}, button={'cn': (589, 294, 691, 427), 'en': (589, 294, 691, 427)}, file={'cn': './assets/cn/handler/MYSTERY_ITEM.png', 'en': './assets/en/handler/MYSTERY_ITEM.png'}) POPUP_CANCEL = Button(area={'cn': (404, 493, 576, 550), 'en': (403, 481, 577, 541)}, color={'cn': (166, 169, 172), 'en': (170, 172, 174)}, button={'cn': (404, 493, 576, 550), 'en': (403, 481, 577, 541)}, file={'cn': './assets/cn/handler/POPUP_CANCEL.png', 'en': './assets/en/handler/POPUP_CANCEL.png'}) POPUP_CONFIRM = Button(area={'cn': (704, 493, 876, 550), 'en': (703, 481, 877, 541)}, color={'cn': (94, 144, 204), 'en': (107, 152, 207)}, button={'cn': (704, 493, 876, 550), 'en': (703, 481, 877, 541)}, file={'cn': './assets/cn/handler/POPUP_CONFIRM.png', 'en': './assets/en/handler/POPUP_CONFIRM.png'}) diff --git a/module/reward/assets.py b/module/reward/assets.py index ba2e24d16..c40379263 100644 --- a/module/reward/assets.py +++ b/module/reward/assets.py @@ -13,9 +13,9 @@ COMMISSION_START = Button(area={'cn': (1028, 322, 1156, 383), 'en': (1031, 333, COMMISSION_STOP_SCROLLING = Button(area={'cn': (115, 236, 179, 487), 'en': (115, 236, 179, 487)}, color={'cn': (50, 55, 74), 'en': (50, 55, 74)}, button={'cn': (115, 236, 179, 487), 'en': (115, 236, 179, 487)}, file={'cn': './assets/cn/reward/COMMISSION_STOP_SCROLLING.png', 'en': './assets/en/reward/COMMISSION_STOP_SCROLLING.png'}) COMMISSION_URGENT = Button(area={'cn': (35, 231, 68, 281), 'en': (28, 221, 76, 283)}, color={'cn': (215, 188, 124), 'en': (169, 138, 95)}, button={'cn': (35, 231, 68, 281), 'en': (28, 221, 76, 283)}, file={'cn': './assets/cn/reward/COMMISSION_URGENT.png', 'en': './assets/en/reward/COMMISSION_URGENT.png'}) EXP_INFO_S_REWARD = Button(area={'cn': (498, 140, 557, 154), 'en': (498, 140, 557, 154)}, color={'cn': (233, 241, 127), 'en': (105, 119, 139)}, button={'cn': (498, 140, 557, 154), 'en': (498, 140, 557, 154)}, file={'cn': './assets/cn/reward/EXP_INFO_S_REWARD.png', 'en': './assets/en/reward/EXP_INFO_S_REWARD.png'}) -MISSION_MULTI = Button(area={'cn': (1041, 8, 1101, 39), 'en': (1041, 8, 1101, 39)}, color={'cn': (226, 192, 142), 'en': (226, 192, 142)}, button={'cn': (1041, 8, 1101, 39), 'en': (1041, 8, 1101, 39)}, file={'cn': './assets/cn/reward/MISSION_MULTI.png', 'en': './assets/en/reward/MISSION_MULTI.png'}) +MISSION_MULTI = Button(area={'cn': (1041, 8, 1101, 39), 'en': (1041, 8, 1101, 39)}, color={'cn': (226, 192, 142), 'en': (221, 179, 96)}, button={'cn': (1041, 8, 1101, 39), 'en': (1041, 8, 1101, 39)}, file={'cn': './assets/cn/reward/MISSION_MULTI.png', 'en': './assets/en/reward/MISSION_MULTI.png'}) MISSION_NOTICE = Button(area={'cn': (940, 670, 945, 681), 'en': (940, 670, 945, 681)}, color={'cn': (183, 83, 66), 'en': (183, 83, 66)}, button={'cn': (940, 670, 945, 681), 'en': (940, 670, 945, 681)}, file={'cn': './assets/cn/reward/MISSION_NOTICE.png', 'en': './assets/en/reward/MISSION_NOTICE.png'}) -MISSION_SINGLE = Button(area={'cn': (1093, 118, 1179, 177), 'en': (1093, 118, 1179, 177)}, color={'cn': (115, 155, 218), 'en': (115, 155, 218)}, button={'cn': (1093, 118, 1179, 177), 'en': (1093, 118, 1179, 177)}, file={'cn': './assets/cn/reward/MISSION_SINGLE.png', 'en': './assets/en/reward/MISSION_SINGLE.png'}) +MISSION_SINGLE = Button(area={'cn': (1093, 118, 1179, 177), 'en': (1093, 118, 1179, 177)}, color={'cn': (115, 155, 218), 'en': (106, 147, 215)}, button={'cn': (1093, 118, 1179, 177), 'en': (1093, 118, 1179, 177)}, file={'cn': './assets/cn/reward/MISSION_SINGLE.png', 'en': './assets/en/reward/MISSION_SINGLE.png'}) OIL = Button(area={'cn': (162, 64, 182, 91), 'en': (162, 64, 182, 91)}, color={'cn': (71, 72, 71), 'en': (71, 72, 71)}, button={'cn': (162, 64, 182, 91), 'en': (162, 64, 182, 91)}, file={'cn': './assets/cn/reward/OIL.png', 'en': './assets/en/reward/OIL.png'}) REWARD_1 = Button(area={'cn': (383, 285, 503, 297), 'en': (383, 283, 503, 294)}, color={'cn': (238, 168, 81), 'en': (241, 187, 120)}, button={'cn': (383, 285, 503, 297), 'en': (383, 283, 503, 294)}, file={'cn': './assets/cn/reward/REWARD_1.png', 'en': './assets/en/reward/REWARD_1.png'}) REWARD_2 = Button(area={'cn': (383, 404, 503, 444), 'en': (382, 403, 504, 445)}, color={'cn': (233, 165, 67), 'en': (236, 177, 92)}, button={'cn': (383, 404, 503, 444), 'en': (382, 403, 504, 445)}, file={'cn': './assets/cn/reward/REWARD_2.png', 'en': './assets/en/reward/REWARD_2.png'}) diff --git a/module/reward/commission.py b/module/reward/commission.py index c2202b0a6..de375c9ad 100644 --- a/module/reward/commission.py +++ b/module/reward/commission.py @@ -37,7 +37,7 @@ dictionary_en = { 'extra_drill': ['Sailing', 'Defense Patrol', 'Buoy'], 'extra_part': ['veinprotectoncommisionll', 'Forestprtectoncommisionl', 'Forestprotectoncommisionll'], 'extra_cube': ['Exercise'], - 'extra_oil': ['Large-saleoilExtractionlll', 'FleetCargoTransport', 'Large-saleoilExtractianl', 'Large-saleoilExtractionl', 'Large-saleoilExtractiaonll'], + 'extra_oil': ['oilextraction', 'FleetCargoTransport', 'oilExtractianl', '', 'oilExtractiaonll'], 'extra_book': ['LargeMerchantEscort'], 'urgent_drill': ['Cargo Defense', 'Scouts', 'Force', 'Elites', 'FrontierDefensePatrol'], 'urgent_part': ['Lavella', 'Maui', 'Rendova', 'AidingWongbanna'], @@ -181,7 +181,7 @@ class Commission: Returns: timedelta: datetime.timedelta instance. """ - string = string.replace('D', '0') # Poor OCR + string = string.replace('D', '0').replace(' ', '').replace('-', '') # Poor OCR result = re.search('(\d+):(\d+):(\d+)', string) if not result: logger.warning(f'Invalid time string: {string}')