|
| 1 | +from module.campaign.campaign_base import CampaignBase |
| 2 | +from module.map.map_base import CampaignMap |
| 3 | +from module.map.map_grids import SelectedGrids, RoadGrids |
| 4 | +from module.logger import logger |
| 5 | + |
| 6 | +MAP = CampaignMap('SP') |
| 7 | +MAP.shape = 'G8' |
| 8 | +MAP.camera_data = ['D2', 'D6'] |
| 9 | +MAP.camera_data_spawn_point = ['D2'] |
| 10 | +MAP.map_data = """ |
| 11 | + ++ ++ MS -- MS ++ ++ |
| 12 | + ++ ME -- MS -- ME ++ |
| 13 | + ME -- -- -- -- -- ME |
| 14 | + ME -- SP __ SP -- ME |
| 15 | + ME -- -- -- -- -- ME |
| 16 | + ++ ME ME -- ME ME ++ |
| 17 | + -- ++ ++ -- ++ ++ -- |
| 18 | + -- ++ ++ MB ++ ++ -- |
| 19 | +""" |
| 20 | +MAP.weight_data = """ |
| 21 | + 50 50 50 50 50 50 50 |
| 22 | + 50 50 50 50 50 50 50 |
| 23 | + 50 50 50 50 50 50 50 |
| 24 | + 50 50 50 50 50 50 50 |
| 25 | + 50 50 50 50 50 50 50 |
| 26 | + 50 50 50 50 50 50 50 |
| 27 | + 50 50 50 50 50 50 50 |
| 28 | + 50 50 50 50 50 50 50 |
| 29 | +""" |
| 30 | +MAP.spawn_data = [ |
| 31 | + {'battle': 0, 'enemy': 12, 'siren': 3}, |
| 32 | + {'battle': 1}, |
| 33 | + {'battle': 2}, |
| 34 | + {'battle': 3}, |
| 35 | + {'battle': 4}, |
| 36 | + {'battle': 5}, |
| 37 | + {'battle': 6}, |
| 38 | + {'battle': 7, 'boss': 1}, |
| 39 | +] |
| 40 | +A1, B1, C1, D1, E1, F1, G1, \ |
| 41 | +A2, B2, C2, D2, E2, F2, G2, \ |
| 42 | +A3, B3, C3, D3, E3, F3, G3, \ |
| 43 | +A4, B4, C4, D4, E4, F4, G4, \ |
| 44 | +A5, B5, C5, D5, E5, F5, G5, \ |
| 45 | +A6, B6, C6, D6, E6, F6, G6, \ |
| 46 | +A7, B7, C7, D7, E7, F7, G7, \ |
| 47 | +A8, B8, C8, D8, E8, F8, G8, \ |
| 48 | + = MAP.flatten() |
| 49 | + |
| 50 | + |
| 51 | +class Config: |
| 52 | + # ===== Start of generated config ===== |
| 53 | + MAP_SIREN_TEMPLATE = [] |
| 54 | + MOVABLE_ENEMY_TURN = (2,) |
| 55 | + MAP_HAS_SIREN = True |
| 56 | + MAP_HAS_MOVABLE_ENEMY = True |
| 57 | + MAP_HAS_MAP_STORY = False |
| 58 | + MAP_HAS_FLEET_STEP = False |
| 59 | + MAP_HAS_AMBUSH = False |
| 60 | + MAP_HAS_MYSTERY = False |
| 61 | + STAR_REQUIRE_1 = 0 |
| 62 | + STAR_REQUIRE_2 = 0 |
| 63 | + STAR_REQUIRE_3 = 0 |
| 64 | + # ===== End of generated config ===== |
| 65 | + |
| 66 | + MAP_CHAPTER_SWITCH_20241219_SP = True |
| 67 | + STAGE_ENTRANCE = ['half', '20240725'] |
| 68 | + MAP_WALK_USE_CURRENT_FLEET = True |
| 69 | + MAP_SIREN_HAS_BOSS_ICON_SMALL = True |
| 70 | + INTERNAL_LINES_FIND_PEAKS_PARAMETERS = { |
| 71 | + 'height': (120, 255 - 33), |
| 72 | + 'width': (1.5, 10), |
| 73 | + 'prominence': 10, |
| 74 | + 'distance': 35, |
| 75 | + } |
| 76 | + EDGE_LINES_FIND_PEAKS_PARAMETERS = { |
| 77 | + 'height': (255 - 33, 255), |
| 78 | + 'prominence': 10, |
| 79 | + 'distance': 50, |
| 80 | + 'wlen': 1000 |
| 81 | + } |
| 82 | + HOMO_EDGE_COLOR_RANGE = (0, 33) |
| 83 | + HOMO_EDGE_HOUGHLINES_THRESHOLD = 210 |
| 84 | + HOMO_STORAGE = ((7, 6), [(135.178, 83.137), (919.07, 83.137), (-16.807, 613.173), (1000.053, 613.173)]) |
| 85 | + MAP_ENSURE_EDGE_INSIGHT_CORNER = 'bottom' |
| 86 | + MAP_IS_ONE_TIME_STAGE = True |
| 87 | + |
| 88 | + MAP_SWIPE_MULTIPLY = (1.127, 1.148) |
| 89 | + MAP_SWIPE_MULTIPLY_MINITOUCH = (1.090, 1.110) |
| 90 | + MAP_SWIPE_MULTIPLY_MAATOUCH = (1.058, 1.077) |
| 91 | + |
| 92 | + |
| 93 | +class Campaign(CampaignBase): |
| 94 | + MAP = MAP |
| 95 | + ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C' |
| 96 | + |
| 97 | + def map_data_init(self, map_): |
| 98 | + super().map_data_init(map_) |
| 99 | + C1.is_siren = True |
| 100 | + D2.is_siren = True |
| 101 | + E1.is_siren = True |
| 102 | + |
| 103 | + def battle_0(self): |
| 104 | + if self.clear_siren(): |
| 105 | + return True |
| 106 | + if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=2): |
| 107 | + return True |
| 108 | + |
| 109 | + return self.battle_default() |
| 110 | + |
| 111 | + def battle_5(self): |
| 112 | + if self.clear_siren(): |
| 113 | + return True |
| 114 | + if self.clear_filter_enemy(self.ENEMY_FILTER, preserve=0): |
| 115 | + return True |
| 116 | + |
| 117 | + return self.battle_default() |
| 118 | + |
| 119 | + def battle_7(self): |
| 120 | + return self.fleet_boss.clear_boss() |
0 commit comments