From f26c6071ce9c2862c7ae6eec62f3c8ee41e206d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Wed, 4 May 2022 22:46:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=AD=85=E6=83=91=E8=8F=87bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/component/plant.py b/source/component/plant.py index 2acb333..55f1e2d 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -951,7 +951,7 @@ class HypnoShroom(Plant): def __init__(self, x, y): Plant.__init__(self, x, y, c.HYPNOSHROOM, c.PLANT_HEALTH, None) self.can_sleep = True - self.animate_interval = 200 + self.animate_interval = 80 def loadImages(self, name, scale): self.idle_frames = [] @@ -967,6 +967,11 @@ class HypnoShroom(Plant): self.loadFrames(frame_list[i], name, 1, c.WHITE) self.frames = self.idle_frames + + def idling(self): + # 现在没有投石车僵尸,所以暂时这样处理 + if self.health < c.PLANT_HEALTH: + self.health = 0 class WallNutBowling(Plant): @@ -1176,11 +1181,13 @@ class CoffeeBean(Plant): def idling(self): if (self.frame_index + 1) == self.frame_num: - self.mapContent[c.MAP_SLEEP] = True + self.mapContent[c.MAP_SLEEP] = False for plant in self.plant_group: if plant.can_sleep: if plant.state == c.SLEEP: + plant.state = c.IDLE plant.setIdle() + plant.changeFrames(plant.idle_frames) self.mapContent[c.MAP_PLANT].remove(self.name) self.kill() \ No newline at end of file