初步加入没有功能的大蒜

This commit is contained in:
星外之神 2022-05-27 13:41:04 +08:00
parent 762741d20d
commit 08b1c19fa2
40 changed files with 32 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

@ -1780,3 +1780,27 @@ class IceFrozenPlot(Plant):
self.health = 0 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

View File

@ -242,6 +242,7 @@ HOLE = 'Hole'
GRAVE = 'Grave' GRAVE = 'Grave'
GRAVEBUSTER = 'GraveBuster' GRAVEBUSTER = 'GraveBuster'
FUMESHROOM = 'FumeShroom' FUMESHROOM = 'FumeShroom'
GARLIC = 'Garlic'
# 植物集体属性集合 # 植物集体属性集合
@ -302,7 +303,7 @@ PLANT_NON_CHECK_ATTACK_STATE = ( # 这里运用了集合运算
TORCHWOOD, SUNFLOWER, TORCHWOOD, SUNFLOWER,
SUNSHROOM, COFFEEBEAN, SUNSHROOM, COFFEEBEAN,
GRAVEBUSTER, LILYPAD, GRAVEBUSTER, LILYPAD,
HYPNOSHROOM, HYPNOSHROOM, GARLIC,
} | } |
# 非植物类 # 非植物类
NON_PLANT_OBJECTS NON_PLANT_OBJECTS
@ -324,6 +325,9 @@ WALLNUT_CRACKED2_HEALTH = WALLNUT_HEALTH//3
TALLNUT_HEALTH = 8000 TALLNUT_HEALTH = 8000
TALLNUT_CRACKED1_HEALTH = TALLNUT_HEALTH//3 * 2 TALLNUT_CRACKED1_HEALTH = TALLNUT_HEALTH//3 * 2
TALLNUT_CRACKED2_HEALTH = TALLNUT_HEALTH//3 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 WALLNUT_BOWLING_DAMAGE = 550
@ -367,6 +371,7 @@ CARD_TANGLEKLEP = 'card_tangleklep'
CARD_DOOMSHROOM = 'card_doomshroom' CARD_DOOMSHROOM = 'card_doomshroom'
CARD_GRAVEBUSTER = 'card_gravebuster' CARD_GRAVEBUSTER = 'card_gravebuster'
CARD_FUMESHROOM = 'card_fumeshroom' CARD_FUMESHROOM = 'card_fumeshroom'
CARD_GARLIC = 'card_garlic'
# 子弹信息 # 子弹信息
# 子弹类型 # 子弹类型

View File

@ -913,6 +913,8 @@ class Level(tool.State):
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:
new_plant = plant.FumeShroom(x, y, self.bullet_groups[map_y], self.zombie_groups[map_y]) 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: if new_plant.can_sleep and self.background_type in c.DAYTIME_BACKGROUNDS: