mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-23 00:52:22 +00:00
Fix: Now able to use 1 or 2 fleets in chapter 2 to 6
- If using 1 fleet in 6-4, will pick up the ammo
This commit is contained in:
parent
caee1450e6
commit
87127c882a
@ -32,8 +32,8 @@ A4, B4, C4, D4, E4, F4, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
'width': (1.5, 10),
|
||||
@ -59,7 +59,7 @@ class Campaign(CampaignBase):
|
||||
def battle_2(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(D4):
|
||||
if not self.check_accessibility(D4, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -48,7 +48,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(D1):
|
||||
if not self.check_accessibility(D1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -48,7 +48,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(E1):
|
||||
if not self.check_accessibility(E1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -41,7 +41,7 @@ class Campaign(CampaignBase):
|
||||
return self.battle_default()
|
||||
|
||||
def battle_3(self):
|
||||
if not self.check_accessibility(G1):
|
||||
if not self.check_accessibility(G1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -33,8 +33,8 @@ A4, B4, C4, D4, E4, F4, G4, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
@ -61,7 +61,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(G2):
|
||||
return self.battle_default()
|
||||
if not self.check_accessibility(G2, fleet='boss'):
|
||||
return self.fleet_boss.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
|
@ -45,7 +45,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(H1):
|
||||
if not self.check_accessibility(H1, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -47,7 +47,7 @@ class Campaign(CampaignBase):
|
||||
def battle_3(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.check_accessibility(A4):
|
||||
if not self.check_accessibility(A4, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -50,10 +50,10 @@ class Campaign(CampaignBase):
|
||||
return self.battle_default()
|
||||
|
||||
def battle_3(self):
|
||||
if not self.check_accessibility(H3):
|
||||
if not self.check_accessibility(H3, fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
||||
def handle_boss_appear_refocus(self):
|
||||
for data in self.map.spawn_data:
|
||||
|
@ -39,8 +39,8 @@ A6, B6, C6, D6, E6, F6, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
@ -72,7 +72,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -58,7 +58,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -54,7 +54,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -65,10 +65,10 @@ class Campaign(CampaignBase):
|
||||
def battle_4(self):
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
if self.clear_roadblocks([road_main]):
|
||||
return True
|
||||
if self.clear_potential_roadblocks([road_main]):
|
||||
return True
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -41,9 +41,9 @@ A6, B6, C6, D6, E6, F6, G6, H6, \
|
||||
|
||||
|
||||
class Config:
|
||||
FLEET_2 = 0
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
|
||||
INTERNAL_LINES_FIND_PEAKS_PARAMETERS = {
|
||||
'height': (120, 255 - 40),
|
||||
'width': (1.5, 10),
|
||||
@ -71,7 +71,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -51,7 +51,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -51,7 +51,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.battle_default()
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -62,10 +62,10 @@ class Campaign(CampaignBase):
|
||||
def battle_4(self):
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0]):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
if self.clear_roadblocks([road_center]):
|
||||
return True
|
||||
if self.clear_potential_roadblocks([road_ring]):
|
||||
return True
|
||||
|
||||
return self.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -42,7 +42,7 @@ road_mystery = RoadGrids([[C4, D5], D4, G2, [G1, H2]])
|
||||
|
||||
|
||||
class Config:
|
||||
SUBMARINE = 0
|
||||
FLEET_BOSS = 1
|
||||
MAP_MYSTERY_HAS_CARRIER = True
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -64,7 +64,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -77,7 +77,7 @@ class Campaign(CampaignBase):
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -68,9 +68,12 @@ class Campaign(CampaignBase):
|
||||
def battle_5(self):
|
||||
self.clear_all_mystery()
|
||||
|
||||
if not self.config.FLEET_2:
|
||||
self.pick_up_ammo()
|
||||
|
||||
boss = self.map.select(is_boss=True)
|
||||
if boss:
|
||||
if not self.check_accessibility(boss[0], fleet=2):
|
||||
if not self.check_accessibility(boss[0], fleet='boss'):
|
||||
return self.clear_roadblocks([road_boss])
|
||||
|
||||
return self.fleet_2.clear_boss()
|
||||
return self.fleet_boss.clear_boss()
|
||||
|
@ -141,12 +141,12 @@ def main(ini_name=''):
|
||||
f1.add_argument('--舰队步长1', default=default('--舰队步长1'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
|
||||
f2 = fleet.add_argument_group('BOSS队')
|
||||
f2.add_argument('--舰队编号2', default=default('--舰队编号2'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--舰队编号2', default=default('--舰队编号2'), choices=['不使用', '1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--舰队阵型2', default=default('--舰队阵型2'), choices=['单纵阵', '复纵阵', '轮形阵'])
|
||||
f2.add_argument('--舰队步长2', default=default('--舰队步长2'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
|
||||
f3 = fleet.add_argument_group('备用道中队')
|
||||
f3.add_argument('--舰队编号3', default=default('--舰队编号3'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--舰队编号3', default=default('--舰队编号3'), choices=['不使用', '1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--舰队阵型3', default=default('--舰队阵型3'), choices=['单纵阵', '复纵阵', '轮形阵'])
|
||||
f3.add_argument('--舰队步长3', default=default('--舰队步长3'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
|
||||
|
@ -139,12 +139,12 @@ def main(ini_name=''):
|
||||
f1.add_argument('--fleet_step_1', default=default('--fleet_step_1'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored')
|
||||
|
||||
f2 = fleet.add_argument_group('Boss Fleet')
|
||||
f2.add_argument('--fleet_index_2', default=default('--fleet_index_2'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--fleet_index_2', default=default('--fleet_index_2'), choices=['do_not_use', '1', '2', '3', '4', '5', '6'])
|
||||
f2.add_argument('--fleet_formation_2', default=default('--fleet_formation_2'), choices=['Line Ahead', 'Double Line', 'Diamond'])
|
||||
f2.add_argument('--fleet_step_2', default=default('--fleet_step_2'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored')
|
||||
|
||||
f3 = fleet.add_argument_group('Alternate Mob Fleet')
|
||||
f3.add_argument('--fleet_index_3', default=default('--fleet_index_3'), choices=['1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--fleet_index_3', default=default('--fleet_index_3'), choices=['do_not_use', '1', '2', '3', '4', '5', '6'])
|
||||
f3.add_argument('--fleet_formation_3', default=default('--fleet_formation_3'), choices=['Line Ahead', 'Double Line', 'Diamond'])
|
||||
f3.add_argument('--fleet_step_3', default=default('--fleet_step_3'), choices=['1', '2', '3', '4', '5', '6'], help='In event map, fleet has limit on moving, so fleet_step is how far can a fleet goes in one operation, if map cleared, it will be ignored')
|
||||
|
||||
|
@ -419,7 +419,7 @@ class AzurLaneConfig:
|
||||
self.ENABLE_FLEET_CONTROL = to_bool(option['enable_fleet_control'])
|
||||
self.ENABLE_MAP_FLEET_LOCK = to_bool(option['enable_map_fleet_lock'])
|
||||
for n in ['1', '2', '3']:
|
||||
self.__setattr__(f'FLEET_{n}', int(option[f'fleet_index_{n}']))
|
||||
self.__setattr__(f'FLEET_{n}', int(option[f'fleet_index_{n}']) if to_bool(option[f'fleet_index_{n}']) else 0)
|
||||
self.__setattr__(f'FLEET_{n}_FORMATION', int(option[f'fleet_formation_{n}'].split('_')[1]))
|
||||
self.__setattr__(f'FLEET_{n}_STEP', int(option[f'fleet_step_{n}']))
|
||||
self.COMBAT_AUTO_MODE = option['combat_auto_mode']
|
||||
|
@ -50,11 +50,18 @@ class Fleet(Camera, MapOperation, AmbushHandler):
|
||||
|
||||
@property
|
||||
def fleet_boss(self):
|
||||
if self.config.FLEET_BOSS == 2 and self.config.FLEET_2:
|
||||
if self.config.FLEET_BOSS == 2 or self.config.FLEET_2:
|
||||
return self.fleet_2
|
||||
else:
|
||||
return self.fleet_1
|
||||
|
||||
@property
|
||||
def fleet_boss_index(self):
|
||||
if self.config.FLEET_BOSS == 2 or self.config.FLEET_2:
|
||||
return 1
|
||||
else:
|
||||
return 1
|
||||
|
||||
@property
|
||||
def fleet_step(self):
|
||||
if not self.config.MAP_HAS_FLEET_STEP:
|
||||
@ -410,13 +417,18 @@ class Fleet(Camera, MapOperation, AmbushHandler):
|
||||
"""
|
||||
Args:
|
||||
grid (Grid):
|
||||
fleet (int): 1, 2
|
||||
fleet (int, str): 1, 2, 'boss'
|
||||
|
||||
Returns:
|
||||
bool: If accessible.
|
||||
"""
|
||||
if fleet is None:
|
||||
return grid.is_accessible
|
||||
if isinstance(fleet, str) and fleet.isdigit():
|
||||
fleet = int(fleet)
|
||||
if fleet == 'boss':
|
||||
fleet = self.fleet_boss_index
|
||||
|
||||
if fleet == self.fleet_current_index:
|
||||
return grid.is_accessible
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user