From 0f723f43d483360016cd05920b0693bfa60c50ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Fri, 6 May 2022 19:06:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E6=8E=89=E5=A5=87=E6=80=AA?= =?UTF-8?q?=E7=9A=84=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/state/level.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/state/level.py b/source/state/level.py index d159dfb..72ffe80 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -1016,8 +1016,7 @@ class Level(tool.State): elif (plant.name == c.POTATOMINE and not plant.is_init): # 土豆雷不是灰烬植物,不能用Boom for zombie in self.zombie_groups[map_y]: if ((pg.sprite.collide_circle_ratio(0.6)(zombie, plant)) or - (abs(zombie.rect.centerx - x) <= plant.explode_x_range) or - ((zombie.rect.right - (x-plant.explode_x_range) > 20) or (zombie.rect.right - (x-plant.explode_x_range))/zombie.rect.width > 0.2, ((x+plant.explode_x_range) - zombie.rect.left > 20) or ((x+plant.explode_x_range) - zombie.rect.left)/zombie.rect.width > 0.2)[zombie.rect.x > x]): # 这代码不太好懂,后面是一个判断僵尸在左还是在右,前面是一个元组,[0]是在左边的情况,[1]是在右边的情况 + (abs(zombie.rect.centerx - x) <= plant.explode_x_range)): # 这代码不太好懂,后面是一个判断僵尸在左还是在右,前面是一个元组,[0]是在左边的情况,[1]是在右边的情况 zombie.setDamage(1800, damageType=c.ZOMBIE_RANGE_DAMAGE) elif plant.name != c.WALLNUTBOWLING: # 触发植物死亡音效