diff --git a/source/component/map.py b/source/component/map.py index 35beed4..b4243d2 100755 --- a/source/component/map.py +++ b/source/component/map.py @@ -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 diff --git a/source/component/plant.py b/source/component/plant.py index d3bf123..8c85334 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -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