mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-09 05:47:30 +08:00
Del: Remove outdated map files
This commit is contained in:
parent
a15e18c75e
commit
a92fd8a305
@ -1,80 +0,0 @@
|
||||
from campaign.campaign_main.campaign_12_1 import Config as ConfigBase
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.logger import logger
|
||||
from module.map.map_base import CampaignMap
|
||||
from module.map.map_grids import RoadGrids, SelectedGrids
|
||||
|
||||
MAP = CampaignMap()
|
||||
MAP.shape = 'I7'
|
||||
MAP.camera_data = ['D2', 'D5', 'F2', 'F5']
|
||||
MAP.camera_data_spawn_point = ['D2', 'D5']
|
||||
MAP.map_data = """
|
||||
++ MB ME ME ++ -- ME Me --
|
||||
++ -- Me -- Me -- Me -- ++
|
||||
MB ME ++ ME SP ME -- ME ++
|
||||
MB __ ME -- SP ++ ++ __ Me
|
||||
++ -- -- Me ME -- ME -- ME
|
||||
-- ME ME ++ -- -- Me ME --
|
||||
ME -- Me -- ME ME -- ++ ++
|
||||
"""
|
||||
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 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 50 50 50 50
|
||||
50 50 50 50 50 50 50 50 50
|
||||
"""
|
||||
MAP.spawn_data = [
|
||||
{'battle': 0, 'enemy': 3},
|
||||
{'battle': 1, 'enemy': 2},
|
||||
{'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, 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, \
|
||||
= MAP.flatten()
|
||||
|
||||
|
||||
class Config(ConfigBase):
|
||||
ENABLE_AUTO_SEARCH = False
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
s3_enemy_count = 0
|
||||
|
||||
def check_s3_enemy(self):
|
||||
if self.battle_count == 0:
|
||||
self.s3_enemy_count = 0
|
||||
elif self.battle_count >= 5:
|
||||
self.withdraw()
|
||||
|
||||
current = self.map.select(is_enemy=True, enemy_scale=2) \
|
||||
.add(self.map.select(is_enemy=True, enemy_scale=1)) \
|
||||
.count
|
||||
logger.attr('S2_enemy', current)
|
||||
|
||||
if self.s3_enemy_count >= self.config.C122MediumLeveling_LargeEnemyTolerance and current == 0:
|
||||
self.withdraw()
|
||||
|
||||
def battle_0(self):
|
||||
self.check_s3_enemy()
|
||||
if self.clear_enemy(scale=(2,), genre=['light', 'main', 'treasure', 'enemy', 'carrier']):
|
||||
return True
|
||||
if self.clear_enemy(scale=(1,)):
|
||||
return True
|
||||
if self.clear_enemy(scale=(3,), genre=['light', 'carrier', 'enemy', 'treasure', 'main']):
|
||||
self.s3_enemy_count += 1
|
||||
return True
|
||||
|
||||
return self.battle_default()
|
@ -1,93 +0,0 @@
|
||||
from campaign.campaign_main.campaign_12_1 import Config as ConfigBase
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.logger import logger
|
||||
from module.map.map_base import CampaignMap
|
||||
from module.map.map_grids import RoadGrids, SelectedGrids
|
||||
|
||||
MAP = CampaignMap('12-4')
|
||||
MAP.shape = 'K8'
|
||||
MAP.camera_data = ['D2', 'D6', 'H2', 'H6']
|
||||
MAP.camera_data_spawn_point = ['D6']
|
||||
MAP.map_data = """
|
||||
MB MB ME -- ME ++ ++ ++ MB MB ++
|
||||
ME ++ -- ME -- MA ++ ++ ME Me ++
|
||||
-- ME __ Me Me -- Me Me -- Me --
|
||||
++ -- ME ++ ++ Me ME __ ++ ++ ME
|
||||
++ ME ME -- ME ME -- ME -- ++ --
|
||||
++ __ Me Me -- Me ME ++ __ -- ME
|
||||
ME -- Me -- Me -- Me -- -- ME --
|
||||
-- -- -- ME SP SP ++ ++ ++ ME --
|
||||
"""
|
||||
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 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 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 50 50
|
||||
50 50 50 50 50 50 50 50 50 50 50
|
||||
"""
|
||||
MAP.spawn_data = [
|
||||
{'battle': 0, 'enemy': 2},
|
||||
{'battle': 1, 'enemy': 2},
|
||||
{'battle': 2, 'enemy': 2},
|
||||
{'battle': 3, 'enemy': 1},
|
||||
{'battle': 4, 'enemy': 1},
|
||||
{'battle': 5},
|
||||
{'battle': 6, 'boss': 1},
|
||||
]
|
||||
A1, B1, C1, D1, E1, F1, G1, H1, I1, J1, K1, \
|
||||
A2, B2, C2, D2, E2, F2, G2, H2, I2, J2, K2, \
|
||||
A3, B3, C3, D3, E3, F3, G3, H3, I3, J3, K3, \
|
||||
A4, B4, C4, D4, E4, F4, G4, H4, I4, J4, K4, \
|
||||
A5, B5, C5, D5, E5, F5, G5, H5, I5, J5, K5, \
|
||||
A6, B6, C6, D6, E6, F6, G6, H6, I6, J6, K6, \
|
||||
A7, B7, C7, D7, E7, F7, G7, H7, I7, J7, K7, \
|
||||
A8, B8, C8, D8, E8, F8, G8, H8, I8, J8, K8, \
|
||||
= MAP.flatten()
|
||||
|
||||
|
||||
class Config(ConfigBase):
|
||||
ENABLE_AUTO_SEARCH = False
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
s3_enemy_count = 0
|
||||
non_s3_enemy_count = 0
|
||||
|
||||
def check_s3_enemy(self):
|
||||
if self.battle_count == 0:
|
||||
self.s3_enemy_count = 0
|
||||
self.non_s3_enemy_count = 0
|
||||
|
||||
current = self.map.select(is_enemy=True, enemy_scale=3).count
|
||||
logger.attr('S3_enemy', current)
|
||||
|
||||
if self.battle_count == self.config.C124LargeLeveling_NonLargeEnterTolerance \
|
||||
and self.config.C124LargeLeveling_NonLargeRetreatTolerance < 10:
|
||||
if self.s3_enemy_count + current == 0:
|
||||
self.withdraw()
|
||||
elif self.battle_count > self.config.C124LargeLeveling_NonLargeEnterTolerance:
|
||||
if self.non_s3_enemy_count >= self.config.C124LargeLeveling_NonLargeRetreatTolerance and current == 0:
|
||||
self.withdraw()
|
||||
|
||||
def battle_0(self):
|
||||
self.check_s3_enemy()
|
||||
|
||||
if self.battle_count >= self.config.C124LargeLeveling_PickupAmmo:
|
||||
self.pick_up_ammo()
|
||||
|
||||
if self.clear_enemy(scale=(3,), genre=['light', 'carrier', 'enemy', 'treasure', 'main']):
|
||||
self.s3_enemy_count += 1
|
||||
self.non_s3_enemy_count = 0
|
||||
return True
|
||||
if self.clear_enemy(scale=[2, 1]):
|
||||
self.non_s3_enemy_count += 1
|
||||
return True
|
||||
if not self.map.select(is_enemy=True, may_boss=False):
|
||||
logger.info('No more enemies.')
|
||||
self.withdraw()
|
||||
|
||||
return self.battle_default()
|
@ -1,124 +0,0 @@
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.combat.assets import *
|
||||
from module.logger import logger
|
||||
from module.map.map_base import CampaignMap
|
||||
from module.map.map_grids import RoadGrids, SelectedGrids
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
# MAP = MAP
|
||||
|
||||
def battle_default(self):
|
||||
if not self.map.select(enemy_scale=3, enemy_genre='Light'):
|
||||
self.withdraw()
|
||||
|
||||
def handle_combat_weapon_release(self):
|
||||
if self.appear_then_click(READY_AIR_RAID, interval=5):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def handle_battle_status(self, save_get_items=False):
|
||||
"""
|
||||
Args:
|
||||
save_get_items (bool):
|
||||
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
if self.is_combat_executing():
|
||||
return False
|
||||
if self.appear_then_click(BATTLE_STATUS_S, screenshot=save_get_items, genre='status', interval=self.battle_status_click_interval):
|
||||
if not save_get_items:
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(BATTLE_STATUS_A, screenshot=save_get_items, genre='status', interval=self.battle_status_click_interval):
|
||||
logger.warning('Battle status: A')
|
||||
if not save_get_items:
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(BATTLE_STATUS_B, screenshot=save_get_items, genre='status', interval=self.battle_status_click_interval):
|
||||
logger.warning('Battle Status B')
|
||||
if not save_get_items:
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(BATTLE_STATUS_C, screenshot=save_get_items, genre='status', interval=self.battle_status_click_interval):
|
||||
if not save_get_items:
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(BATTLE_STATUS_D, screenshot=save_get_items, genre='status', interval=self.battle_status_click_interval):
|
||||
logger.warning('Battle Status D')
|
||||
if not save_get_items:
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def handle_get_items(self, save_get_items=False):
|
||||
"""
|
||||
Args:
|
||||
save_get_items (bool):
|
||||
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
if self.appear_then_click(GET_ITEMS_1, screenshot=save_get_items, genre='get_items', offset=5,
|
||||
interval=self.battle_status_click_interval):
|
||||
self.interval_reset(BATTLE_STATUS_S)
|
||||
self.interval_reset(BATTLE_STATUS_A)
|
||||
self.interval_reset(BATTLE_STATUS_B)
|
||||
self.interval_reset(BATTLE_STATUS_C)
|
||||
self.interval_reset(BATTLE_STATUS_D)
|
||||
return True
|
||||
if self.appear_then_click(GET_ITEMS_2, screenshot=save_get_items, genre='get_items', offset=5,
|
||||
interval=self.battle_status_click_interval):
|
||||
self.interval_reset(BATTLE_STATUS_S)
|
||||
self.interval_reset(BATTLE_STATUS_A)
|
||||
self.interval_reset(BATTLE_STATUS_B)
|
||||
self.interval_reset(BATTLE_STATUS_C)
|
||||
self.interval_reset(BATTLE_STATUS_D)
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def handle_exp_info(self):
|
||||
"""
|
||||
Returns:
|
||||
bool:
|
||||
"""
|
||||
if self.is_combat_executing():
|
||||
return False
|
||||
if self.appear_then_click(EXP_INFO_S):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_A):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_B):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_C):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(EXP_INFO_D):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
if self.appear_then_click(OPTS_INFO_D, offset=(20, 20)):
|
||||
self.device.sleep((0.25, 0.5))
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
def combat(self, balance_hp=None, emotion_reduce=None, func=None, call_submarine_at_boss=None, save_get_items=None,
|
||||
expected_end=None, fleet_index=1):
|
||||
self.battle_status_click_interval = 7 if save_get_items else 0
|
||||
super().combat(balance_hp=False, expected_end='no_searching', auto_mode='hide_in_bottom_left', save_get_items=False)
|
||||
|
||||
|
||||
from module.config.config import AzurLaneConfig
|
||||
|
||||
az = Campaign(AzurLaneConfig('alas'))
|
||||
for n in range(10000):
|
||||
logger.hr(f'count: {n}')
|
||||
az.map_offensive()
|
||||
az.combat()
|
@ -1,37 +0,0 @@
|
||||
import numpy as np
|
||||
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.exception import CampaignEnd, ScriptEnd
|
||||
from module.logger import logger
|
||||
from module.map.map_base import CampaignMap
|
||||
from module.map.map_grids import RoadGrids, SelectedGrids
|
||||
|
||||
from .campaign_1_1 import MAP
|
||||
from .campaign_1_1 import Config as ConfigBase
|
||||
|
||||
A1, B1, C1, D1, E1, F1, G1, \
|
||||
= MAP.flatten()
|
||||
|
||||
|
||||
class Config(ConfigBase):
|
||||
ENABLE_FAST_FORWARD = False
|
||||
ENABLE_AUTO_SEARCH = False
|
||||
AMBUSH_EVADE = False
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
affinity_battle = 0
|
||||
|
||||
def battle_default(self):
|
||||
while self.affinity_battle < self.config.C11AffinityFarming_RunCount:
|
||||
logger.attr('Affinity_battle', f'{self.affinity_battle}/{self.config.C11AffinityFarming_RunCount}')
|
||||
self.goto(C1)
|
||||
self.affinity_battle += 1
|
||||
self.goto(D1 if np.random.uniform() < 0.7 else B1)
|
||||
|
||||
# End
|
||||
try:
|
||||
self.withdraw()
|
||||
except CampaignEnd:
|
||||
raise ScriptEnd('Reach condition: Affinity farming battle count')
|
@ -1,86 +0,0 @@
|
||||
from campaign.campaign_main.campaign_7_2 import MAP
|
||||
from campaign.campaign_main.campaign_7_2 import Config as ConfigBase
|
||||
from module.campaign.campaign_base import CampaignBase
|
||||
from module.logger import logger
|
||||
from module.map.map_base import CampaignMap
|
||||
from module.map.map_grids import RoadGrids, SelectedGrids
|
||||
|
||||
# MAP.in_map_swipe_preset_data = (-1, 0)
|
||||
|
||||
A1, B1, C1, D1, E1, F1, G1, H1, \
|
||||
A2, B2, C2, D2, E2, F2, G2, H2, \
|
||||
A3, B3, C3, D3, E3, F3, G3, H3, \
|
||||
A4, B4, C4, D4, E4, F4, G4, H4, \
|
||||
A5, B5, C5, D5, E5, F5, G5, H5 = MAP.flatten()
|
||||
|
||||
ROAD_MAIN = RoadGrids([A3, [C3, B4, C5], [F1, G2, G3]])
|
||||
GRIDS_FOR_FASTER = SelectedGrids([A3, C3, E3, G3])
|
||||
FLEET_2_STEP_ON = SelectedGrids([A3, G3, C3, E3])
|
||||
|
||||
|
||||
class Config(ConfigBase):
|
||||
ENABLE_AUTO_SEARCH = False
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
MAP = MAP
|
||||
|
||||
def battle_0(self):
|
||||
if self.config.C72MysteryFarming_StepOnA3:
|
||||
if self.fleet_2_step_on(FLEET_2_STEP_ON, roadblocks=[ROAD_MAIN]):
|
||||
return True
|
||||
|
||||
ignore = None
|
||||
if self.fleet_at(A3, fleet=2) and A1.enemy_scale != 3 and not self.fleet_at(A1, fleet=1):
|
||||
ignore = SelectedGrids([A2])
|
||||
if self.fleet_at(G3, fleet=2):
|
||||
ignore = SelectedGrids([H3])
|
||||
|
||||
self.clear_all_mystery(nearby=False, ignore=ignore)
|
||||
else:
|
||||
self.clear_all_mystery(nearby=False)
|
||||
|
||||
if self.clear_roadblocks([ROAD_MAIN], strongest=True):
|
||||
return True
|
||||
if self.clear_potential_roadblocks([ROAD_MAIN], strongest=True):
|
||||
return True
|
||||
|
||||
if self.clear_enemy(scale=(3,)):
|
||||
return True
|
||||
|
||||
if self.clear_grids_for_faster(GRIDS_FOR_FASTER, scale=(2,)):
|
||||
return True
|
||||
if self.clear_enemy(scale=(2,)):
|
||||
return True
|
||||
if self.clear_grids_for_faster(GRIDS_FOR_FASTER):
|
||||
return True
|
||||
|
||||
return self.battle_default()
|
||||
|
||||
def battle_3(self):
|
||||
if self.config.C72MysteryFarming_StepOnA3:
|
||||
ignore = None
|
||||
if self.fleet_at(A3, fleet=2):
|
||||
ignore = SelectedGrids([A2])
|
||||
if self.fleet_at(G3, fleet=2):
|
||||
ignore = SelectedGrids([H3])
|
||||
self.clear_all_mystery(nearby=False, ignore=ignore)
|
||||
|
||||
if self.fleet_at(A3, fleet=2) and A2.is_mystery:
|
||||
self.fleet_2.clear_chosen_mystery(A2)
|
||||
if self.fleet_at(G3, fleet=2) and H3.is_mystery:
|
||||
self.fleet_2.clear_chosen_mystery(H3)
|
||||
else:
|
||||
self.clear_all_mystery(nearby=False)
|
||||
|
||||
if self.map.select(is_mystery=True, is_accessible=False):
|
||||
logger.info('Roadblock blocks mystery.')
|
||||
if self.fleet_1.clear_roadblocks([ROAD_MAIN]):
|
||||
return True
|
||||
|
||||
if not self.map.select(is_mystery=True):
|
||||
self.withdraw()
|
||||
|
||||
@property
|
||||
def _map_battle(self):
|
||||
return 3
|
@ -1,38 +0,0 @@
|
||||
from .campaign_8_4 import Campaign as CampaignBase
|
||||
from .campaign_8_4 import Config as ConfigBase
|
||||
from .campaign_8_4 import *
|
||||
|
||||
|
||||
class Config(ConfigBase):
|
||||
ENABLE_AUTO_SEARCH = False
|
||||
|
||||
|
||||
class Campaign(CampaignBase):
|
||||
def battle_0(self):
|
||||
self.fleet_2_push_forward()
|
||||
|
||||
self.clear_all_mystery()
|
||||
if self.map.select(is_mystery=True, is_accessible_1=False, is_accessible_2=True):
|
||||
self.fleet_2.clear_all_mystery()
|
||||
self.fleet_2_push_forward()
|
||||
|
||||
if self.clear_roadblocks([road_D7, road_F3, road_main], strongest=True):
|
||||
return True
|
||||
if self.clear_potential_roadblocks([road_D7, road_F3, road_main], scale=(3,)):
|
||||
return True
|
||||
if self.clear_enemy(scale=(3,)):
|
||||
return True
|
||||
if self.clear_potential_roadblocks([road_D7, road_F3, road_main], strongest=True):
|
||||
return True
|
||||
if self.clear_first_roadblocks([road_D7, road_F3, road_main]):
|
||||
return True
|
||||
|
||||
return self.battle_default()
|
||||
|
||||
def battle_4(self):
|
||||
self.clear_all_mystery()
|
||||
if self.map.select(is_mystery=True, is_accessible_1=False, is_accessible_2=True):
|
||||
self.fleet_2.clear_all_mystery()
|
||||
self.fleet_2_push_forward()
|
||||
|
||||
return self.brute_clear_boss()
|
Loading…
Reference in New Issue
Block a user