mirror of
https://github.com/LmeSzinc/StarRailCopilot.git
synced 2024-11-23 17:11:42 +00:00
Fix: 解决领完任务还会完成新的任务的问题, 修复困难图
- 给之前修的一堆bug擦屁股 - 修复了舰队不上满的时, 会触发低血量撤退的问题
This commit is contained in:
parent
d2c84878f4
commit
cae9762b65
@ -9,7 +9,8 @@ from module.ui.ui import CAMPAIGN_CHECK
|
|||||||
|
|
||||||
class Config:
|
class Config:
|
||||||
MAP_HAS_AMBUSH = False
|
MAP_HAS_AMBUSH = False
|
||||||
EMOTION_REDUCE = False
|
ENABLE_EMOTION_REDUCE = False
|
||||||
|
|
||||||
|
|
||||||
class Campaign(CampaignBase, HardEquipment):
|
class Campaign(CampaignBase, HardEquipment):
|
||||||
def run(self):
|
def run(self):
|
||||||
@ -35,8 +36,7 @@ class Campaign(CampaignBase, HardEquipment):
|
|||||||
def fleet_preparation(self):
|
def fleet_preparation(self):
|
||||||
self.equipment_take_on()
|
self.equipment_take_on()
|
||||||
|
|
||||||
@property
|
def _expected_combat_end(self, expected):
|
||||||
def _expected_combat_end(self):
|
|
||||||
return 'in_stage'
|
return 'in_stage'
|
||||||
|
|
||||||
def clear_boss(self):
|
def clear_boss(self):
|
||||||
|
@ -27,6 +27,7 @@ SCOUT_POSITION = [
|
|||||||
|
|
||||||
class HPBalancer(ModuleBase):
|
class HPBalancer(ModuleBase):
|
||||||
hp = []
|
hp = []
|
||||||
|
hp_record = []
|
||||||
_scout_order = (0, 1, 2)
|
_scout_order = (0, 1, 2)
|
||||||
|
|
||||||
def _calculate_hp(self, location, size):
|
def _calculate_hp(self, location, size):
|
||||||
@ -60,6 +61,11 @@ class HPBalancer(ModuleBase):
|
|||||||
)
|
)
|
||||||
return self.hp
|
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):
|
def _scout_position_change(self, p1, p2):
|
||||||
"""Exchange KAN-SEN's position.
|
"""Exchange KAN-SEN's position.
|
||||||
It need to move up and down a little, even though it moves to the right location.
|
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):
|
def hp_withdraw_triggered(self):
|
||||||
if self.config.ENABLE_LOW_HP_WITHDRAW:
|
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.')
|
logger.info('Low HP withdraw triggered.')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -226,7 +226,7 @@ class Fleet(Camera, AmbushHandler, MysteryHandler, MapOperation):
|
|||||||
self.ammo_count = 3
|
self.ammo_count = 3
|
||||||
self.map = map_
|
self.map = map_
|
||||||
self.map.reset()
|
self.map.reset()
|
||||||
self.hp_get()
|
self.hp_init()
|
||||||
self.ensure_edge_insight(preset=self.map.in_map_swipe_preset_data)
|
self.ensure_edge_insight(preset=self.map.in_map_swipe_preset_data)
|
||||||
self.full_scan(battle_count=self.battle_count, mystery_count=self.mystery_count, siren_count=self.siren_count)
|
self.full_scan(battle_count=self.battle_count, mystery_count=self.mystery_count, siren_count=self.siren_count)
|
||||||
self.find_current_fleet()
|
self.find_current_fleet()
|
||||||
|
@ -16,7 +16,7 @@ COMMISSION_URGENT = Button(area=(35, 231, 68, 281), color=(215, 188, 124), butto
|
|||||||
EXP_INFO_S_REWARD = Button(area=(498, 140, 557, 154), color=(233, 241, 127), button=(498, 140, 557, 154), file='./assets/reward/EXP_INFO_S_REWARD.png')
|
EXP_INFO_S_REWARD = Button(area=(498, 140, 557, 154), color=(233, 241, 127), button=(498, 140, 557, 154), file='./assets/reward/EXP_INFO_S_REWARD.png')
|
||||||
MISSION_MULTI = Button(area=(1041, 8, 1101, 39), color=(226, 192, 142), button=(1041, 8, 1101, 39), file='./assets/reward/MISSION_MULTI.png')
|
MISSION_MULTI = Button(area=(1041, 8, 1101, 39), color=(226, 192, 142), button=(1041, 8, 1101, 39), file='./assets/reward/MISSION_MULTI.png')
|
||||||
MISSION_NOTICE = Button(area=(940, 670, 945, 681), color=(183, 83, 66), button=(940, 670, 945, 681), file='./assets/reward/MISSION_NOTICE.png')
|
MISSION_NOTICE = Button(area=(940, 670, 945, 681), color=(183, 83, 66), button=(940, 670, 945, 681), file='./assets/reward/MISSION_NOTICE.png')
|
||||||
MISSION_SINGLE = Button(area=(1093, 118, 1179, 177), color=(115, 155, 218), button=(1093, 118, 1179, 177), file='./assets/reward/MISSION_SIGNAL.png')
|
MISSION_SINGLE = Button(area=(1093, 118, 1179, 177), color=(115, 155, 218), button=(1093, 118, 1179, 177), file='./assets/reward/MISSION_SINGLE.png')
|
||||||
OIL = Button(area=(162, 64, 182, 91), color=(71, 72, 71), button=(162, 64, 182, 91), file='./assets/reward/OIL.png')
|
OIL = Button(area=(162, 64, 182, 91), color=(71, 72, 71), button=(162, 64, 182, 91), file='./assets/reward/OIL.png')
|
||||||
REWARD_1 = Button(area=(383, 285, 503, 297), color=(238, 168, 81), button=(383, 285, 503, 297), file='./assets/reward/REWARD_1.png')
|
REWARD_1 = Button(area=(383, 285, 503, 297), color=(238, 168, 81), button=(383, 285, 503, 297), file='./assets/reward/REWARD_1.png')
|
||||||
REWARD_2 = Button(area=(383, 404, 503, 444), color=(233, 165, 67), button=(383, 404, 503, 444), file='./assets/reward/REWARD_2.png')
|
REWARD_2 = Button(area=(383, 404, 503, 444), color=(233, 165, 67), button=(383, 404, 503, 444), file='./assets/reward/REWARD_2.png')
|
||||||
|
@ -99,7 +99,7 @@ class Reward(RewardCommission):
|
|||||||
self.ui_goto(page_mission, skip_first_screenshot=True)
|
self.ui_goto(page_mission, skip_first_screenshot=True)
|
||||||
|
|
||||||
reward = False
|
reward = False
|
||||||
exit_timer = Timer(1)
|
exit_timer = Timer(2)
|
||||||
click_timer = Timer(1)
|
click_timer = Timer(1)
|
||||||
timeout = Timer(10)
|
timeout = Timer(10)
|
||||||
exit_timer.start()
|
exit_timer.start()
|
||||||
|
Loading…
Reference in New Issue
Block a user