删除不需要的常数

This commit is contained in:
星外之神 2022-05-06 13:28:47 +08:00
parent e222687474
commit 05d7ad2adb
2 changed files with 1 additions and 2 deletions

View File

@ -592,7 +592,6 @@ class PotatoMine(Plant):
self.is_init = True
self.init_timer = 0
self.bomb_timer = 0
self.explode_y_range = 0
self.explode_x_range = c.GRID_X_SIZE
def loadImages(self, name, scale):

View File

@ -1012,7 +1012,7 @@ class Level(tool.State):
self.hypno_zombie_groups[map_y].add(zombie)
elif (plant.name == c.POTATOMINE and not plant.is_init): # 土豆雷不是灰烬植物不能用Boom
for zombie in self.zombie_groups[map_y]:
if ((abs(zombie.rect.centerx - x) <= plant.explode_y_range) or
if ((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]是在右边的情况
zombie.setDamage(1800, damageType=c.ZOMBIE_RANGE_DAMAGE)
else: