更改毁灭菇爆炸范围
This commit is contained in:
parent
b2d62deaed
commit
c37208bfb2
@ -1500,17 +1500,13 @@ class TangleKlep(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)
|
||||
self.can_sleep = True
|
||||
self.mapContent = mapContent
|
||||
self.mapPlantSet = mapPlantsSet
|
||||
self.bomb_timer = 0
|
||||
# 不同场景由于格子的长不同,范围有变化
|
||||
if mapContent[c.MAP_PLOT_TYPE] == c.MAP_GRASS:
|
||||
self.explode_y_range = 2
|
||||
else:
|
||||
self.explode_y_range = 3
|
||||
self.explode_x_range = c.GRID_X_SIZE * 2.5
|
||||
self.explode_y_range = explode_y_range
|
||||
self.explode_x_range = 250
|
||||
self.start_boom = False
|
||||
self.boomed = False
|
||||
self.originalX = x
|
||||
@ -1550,7 +1546,7 @@ class DoomShroom(Plant):
|
||||
if self.frame_index >= self.frame_num:
|
||||
self.health = 0
|
||||
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:
|
||||
if (self.current_time - self.animate_timer) > self.animate_interval:
|
||||
|
||||
@ -896,7 +896,11 @@ class Level(tool.State):
|
||||
elif self.plant_name == c.TANGLEKLEP:
|
||||
new_plant = plant.TangleKlep(x, y)
|
||||
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:
|
||||
new_plant = plant.GraveBuster(x, y, self.plant_groups[map_y], self.map, map_x)
|
||||
elif self.plant_name == c.FUMESHROOM:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user