1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-12 10:58:21 +08:00

Fix: Path finding when grids blocked by fortress

This commit is contained in:
LmeSzinc
2021-09-17 18:22:24 +08:00
parent e0063325b2
commit 017df17029
18 changed files with 152 additions and 35 deletions

View File

@@ -61,14 +61,13 @@ class GridInfo:
mechanism_trigger = None # SelectedGrids
mechanism_block = None # SelectedGrids
mechanism_wait = 2 # Seconds to wait the mechanism unlock animation
is_fortress = False # Machine fortress
cost = 9999
cost_1 = 9999
cost_2 = 9999
connection = None
weight = 1
manual_siren = False
location = None
def decode(self, text):
@@ -101,7 +100,7 @@ class GridInfo:
if self.__getattribute__(value):
return key
if self.is_siren or self.manual_siren:
if self.is_siren:
name = self.enemy_genre[6:8].upper() if self.enemy_genre else 'SU'
return name if name else 'SU'
@@ -117,6 +116,7 @@ class GridInfo:
'ss': 'is_submarine',
'MY': 'is_mystery',
'AM': 'is_ammo',
'FR': 'is_fortress',
'==': 'is_cleared'
}
for key, value in dic.items():
@@ -142,7 +142,7 @@ class GridInfo:
@property
def is_sea(self):
return False if self.is_land or self.is_enemy or self.is_siren or self.manual_siren or self.is_boss else True
return False if self.is_land or self.is_enemy or self.is_siren or self.is_fortress or self.is_boss else True
@property
def may_carrier(self):
@@ -257,7 +257,7 @@ class GridInfo:
self.is_boss = False
self.is_ammo = False
self.is_siren = False
self.manual_siren = False
self.is_fortress = False
self.is_caught_by_siren = False
self.is_carrier = False
self.is_movable = False