From 9e01c018e4701d6eacb3a6678cff78c630a15045 Mon Sep 17 00:00:00 2001 From: wszqkzqk Date: Mon, 8 Aug 2022 23:59:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=BC=A0=E7=BB=95=E6=B5=B7?= =?UTF-8?q?=E8=8D=89=E6=94=BB=E5=87=BB=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/map.py | 6 ++++-- source/component/plant.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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