修复僵尸在用铲子移除植物后还在原位啃食的bug

This commit is contained in:
星外之神 2022-04-07 13:20:15 +08:00
parent b6e0961d2b
commit 4ed1f0a7ef
2 changed files with 2 additions and 5 deletions

View File

@ -3,11 +3,6 @@
"init_sun_value":5000, "init_sun_value":5000,
"shovel":1, "shovel":1,
"zombie_list":[ "zombie_list":[
{"time":1000, "map_y":2, "name":"BucketheadZombie"},
{"time":1000, "map_y":2, "name":"BucketheadZombie"},
{"time":1000, "map_y":2, "name":"Zombie"},
{"time":1000, "map_y":2, "name":"Zombie"},
{"time":1000, "map_y":2, "name":"Zombie"},
{"time":1000, "map_y":2, "name":"Zombie"}, {"time":1000, "map_y":2, "name":"Zombie"},
{"time":2000, "map_y":2, "name":"BucketheadZombie"}, {"time":2000, "map_y":2, "name":"BucketheadZombie"},
{"time":3000, "map_y":2, "name":"BucketheadZombie"}, {"time":3000, "map_y":2, "name":"BucketheadZombie"},

View File

@ -612,6 +612,8 @@ class Level(tool.State):
_, map_y = self.map.getMapIndex(zombie.rect.centerx, zombie.rect.bottom) _, map_y = self.map.getMapIndex(zombie.rect.centerx, zombie.rect.bottom)
self.zombie_groups[map_y].remove(zombie) self.zombie_groups[map_y].remove(zombie)
self.hypno_zombie_groups[map_y].add(zombie) self.hypno_zombie_groups[map_y].add(zombie)
# 避免僵尸在用铲子移除植物后还在原位啃食
plant.health = 0
plant.kill() plant.kill()
def checkPlant(self, plant, i): def checkPlant(self, plant, i):