初步加入没有功能的大蒜
BIN
resources/graphics/Cards/card_garlic.png
Normal file
|
After Width: | Height: | Size: 37 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_0.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_1.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_10.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_11.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_2.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_3.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_4.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_5.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_6.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_7.png
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_8.png
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
BIN
resources/graphics/Plants/Garlic/Garlic/Garlic_9.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 5.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 4.6 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
@ -1780,3 +1780,27 @@ class IceFrozenPlot(Plant):
|
||||
self.health = 0
|
||||
|
||||
|
||||
class Garlic(Plant):
|
||||
def __init__(self, x, y):
|
||||
Plant.__init__(self, x, y, c.GARLIC, c.GARLIC_HEALTH, None)
|
||||
self.load_images()
|
||||
self.cracked1 = False
|
||||
self.cracked2 = False
|
||||
|
||||
def load_images(self):
|
||||
self.cracked1_frames = []
|
||||
self.cracked2_frames = []
|
||||
|
||||
cracked1_frames_name = self.name + '_cracked1'
|
||||
cracked2_frames_name = self.name + '_cracked2'
|
||||
|
||||
self.loadFrames(self.cracked1_frames, cracked1_frames_name, 1)
|
||||
self.loadFrames(self.cracked2_frames, cracked2_frames_name, 1)
|
||||
|
||||
def idling(self):
|
||||
if (not self.cracked1) and self.health <= c.GARLIC_CRACKED1_HEALTH:
|
||||
self.changeFrames(self.cracked1_frames)
|
||||
self.cracked1 = True
|
||||
elif (not self.cracked2) and self.health <= c.GARLIC_CRACKED2_HEALTH:
|
||||
self.changeFrames(self.cracked2_frames)
|
||||
self.cracked2 = True
|
||||
|
||||
@ -242,6 +242,7 @@ HOLE = 'Hole'
|
||||
GRAVE = 'Grave'
|
||||
GRAVEBUSTER = 'GraveBuster'
|
||||
FUMESHROOM = 'FumeShroom'
|
||||
GARLIC = 'Garlic'
|
||||
|
||||
|
||||
# 植物集体属性集合
|
||||
@ -302,7 +303,7 @@ PLANT_NON_CHECK_ATTACK_STATE = ( # 这里运用了集合运算
|
||||
TORCHWOOD, SUNFLOWER,
|
||||
SUNSHROOM, COFFEEBEAN,
|
||||
GRAVEBUSTER, LILYPAD,
|
||||
HYPNOSHROOM,
|
||||
HYPNOSHROOM, GARLIC,
|
||||
} |
|
||||
# 非植物类
|
||||
NON_PLANT_OBJECTS
|
||||
@ -324,6 +325,9 @@ WALLNUT_CRACKED2_HEALTH = WALLNUT_HEALTH//3
|
||||
TALLNUT_HEALTH = 8000
|
||||
TALLNUT_CRACKED1_HEALTH = TALLNUT_HEALTH//3 * 2
|
||||
TALLNUT_CRACKED2_HEALTH = TALLNUT_HEALTH//3
|
||||
GARLIC_HEALTH = 450
|
||||
GARLIC_CRACKED1_HEALTH = GARLIC_HEALTH//3 * 2
|
||||
GARLIC_CRACKED2_HEALTH = GARLIC_HEALTH//3
|
||||
# 坚果保龄球攻击伤害
|
||||
WALLNUT_BOWLING_DAMAGE = 550
|
||||
|
||||
@ -367,6 +371,7 @@ CARD_TANGLEKLEP = 'card_tangleklep'
|
||||
CARD_DOOMSHROOM = 'card_doomshroom'
|
||||
CARD_GRAVEBUSTER = 'card_gravebuster'
|
||||
CARD_FUMESHROOM = 'card_fumeshroom'
|
||||
CARD_GARLIC = 'card_garlic'
|
||||
|
||||
# 子弹信息
|
||||
# 子弹类型
|
||||
|
||||
@ -913,6 +913,8 @@ class Level(tool.State):
|
||||
new_plant = plant.GraveBuster(x, y, self.plant_groups[map_y], self.map, map_x)
|
||||
elif self.plant_name == c.FUMESHROOM:
|
||||
new_plant = plant.FumeShroom(x, y, self.bullet_groups[map_y], self.zombie_groups[map_y])
|
||||
elif self.plant_name == c.GARLIC:
|
||||
new_plant = plant.Garlic(x, y)
|
||||
|
||||
|
||||
if new_plant.can_sleep and self.background_type in c.DAYTIME_BACKGROUNDS:
|
||||
|
||||