更改缠绕海草攻击范围

This commit is contained in:
wszqkzqk 2022-08-08 23:59:17 +08:00
parent 544560c49e
commit 9e01c018e4
2 changed files with 5 additions and 3 deletions

View File

@ -112,7 +112,8 @@ class Map():
return False
else:
return True
elif (plant_name == c.PUMPKINHEAD) and (c.PUMPKINHEAD not in self.map[map_y][map_x][c.MAP_PLANT]): # 有花盆且没有南瓜头就能种南瓜头
elif ((plant_name == c.PUMPKINHEAD)
and (c.PUMPKINHEAD not in self.map[map_y][map_x][c.MAP_PLANT])): # 有花盆且没有南瓜头就能种南瓜头
return True
else:
return False
@ -136,7 +137,8 @@ class Map():
return False
else:
return True
elif (plant_name == c.PUMPKINHEAD) and (c.PUMPKINHEAD not in self.map[map_y][map_x][c.MAP_PLANT]): # 在睡莲上且没有南瓜头就能种南瓜头
elif ((plant_name == c.PUMPKINHEAD)
and (c.PUMPKINHEAD not in self.map[map_y][map_x][c.MAP_PLANT])): # 在睡莲上且没有南瓜头就能种南瓜头
return True
else:
return False

View File

@ -1474,7 +1474,7 @@ class TangleKlep(Plant):
def canAttack(self, zombie):
if zombie.state != c.DIE and (not zombie.losthead):
# 这里碰撞应当比碰撞一般更容易就设置成圆形或矩形模式不宜采用mask
if pg.sprite.collide_circle_ratio(0.7)(zombie, self):
if pg.sprite.collide_rect_ratio(1)(zombie, self):
return True
return False