新增植物:火炬树桩
BIN
resources/graphics/Cards/card_torchwood.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 8.6 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 7.6 KiB |
@ -76,20 +76,20 @@ plantDict = {# 字典 植物名称:(卡片名称, 阳光, 冷却时间)
|
|||||||
7500)}
|
7500)}
|
||||||
'''
|
'''
|
||||||
|
|
||||||
card_name_list = [c.CARD_SUNFLOWER, c.CARD_PEASHOOTER, c.CARD_SNOWPEASHOOTER, c.CARD_WALLNUT,
|
card_name_list = (c.CARD_SUNFLOWER, c.CARD_PEASHOOTER, c.CARD_SNOWPEASHOOTER, c.CARD_WALLNUT,
|
||||||
c.CARD_CHERRYBOMB, c.CARD_THREEPEASHOOTER, c.CARD_REPEATERPEA, c.CARD_CHOMPER,
|
c.CARD_CHERRYBOMB, c.CARD_THREEPEASHOOTER, c.CARD_REPEATERPEA, c.CARD_CHOMPER,
|
||||||
c.CARD_PUFFSHROOM, c.CARD_POTATOMINE, c.CARD_SQUASH, c.CARD_SPIKEWEED,
|
c.CARD_PUFFSHROOM, c.CARD_POTATOMINE, c.CARD_SQUASH, c.CARD_SPIKEWEED,
|
||||||
c.CARD_JALAPENO, c.CARD_SCAREDYSHROOM, c.CARD_SUNSHROOM, c.CARD_ICESHROOM,
|
c.CARD_JALAPENO, c.CARD_SCAREDYSHROOM, c.CARD_SUNSHROOM, c.CARD_ICESHROOM,
|
||||||
c.CARD_HYPNOSHROOM, c.CARD_LILYPAD, c.CARD_WALLNUT, c.CARD_REDWALLNUT]
|
c.CARD_HYPNOSHROOM, c.CARD_LILYPAD, c.CARD_TORCHWOOD, c.CARD_WALLNUT, c.CARD_REDWALLNUT)
|
||||||
plant_name_list = [c.SUNFLOWER, c.PEASHOOTER, c.SNOWPEASHOOTER, c.WALLNUT,
|
plant_name_list = (c.SUNFLOWER, c.PEASHOOTER, c.SNOWPEASHOOTER, c.WALLNUT,
|
||||||
c.CHERRYBOMB, c.THREEPEASHOOTER, c.REPEATERPEA, c.CHOMPER,
|
c.CHERRYBOMB, c.THREEPEASHOOTER, c.REPEATERPEA, c.CHOMPER,
|
||||||
c.PUFFSHROOM, c.POTATOMINE, c.SQUASH, c.SPIKEWEED,
|
c.PUFFSHROOM, c.POTATOMINE, c.SQUASH, c.SPIKEWEED,
|
||||||
c.JALAPENO, c.SCAREDYSHROOM, c.SUNSHROOM, c.ICESHROOM,
|
c.JALAPENO, c.SCAREDYSHROOM, c.SUNSHROOM, c.ICESHROOM,
|
||||||
c.HYPNOSHROOM, c.LILYPAD, c.WALLNUTBOWLING, c.REDWALLNUTBOWLING]
|
c.HYPNOSHROOM, c.LILYPAD, c.TORCHWOOD, c.WALLNUTBOWLING, c.REDWALLNUTBOWLING)
|
||||||
plant_sun_list = [50, 100, 175, 50, 150, 325, 200, 150, 0, 25, 50, 100, 125, 25, 25, 75, 75, 25, 0, 0]
|
plant_sun_list = (50, 100, 175, 50, 150, 325, 200, 150, 0, 25, 50, 100, 125, 25, 25, 75, 75, 25, 0, 0)
|
||||||
plant_frozen_time_list = [7500, 7500, 7500, 30000, 50000, 7500, 7500, 7500, 7500, 30000,
|
plant_frozen_time_list = (7500, 7500, 7500, 30000, 50000, 7500, 7500, 7500, 7500, 30000,
|
||||||
30000, 7500, 50000, 7500, 7500, 50000, 30000, 7500, 0, 0]
|
30000, 7500, 50000, 7500, 7500, 50000, 30000, 7500, 7500, 0, 0)
|
||||||
all_card_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
|
all_card_list = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18)
|
||||||
|
|
||||||
|
|
||||||
def getSunValueImage(sun_value):
|
def getSunValueImage(sun_value):
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class Car(pg.sprite.Sprite):
|
|||||||
|
|
||||||
|
|
||||||
class Bullet(pg.sprite.Sprite):
|
class Bullet(pg.sprite.Sprite):
|
||||||
def __init__(self, x, start_y, dest_y, name, damage, ice):
|
def __init__(self, x, start_y, dest_y, name, damage, effect=False, passedTorchWood=None):
|
||||||
pg.sprite.Sprite.__init__(self)
|
pg.sprite.Sprite.__init__(self)
|
||||||
|
|
||||||
self.name = name
|
self.name = name
|
||||||
@ -51,9 +51,10 @@ class Bullet(pg.sprite.Sprite):
|
|||||||
self.y_vel = 4 if (dest_y > start_y) else -4
|
self.y_vel = 4 if (dest_y > start_y) else -4
|
||||||
self.x_vel = 10
|
self.x_vel = 10
|
||||||
self.damage = damage
|
self.damage = damage
|
||||||
self.ice = ice
|
self.effect = effect
|
||||||
self.state = c.FLY
|
self.state = c.FLY
|
||||||
self.current_time = 0
|
self.current_time = 0
|
||||||
|
self.passedTorchWood = passedTorchWood # 记录最近通过的火炬树横坐标,如果没有缺省为None
|
||||||
|
|
||||||
def loadFrames(self, frames, name):
|
def loadFrames(self, frames, name):
|
||||||
frame_list = tool.GFX[name]
|
frame_list = tool.GFX[name]
|
||||||
@ -297,7 +298,7 @@ class PeaShooter(Plant):
|
|||||||
def attacking(self):
|
def attacking(self):
|
||||||
if (self.current_time - self.shoot_timer) > 1400:
|
if (self.current_time - self.shoot_timer) > 1400:
|
||||||
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
||||||
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, False))
|
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, effect=False))
|
||||||
self.shoot_timer = self.current_time
|
self.shoot_timer = self.current_time
|
||||||
|
|
||||||
|
|
||||||
@ -313,12 +314,12 @@ class RepeaterPea(Plant):
|
|||||||
if (self.current_time - self.shoot_timer > 1400):
|
if (self.current_time - self.shoot_timer > 1400):
|
||||||
self.firstShot = True
|
self.firstShot = True
|
||||||
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
||||||
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, False))
|
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, effect=False))
|
||||||
self.shoot_timer = self.current_time
|
self.shoot_timer = self.current_time
|
||||||
elif self.firstShot and (self.current_time - self.shoot_timer) > 100:
|
elif self.firstShot and (self.current_time - self.shoot_timer) > 100:
|
||||||
self.firstShot = False
|
self.firstShot = False
|
||||||
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
||||||
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, False))
|
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, effect=False))
|
||||||
|
|
||||||
|
|
||||||
class ThreePeaShooter(Plant):
|
class ThreePeaShooter(Plant):
|
||||||
@ -337,7 +338,7 @@ class ThreePeaShooter(Plant):
|
|||||||
continue
|
continue
|
||||||
dest_y = self.rect.y + (i - 1) * c.GRID_Y_SIZE + offset_y
|
dest_y = self.rect.y + (i - 1) * c.GRID_Y_SIZE + offset_y
|
||||||
self.bullet_groups[tmp_y].add(Bullet(self.rect.right - 15, self.rect.y, dest_y,
|
self.bullet_groups[tmp_y].add(Bullet(self.rect.right - 15, self.rect.y, dest_y,
|
||||||
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, False))
|
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, effect=False))
|
||||||
self.shoot_timer = self.current_time
|
self.shoot_timer = self.current_time
|
||||||
|
|
||||||
|
|
||||||
@ -349,7 +350,7 @@ class SnowPeaShooter(Plant):
|
|||||||
def attacking(self):
|
def attacking(self):
|
||||||
if (self.current_time - self.shoot_timer) > 1400:
|
if (self.current_time - self.shoot_timer) > 1400:
|
||||||
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y, self.rect.y,
|
||||||
c.BULLET_PEA_ICE, c.BULLET_DAMAGE_NORMAL, True))
|
c.BULLET_PEA_ICE, c.BULLET_DAMAGE_NORMAL, effect=c.BULLET_EFFECT_ICE))
|
||||||
self.shoot_timer = self.current_time
|
self.shoot_timer = self.current_time
|
||||||
|
|
||||||
|
|
||||||
@ -507,7 +508,7 @@ class PuffShroom(Plant):
|
|||||||
def attacking(self):
|
def attacking(self):
|
||||||
if (self.current_time - self.shoot_timer) > 1400:
|
if (self.current_time - self.shoot_timer) > 1400:
|
||||||
self.bullet_group.add(Bullet(self.rect.right, self.rect.y + 10, self.rect.y + 10,
|
self.bullet_group.add(Bullet(self.rect.right, self.rect.y + 10, self.rect.y + 10,
|
||||||
c.BULLET_MUSHROOM, c.BULLET_DAMAGE_NORMAL, False))
|
c.BULLET_MUSHROOM, c.BULLET_DAMAGE_NORMAL, effect=False))
|
||||||
self.shoot_timer = self.current_time
|
self.shoot_timer = self.current_time
|
||||||
|
|
||||||
def canAttack(self, zombie):
|
def canAttack(self, zombie):
|
||||||
@ -760,7 +761,7 @@ class ScaredyShroom(Plant):
|
|||||||
def attacking(self):
|
def attacking(self):
|
||||||
if (self.current_time - self.shoot_timer) > 1400:
|
if (self.current_time - self.shoot_timer) > 1400:
|
||||||
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y + 40, self.rect.y + 40,
|
self.bullet_group.add(Bullet(self.rect.right - 15, self.rect.y + 40, self.rect.y + 40,
|
||||||
c.BULLET_MUSHROOM, c.BULLET_DAMAGE_NORMAL, False))
|
c.BULLET_MUSHROOM, c.BULLET_DAMAGE_NORMAL, effect=False))
|
||||||
self.shoot_timer = self.current_time
|
self.shoot_timer = self.current_time
|
||||||
|
|
||||||
|
|
||||||
@ -1036,3 +1037,20 @@ class RedWallNutBowling(Plant):
|
|||||||
class LilyPad(Plant):
|
class LilyPad(Plant):
|
||||||
def __init__(self, x, y):
|
def __init__(self, x, y):
|
||||||
Plant.__init__(self, x, y, c.LILYPAD, c.PLANT_HEALTH, None)
|
Plant.__init__(self, x, y, c.LILYPAD, c.PLANT_HEALTH, None)
|
||||||
|
|
||||||
|
class TorchWood(Plant):
|
||||||
|
def __init__(self, x, y, bullet_group):
|
||||||
|
Plant.__init__(self, x, y, c.TORCHWOOD, c.PLANT_HEALTH, bullet_group)
|
||||||
|
|
||||||
|
def idling(self):
|
||||||
|
for i in self.bullet_group:
|
||||||
|
if i.passedTorchWood != self.rect.x:
|
||||||
|
if -10 <= i.rect.x - self.rect.x <= 20:
|
||||||
|
if i.name == c.BULLET_PEA:
|
||||||
|
self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.rect.y,
|
||||||
|
c.BULLET_FIREBALL, c.BULLET_DAMAGE_FIREBALL_BODY, effect=c.BULLET_EFFECT_UNICE, passedTorchWood=self.rect.x))
|
||||||
|
i.kill()
|
||||||
|
elif i.name == c.BULLET_PEA_ICE:
|
||||||
|
self.bullet_group.add(Bullet(i.rect.x, i.rect.y, i.rect.y,
|
||||||
|
c.BULLET_PEA, c.BULLET_DAMAGE_NORMAL, effect=False, passedTorchWood=self.rect.x))
|
||||||
|
i.kill()
|
||||||
|
|||||||
@ -200,14 +200,21 @@ class Zombie(pg.sprite.Sprite):
|
|||||||
if (self.current_time - self.ice_slow_timer) > c.ICE_SLOW_TIME:
|
if (self.current_time - self.ice_slow_timer) > c.ICE_SLOW_TIME:
|
||||||
self.ice_slow_ratio = 1
|
self.ice_slow_ratio = 1
|
||||||
|
|
||||||
def setDamage(self, damage, ice=False, damageType=c.ZOMBIE_COMMON_DAMAGE):
|
def setDamage(self, damage, effect=False, damageType=c.ZOMBIE_COMMON_DAMAGE):
|
||||||
# 冰冻减速效果
|
# 冰冻减速效果
|
||||||
if ice:
|
if effect == c.BULLET_EFFECT_ICE:
|
||||||
if damageType == c.ZOMBIE_DEAFULT_DAMAGE: # 寒冰射手不能穿透二类防具进行减速
|
if damageType == c.ZOMBIE_DEAFULT_DAMAGE: # 寒冰射手不能穿透二类防具进行减速
|
||||||
if not self.helmetType2:
|
if not self.helmetType2:
|
||||||
self.setIceSlow()
|
self.setIceSlow()
|
||||||
else:
|
else:
|
||||||
self.setIceSlow()
|
self.setIceSlow()
|
||||||
|
# 解冻
|
||||||
|
elif effect == c.BULLET_EFFECT_UNICE:
|
||||||
|
if damageType == c.ZOMBIE_DEAFULT_DAMAGE: # 寒冰射手不能穿透二类防具进行减速
|
||||||
|
if not self.helmetType2:
|
||||||
|
self.ice_slow_ratio = 1
|
||||||
|
else:
|
||||||
|
self.ice_slow_ratio = 1
|
||||||
|
|
||||||
if damageType == c.ZOMBIE_DEAFULT_DAMAGE: # 不穿透二类防具的攻击
|
if damageType == c.ZOMBIE_DEAFULT_DAMAGE: # 不穿透二类防具的攻击
|
||||||
# 从第二类防具开始逐级传递
|
# 从第二类防具开始逐级传递
|
||||||
@ -274,7 +281,7 @@ class Zombie(pg.sprite.Sprite):
|
|||||||
self.health -= damage
|
self.health -= damage
|
||||||
else:
|
else:
|
||||||
print('警告:植物攻击类型错误,现在默认进行类豌豆射手型攻击')
|
print('警告:植物攻击类型错误,现在默认进行类豌豆射手型攻击')
|
||||||
setDamage(damage, ice=ice, damageType=c.ZOMBIE_DEAFULT_DAMAGE)
|
setDamage(damage, effect=effect, damageType=c.ZOMBIE_DEAFULT_DAMAGE)
|
||||||
|
|
||||||
# 记录攻击时间
|
# 记录攻击时间
|
||||||
self.hit_timer = self.current_time
|
self.hit_timer = self.current_time
|
||||||
|
|||||||
@ -149,6 +149,7 @@ HYPNOSHROOM = 'HypnoShroom'
|
|||||||
WALLNUTBOWLING = 'WallNutBowling'
|
WALLNUTBOWLING = 'WallNutBowling'
|
||||||
REDWALLNUTBOWLING = 'RedWallNutBowling'
|
REDWALLNUTBOWLING = 'RedWallNutBowling'
|
||||||
LILYPAD = 'LilyPad'
|
LILYPAD = 'LilyPad'
|
||||||
|
TORCHWOOD = 'TorchWood'
|
||||||
|
|
||||||
PLANT_HEALTH = 300
|
PLANT_HEALTH = 300
|
||||||
WALLNUT_HEALTH = 4000
|
WALLNUT_HEALTH = 4000
|
||||||
@ -186,12 +187,21 @@ CARD_ICESHROOM = 'card_iceshroom'
|
|||||||
CARD_HYPNOSHROOM = 'card_hypnoshroom'
|
CARD_HYPNOSHROOM = 'card_hypnoshroom'
|
||||||
CARD_REDWALLNUT = 'card_redwallnut'
|
CARD_REDWALLNUT = 'card_redwallnut'
|
||||||
CARD_LILYPAD = 'card_lilypad'
|
CARD_LILYPAD = 'card_lilypad'
|
||||||
|
CARD_TORCHWOOD = 'card_torchwood'
|
||||||
|
|
||||||
#BULLET INFO
|
#BULLET INFO
|
||||||
|
# 子弹类型
|
||||||
BULLET_PEA = 'PeaNormal'
|
BULLET_PEA = 'PeaNormal'
|
||||||
BULLET_PEA_ICE = 'PeaIce'
|
BULLET_PEA_ICE = 'PeaIce'
|
||||||
|
BULLET_FIREBALL = 'Fireball'
|
||||||
BULLET_MUSHROOM = 'BulletMushRoom'
|
BULLET_MUSHROOM = 'BulletMushRoom'
|
||||||
|
# 子弹伤害
|
||||||
BULLET_DAMAGE_NORMAL = 20
|
BULLET_DAMAGE_NORMAL = 20
|
||||||
|
BULLET_DAMAGE_FIREBALL_BODY = 27 # 这是火球本体的伤害,注意不是40,本体(27) + 溅射(13)才是40
|
||||||
|
BULLET_DAMAGE_FIREBALL_RANGE = 13
|
||||||
|
# 子弹效果
|
||||||
|
BULLET_EFFECT_ICE = 'ice'
|
||||||
|
BULLET_EFFECT_UNICE = 'unice'
|
||||||
|
|
||||||
#ZOMBIE INFO
|
#ZOMBIE INFO
|
||||||
ZOMBIE_IMAGE_RECT = 'zombie_image_rect'
|
ZOMBIE_IMAGE_RECT = 'zombie_image_rect'
|
||||||
|
|||||||
@ -517,6 +517,8 @@ class Level(tool.State):
|
|||||||
new_plant = plant.RedWallNutBowling(x, y)
|
new_plant = plant.RedWallNutBowling(x, y)
|
||||||
elif self.plant_name == c.LILYPAD:
|
elif self.plant_name == c.LILYPAD:
|
||||||
new_plant = plant.LilyPad(x, y)
|
new_plant = plant.LilyPad(x, y)
|
||||||
|
elif self.plant_name == c.TORCHWOOD:
|
||||||
|
new_plant = plant.TorchWood(x, y, self.bullet_groups[map_y])
|
||||||
|
|
||||||
if new_plant.can_sleep and self.background_type in {c.BACKGROUND_DAY, c.BACKGROUND_POOL, c.BACKGROUND_ROOF, c.BACKGROUND_WALLNUTBOWLING, c.BACKGROUND_SINGLE, c.BACKGROUND_TRIPLE}:
|
if new_plant.can_sleep and self.background_type in {c.BACKGROUND_DAY, c.BACKGROUND_POOL, c.BACKGROUND_ROOF, c.BACKGROUND_WALLNUTBOWLING, c.BACKGROUND_SINGLE, c.BACKGROUND_TRIPLE}:
|
||||||
new_plant.setSleep()
|
new_plant.setSleep()
|
||||||
@ -597,8 +599,14 @@ class Level(tool.State):
|
|||||||
if bullet.state == c.FLY:
|
if bullet.state == c.FLY:
|
||||||
zombie = pg.sprite.spritecollideany(bullet, self.zombie_groups[i], collided_func)
|
zombie = pg.sprite.spritecollideany(bullet, self.zombie_groups[i], collided_func)
|
||||||
if zombie and zombie.state != c.DIE:
|
if zombie and zombie.state != c.DIE:
|
||||||
zombie.setDamage(bullet.damage, ice=bullet.ice, damageType=c.ZOMBIE_DEAFULT_DAMAGE)
|
# 这里生效代表已经发生了碰撞
|
||||||
|
zombie.setDamage(bullet.damage, effect=bullet.effect, damageType=c.ZOMBIE_DEAFULT_DAMAGE)
|
||||||
bullet.setExplode()
|
bullet.setExplode()
|
||||||
|
# 火球有溅射伤害
|
||||||
|
if bullet.name == c.BULLET_FIREBALL:
|
||||||
|
for rangeZombie in self.zombie_groups[i]:
|
||||||
|
if abs(rangeZombie.rect.x - bullet.rect.x) <= (c.GRID_X_SIZE // 2):
|
||||||
|
rangeZombie.setDamage(c.BULLET_DAMAGE_FIREBALL_RANGE, effect=False, damageType=c.ZOMBIE_DEAFULT_DAMAGE)
|
||||||
|
|
||||||
def checkZombieCollisions(self):
|
def checkZombieCollisions(self):
|
||||||
if self.bar_type == c.CHOSSEBAR_BOWLING:
|
if self.bar_type == c.CHOSSEBAR_BOWLING:
|
||||||
@ -649,13 +657,15 @@ class Level(tool.State):
|
|||||||
if car.dead:
|
if car.dead:
|
||||||
self.cars.remove(car)
|
self.cars.remove(car)
|
||||||
|
|
||||||
def boomZombies(self, x, map_y, y_range, x_range):
|
def boomZombies(self, x, map_y, y_range, x_range, effect=False):
|
||||||
for i in range(self.map_y_len):
|
for i in range(self.map_y_len):
|
||||||
if abs(i - map_y) > y_range:
|
if abs(i - map_y) > y_range:
|
||||||
continue
|
continue
|
||||||
for zombie in self.zombie_groups[i]:
|
for zombie in self.zombie_groups[i]:
|
||||||
if ((abs(zombie.rect.centerx - x) <= x_range) or
|
if ((abs(zombie.rect.centerx - x) <= x_range) or
|
||||||
((zombie.rect.right - (x-x_range) > 20) or (zombie.rect.right - (x-x_range))/zombie.rect.width > 0.2, ((x+x_range) - zombie.rect.left > 20) or ((x+x_range) - zombie.rect.left)/zombie.rect.width > 0.2)[zombie.rect.x > x]): # 这代码不太好懂,后面是一个判断僵尸在左还是在右,前面是一个元组,[0]是在左边的情况,[1]是在右边的情况
|
((zombie.rect.right - (x-x_range) > 20) or (zombie.rect.right - (x-x_range))/zombie.rect.width > 0.2, ((x+x_range) - zombie.rect.left > 20) or ((x+x_range) - zombie.rect.left)/zombie.rect.width > 0.2)[zombie.rect.x > x]): # 这代码不太好懂,后面是一个判断僵尸在左还是在右,前面是一个元组,[0]是在左边的情况,[1]是在右边的情况
|
||||||
|
if effect == c.BULLET_EFFECT_UNICE:
|
||||||
|
zombie.ice_slow_ratio = 1
|
||||||
zombie.setDamage(1800, damageType=c.ZOMBIE_ASH_DAMAGE)
|
zombie.setDamage(1800, damageType=c.ZOMBIE_ASH_DAMAGE)
|
||||||
if zombie.health <= 0:
|
if zombie.health <= 0:
|
||||||
zombie.setBoomDie()
|
zombie.setBoomDie()
|
||||||
@ -680,10 +690,12 @@ class Level(tool.State):
|
|||||||
self.map.map[map_y][map_x][c.MAP_SLEEP] = False
|
self.map.map[map_y][map_x][c.MAP_SLEEP] = False
|
||||||
# 用铲子铲不用触发植物功能
|
# 用铲子铲不用触发植物功能
|
||||||
if not shovel:
|
if not shovel:
|
||||||
if (plant.name == c.CHERRYBOMB or plant.name == c.JALAPENO or
|
if (plant.name == c.CHERRYBOMB or plant.name == c.REDWALLNUTBOWLING):
|
||||||
plant.name == c.REDWALLNUTBOWLING):
|
|
||||||
self.boomZombies(plant.rect.centerx, map_y, plant.explode_y_range,
|
self.boomZombies(plant.rect.centerx, map_y, plant.explode_y_range,
|
||||||
plant.explode_x_range)
|
plant.explode_x_range)
|
||||||
|
elif plant.name == c.JALAPENO:
|
||||||
|
self.boomZombies(plant.rect.centerx, map_y, plant.explode_y_range,
|
||||||
|
plant.explode_x_range, effect=c.BULLET_EFFECT_UNICE)
|
||||||
elif plant.name == c.ICESHROOM and plant.state != c.SLEEP:
|
elif plant.name == c.ICESHROOM and plant.state != c.SLEEP:
|
||||||
self.freezeZombies(plant)
|
self.freezeZombies(plant)
|
||||||
elif plant.name == c.HYPNOSHROOM and plant.state != c.SLEEP:
|
elif plant.name == c.HYPNOSHROOM and plant.state != c.SLEEP:
|
||||||
|
|||||||