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: # 触发植物死亡音效