From 5bb62383c555ed42bb72817bcb414885d34f9a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Sat, 14 May 2022 12:01:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=86=B0=E9=81=93=E8=AE=BE?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 9 ++++++++- source/state/level.py | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/source/component/plant.py b/source/component/plant.py index 143f431..d597971 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -1715,4 +1715,11 @@ class FumeShroom(Plant): class IceFrozenPlot(Plant): def __init__(self, x, y): - Plant.__init__(self, x, y, c.ICE_FROZEN_PLOT, c.INF, None) \ No newline at end of file + Plant.__init__(self, x, y, c.ICE_FROZEN_PLOT, c.INF, None) + self.timer = 0 + + def idling(self): + if self.timer == 0: + self.timer = self.current_time + elif self.current_time - self.timer >= 30000: + self.health = 0 \ No newline at end of file diff --git a/source/state/level.py b/source/state/level.py index 424c468..6dcd527 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -1208,6 +1208,10 @@ class Level(tool.State): elif targetPlant.name == c.JALAPENO: self.boomZombies(targetPlant.rect.centerx, map_y, targetPlant.explode_y_range, targetPlant.explode_x_range, effect=c.BULLET_EFFECT_UNICE) + # 消除冰道 + for i in self.plant_groups[map_y]: + if i.name == c.ICE_FROZEN_PLOT: + i.health = 0 elif targetPlant.name == c.ICESHROOM and targetPlant.state != c.SLEEP: self.freezeZombies(targetPlant) elif targetPlant.name == c.HYPNOSHROOM and targetPlant.state != c.SLEEP: