From 90e07b033d63dafddcb399b172726ee1db079a4f Mon Sep 17 00:00:00 2001 From: LmeSzinc Date: Fri, 1 May 2020 17:54:24 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E7=8C=AB=E6=94=BB=E5=87=BB=E7=9A=84=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/map/MAP_CAT_ATTACK.png | Bin 5533 -> 5927 bytes module/map/assets.py | 2 +- module/map/map_operation.py | 10 +++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/assets/map/MAP_CAT_ATTACK.png b/assets/map/MAP_CAT_ATTACK.png index f382d05f7de98bfe5a8a4d7245ab2ab270b151a6..bfdda8e59c64ad3ae2e352d7403ea84552a45c46 100644 GIT binary patch delta 706 zcmbQMyJIWk*xZmiIPRzuHCPr4~IKhn<@A*Gyx3@mc zQ9j`SXQY8aa86?3^%dWh9_5&opTGPhcV=YSYI*D3otroE)HBv6xcJL3F)%Q=ZK&G6 zYU?opK|#%R_wOYA&Ha17T)~nZDATj}N{5Ev_UrF26ntCm2NYmftop%r|ME8RtXM`i z28INgpRZDXK8wA7zf#sBY4=^O1fY^W z#-_JaFHT?lym+{@PTX0$`ublAU<>~7{QH`G|9#o?zn@CJetc`>e&zjEo}EYcOmhIb ztRUgy04 z&)RQhkpg<8GxL+a2Pmi-PCm__%p?Z#w2$ZJ=u%ct$O%uH-Kzs~`HTrtf$R`_%f7EI zIJdKVp*Tn>*jp6>pWdW)Cr(!828L$Im)}9>x9hrizwB9s13m})l)78&q Iol`;+0H+53h5!Hn delta 160 zcmZ3kH&=VZUM>x;Q=Tr4Ar-gY+}z09pdiq8@$!b2%|X`M-V+`$MHS8X5LeB5@_wx% z)8>nOU5rlmWYicK7!+=1l!iTx`+oi97Hc5aTHpYXTyt5u>QeC0TR^7HC!vKr9AE9-uiE9FrBer^y{yZvzzh|DTzmXeO(`=Nrqv0J#jFu6{1- HoD!M<#mG63 diff --git a/module/map/assets.py b/module/map/assets.py index 7d57a186c..46daef56c 100644 --- a/module/map/assets.py +++ b/module/map/assets.py @@ -15,7 +15,7 @@ FLEET_2_IN_USE = Button(area=(390, 291, 473, 374), color=(74, 66, 66), button=(3 FLEET_PREPARATION = Button(area=(981, 575, 1180, 636), color=(235, 185, 114), button=(981, 575, 1180, 636), file='./assets/map/FLEET_PREPARATION.png') FLEET_PREPARATION_HARD_1 = Button(area=(200, 260, 1004, 261), color=(247, 215, 0), button=(200, 260, 1004, 261), file='./assets/map/FLEET_PREPARATION_HARD_1.png') FLEET_PREPARATION_HARD_2 = Button(area=(201, 393, 1001, 394), color=(255, 219, 0), button=(201, 393, 1001, 394), file='./assets/map/FLEET_PREPARATION_HARD_2.png') -MAP_CAT_ATTACK = Button(area=(1241, 106, 1271, 115), color=(255, 231, 123), button=(1148, 653, 1262, 705), file='./assets/map/MAP_CAT_ATTACK.png') +MAP_CAT_ATTACK = Button(area=(1237, 103, 1252, 153), color=(43, 45, 52), button=(1148, 653, 1262, 705), file='./assets/map/MAP_CAT_ATTACK.png') MAP_OFFENSIVE = Button(area=(1148, 653, 1262, 705), color=(234, 180, 108), button=(1148, 653, 1262, 705), file='./assets/map/MAP_OFFENSIVE.png') MAP_PREPARATION = Button(area=(854, 488, 1052, 548), color=(236, 186, 115), button=(854, 488, 1052, 548), file='./assets/map/MAP_PREPARATION.png') MAP_PREPARATION_CANCEL = Button(area=(234, 12, 278, 47), color=(45, 46, 69), button=(234, 12, 278, 47), file='./assets/map/MAP_PREPARATION_CANCEL.png') diff --git a/module/map/map_operation.py b/module/map/map_operation.py index 28d1dd494..877ab96f6 100644 --- a/module/map/map_operation.py +++ b/module/map/map_operation.py @@ -1,4 +1,7 @@ +import numpy as np + from module.base.timer import Timer +from module.base.utils import color_similarity_2d from module.exception import CampaignEnd from module.exception import ScriptEnd from module.handler.fast_forward import FastForwardHandler @@ -13,6 +16,8 @@ from module.retire.retirement import Retirement class MapOperation(UrgentCommissionHandler, MysteryHandler, FleetPreparation, Retirement, FastForwardHandler, LowEmotionHandler): + map_cat_attack_timer = Timer(2) + def fleet_switch_click(self): """ Switch fleet. @@ -137,8 +142,11 @@ class MapOperation(UrgentCommissionHandler, MysteryHandler, FleetPreparation, Re """ Click to skip the animation when cat attacks. """ - if self.appear_then_click(MAP_CAT_ATTACK, genre='cat_attack', interval=2): + if not self.map_cat_attack_timer.reached(): + return False + if np.sum(color_similarity_2d(self.image_area(MAP_CAT_ATTACK), (255, 231, 123)) > 221) > 100: logger.info('Skip map cat attack') + self.map_cat_attack_timer.reset() return True return False