更改数据以贴近原版
This commit is contained in:
parent
793eb701a7
commit
87dfd57d68
@ -5,7 +5,7 @@ from .. import constants as c
|
||||
|
||||
|
||||
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)
|
||||
|
||||
self.name = name
|
||||
@ -19,7 +19,9 @@ class Zombie(pg.sprite.Sprite):
|
||||
self.rect.centerx = x
|
||||
self.rect.bottom = y
|
||||
|
||||
self.health = health
|
||||
self.bodyHealth = bodyHealth
|
||||
self.helmetHealth = helmetHealth
|
||||
self.health = bodyHealth + helmetHealth
|
||||
self.damage = damage
|
||||
self.dead = False
|
||||
self.lostHead = False
|
||||
@ -250,7 +252,7 @@ class ZombieHead(Zombie):
|
||||
|
||||
class NormalZombie(Zombie):
|
||||
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):
|
||||
self.walk_frames = []
|
||||
@ -280,7 +282,7 @@ class NormalZombie(Zombie):
|
||||
# 路障僵尸
|
||||
class ConeHeadZombie(Zombie):
|
||||
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
|
||||
|
||||
def loadImages(self):
|
||||
@ -317,7 +319,7 @@ class ConeHeadZombie(Zombie):
|
||||
|
||||
class BucketHeadZombie(Zombie):
|
||||
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
|
||||
|
||||
def loadImages(self):
|
||||
@ -354,7 +356,7 @@ class BucketHeadZombie(Zombie):
|
||||
|
||||
class FlagZombie(Zombie):
|
||||
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):
|
||||
self.walk_frames = []
|
||||
@ -384,7 +386,7 @@ class FlagZombie(Zombie):
|
||||
|
||||
class NewspaperZombie(Zombie):
|
||||
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
|
||||
|
||||
def loadImages(self):
|
||||
|
||||
@ -109,15 +109,15 @@ HYPNOSHROOM = 'HypnoShroom'
|
||||
WALLNUTBOWLING = 'WallNutBowling'
|
||||
REDWALLNUTBOWLING = 'RedWallNutBowling'
|
||||
|
||||
PLANT_HEALTH = 5
|
||||
WALLNUT_HEALTH = 30
|
||||
WALLNUT_CRACKED1_HEALTH = 20
|
||||
WALLNUT_CRACKED2_HEALTH = 10
|
||||
WALLNUT_BOWLING_DAMAGE = 10
|
||||
PLANT_HEALTH = 300
|
||||
WALLNUT_HEALTH = 4000
|
||||
WALLNUT_CRACKED1_HEALTH = 4000//3 * 2
|
||||
WALLNUT_CRACKED2_HEALTH = 4000//3
|
||||
WALLNUT_BOWLING_DAMAGE = 370
|
||||
|
||||
PRODUCE_SUN_INTERVAL = 7000
|
||||
FLOWER_SUN_INTERVAL = 22000
|
||||
SUN_LIVE_TIME = 7000
|
||||
FLOWER_SUN_INTERVAL = 24000
|
||||
SUN_LIVE_TIME = 10000
|
||||
SUN_VALUE = 25
|
||||
|
||||
ICE_SLOW_TIME = 10000
|
||||
@ -149,7 +149,7 @@ CARD_REDWALLNUT = 'card_redwallnut'
|
||||
BULLET_PEA = 'PeaNormal'
|
||||
BULLET_PEA_ICE = 'PeaIce'
|
||||
BULLET_MUSHROOM = 'BulletMushRoom'
|
||||
BULLET_DAMAGE_NORMAL = 1
|
||||
BULLET_DAMAGE_NORMAL = 20
|
||||
|
||||
#ZOMBIE INFO
|
||||
ZOMBIE_IMAGE_RECT = 'zombie_image_rect'
|
||||
@ -161,15 +161,17 @@ FLAG_ZOMBIE = 'FlagZombie'
|
||||
NEWSPAPER_ZOMBIE = 'NewspaperZombie'
|
||||
BOOMDIE = 'BoomDie'
|
||||
|
||||
LOSTHEAD_HEALTH = 2
|
||||
NORMAL_HEALTH = 10
|
||||
FLAG_HEALTH = 15
|
||||
CONEHEAD_HEALTH = 20
|
||||
BUCKETHEAD_HEALTH = 30
|
||||
NEWSPAPER_HEALTH = 15
|
||||
# 僵尸生命值设置
|
||||
LOSTHEAD_HEALTH = 70
|
||||
NORMAL_HEALTH = 200 # 普通僵尸生命值
|
||||
|
||||
ATTACK_INTERVAL = 1000
|
||||
ZOMBIE_WALK_INTERVAL = 70
|
||||
FLAG_HEALTH = 50
|
||||
CONEHEAD_HEALTH = 370
|
||||
BUCKETHEAD_HEALTH = 1100
|
||||
NEWSPAPER_HEALTH = 200
|
||||
|
||||
ATTACK_INTERVAL = 500
|
||||
ZOMBIE_WALK_INTERVAL = 100
|
||||
|
||||
ZOMBIE_START_X = SCREEN_WIDTH + 50
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user