From e66f2307cff5bd414afc125a25547dbc31ccd558 Mon Sep 17 00:00:00 2001 From: wszqkzqk Date: Tue, 3 May 2022 14:10:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=83=B5=E5=B0=B8=E5=95=83?= =?UTF-8?q?=E5=92=AC=E8=BF=9E=E7=BB=AD=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/zombie.py | 4 ++-- source/constants.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/source/component/zombie.py b/source/component/zombie.py index b45270c..bdd8511 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -4,7 +4,7 @@ from .. import constants as c class Zombie(pg.sprite.Sprite): - def __init__(self, x, y, name, head_group=None, helmetHealth=0, helmetType2Health=0, bodyHealth=c.NORMAL_HEALTH + c.LOSTHEAD_HEALTH, damage=30): + def __init__(self, x, y, name, head_group=None, helmetHealth=0, helmetType2Health=0, bodyHealth=c.NORMAL_HEALTH + c.LOSTHEAD_HEALTH, damage=c.ZOMBIE_ATTACK_DAMAGE): pg.sprite.Sprite.__init__(self) self.name = name @@ -123,7 +123,7 @@ class Zombie(pg.sprite.Sprite): self.helmetType2 = False if self.name == c.NEWSPAPER_ZOMBIE: self.speed = 2.5 - if ((self.current_time - self.attack_timer) > (c.ATTACK_INTERVAL * self.getAttackTimeRatio())) and not self.lostHead: + if ((self.current_time - self.attack_timer) > (c.ATTACK_INTERVAL * self.getAttackTimeRatio())) and (not self.lostHead): if self.prey.health > 0: if self.prey_is_plant: self.prey.setDamage(self.damage, self) diff --git a/source/constants.py b/source/constants.py index 5283118..8999a76 100755 --- a/source/constants.py +++ b/source/constants.py @@ -299,7 +299,8 @@ FOOTBALL_HELMET_HEALTH = 1400 NEWSPAPER_HEALTH = 150 # 僵尸行动信息 -ATTACK_INTERVAL = 500 +ATTACK_INTERVAL = 250 +ZOMBIE_ATTACK_DAMAGE = 15 ZOMBIE_WALK_INTERVAL = 60 # 僵尸步行间隔 # 僵尸生成位置