From fda640ec304e89c31f86262d48ff413069f205f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Fri, 6 May 2022 13:04:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/state/level.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/state/level.py b/source/state/level.py index 3240930..21b5f37 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -840,11 +840,12 @@ class Level(tool.State): rect = frame_list[0].get_rect() width, height = rect.w, rect.h - if (plant_name == c.POTATOMINE or plant_name == c.SQUASH or - plant_name == c.SPIKEWEED or plant_name == c.JALAPENO or - plant_name == c.SCAREDYSHROOM or plant_name == c.SUNSHROOM or - plant_name == c.ICESHROOM or plant_name == c.HYPNOSHROOM or - plant_name == c.WALLNUTBOWLING or plant_name == c.REDWALLNUTBOWLING): + if (plant_name in { c.POTATOMINE, c.SPIKEWEED, + c.JALAPENO, c.SCAREDYSHROOM, + c.SUNSHROOM, c.ICESHROOM, + c.HYPNOSHROOM, c.SQUASH, + c.WALLNUTBOWLING, c.REDWALLNUTBOWLING, + }): color = c.WHITE else: color = c.BLACK @@ -997,7 +998,7 @@ class Level(tool.State): if not shovel: # 触发植物死亡音效 pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "plantDie.ogg")).play() - if (plant.name == c.CHERRYBOMB or plant.name == c.REDWALLNUTBOWLING): + if plant.name in {c.CHERRYBOMB, c.REDWALLNUTBOWLING}: self.boomZombies(plant.rect.centerx, map_y, plant.explode_y_range, plant.explode_x_range) elif plant.name == c.JALAPENO: