更改数据以贴近原版

This commit is contained in:
星外之神 2022-04-05 16:07:49 +08:00
parent 793eb701a7
commit 87dfd57d68
2 changed files with 27 additions and 23 deletions

View File

@ -5,7 +5,7 @@ from .. import constants as c
class Zombie(pg.sprite.Sprite): class Zombie(pg.sprite.Sprite):
def __init__(self, x, y, name, health, head_group=None, damage=1): def __init__(self, x, y, name, head_group=None, helmetHealth=0, bodyHealth=c.NORMAL_HEALTH + c.LOSTHEAD_HEALTH, damage=30):
pg.sprite.Sprite.__init__(self) pg.sprite.Sprite.__init__(self)
self.name = name self.name = name
@ -19,7 +19,9 @@ class Zombie(pg.sprite.Sprite):
self.rect.centerx = x self.rect.centerx = x
self.rect.bottom = y self.rect.bottom = y
self.health = health self.bodyHealth = bodyHealth
self.helmetHealth = helmetHealth
self.health = bodyHealth + helmetHealth
self.damage = damage self.damage = damage
self.dead = False self.dead = False
self.lostHead = False self.lostHead = False
@ -250,7 +252,7 @@ class ZombieHead(Zombie):
class NormalZombie(Zombie): class NormalZombie(Zombie):
def __init__(self, x, y, head_group): def __init__(self, x, y, head_group):
Zombie.__init__(self, x, y, c.NORMAL_ZOMBIE, c.NORMAL_HEALTH, head_group) Zombie.__init__(self, x, y, c.NORMAL_ZOMBIE, head_group)
def loadImages(self): def loadImages(self):
self.walk_frames = [] self.walk_frames = []
@ -280,7 +282,7 @@ class NormalZombie(Zombie):
# 路障僵尸 # 路障僵尸
class ConeHeadZombie(Zombie): class ConeHeadZombie(Zombie):
def __init__(self, x, y, head_group): def __init__(self, x, y, head_group):
Zombie.__init__(self, x, y, c.CONEHEAD_ZOMBIE, c.CONEHEAD_HEALTH, head_group) Zombie.__init__(self, x, y, c.CONEHEAD_ZOMBIE, head_group, c.CONEHEAD_HEALTH)
self.helmet = True self.helmet = True
def loadImages(self): def loadImages(self):
@ -317,7 +319,7 @@ class ConeHeadZombie(Zombie):
class BucketHeadZombie(Zombie): class BucketHeadZombie(Zombie):
def __init__(self, x, y, head_group): def __init__(self, x, y, head_group):
Zombie.__init__(self, x, y, c.BUCKETHEAD_ZOMBIE, c.BUCKETHEAD_HEALTH, head_group) Zombie.__init__(self, x, y, c.BUCKETHEAD_ZOMBIE, head_group, c.BUCKETHEAD_HEALTH)
self.helmet = True self.helmet = True
def loadImages(self): def loadImages(self):
@ -354,7 +356,7 @@ class BucketHeadZombie(Zombie):
class FlagZombie(Zombie): class FlagZombie(Zombie):
def __init__(self, x, y, head_group): def __init__(self, x, y, head_group):
Zombie.__init__(self, x, y, c.FLAG_ZOMBIE, c.FLAG_HEALTH, head_group) Zombie.__init__(self, x, y, c.FLAG_ZOMBIE, head_group, c.FLAG_HEALTH)
def loadImages(self): def loadImages(self):
self.walk_frames = [] self.walk_frames = []
@ -384,7 +386,7 @@ class FlagZombie(Zombie):
class NewspaperZombie(Zombie): class NewspaperZombie(Zombie):
def __init__(self, x, y, head_group): def __init__(self, x, y, head_group):
Zombie.__init__(self, x, y, c.NEWSPAPER_ZOMBIE, c.NEWSPAPER_HEALTH, head_group) Zombie.__init__(self, x, y, c.NEWSPAPER_ZOMBIE, head_group, c.NEWSPAPER_HEALTH)
self.helmet = True self.helmet = True
def loadImages(self): def loadImages(self):

View File

@ -109,15 +109,15 @@ HYPNOSHROOM = 'HypnoShroom'
WALLNUTBOWLING = 'WallNutBowling' WALLNUTBOWLING = 'WallNutBowling'
REDWALLNUTBOWLING = 'RedWallNutBowling' REDWALLNUTBOWLING = 'RedWallNutBowling'
PLANT_HEALTH = 5 PLANT_HEALTH = 300
WALLNUT_HEALTH = 30 WALLNUT_HEALTH = 4000
WALLNUT_CRACKED1_HEALTH = 20 WALLNUT_CRACKED1_HEALTH = 4000//3 * 2
WALLNUT_CRACKED2_HEALTH = 10 WALLNUT_CRACKED2_HEALTH = 4000//3
WALLNUT_BOWLING_DAMAGE = 10 WALLNUT_BOWLING_DAMAGE = 370
PRODUCE_SUN_INTERVAL = 7000 PRODUCE_SUN_INTERVAL = 7000
FLOWER_SUN_INTERVAL = 22000 FLOWER_SUN_INTERVAL = 24000
SUN_LIVE_TIME = 7000 SUN_LIVE_TIME = 10000
SUN_VALUE = 25 SUN_VALUE = 25
ICE_SLOW_TIME = 10000 ICE_SLOW_TIME = 10000
@ -149,7 +149,7 @@ CARD_REDWALLNUT = 'card_redwallnut'
BULLET_PEA = 'PeaNormal' BULLET_PEA = 'PeaNormal'
BULLET_PEA_ICE = 'PeaIce' BULLET_PEA_ICE = 'PeaIce'
BULLET_MUSHROOM = 'BulletMushRoom' BULLET_MUSHROOM = 'BulletMushRoom'
BULLET_DAMAGE_NORMAL = 1 BULLET_DAMAGE_NORMAL = 20
#ZOMBIE INFO #ZOMBIE INFO
ZOMBIE_IMAGE_RECT = 'zombie_image_rect' ZOMBIE_IMAGE_RECT = 'zombie_image_rect'
@ -161,15 +161,17 @@ FLAG_ZOMBIE = 'FlagZombie'
NEWSPAPER_ZOMBIE = 'NewspaperZombie' NEWSPAPER_ZOMBIE = 'NewspaperZombie'
BOOMDIE = 'BoomDie' BOOMDIE = 'BoomDie'
LOSTHEAD_HEALTH = 2 # 僵尸生命值设置
NORMAL_HEALTH = 10 LOSTHEAD_HEALTH = 70
FLAG_HEALTH = 15 NORMAL_HEALTH = 200 # 普通僵尸生命值
CONEHEAD_HEALTH = 20
BUCKETHEAD_HEALTH = 30
NEWSPAPER_HEALTH = 15
ATTACK_INTERVAL = 1000 FLAG_HEALTH = 50
ZOMBIE_WALK_INTERVAL = 70 CONEHEAD_HEALTH = 370
BUCKETHEAD_HEALTH = 1100
NEWSPAPER_HEALTH = 200
ATTACK_INTERVAL = 500
ZOMBIE_WALK_INTERVAL = 100
ZOMBIE_START_X = SCREEN_WIDTH + 50 ZOMBIE_START_X = SCREEN_WIDTH + 50