From 26c4d6552d6ae64dfa250afe144b514f5380129e Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 5 Jun 2020 10:54:29 +0800 Subject: [PATCH 1/7] Add: Reward loop when finished, to all function --- alas.py | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/alas.py b/alas.py index d6ab4861f..c2722aa5b 100644 --- a/alas.py +++ b/alas.py @@ -37,6 +37,11 @@ class AzurLaneAutoScript: with open(f'{folder}/log.txt', 'w') as f: f.writelines(text) + def reward_when_finished(self): + from module.reward.reward import Reward + az = Reward(self.config) + az.reward_loop() + def setting(self): for key, value in self.config.config['Setting'].items(): print(f'{key} = {value}') @@ -49,9 +54,7 @@ class AzurLaneAutoScript: print(f'{key} = {value}') logger.hr('Reward Settings saved') - from module.reward.reward import Reward - az = Reward(self.config) - az.reward_loop() + self.reward_when_finished() def emulator(self): for key, value in self.config.config['Emulator'].items(): @@ -72,20 +75,18 @@ class AzurLaneAutoScript: from module.campaign.run import CampaignRun az = CampaignRun(self.config) az.run(self.config.CAMPAIGN_NAME) + self.reward_when_finished() def daily(self): """ Method to run daily missions. """ - flag = True - if self.config.ENABLE_DAILY_MISSION: from module.daily.daily import Daily az = Daily(self.config) if not az.record_executed_since(): az.run() az.record_save() - flag = True if self.config.ENABLE_HARD_CAMPAIGN: from module.hard.hard import CampaignHard @@ -93,7 +94,6 @@ class AzurLaneAutoScript: if not az.record_executed_since(): az.run() az.record_save() - flag = True if self.config.ENABLE_EXERCISE: from module.exercise.exercise import Exercise @@ -101,12 +101,8 @@ class AzurLaneAutoScript: if not az.record_executed_since(): az.run() az.record_save() - flag = True - if flag: - from module.reward.reward import Reward - az = Reward(self.config) - az.reward() + self.reward_when_finished() def event(self): """ @@ -115,11 +111,13 @@ class AzurLaneAutoScript: from module.campaign.run import CampaignRun az = CampaignRun(self.config) az.run(self.config.CAMPAIGN_EVENT, folder=self.config.EVENT_NAME) + self.reward_when_finished() def event_daily_ab(self): from module.event.campaign_ab import CampaignAB az = CampaignAB(self.config) az.run_event_daily() + self.reward_when_finished() def semi_auto(self): from module.daemon.daemon import AzurLaneDaemon @@ -130,16 +128,19 @@ class AzurLaneAutoScript: from module.campaign.run import CampaignRun az = CampaignRun(self.config) az.run('campaign_7_2_mystery_farming') + self.reward_when_finished() def c124_leveling(self): from module.campaign.run import CampaignRun az = CampaignRun(self.config) az.run('campaign_12_4_leveling') + self.reward_when_finished() def c122_leveling(self): from module.campaign.run import CampaignRun az = CampaignRun(self.config) az.run('campaign_12_2_leveling') + self.reward_when_finished() def retire(self): from module.retire.retirement import Retirement From 83afdafccbe7b5ab16868b3cb6eefd030c6e0ee2 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 5 Jun 2020 18:10:48 +0800 Subject: [PATCH 2/7] Fix: Commission not found - Add commission_swipe_to_top, because switching daily/urgent won't reset commission list now --- assets/cn/reward/COMMISSION_SCROLL.png | Bin 0 -> 7846 bytes assets/cn/reward/COMMISSION_SCROLL_TOP.png | Bin 0 -> 5535 bytes assets/en/reward/COMMISSION_SCROLL.png | Bin 0 -> 7846 bytes assets/en/reward/COMMISSION_SCROLL_TOP.png | Bin 0 -> 5535 bytes module/reward/assets.py | 2 ++ module/reward/commission.py | 25 +++++++++++++++++++++ 6 files changed, 27 insertions(+) create mode 100644 assets/cn/reward/COMMISSION_SCROLL.png create mode 100644 assets/cn/reward/COMMISSION_SCROLL_TOP.png create mode 100644 assets/en/reward/COMMISSION_SCROLL.png create mode 100644 assets/en/reward/COMMISSION_SCROLL_TOP.png diff --git a/assets/cn/reward/COMMISSION_SCROLL.png b/assets/cn/reward/COMMISSION_SCROLL.png new file mode 100644 index 0000000000000000000000000000000000000000..27d5d9294df8e3ba3ae7945c01c6ad9dea2e712a GIT binary patch literal 7846 zcmd^EcRZE-`@gL+GO|ZTL^7HxWTj+eWga32PqvQigE$e1jIuJ0WMqU?WMrI%lua2S zDpL5@zYrU`cb$zaLyQQnGN>9s83qcUQy4qPi z2%^F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obi3mlZ-&On>Q@#stya*WO z97pLVImQA+!2pE{494d!nK<~IK;5kK_Z0>k_51pf--y=59(6ddV#I+_v>snGL8tg zS<=SDim5N*lE-EHgNPiM+s%lrV3d0t0Se=zgIDo1a`D@7q8~=aULpL*p9sG!oRLS$ znd$UU0w#!d+jX2oYgRCw2ZShmonhH=vQUu?gZK91fvm;Zlxu|UfHE!MzwJh>wOqNg z2v?BDjM7ybNMzAvWXVAB=+j(o4ADct=RQC9Od3!MG96+m3ls{Savu zsXy+Y?R*pXC2<2JiXL!nOHHWopjST=dkoKA!WLo+avdES8z+|CV<}?YVwB4WLn5*D zmVm(;#SX?^)K`!JViop|Z8;ORR3Po(F*Uq2(X*qZZb$Tm5dRjh$_P?i_rum93iPz~&zb+6x0`SS%l(eHuE`9?)k9U^o4gke-ADU= zj4!3Zcl0Nb*h^UD6^BhX*z}&Y<-UwSaJyVN%)Bf3poe)vSBwZU5g#+FcqIQr;e22V z{>2IHxx4sc8lFYJHH(p8BCWQELxPQj0BQA01h$EgTEy>I*(UriBHNhp&yHp}6)nJSHZ_Evn~d2kkFqsHp6h ztKKQ@uDU5JhZ7|pxX+nZWrhvG4B)!%X&(7ZlX%3BhAj}ME#f$;TO`*zWNu41az%}O zD(Ph1&B0mt@iPXQD)U^4@a2Pa9H30WF^Cb&ytRn{Zz)tl0c(kGj{r|~%cKX0v)`6? z4GzR1S?WTe5y2F(FQ>s5oXvo>Eu-;vuD6K&^QrbPT|q**ep^|Yey_oMu;O&!gF43n Qd~zUl745Ty%J9Jd0BI9qI{*Lx literal 0 HcmV?d00001 diff --git a/assets/cn/reward/COMMISSION_SCROLL_TOP.png b/assets/cn/reward/COMMISSION_SCROLL_TOP.png new file mode 100644 index 0000000000000000000000000000000000000000..f31cb4b8aafa98b704f7268ed978e2b46eb48752 GIT binary patch literal 5535 zcmeI0`8yQs_s4Hr*~vDRWQ(V=iykQq!jNT*J!C8E46={VAWMXiEo-*2G=!8%wqzem z6v@6zgRxKckLNG=e*X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pf--y=59(6ddV#I+_v>snGL8tg zS<=SDim5N*lE-EHgNPiM+s%lrV3d0t0Se=zgIDo1a`D@7q8~=aULpL*p9sG!oRLS$ znd$UU0w#!d+jX2oYgRCw2ZShmonhH=vQUu?gZK91fvm;Zlxu|UfHE!MzwJh>wOqNg z2v?BDjM7ybNMzAvWXVAB=+j(o4ADct=RQC9Od3!MG96+m3ls{Savu zsXy+Y?R*pXC2<2JiXL!nOHHWopjST=dkoKA!WLo+avdES8z+|CV<}?YVwB4WLn5*D zmVm(;#SX?^)K`!JViop|Z8;ORR3Po(F*Uq2(X*qZZb$Tm5dRjh$_P?i_rum93iPz~&zb+6x0`SS%l(eHuE`9?)k9U^o4gke-ADU= zj4!3Zcl0Nb*h^UD6^BhX*z}&Y<-UwSaJyVN%)Bf3poe)vSBwZU5g#+FcqIQr;e22V z{>2IHxx4sc8lFYJHH(p8BCWQELxPQj0BQA01h$EgTEy>I*(UriBHNhp&yHp}6)nJSHZ_Evn~d2kkFqsHp6h ztKKQ@uDU5JhZ7|pxX+nZWrhvG4B)!%X&(7ZlX%3BhAj}ME#f$;TO`*zWNu41az%}O zD(Ph1&B0mt@iPXQD)U^4@a2Pa9H30WF^Cb&ytRn{Zz)tl0c(kGj{r|~%cKX0v)`6? z4GzR1S?WTe5y2F(FQ>s5oXvo>Eu-;vuD6K&^QrbPT|q**ep^|Yey_oMu;O&!gF43n Qd~zUl745Ty%J9Jd0BI9qI{*Lx literal 0 HcmV?d00001 diff --git a/assets/en/reward/COMMISSION_SCROLL_TOP.png b/assets/en/reward/COMMISSION_SCROLL_TOP.png new file mode 100644 index 0000000000000000000000000000000000000000..f31cb4b8aafa98b704f7268ed978e2b46eb48752 GIT binary patch literal 5535 zcmeI0`8yQs_s4Hr*~vDRWQ(V=iykQq!jNT*J!C8E46={VAWMXiEo-*2G=!8%wqzem z6v@6zgRxKckLNG=e*XaHy3X}J*SXJi|M0qhd7t|k+(4U&o|hf~z@!7ag8+c$w50q- zOL;0#0bPny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Tv0j{5==h_=j)#-U{~i_3QCRdesw)X5_z?ww8WfHh1Q8&iBdLQh>a*U zQN^*v91Cw zr#P#)Wed9`ec%7S<^6+(ONQ^W#d3#bP@Q9~R?`iH$9768$`AMZmZ?z z;%PpglV()mRA;1PvJ~)6_H2f1^6fcZA9t3>9N_Gx&EdSqw=dHprgv%hLPAtO?G$UM z=bJsf<(`kUG1J<}7`%WhPX=T!gyZTpxiYCgMm5I1k9^4z!?=0N1LuZ>jl|ODpKgu0 zef0Ks#qx8evpFBiC1mFH?DtVl!6#)9|)qpDiG z?(G+gIcBN5iW9d&H1=Jh47L2)uhSVK#L-DSFFuKE>6_gdp2YS4dh|>3W=eKSb|Hev zHLXVcr%dgYT02bZzdoj24BC{5Dzz(Pc2R9B6w76-}~gqX`lMQl;oB^WM%f`8YI;g z=Y=b&_*keu2*x zr90`HALO=^&|A~n-Akoludr&>^AR_;nSY~jHz?bS*w`=AH42eV{TDf`0~%xo8ZTD@Zb4;U&p`pPGvl)-JvDI z(BgwiO@27ZLR6k|egosu15by;@sx*Vg1xqRo1}*S0X(VNA64Zn<)WvUaG~ z(G2XJl_&8bnXqbpyTW%{pLlD4^!>@cTl0|5&%ZyVY+j)oNbM_pwH{&<7xAKXJAeIm zS0MrPYkK20L5YFy4jV_0{+!=u`SYaaxawguYWlBTvt9pJOBNC{U3Bho%E|ZWnL+Iy z?I95@k@&9@dvX0u73k6} zZ_?Y+cS;>19Rl@zXyuJJhvj`^AtXGhZmOd}Amhp*^ccQ1uiVhM6m*0k^Z^JG1ppHPz~0HJE(72v1Hd0U0F+(=0P%cb+opADLVI-XsF?(g zuKdhr!ay0J1L~})7Fu8AyQZ3&6N#typ2h!{KpsN` Date: Fri, 5 Jun 2020 18:41:56 +0800 Subject: [PATCH 3/7] Add: Boss fleet check from chapter 7 to 13 --- module/config/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/config/config.py b/module/config/config.py index 6760073f8..ff4fa599b 100644 --- a/module/config/config.py +++ b/module/config/config.py @@ -382,6 +382,11 @@ class AzurLaneConfig: logger.warning(f'Mob fleet [{self.FLEET_1}] and boss fleet [{self.FLEET_2}] is the same') logger.warning('They should to be set to different fleets') exit(1) + if self.COMMAND.lower() == 'main' and self.CAMPAIGN_NAME.startswith('campaign_'): + if int(self.CAMPAIGN_NAME.split('_')[1]) >= 7 and self.FLEET_2 == 0: + logger.warning('You should use 2 fleets from chapter 7 to 13') + logger.warning(f'Current: mob fleet [{self.FLEET_1}], boss fleet [{self.FLEET_2}]') + exit(1) def save(self): self.config.write(codecs.open(self.CONFIG_FILE, "w+", "utf8")) From 66d119e250d6e701dd3d94bffb8cea09b1fe2b55 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 5 Jun 2020 20:22:27 +0800 Subject: [PATCH 4/7] Add: camera_data_spawn_point --- campaign/campaign_main/campaign_7_1.py | 1 + module/map/camera.py | 11 +++++++++-- module/map/map_base.py | 19 +++++++++++++++++++ module/map/map_grids.py | 2 +- 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/campaign/campaign_main/campaign_7_1.py b/campaign/campaign_main/campaign_7_1.py index 9f46e1556..97bf63c44 100644 --- a/campaign/campaign_main/campaign_7_1.py +++ b/campaign/campaign_main/campaign_7_1.py @@ -11,6 +11,7 @@ MAP.map_data = ''' SP -- ++ ++ -- ME ME MB ''' MAP.camera_data = ['C1', 'E1'] +MAP.camera_data_spawn_point = ['C1'] MAP.weight_data = ''' 40 30 21 20 17 15 50 50 40 40 50 50 16 13 50 50 diff --git a/module/map/camera.py b/module/map/camera.py index 4900257fe..ecb623869 100644 --- a/module/map/camera.py +++ b/module/map/camera.py @@ -258,10 +258,17 @@ class Camera(InfoHandler): self.map.reset_fleet() queue = self.map.camera_data + if battle_count == 0: + queue.add(self.map.camera_data_spawn_point) + while len(queue) > 0: if self.map.missing_is_none(battle_count, mystery_count, siren_count, carrier_count): - logger.info('All spawn found, Early stopped.') - break + if battle_count == 0 and queue.count != queue.delete(self.map.camera_data_spawn_point).count: + logger.info('Continue scanning spawn points.') + pass + else: + logger.info('All spawn found, Early stopped.') + break queue = queue.sort_by_camera_distance(self.camera) self.focus_to(queue[0]) self.predict(is_carrier_scan=is_carrier_scan) diff --git a/module/map/map_base.py b/module/map/map_base.py index 5b8829040..094b16bef 100644 --- a/module/map/map_base.py +++ b/module/map/map_base.py @@ -45,6 +45,7 @@ class CampaignMap: self._spawn_data = [] self._spawn_data_backup = [] self._camera_data = [] + self._camera_data_spawn_point = [] self.in_map_swipe_preset_data = None self.poor_map_data = False self.camera_sight = (-3, -1, 3, 2) @@ -89,6 +90,7 @@ class CampaignMap: # camera_data can be generate automatically, but it's better to set it manually. self.camera_data = [location2node(loca) for loca in camera_2d(self._shape, sight=self.camera_sight)] + self.camera_data_spawn_point = [] # weight_data set to 10. for grid in self: grid.weight = 10. @@ -208,6 +210,23 @@ class CampaignMap: """ self._camera_data = SelectedGrids([self[node2location(node)] for node in nodes]) + @property + def camera_data_spawn_point(self): + """Additional camera_data to detect fleets at spawn point. + + Returns: + SelectedGrids: + """ + return self._camera_data_spawn_point + + @camera_data_spawn_point.setter + def camera_data_spawn_point(self, nodes): + """ + Args: + nodes (list): Contains str. + """ + self._camera_data_spawn_point = SelectedGrids([self[node2location(node)] for node in nodes]) + @property def spawn_data(self): return self._spawn_data diff --git a/module/map/map_grids.py b/module/map/map_grids.py index 99253331a..a033d6b17 100644 --- a/module/map/map_grids.py +++ b/module/map/map_grids.py @@ -92,7 +92,7 @@ class SelectedGrids: Returns: SelectedGrids: """ - return SelectedGrids(self.grids + grids.grids) + return SelectedGrids(list(set(self.grids + grids.grids))) def delete(self, grids): """ From d042f926b539c55f9cb2f59de4ed85e3b112a5e8 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 5 Jun 2020 21:51:08 +0800 Subject: [PATCH 5/7] Fix: Catch other error caused by info_bar - Increase EDGE_LINES_HOUGHLINES_THRESHOLD in chapter 3 --- campaign/campaign_main/campaign_3_1.py | 3 +-- module/map/camera.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/campaign/campaign_main/campaign_3_1.py b/campaign/campaign_main/campaign_3_1.py index b87a7025d..1f35beedf 100644 --- a/campaign/campaign_main/campaign_3_1.py +++ b/campaign/campaign_main/campaign_3_1.py @@ -34,11 +34,10 @@ A4, B4, C4, D4, E4, F4, G4, \ class Config: FLEET_BOSS = 1 - MAP_MYSTERY_HAS_CARRIER = True INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 - EDGE_LINES_HOUGHLINES_THRESHOLD = 40 + EDGE_LINES_HOUGHLINES_THRESHOLD = 75 INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (120, 255 - 40), 'width': (1.5, 10), diff --git a/module/map/camera.py b/module/map/camera.py index ecb623869..e3aa810db 100644 --- a/module/map/camera.py +++ b/module/map/camera.py @@ -113,7 +113,7 @@ class Camera(InfoHandler): try: self.grids = Grids(self.device.image, config=self.config) - except PerspectiveError as e: + except Exception as e: if self.info_bar_count(): logger.info('Perspective error cause by info bar. Waiting.') self.handle_info_bar() From 1e94b5d69c4a1f56a3c2e9118ed242a19014c6f5 Mon Sep 17 00:00:00 2001 From: Cerz0 <62533167+Cerz0@users.noreply.github.com> Date: Fri, 5 Jun 2020 17:19:03 +0200 Subject: [PATCH 6/7] Update: map 10-1 Update campaign_10_1.py --- campaign/campaign_main/campaign_10_1.py | 53 +++++++++++++------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/campaign/campaign_main/campaign_10_1.py b/campaign/campaign_main/campaign_10_1.py index ecad3a6f7..ec3c7870d 100644 --- a/campaign/campaign_main/campaign_10_1.py +++ b/campaign/campaign_main/campaign_10_1.py @@ -15,12 +15,12 @@ MAP.map_data = ''' SP -- ++ ++ -- -- ++ ''' MAP.weight_data = ''' - 10 10 10 10 40 40 10 - 10 20 10 30 30 40 40 - 10 40 30 30 30 10 10 - 10 10 10 10 30 10 10 - 10 10 10 10 10 10 10 - 10 10 10 10 10 10 10 + 50 50 50 50 50 40 50 + 50 50 50 30 30 50 40 + 50 40 30 30 30 50 05 + 50 25 20 20 30 50 05 + 50 50 50 15 10 10 05 + 50 50 50 50 50 50 50 ''' # MAP.camera_data = ['D3'] MAP.spawn_data = [ @@ -43,18 +43,17 @@ A6, B6, C6, D6, E6, F6, G6, \ road_main = RoadGrids([B4, C4, D4, E5, F5, G5]) - class Config: - INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 - EDGE_LINES_HOUGHLINES_THRESHOLD = 40 - COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 - INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { + INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 + EDGE_LINES_HOUGHLINES_THRESHOLD = 40 + COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (150, 255 - 24), 'width': (0.9, 10), 'prominence': 10, 'distance': 35, } - EDGE_LINES_FIND_PEAKS_PARAMETERS = { + EDGE_LINES_FIND_PEAKS_PARAMETERS = { 'height': (255 - 24, 255), 'prominence': 10, 'distance': 50, @@ -64,21 +63,23 @@ class Config: class Campaign(CampaignBase): - MAP = MAP + MAP = MAP - def battle_0(self): - if self.clear_roadblocks([road_main]): - return True - if self.clear_potential_roadblocks([road_main]): - return True + def battle_0(self): + self.fleet_2_push_forward() + + if self.clear_roadblocks([road_main]): + return True + if self.clear_potential_roadblocks([road_main]): + return True - return self.battle_default() + return self.battle_default() - def battle_6(self): - boss = self.map.select(is_boss=True) - if boss: - if not self.check_accessibility(boss[0], fleet=2): - if self.clear_roadblocks([road_main]): - return True + def battle_6(self): + boss = self.map.select(is_boss=True) + if boss: + if not self.check_accessibility(boss[0], fleet=2): + if self.clear_roadblocks([road_main]): + return True - return self.fleet_2.clear_boss() \ No newline at end of file + return self.fleet_2.clear_boss() \ No newline at end of file From a3feef6f1bb69578c831658ab20133c44eb5d6d3 Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 5 Jun 2020 23:25:50 +0800 Subject: [PATCH 7/7] Format: PEP-8 for campaign maps --- campaign/campaign_main/campaign_10_1.py | 54 +++++----- campaign/campaign_main/campaign_10_2.py | 1 - campaign/campaign_main/campaign_10_4.py | 1 - campaign/campaign_main/campaign_3_2.py | 1 - campaign/campaign_main/campaign_9_2.py | 137 ++++++++++++------------ campaign/campaign_main/campaign_9_3.py | 87 +++++++-------- campaign/campaign_main/campaign_9_4.py | 84 ++++++++------- 7 files changed, 182 insertions(+), 183 deletions(-) diff --git a/campaign/campaign_main/campaign_10_1.py b/campaign/campaign_main/campaign_10_1.py index ec3c7870d..e5d13e440 100644 --- a/campaign/campaign_main/campaign_10_1.py +++ b/campaign/campaign_main/campaign_10_1.py @@ -3,35 +3,34 @@ from module.map.map_base import CampaignMap from module.map.map_grids import SelectedGrids, RoadGrids from module.logger import logger - MAP = CampaignMap('10-1') MAP.shape = 'G6' MAP.map_data = ''' - SP -- ++ -- ME ME -- - -- -- ++ ME ME ME ME - -- ME ME ME ++ ++ MB - -- ME ME ME ME ++ MB - -- -- ++ -- ME ME ME - SP -- ++ ++ -- -- ++ + SP -- ++ -- ME ME -- + -- -- ++ ME ME ME ME + -- ME ME ME ++ ++ MB + -- ME ME ME ME ++ MB + -- -- ++ -- ME ME ME + SP -- ++ ++ -- -- ++ ''' MAP.weight_data = ''' - 50 50 50 50 50 40 50 - 50 50 50 30 30 50 40 - 50 40 30 30 30 50 05 - 50 25 20 20 30 50 05 - 50 50 50 15 10 10 05 - 50 50 50 50 50 50 50 + 50 50 50 50 50 40 50 + 50 50 50 30 30 50 40 + 50 40 30 30 30 50 05 + 50 25 20 20 30 50 05 + 50 50 50 15 10 10 05 + 50 50 50 50 50 50 50 ''' # MAP.camera_data = ['D3'] MAP.spawn_data = [ - {'battle': 0, 'enemy': 4}, - {'battle': 1, 'enemy': 1}, - {'battle': 2, 'enemy': 1}, - {'battle': 3, 'enemy': 1}, - {'battle': 4, 'enemy': 1}, - {'battle': 5}, - {'battle': 6, 'boss': 1}, - ] + {'battle': 0, 'enemy': 4}, + {'battle': 1, 'enemy': 1}, + {'battle': 2, 'enemy': 1}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 1}, + {'battle': 5}, + {'battle': 6, 'boss': 1}, +] A1, B1, C1, D1, E1, F1, G1, \ A2, B2, C2, D2, E2, F2, G2, \ @@ -43,6 +42,7 @@ A6, B6, C6, D6, E6, F6, G6, \ road_main = RoadGrids([B4, C4, D4, E5, F5, G5]) + class Config: INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 EDGE_LINES_HOUGHLINES_THRESHOLD = 40 @@ -52,22 +52,22 @@ class Config: 'width': (0.9, 10), 'prominence': 10, 'distance': 35, - } + } EDGE_LINES_FIND_PEAKS_PARAMETERS = { 'height': (255 - 24, 255), 'prominence': 10, 'distance': 50, 'width': (0, 10), 'wlen': 1000, - } + } class Campaign(CampaignBase): MAP = MAP - + def battle_0(self): self.fleet_2_push_forward() - + if self.clear_roadblocks([road_main]): return True if self.clear_potential_roadblocks([road_main]): @@ -81,5 +81,5 @@ class Campaign(CampaignBase): if not self.check_accessibility(boss[0], fleet=2): if self.clear_roadblocks([road_main]): return True - - return self.fleet_2.clear_boss() \ No newline at end of file + + return self.fleet_2.clear_boss() diff --git a/campaign/campaign_main/campaign_10_2.py b/campaign/campaign_main/campaign_10_2.py index 6038fee70..3b04900fb 100644 --- a/campaign/campaign_main/campaign_10_2.py +++ b/campaign/campaign_main/campaign_10_2.py @@ -3,7 +3,6 @@ from module.map.map_base import CampaignMap from module.map.map_grids import SelectedGrids, RoadGrids from module.logger import logger - MAP = CampaignMap('10-2') MAP.shape = 'H6' MAP.map_data = ''' diff --git a/campaign/campaign_main/campaign_10_4.py b/campaign/campaign_main/campaign_10_4.py index 944d4eb4f..3c6f93a30 100644 --- a/campaign/campaign_main/campaign_10_4.py +++ b/campaign/campaign_main/campaign_10_4.py @@ -3,7 +3,6 @@ from module.map.map_base import CampaignMap from module.map.map_grids import SelectedGrids, RoadGrids from module.logger import logger - MAP = CampaignMap('10-4') MAP.shape = 'I6' MAP.map_data = ''' diff --git a/campaign/campaign_main/campaign_3_2.py b/campaign/campaign_main/campaign_3_2.py index e0e833019..35dcd4869 100644 --- a/campaign/campaign_main/campaign_3_2.py +++ b/campaign/campaign_main/campaign_3_2.py @@ -48,7 +48,6 @@ class Campaign(CampaignBase): return self.battle_default() def battle_3(self): - # print(H1.__dict__) self.clear_all_mystery() if not self.check_accessibility(H1, fleet='boss'): diff --git a/campaign/campaign_main/campaign_9_2.py b/campaign/campaign_main/campaign_9_2.py index d537d91bb..b38d8cfe3 100644 --- a/campaign/campaign_main/campaign_9_2.py +++ b/campaign/campaign_main/campaign_9_2.py @@ -3,32 +3,31 @@ from module.map.map_base import CampaignMap from module.map.map_grids import SelectedGrids, RoadGrids from module.logger import logger - MAP = CampaignMap('9-2') MAP.shape = 'I5' MAP.map_data = ''' - ++ ++ ME -- MB ME -- ME -- - MM ++ ME ME MB ME ++ ME -- - ME -- ME ++ ++ ++ ++ ME ++ - -- ++ -- -- ++ SP -- ME -- - -- ME -- SP ++ SP -- -- -- + ++ ++ ME -- MB ME -- ME -- + MM ++ ME ME MB ME ++ ME -- + ME -- ME ++ ++ ++ ++ ME ++ + -- ++ -- -- ++ SP -- ME -- + -- ME -- SP ++ SP -- -- -- ''' -#MAP.weight_data = ''' -# 10 10 30 10 10 10 10 10 10 -# 10 10 20 30 10 30 10 10 10 -# 30 10 20 10 10 10 10 10 10 -# 10 10 10 10 10 10 10 10 10 -# 10 30 10 10 10 10 10 10 10 -#''' -#MAP.camera_data = ['D4'] +MAP.weight_data = ''' + 10 10 30 10 10 10 10 10 10 + 10 10 20 30 10 30 10 10 10 + 30 10 20 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 + 10 30 10 10 10 10 10 10 10 +''' +MAP.camera_data = ['D4'] MAP.spawn_data = [ - {'battle': 0, 'enemy': 3}, - {'battle': 1, 'enemy': 2}, - {'battle': 2, 'enemy': 2}, - {'battle': 3, 'enemy': 1}, - {'battle': 4, 'enemy': 1}, - {'battle': 5, 'boss': 1}, - ] + {'battle': 0, 'enemy': 3}, + {'battle': 1, 'enemy': 2}, + {'battle': 2, 'enemy': 2}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 1}, + {'battle': 5, 'boss': 1}, +] A1, B1, C1, D1, E1, F1, G1, H1, I1, \ A2, B2, C2, D2, E2, F2, G2, H2, I2, \ @@ -40,66 +39,66 @@ A5, B5, C5, D5, E5, F5, G5, H5, I5, \ road_main = RoadGrids([C3, C2, [C1, D2], F1, H1, H2, H3, H4]) - class Config: - SUBMARINE = 0 - INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 - EDGE_LINES_HOUGHLINES_THRESHOLD = 40 - COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 - INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { + SUBMARINE = 0 + INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 + EDGE_LINES_HOUGHLINES_THRESHOLD = 40 + COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (150, 255 - 24), 'width': (0.9, 10), 'prominence': 10, 'distance': 35, - } - EDGE_LINES_FIND_PEAKS_PARAMETERS = { + } + EDGE_LINES_FIND_PEAKS_PARAMETERS = { 'height': (255 - 24, 255), 'prominence': 10, 'distance': 50, 'width': (0, 10), 'wlen': 1000, - } + } + class Campaign(CampaignBase): - MAP = MAP + MAP = MAP - def battle_0(self): - if self.fleet_at(D5, fleet=2): - self.map.weight_data = ''' - 10 10 30 10 10 20 30 40 10 - 10 10 10 10 10 30 10 50 10 - 30 10 10 10 10 10 10 60 10 - 10 10 10 10 10 10 10 70 10 - 10 30 10 10 10 10 10 10 10 - ''' - if self.fleet_at(F4, fleet=2): - self.map.weight_data = ''' - 10 10 30 10 10 10 10 10 10 - 10 10 20 30 10 30 10 10 10 - 30 10 20 10 10 10 10 10 10 - 10 10 10 10 10 10 10 10 10 - 10 30 10 10 10 10 10 10 10 - ''' - if self.fleet_at(F5, fleet=2): - self.map.weight_data = ''' - 10 10 30 10 10 10 10 10 10 - 10 10 20 30 10 30 10 10 10 - 30 10 20 10 10 10 10 10 10 - 10 10 10 10 10 10 10 10 10 - 10 30 10 10 10 10 10 10 10 - ''' - if self.clear_roadblocks([road_main]): - return True - if self.clear_potential_roadblocks([road_main]): - return True + def battle_0(self): + if self.fleet_at(D5, fleet=2): + self.map.weight_data = ''' + 10 10 30 10 10 20 30 40 10 + 10 10 10 10 10 30 10 50 10 + 30 10 10 10 10 10 10 60 10 + 10 10 10 10 10 10 10 70 10 + 10 30 10 10 10 10 10 10 10 + ''' + if self.fleet_at(F4, fleet=2): + self.map.weight_data = ''' + 10 10 30 10 10 10 10 10 10 + 10 10 20 30 10 30 10 10 10 + 30 10 20 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 + 10 30 10 10 10 10 10 10 10 + ''' + if self.fleet_at(F5, fleet=2): + self.map.weight_data = ''' + 10 10 30 10 10 10 10 10 10 + 10 10 20 30 10 30 10 10 10 + 30 10 20 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 + 10 30 10 10 10 10 10 10 10 + ''' + if self.clear_roadblocks([road_main]): + return True + if self.clear_potential_roadblocks([road_main]): + return True - return self.battle_default() + return self.battle_default() - def battle_5(self): - boss = self.map.select(is_boss=True) - if boss: - if not self.check_accessibility(boss[0], fleet=2): - if self.clear_roadblocks([road_main]): - return True - - return self.fleet_2.clear_boss() \ No newline at end of file + def battle_5(self): + boss = self.map.select(is_boss=True) + if boss: + if not self.check_accessibility(boss[0], fleet=2): + if self.clear_roadblocks([road_main]): + return True + + return self.fleet_2.clear_boss() diff --git a/campaign/campaign_main/campaign_9_3.py b/campaign/campaign_main/campaign_9_3.py index fdf120fed..d8521199c 100644 --- a/campaign/campaign_main/campaign_9_3.py +++ b/campaign/campaign_main/campaign_9_3.py @@ -3,34 +3,33 @@ from module.map.map_base import CampaignMap from module.map.map_grids import SelectedGrids, RoadGrids from module.logger import logger - MAP = CampaignMap('9-3') MAP.shape = 'H6' MAP.map_data = ''' - MB -- ME -- ME -- ++ MB - ME ++ ++ ++ MB ME ++ -- - ME __ -- SP ++ ME ME -- - -- -- ME ++ SP -- __ ME - ++ -- ME MB ++ ++ ++ -- - ++ ++ -- ME -- ME ME MB + MB -- ME -- ME -- ++ MB + ME ++ ++ ++ MB ME ++ -- + ME __ -- SP ++ ME ME -- + -- -- ME ++ SP -- __ ME + ++ -- ME MB ++ ++ ++ -- + ++ ++ -- ME -- ME ME MB ''' MAP.weight_data = ''' - 10 10 10 10 10 10 10 10 - 10 10 10 10 10 10 10 10 - 10 10 10 10 10 10 20 10 - 10 10 20 10 10 10 10 10 - 10 10 10 10 10 10 10 10 - 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 20 10 + 10 10 20 10 10 10 10 10 + 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 ''' -#MAP.camera_data = ['D4'] +# MAP.camera_data = ['D4'] MAP.spawn_data = [ - {'battle': 0, 'enemy': 3}, - {'battle': 1, 'enemy': 2}, - {'battle': 2, 'enemy': 2}, - {'battle': 3, 'enemy': 1}, - {'battle': 4, 'enemy': 1}, - {'battle': 5, 'boss': 1}, - ] + {'battle': 0, 'enemy': 3}, + {'battle': 1, 'enemy': 2}, + {'battle': 2, 'enemy': 2}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 1}, + {'battle': 5, 'boss': 1}, +] A1, B1, C1, D1, E1, F1, G1, H1, \ A2, B2, C2, D2, E2, F2, G2, H2, \ @@ -42,40 +41,42 @@ A6, B6, C6, D6, E6, F6, G6, H6, \ road_main = RoadGrids([A2, A3, C5, D6, F2, F3, F6, G6, H4]) + class Config: - INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 - EDGE_LINES_HOUGHLINES_THRESHOLD = 40 - COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 - INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { + INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 + EDGE_LINES_HOUGHLINES_THRESHOLD = 40 + COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (150, 255 - 24), 'width': (0.9, 10), 'prominence': 10, 'distance': 35, - } - EDGE_LINES_FIND_PEAKS_PARAMETERS = { + } + EDGE_LINES_FIND_PEAKS_PARAMETERS = { 'height': (255 - 24, 255), 'prominence': 10, 'distance': 50, 'width': (0, 10), 'wlen': 1000, - } + } + class Campaign(CampaignBase): - MAP = MAP + MAP = MAP - def battle_0(self): - if self.clear_roadblocks([road_main]): - return True - if self.clear_potential_roadblocks([road_main]): - return True + def battle_0(self): + if self.clear_roadblocks([road_main]): + return True + if self.clear_potential_roadblocks([road_main]): + return True - return self.battle_default() + return self.battle_default() - def battle_5(self): - boss = self.map.select(is_boss=True) - if boss: - if not self.check_accessibility(boss[0], fleet=2): - if self.clear_roadblocks([road_main]): - return True - - return self.fleet_2.clear_boss() \ No newline at end of file + def battle_5(self): + boss = self.map.select(is_boss=True) + if boss: + if not self.check_accessibility(boss[0], fleet=2): + if self.clear_roadblocks([road_main]): + return True + + return self.fleet_2.clear_boss() diff --git a/campaign/campaign_main/campaign_9_4.py b/campaign/campaign_main/campaign_9_4.py index d708b9b76..3ca32c481 100644 --- a/campaign/campaign_main/campaign_9_4.py +++ b/campaign/campaign_main/campaign_9_4.py @@ -7,31 +7,31 @@ MAP = CampaignMap('9-4') MAP.shape = 'I6' MAP.map_data = ''' - MB -- ME -- ++ ++ ++ -- MB - -- ++ __ ME -- ME ME ME -- - ME -- ME -- ME -- __ ++ -- - ME -- ++ ++ -- -- ME __ ME - SP -- MA ++ ME -- ++ ME -- - SP -- -- ME -- ME ++ -- MB + MB -- ME -- ++ ++ ++ -- MB + -- ++ __ ME -- ME ME ME -- + ME -- ME -- ME -- __ ++ -- + ME -- ++ ++ -- -- ME __ ME + SP -- MA ++ ME -- ++ ME -- + SP -- -- ME -- ME ++ -- MB ''' MAP.weight_data = ''' - 10 10 20 10 10 10 10 10 10 - 10 10 10 20 10 10 10 10 10 - 10 10 20 10 20 10 10 10 10 - 20 10 10 10 10 10 10 10 10 - 10 10 10 10 10 10 10 10 10 - 10 10 10 10 10 10 10 10 10 + 10 10 20 10 10 10 10 10 10 + 10 10 10 20 10 10 10 10 10 + 10 10 20 10 20 10 10 10 10 + 20 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 + 10 10 10 10 10 10 10 10 10 ''' MAP.spawn_data = [ - {'battle': 0, 'enemy': 3}, - {'battle': 1, 'enemy': 2}, - {'battle': 2, 'enemy': 2}, - {'battle': 3, 'enemy': 1}, - {'battle': 4, 'enemy': 2}, - {'battle': 5, 'boss': 1}, - ] + {'battle': 0, 'enemy': 3}, + {'battle': 1, 'enemy': 2}, + {'battle': 2, 'enemy': 2}, + {'battle': 3, 'enemy': 1}, + {'battle': 4, 'enemy': 2}, + {'battle': 5, 'boss': 1}, +] A1, B1, C1, D1, E1, F1, G1, H1, I1, \ A2, B2, C2, D2, E2, F2, G2, H2, I2, \ @@ -43,40 +43,42 @@ A6, B6, C6, D6, E6, F6, G6, H6, I6, \ road_main = RoadGrids([A3, D6, [E5, F6], G4, I4]) + class Config: - INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 - EDGE_LINES_HOUGHLINES_THRESHOLD = 40 - COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 - INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { + INTERNAL_LINES_HOUGHLINES_THRESHOLD = 40 + EDGE_LINES_HOUGHLINES_THRESHOLD = 40 + COINCIDENT_POINT_ENCOURAGE_DISTANCE = 1.5 + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { 'height': (150, 255 - 24), 'width': (0.9, 10), 'prominence': 10, 'distance': 35, - } - EDGE_LINES_FIND_PEAKS_PARAMETERS = { + } + EDGE_LINES_FIND_PEAKS_PARAMETERS = { 'height': (255 - 24, 255), 'prominence': 10, 'distance': 50, 'width': (0, 10), 'wlen': 1000, - } + } + class Campaign(CampaignBase): - MAP = MAP + MAP = MAP - def battle_0(self): - if self.clear_roadblocks([road_main]): - return True - if self.clear_potential_roadblocks([road_main]): - return True + def battle_0(self): + if self.clear_roadblocks([road_main]): + return True + if self.clear_potential_roadblocks([road_main]): + return True - return self.battle_default() + return self.battle_default() - def battle_5(self): - boss = self.map.select(is_boss=True) - if boss: - if not self.check_accessibility(boss[0], fleet=2): - if self.clear_roadblocks([road_main]): - return True - - return self.fleet_2.clear_boss() \ No newline at end of file + def battle_5(self): + boss = self.map.select(is_boss=True) + if boss: + if not self.check_accessibility(boss[0], fleet=2): + if self.clear_roadblocks([road_main]): + return True + + return self.fleet_2.clear_boss()