Add: Chapter TTL

This commit is contained in:
LmeSzinc 2024-11-22 21:49:44 +08:00
parent 64b3122127
commit be37625f50
6 changed files with 315 additions and 2 deletions

View File

@ -6,9 +6,21 @@ from module.logger import logger
class CampaignBase(CampaignBase_):
STAGE_INCREASE = [
'T1 > T2 > T3 > T4 > T5 > T6',
'ttl1 > ttl2 > ttl3 > ttl4 > ttl5',
'TTL1 > TTL2 > TTL3 > TTL4 > TTL5',
]
@staticmethod
def _campaign_get_chapter_index(name):
"""
Args:
name (str, int):
Returns:
int
"""
if name == 'ttl':
return 1
return CampaignBase_._campaign_get_chapter_index(name)
def campaign_set_chapter(self, name, mode='normal'):
"""
@ -17,16 +29,24 @@ class CampaignBase(CampaignBase_):
mode (str): 'normal' or 'hard'.
"""
chapter, stage = self._campaign_separate_name(name)
logger.info([chapter, stage])
if chapter in ['t']:
self.ui_goto_event()
MODE_SWITCH_20240725.set('combat', main=self)
if stage in ['1', '2', '3', '4', '5']:
CHAPTER_SWITCH_20241024.set('ab', main=self)
elif stage in ['6']:
else:
logger.warning(f'Stage {name} is not in CHAPTER_SWITCH_20241024')
self.campaign_ensure_chapter(index=chapter)
elif chapter in ['ttl']:
self.ui_goto_event()
MODE_SWITCH_20240725.set('combat', main=self)
if stage in ['1', '2', '3', '4', '5']:
CHAPTER_SWITCH_20241024.set('cd', main=self)
else:
logger.warning(f'Stage {name} is not in CHAPTER_SWITCH_20241024')
logger.info('campaign_ensure_chapter')
self.campaign_ensure_chapter(index=chapter)
elif chapter in ['ex_sp']:
self.ui_goto_event()

View File

@ -0,0 +1,81 @@
from module.config.config import AzurLaneConfig
from .campaign_base import CampaignBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
MAP = CampaignMap('TTL1')
MAP.shape = 'E5'
MAP.camera_data = ['C2']
MAP.camera_data_spawn_point = ['C2']
MAP.map_data = """
++ ++ -- ++ ++
++ ++ MB ++ ++
-- -- -- -- --
++ -- SP -- ++
-- ++ ++ ++ --
"""
MAP.weight_data = """
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
"""
MAP.spawn_data = [
{'battle': 0, 'boss': 1},
]
A1, B1, C1, D1, E1, \
A2, B2, C2, D2, E2, \
A3, B3, C3, D3, E3, \
A4, B4, C4, D4, E4, \
A5, B5, C5, D5, E5, \
= MAP.flatten()
class Config:
# ===== Start of generated config =====
MAP_HAS_MAP_STORY = False
MAP_HAS_FLEET_STEP = False
MAP_HAS_AMBUSH = False
MAP_HAS_MYSTERY = False
STAR_REQUIRE_1 = 0
STAR_REQUIRE_2 = 0
STAR_REQUIRE_3 = 0
# ===== End of generated config =====
STAGE_ENTRANCE = ['half', '20240725']
MAP_IS_ONE_TIME_STAGE = True
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
'height': (80, 255 - 33),
'width': (0.9, 10),
'prominence': 10,
'distance': 35,
}
EDGE_LINES_FIND_PEAKS_PARAMETERS = {
'height': (255 - 33, 255),
'prominence': 10,
'distance': 50,
# 'width': (0, 7),
'wlen': 1000
}
MAP_ENSURE_EDGE_INSIGHT_CORNER = 'bottom'
MAP_SWIPE_MULTIPLY = (1.107, 1.128)
MAP_SWIPE_MULTIPLY_MINITOUCH = (1.071, 1.091)
MAP_SWIPE_MULTIPLY_MAATOUCH = (1.040, 1.059)
class Campaign(CampaignBase):
MAP = MAP
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
def battle_0(self):
return self.clear_boss()
if __name__ == '__main__':
cfg = AzurLaneConfig('alas5').merge(Config())
self = Campaign(cfg)
self.device.screenshot()
self.campaign_set_chapter('ttl1', 'normal')
self.ENTRANCE = self.campaign_get_entrance(name='ttl1')

View File

@ -0,0 +1,53 @@
from .campaign_base import CampaignBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
from .ttl1 import Config as ConfigBase
MAP = CampaignMap('TTL2')
MAP.shape = 'E5'
MAP.camera_data = ['C2']
MAP.camera_data_spawn_point = ['C2']
MAP.map_data = """
++ ++ -- ++ ++
++ ++ MB ++ ++
-- -- -- -- --
++ -- SP -- ++
-- ++ ++ ++ --
"""
MAP.weight_data = """
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
"""
MAP.spawn_data = [
{'battle': 0, 'boss': 1},
]
A1, B1, C1, D1, E1, \
A2, B2, C2, D2, E2, \
A3, B3, C3, D3, E3, \
A4, B4, C4, D4, E4, \
A5, B5, C5, D5, E5, \
= MAP.flatten()
class Config(ConfigBase):
# ===== Start of generated config =====
MAP_HAS_MAP_STORY = False
MAP_HAS_FLEET_STEP = False
MAP_HAS_AMBUSH = False
MAP_HAS_MYSTERY = False
STAR_REQUIRE_1 = 0
STAR_REQUIRE_2 = 0
STAR_REQUIRE_3 = 0
# ===== End of generated config =====
class Campaign(CampaignBase):
MAP = MAP
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
def battle_0(self):
return self.clear_boss()

View File

@ -0,0 +1,53 @@
from .campaign_base import CampaignBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
from .ttl1 import Config as ConfigBase
MAP = CampaignMap('TTL3')
MAP.shape = 'E5'
MAP.camera_data = ['C2']
MAP.camera_data_spawn_point = ['C2']
MAP.map_data = """
++ ++ -- ++ ++
++ ++ MB ++ ++
-- -- -- -- --
++ -- SP -- ++
-- ++ ++ ++ --
"""
MAP.weight_data = """
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
"""
MAP.spawn_data = [
{'battle': 0, 'boss': 1},
]
A1, B1, C1, D1, E1, \
A2, B2, C2, D2, E2, \
A3, B3, C3, D3, E3, \
A4, B4, C4, D4, E4, \
A5, B5, C5, D5, E5, \
= MAP.flatten()
class Config(ConfigBase):
# ===== Start of generated config =====
MAP_HAS_MAP_STORY = False
MAP_HAS_FLEET_STEP = False
MAP_HAS_AMBUSH = False
MAP_HAS_MYSTERY = False
STAR_REQUIRE_1 = 0
STAR_REQUIRE_2 = 0
STAR_REQUIRE_3 = 0
# ===== End of generated config =====
class Campaign(CampaignBase):
MAP = MAP
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
def battle_0(self):
return self.clear_boss()

View File

@ -0,0 +1,53 @@
from .campaign_base import CampaignBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
from .ttl1 import Config as ConfigBase
MAP = CampaignMap('TTL4')
MAP.shape = 'E5'
MAP.camera_data = ['C2']
MAP.camera_data_spawn_point = ['C2']
MAP.map_data = """
++ ++ -- ++ ++
++ ++ MB ++ ++
-- -- -- -- --
++ -- SP -- ++
-- ++ ++ ++ --
"""
MAP.weight_data = """
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
"""
MAP.spawn_data = [
{'battle': 0, 'boss': 1},
]
A1, B1, C1, D1, E1, \
A2, B2, C2, D2, E2, \
A3, B3, C3, D3, E3, \
A4, B4, C4, D4, E4, \
A5, B5, C5, D5, E5, \
= MAP.flatten()
class Config(ConfigBase):
# ===== Start of generated config =====
MAP_HAS_MAP_STORY = False
MAP_HAS_FLEET_STEP = False
MAP_HAS_AMBUSH = False
MAP_HAS_MYSTERY = False
STAR_REQUIRE_1 = 0
STAR_REQUIRE_2 = 0
STAR_REQUIRE_3 = 0
# ===== End of generated config =====
class Campaign(CampaignBase):
MAP = MAP
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
def battle_0(self):
return self.clear_boss()

View File

@ -0,0 +1,53 @@
from .campaign_base import CampaignBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
from .ttl1 import Config as ConfigBase
MAP = CampaignMap('TTL5')
MAP.shape = 'E5'
MAP.camera_data = ['C2']
MAP.camera_data_spawn_point = ['C2']
MAP.map_data = """
++ ++ -- ++ ++
++ ++ MB ++ ++
-- -- -- -- --
++ -- SP -- ++
-- ++ ++ ++ --
"""
MAP.weight_data = """
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
50 50 50 50 50
"""
MAP.spawn_data = [
{'battle': 0, 'boss': 1},
]
A1, B1, C1, D1, E1, \
A2, B2, C2, D2, E2, \
A3, B3, C3, D3, E3, \
A4, B4, C4, D4, E4, \
A5, B5, C5, D5, E5, \
= MAP.flatten()
class Config(ConfigBase):
# ===== Start of generated config =====
MAP_HAS_MAP_STORY = False
MAP_HAS_FLEET_STEP = False
MAP_HAS_AMBUSH = False
MAP_HAS_MYSTERY = False
STAR_REQUIRE_1 = 0
STAR_REQUIRE_2 = 0
STAR_REQUIRE_3 = 0
# ===== End of generated config =====
class Campaign(CampaignBase):
MAP = MAP
ENEMY_FILTER = '1L > 1M > 1E > 1C > 2L > 2M > 2E > 2C > 3L > 3M > 3E > 3C'
def battle_0(self):
return self.clear_boss()