From e0f05cda8ab47bcc7d844523db050b4008530ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Sun, 1 May 2022 21:43:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=88=A4=E6=96=AD=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/state/level.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/state/level.py b/source/state/level.py index 18564be..0db8fcd 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -194,12 +194,13 @@ class Level(tool.State): numZombies = 0 for i in range(self.map_y_len): numZombies += len(self.zombie_groups[i]) - if numZombies / self.numZombie < uniform(0.15, 0.25): - # 当僵尸所剩无几时,改变时间记录,使得2000 ms后刷新僵尸(所以需要判断剩余时间是否大于2000 ms) - if current_time - self.waveTime > 2000: - if self.bar_type == c.CHOOSEBAR_STATIC: + if (numZombies / self.numZombie < uniform(0.15, 0.25)) and (current_time - self.waveTime > 4000): + # 当僵尸所剩无几并且时间过了4000 ms以上时,改变时间记录,使得2000 ms后刷新僵尸(所以需要判断剩余时间是否大于2000 ms) + if self.bar_type == c.CHOOSEBAR_STATIC: + if current_time - 43000 < self.waveTime: # 判断剩余时间是否有2000 ms self.waveTime = current_time - 43000 # 即倒计时2000 ms - else: + else: + if current_time - 23000 < self.waveTime: # 判断剩余时间是否有2000 ms self.waveTime = current_time - 23000 # 即倒计时2000 ms