更改毁灭菇爆炸范围
This commit is contained in:
parent
b2d62deaed
commit
c37208bfb2
@ -35,7 +35,7 @@ class Map():
|
|||||||
map_y < 0 or map_y >= self.height):
|
map_y < 0 or map_y >= self.height):
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# 判断位置是否可用
|
# 判断位置是否可用
|
||||||
# 暂时没有写紫卡植物的判断方法
|
# 暂时没有写紫卡植物的判断方法
|
||||||
# 由于紫卡植物需要移除以前的植物,所以可用另外定义一个函数
|
# 由于紫卡植物需要移除以前的植物,所以可用另外定义一个函数
|
||||||
|
|||||||
@ -1500,17 +1500,13 @@ class TangleKlep(Plant):
|
|||||||
# 坑形态的毁灭菇同地刺一样不可以被啃食
|
# 坑形态的毁灭菇同地刺一样不可以被啃食
|
||||||
# 爆炸时杀死同一格的所有植物
|
# 爆炸时杀死同一格的所有植物
|
||||||
class DoomShroom(Plant):
|
class DoomShroom(Plant):
|
||||||
def __init__(self, x, y, mapContent):
|
def __init__(self, x, y, mapPlantsSet, explode_y_range):
|
||||||
Plant.__init__(self, x, y, c.DOOMSHROOM, c.PLANT_HEALTH, None)
|
Plant.__init__(self, x, y, c.DOOMSHROOM, c.PLANT_HEALTH, None)
|
||||||
self.can_sleep = True
|
self.can_sleep = True
|
||||||
self.mapContent = mapContent
|
self.mapPlantSet = mapPlantsSet
|
||||||
self.bomb_timer = 0
|
self.bomb_timer = 0
|
||||||
# 不同场景由于格子的长不同,范围有变化
|
self.explode_y_range = explode_y_range
|
||||||
if mapContent[c.MAP_PLOT_TYPE] == c.MAP_GRASS:
|
self.explode_x_range = 250
|
||||||
self.explode_y_range = 2
|
|
||||||
else:
|
|
||||||
self.explode_y_range = 3
|
|
||||||
self.explode_x_range = c.GRID_X_SIZE * 2.5
|
|
||||||
self.start_boom = False
|
self.start_boom = False
|
||||||
self.boomed = False
|
self.boomed = False
|
||||||
self.originalX = x
|
self.originalX = x
|
||||||
@ -1550,7 +1546,7 @@ class DoomShroom(Plant):
|
|||||||
if self.frame_index >= self.frame_num:
|
if self.frame_index >= self.frame_num:
|
||||||
self.health = 0
|
self.health = 0
|
||||||
self.frame_index = self.frame_num - 1
|
self.frame_index = self.frame_num - 1
|
||||||
self.mapContent[c.MAP_PLANT].add(c.HOLE)
|
self.mapPlantSet.add(c.HOLE)
|
||||||
# 睡觉状态
|
# 睡觉状态
|
||||||
elif self.state == c.SLEEP:
|
elif self.state == c.SLEEP:
|
||||||
if (self.current_time - self.animate_timer) > self.animate_interval:
|
if (self.current_time - self.animate_timer) > self.animate_interval:
|
||||||
|
|||||||
@ -896,7 +896,11 @@ class Level(tool.State):
|
|||||||
elif self.plant_name == c.TANGLEKLEP:
|
elif self.plant_name == c.TANGLEKLEP:
|
||||||
new_plant = plant.TangleKlep(x, y)
|
new_plant = plant.TangleKlep(x, y)
|
||||||
elif self.plant_name == c.DOOMSHROOM:
|
elif self.plant_name == c.DOOMSHROOM:
|
||||||
new_plant = plant.DoomShroom(x, y, self.map.map[map_y][map_x])
|
if ((self.map_data[c.BACKGROUND_TYPE] in c.ON_ROOF_BACKGROUNDS) or
|
||||||
|
(self.map_data[c.BACKGROUND_TYPE] in c.POOL_EQUIPPED_BACKGROUNDS)):
|
||||||
|
new_plant = plant.DoomShroom(x, y, self.map.map[map_y][map_x][c.MAP_PLANT], explode_y_range=3)
|
||||||
|
else:
|
||||||
|
new_plant = plant.DoomShroom(x, y, self.map.map[map_y][map_x][c.MAP_PLANT], explode_y_range=2)
|
||||||
elif self.plant_name == c.GRAVEBUSTER:
|
elif self.plant_name == c.GRAVEBUSTER:
|
||||||
new_plant = plant.GraveBuster(x, y, self.plant_groups[map_y], self.map, map_x)
|
new_plant = plant.GraveBuster(x, y, self.plant_groups[map_y], self.map, map_x)
|
||||||
elif self.plant_name == c.FUMESHROOM:
|
elif self.plant_name == c.FUMESHROOM:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user