From cae9762b6561a0cf87603d9e900a00718da4106a Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Wed, 8 Apr 2020 00:53:26 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E8=A7=A3=E5=86=B3=E9=A2=86=E5=AE=8C?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E8=BF=98=E4=BC=9A=E5=AE=8C=E6=88=90=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E4=BB=BB=E5=8A=A1=E7=9A=84=E9=97=AE=E9=A2=98,=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=B0=E9=9A=BE=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 给之前修的一堆bug擦屁股 - 修复了舰队不上满的时, 会触发低血量撤退的问题 --- campaign/campaign_hard/campaign_hard.py | 6 +++--- module/combat/hp_balancer.py | 9 ++++++++- module/map/fleet.py | 2 +- module/reward/assets.py | 2 +- module/reward/reward.py | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/campaign/campaign_hard/campaign_hard.py b/campaign/campaign_hard/campaign_hard.py index a0f62116d..e4c7545ec 100644 --- a/campaign/campaign_hard/campaign_hard.py +++ b/campaign/campaign_hard/campaign_hard.py @@ -9,7 +9,8 @@ from module.ui.ui import CAMPAIGN_CHECK class Config: MAP_HAS_AMBUSH = False - EMOTION_REDUCE = False + ENABLE_EMOTION_REDUCE = False + class Campaign(CampaignBase, HardEquipment): def run(self): @@ -35,8 +36,7 @@ class Campaign(CampaignBase, HardEquipment): def fleet_preparation(self): self.equipment_take_on() - @property - def _expected_combat_end(self): + def _expected_combat_end(self, expected): return 'in_stage' def clear_boss(self): diff --git a/module/combat/hp_balancer.py b/module/combat/hp_balancer.py index 0dfe34e4d..01c75cf7e 100644 --- a/module/combat/hp_balancer.py +++ b/module/combat/hp_balancer.py @@ -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 diff --git a/module/map/fleet.py b/module/map/fleet.py index 3e0c40d25..617a9d3f6 100644 --- a/module/map/fleet.py +++ b/module/map/fleet.py @@ -226,7 +226,7 @@ class Fleet(Camera, AmbushHandler, MysteryHandler, MapOperation): self.ammo_count = 3 self.map = map_ self.map.reset() - self.hp_get() + self.hp_init() 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.find_current_fleet() diff --git a/module/reward/assets.py b/module/reward/assets.py index c3b4a5406..9214797f6 100644 --- a/module/reward/assets.py +++ b/module/reward/assets.py @@ -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') 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_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') 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') diff --git a/module/reward/reward.py b/module/reward/reward.py index 2a3b84c29..9be47bf70 100644 --- a/module/reward/reward.py +++ b/module/reward/reward.py @@ -99,7 +99,7 @@ class Reward(RewardCommission): self.ui_goto(page_mission, skip_first_screenshot=True) reward = False - exit_timer = Timer(1) + exit_timer = Timer(2) click_timer = Timer(1) timeout = Timer(10) exit_timer.start()