From 777e937d986d4ffe7bc7492c02275cc6a5df625b Mon Sep 17 00:00:00 2001 From: wszqkzqk Date: Tue, 9 Aug 2022 20:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/plant.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/source/component/plant.py b/source/component/plant.py index 8c85334..a4e4a59 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -1279,18 +1279,20 @@ class TorchWood(Plant): def idling(self): for i in self.bullet_group: - if i.name == c.BULLET_PEA: - if i.passed_torchwood_x != self.rect.centerx: - if abs(i.rect.centerx - self.rect.centerx) <= 20: - self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y, - c.BULLET_FIREBALL, c.BULLET_DAMAGE_FIREBALL_BODY, effect=c.BULLET_EFFECT_UNICE, passed_torchwood_x=self.rect.centerx)) - i.kill() - elif i.name == c.BULLET_PEA_ICE: - if i.passed_torchwood_x != self.rect.centerx: - if abs(i.rect.centerx - self.rect.centerx) <= 20: - self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y, - c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, effect=None, passed_torchwood_x=self.rect.centerx)) - i.kill() + if (i.name == c.BULLET_PEA + and i.passed_torchwood_x != self.rect.centerx + and abs(i.rect.centerx - self.rect.centerx) <= 20): + self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y, + c.BULLET_FIREBALL, c.BULLET_DAMAGE_FIREBALL_BODY, + effect=c.BULLET_EFFECT_UNICE, passed_torchwood_x=self.rect.centerx)) + i.kill() + elif (i.name == c.BULLET_PEA_ICE + and i.passed_torchwood_x != self.rect.centerx + and abs(i.rect.centerx - self.rect.centerx)): + self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.dest_y, + c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, + effect=None, passed_torchwood_x=self.rect.centerx)) + i.kill() class StarFruit(Plant): def __init__(self, x, y, bullet_group, level):