mirror of
https://gitee.com/sui-feng-cb/AzurLaneAutoScript1
synced 2026-03-15 13:27:20 +08:00
Fix: 解决领完任务还会完成新的任务的问题, 修复困难图
- 给之前修的一堆bug擦屁股 - 修复了舰队不上满的时, 会触发低血量撤退的问题
This commit is contained in:
@@ -27,6 +27,7 @@ SCOUT_POSITION = [
|
||||
|
||||
class HPBalancer(ModuleBase):
|
||||
hp = []
|
||||
hp_record = []
|
||||
_scout_order = (0, 1, 2)
|
||||
|
||||
def _calculate_hp(self, location, size):
|
||||
@@ -60,6 +61,11 @@ class HPBalancer(ModuleBase):
|
||||
)
|
||||
return self.hp
|
||||
|
||||
def hp_init(self):
|
||||
self.hp_get()
|
||||
self.hp_record = self.hp
|
||||
return self.hp
|
||||
|
||||
def _scout_position_change(self, p1, p2):
|
||||
"""Exchange KAN-SEN's position.
|
||||
It need to move up and down a little, even though it moves to the right location.
|
||||
@@ -117,7 +123,8 @@ class HPBalancer(ModuleBase):
|
||||
|
||||
def hp_withdraw_triggered(self):
|
||||
if self.config.ENABLE_LOW_HP_WITHDRAW:
|
||||
if np.any(np.array(self.hp) < self.config.LOW_HP_WITHDRAW_THRESHOLD):
|
||||
hp = np.array(self.hp)[np.array(self.hp_record) > 0.3]
|
||||
if np.any(hp < self.config.LOW_HP_WITHDRAW_THRESHOLD):
|
||||
logger.info('Low HP withdraw triggered.')
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user