diff --git a/resources/graphics/Cards/card_cherrybomb.png b/resources/graphics/Cards/card_cherrybomb.png index fba0aae..10492ca 100644 Binary files a/resources/graphics/Cards/card_cherrybomb.png and b/resources/graphics/Cards/card_cherrybomb.png differ diff --git a/resources/graphics/Cards/card_cherrybomb_move.png b/resources/graphics/Cards/card_cherrybomb_move.png index 03561e0..1e65149 100644 Binary files a/resources/graphics/Cards/card_cherrybomb_move.png and b/resources/graphics/Cards/card_cherrybomb_move.png differ diff --git a/resources/graphics/Cards/card_chomper.png b/resources/graphics/Cards/card_chomper.png index 658cd5f..e93c6c8 100644 Binary files a/resources/graphics/Cards/card_chomper.png and b/resources/graphics/Cards/card_chomper.png differ diff --git a/resources/graphics/Cards/card_chomper_move.png b/resources/graphics/Cards/card_chomper_move.png index 8a30884..3ec32cd 100644 Binary files a/resources/graphics/Cards/card_chomper_move.png and b/resources/graphics/Cards/card_chomper_move.png differ diff --git a/resources/graphics/Cards/card_hypnoshroom.png b/resources/graphics/Cards/card_hypnoshroom.png index e605f48..3708c8b 100644 Binary files a/resources/graphics/Cards/card_hypnoshroom.png and b/resources/graphics/Cards/card_hypnoshroom.png differ diff --git a/resources/graphics/Cards/card_iceshroom.png b/resources/graphics/Cards/card_iceshroom.png index 6ab9c79..77dc16a 100644 Binary files a/resources/graphics/Cards/card_iceshroom.png and b/resources/graphics/Cards/card_iceshroom.png differ diff --git a/resources/graphics/Cards/card_jalapeno.png b/resources/graphics/Cards/card_jalapeno.png index 5f9486a..042bbcd 100644 Binary files a/resources/graphics/Cards/card_jalapeno.png and b/resources/graphics/Cards/card_jalapeno.png differ diff --git a/resources/graphics/Cards/card_lilypad.png b/resources/graphics/Cards/card_lilypad.png new file mode 100644 index 0000000..beb77a8 Binary files /dev/null and b/resources/graphics/Cards/card_lilypad.png differ diff --git a/resources/graphics/Cards/card_lilypad_move.png b/resources/graphics/Cards/card_lilypad_move.png new file mode 100644 index 0000000..ca33cf3 Binary files /dev/null and b/resources/graphics/Cards/card_lilypad_move.png differ diff --git a/resources/graphics/Cards/card_peashooter.png b/resources/graphics/Cards/card_peashooter.png index 5b4f3df..2e20222 100644 Binary files a/resources/graphics/Cards/card_peashooter.png and b/resources/graphics/Cards/card_peashooter.png differ diff --git a/resources/graphics/Cards/card_peashooter_move.png b/resources/graphics/Cards/card_peashooter_move.png index d842730..a86e850 100644 Binary files a/resources/graphics/Cards/card_peashooter_move.png and b/resources/graphics/Cards/card_peashooter_move.png differ diff --git a/resources/graphics/Cards/card_potatomine.png b/resources/graphics/Cards/card_potatomine.png index 192fe4b..f9abd76 100644 Binary files a/resources/graphics/Cards/card_potatomine.png and b/resources/graphics/Cards/card_potatomine.png differ diff --git a/resources/graphics/Cards/card_potatomine_move.png b/resources/graphics/Cards/card_potatomine_move.png index ab9a7e6..315da5f 100644 Binary files a/resources/graphics/Cards/card_potatomine_move.png and b/resources/graphics/Cards/card_potatomine_move.png differ diff --git a/resources/graphics/Cards/card_puffshroom.png b/resources/graphics/Cards/card_puffshroom.png index 6a52f76..ce37a42 100644 Binary files a/resources/graphics/Cards/card_puffshroom.png and b/resources/graphics/Cards/card_puffshroom.png differ diff --git a/resources/graphics/Cards/card_redwallnut_move.png b/resources/graphics/Cards/card_redwallnut_move.png index 11a6a1f..b279869 100644 Binary files a/resources/graphics/Cards/card_redwallnut_move.png and b/resources/graphics/Cards/card_redwallnut_move.png differ diff --git a/resources/graphics/Cards/card_repeaterpea.png b/resources/graphics/Cards/card_repeaterpea.png index f595c09..f47c24e 100644 Binary files a/resources/graphics/Cards/card_repeaterpea.png and b/resources/graphics/Cards/card_repeaterpea.png differ diff --git a/resources/graphics/Cards/card_repeaterpea_move.png b/resources/graphics/Cards/card_repeaterpea_move.png index d6ead86..f9a0afc 100644 Binary files a/resources/graphics/Cards/card_repeaterpea_move.png and b/resources/graphics/Cards/card_repeaterpea_move.png differ diff --git a/resources/graphics/Cards/card_scaredyshroom.png b/resources/graphics/Cards/card_scaredyshroom.png index b8ebf82..54d44ac 100644 Binary files a/resources/graphics/Cards/card_scaredyshroom.png and b/resources/graphics/Cards/card_scaredyshroom.png differ diff --git a/resources/graphics/Cards/card_snowpea.png b/resources/graphics/Cards/card_snowpea.png index 57fb883..d1fc2fb 100644 Binary files a/resources/graphics/Cards/card_snowpea.png and b/resources/graphics/Cards/card_snowpea.png differ diff --git a/resources/graphics/Cards/card_snowpea_move.png b/resources/graphics/Cards/card_snowpea_move.png index 31f716e..6df72ce 100644 Binary files a/resources/graphics/Cards/card_snowpea_move.png and b/resources/graphics/Cards/card_snowpea_move.png differ diff --git a/resources/graphics/Cards/card_spikeweed.png b/resources/graphics/Cards/card_spikeweed.png index 704a871..d661c6e 100644 Binary files a/resources/graphics/Cards/card_spikeweed.png and b/resources/graphics/Cards/card_spikeweed.png differ diff --git a/resources/graphics/Cards/card_squash.png b/resources/graphics/Cards/card_squash.png index 7474a8b..0a5b406 100644 Binary files a/resources/graphics/Cards/card_squash.png and b/resources/graphics/Cards/card_squash.png differ diff --git a/resources/graphics/Cards/card_sunflower.png b/resources/graphics/Cards/card_sunflower.png index 200a3d8..3413a28 100644 Binary files a/resources/graphics/Cards/card_sunflower.png and b/resources/graphics/Cards/card_sunflower.png differ diff --git a/resources/graphics/Cards/card_sunshroom.png b/resources/graphics/Cards/card_sunshroom.png index d869b38..3f14fac 100644 Binary files a/resources/graphics/Cards/card_sunshroom.png and b/resources/graphics/Cards/card_sunshroom.png differ diff --git a/resources/graphics/Cards/card_threepeashooter.png b/resources/graphics/Cards/card_threepeashooter.png index e71fc31..b7e5788 100644 Binary files a/resources/graphics/Cards/card_threepeashooter.png and b/resources/graphics/Cards/card_threepeashooter.png differ diff --git a/resources/graphics/Cards/card_wallnut.png b/resources/graphics/Cards/card_wallnut.png index 2b7752d..e7207f1 100644 Binary files a/resources/graphics/Cards/card_wallnut.png and b/resources/graphics/Cards/card_wallnut.png differ diff --git a/resources/graphics/Cards/card_wallnut_move.png b/resources/graphics/Cards/card_wallnut_move.png index f9bc6e8..e56b255 100644 Binary files a/resources/graphics/Cards/card_wallnut_move.png and b/resources/graphics/Cards/card_wallnut_move.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_0.png b/resources/graphics/Plants/LilyPad/LilyPad_0.png index 4235d3b..3bf1a65 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_0.png and b/resources/graphics/Plants/LilyPad/LilyPad_0.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_1.png b/resources/graphics/Plants/LilyPad/LilyPad_1.png index 626bb48..88800db 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_1.png and b/resources/graphics/Plants/LilyPad/LilyPad_1.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_10.png b/resources/graphics/Plants/LilyPad/LilyPad_10.png index 2ac3e5b..2e9246f 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_10.png and b/resources/graphics/Plants/LilyPad/LilyPad_10.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_11.png b/resources/graphics/Plants/LilyPad/LilyPad_11.png index 34a2ed0..7141340 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_11.png and b/resources/graphics/Plants/LilyPad/LilyPad_11.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_12.png b/resources/graphics/Plants/LilyPad/LilyPad_12.png index 6aa1184..3e95404 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_12.png and b/resources/graphics/Plants/LilyPad/LilyPad_12.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_2.png b/resources/graphics/Plants/LilyPad/LilyPad_2.png index 26d3bfd..fdf5934 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_2.png and b/resources/graphics/Plants/LilyPad/LilyPad_2.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_3.png b/resources/graphics/Plants/LilyPad/LilyPad_3.png index 76ec5d3..dc3cb20 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_3.png and b/resources/graphics/Plants/LilyPad/LilyPad_3.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_4.png b/resources/graphics/Plants/LilyPad/LilyPad_4.png index 3ce681f..d366580 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_4.png and b/resources/graphics/Plants/LilyPad/LilyPad_4.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_5.png b/resources/graphics/Plants/LilyPad/LilyPad_5.png index 1a7f0f6..7837eb4 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_5.png and b/resources/graphics/Plants/LilyPad/LilyPad_5.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_6.png b/resources/graphics/Plants/LilyPad/LilyPad_6.png index 1a7f0f6..7837eb4 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_6.png and b/resources/graphics/Plants/LilyPad/LilyPad_6.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_7.png b/resources/graphics/Plants/LilyPad/LilyPad_7.png index 7411a09..a43a331 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_7.png and b/resources/graphics/Plants/LilyPad/LilyPad_7.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_8.png b/resources/graphics/Plants/LilyPad/LilyPad_8.png index 32f46be..353ffb4 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_8.png and b/resources/graphics/Plants/LilyPad/LilyPad_8.png differ diff --git a/resources/graphics/Plants/LilyPad/LilyPad_9.png b/resources/graphics/Plants/LilyPad/LilyPad_9.png index 0d80e17..dd933c9 100644 Binary files a/resources/graphics/Plants/LilyPad/LilyPad_9.png and b/resources/graphics/Plants/LilyPad/LilyPad_9.png differ diff --git a/source/component/map.py b/source/component/map.py index 5a0d3c6..e7f3b65 100755 --- a/source/component/map.py +++ b/source/component/map.py @@ -33,7 +33,7 @@ class Map(): def isAvailable(self, map_x, map_y, plantName): if self.map[map_y][map_x][c.MAP_PLOT_TYPE] == c.MAP_GRASS: # 草地 # 首先需要判断植物是否是水生植物,水生植物不能种植在陆地上 - if plantName not in {'睡莲(未实现)', '海蘑菇(未实现)', '缠绕水草(未实现)'}: # 这里的集合也可以换成存储在某一文件中的常数的表达 + if plantName not in {c.LILYPAD, '海蘑菇(未实现)', '缠绕水草(未实现)'}: # 这里的集合也可以换成存储在某一文件中的常数的表达 if not self.map[map_y][map_x][c.MAP_PLANT]: # 没有植物肯定可以种植 return True elif ((self.map[map_y][map_x][c.MAP_PLANT] | {'花盆(未实现)', '南瓜头(未实现)'} == {'花盆(未实现)', '南瓜头(未实现)'}) @@ -47,7 +47,7 @@ class Map(): return False elif self.map[map_y][map_x][c.MAP_PLOT_TYPE] == c.MAP_TILE: # 屋顶 # 首先需要判断植物是否是水生植物,水生植物不能种植在陆地上 - if plantName not in {'睡莲(未实现)', '海蘑菇(未实现)', '缠绕水草(未实现)'}: # 这里的集合也可以换成存储在某一文件中的常数的表达 + if plantName not in {c.LILYPAD, '海蘑菇(未实现)', '缠绕水草(未实现)'}: # 这里的集合也可以换成存储在某一文件中的常数的表达 if '花盆(未实现)' in self.map[map_y][map_x][c.MAP_PLANT]: if ((self.map[map_y][map_x][c.MAP_PLANT] | {'花盆(未实现)', '南瓜头(未实现)'} == {'花盆(未实现)', '南瓜头(未实现)'}) and (plantName not in self.map[map_y][map_x][c.MAP_PLANT])): # 例外植物:集合中填花盆和南瓜头,只要这里没有这种植物就能种植;判断方法:并集 @@ -61,14 +61,14 @@ class Map(): else: return False else: # 水里 - if plantName in {'睡莲(未实现)', '海蘑菇(未实现)', '缠绕水草(未实现)'}: # 是水生植物 + if plantName in {c.LILYPAD, '海蘑菇(未实现)', '缠绕水草(未实现)'}: # 是水生植物 if not self.map[map_y][map_x][c.MAP_PLANT]: # 只有无植物时才能在水里种植水生植物 return True else: return False else: # 非水生植物,依赖睡莲 - if '睡莲(未实现)' in self.map[map_y][map_x][c.MAP_PLANT]: - if ((self.map[map_y][map_x][c.MAP_PLANT] | {'睡莲(未实现)', '花盆(未实现)', '南瓜头(未实现)'} == {'睡莲(未实现)', '花盆(未实现)', '南瓜头(未实现)'}) + if c.LILYPAD in self.map[map_y][map_x][c.MAP_PLANT]: + if ((self.map[map_y][map_x][c.MAP_PLANT] | {c.LILYPAD, '花盆(未实现)', '南瓜头(未实现)'} == {c.LILYPAD, '花盆(未实现)', '南瓜头(未实现)'}) and (plantName not in self.map[map_y][map_x][c.MAP_PLANT])): # 例外植物:集合中填花盆和南瓜头,只要这里没有这种植物就能种植;判断方法:并集 return True else: diff --git a/source/component/menubar.py b/source/component/menubar.py index 823915b..24f1cc3 100755 --- a/source/component/menubar.py +++ b/source/component/menubar.py @@ -9,23 +9,88 @@ PANEL_X_START = 22 PANEL_Y_INTERNAL = 67 PANEL_X_INTERNAL = 53 # 以后可以增加到10,并且增加解锁功能 -CARD_LIST_NUM = 8 -CARD_MAX_NUM = CARD_LIST_NUM +CARD_MAX_NUM = 8 +CARD_LIST_NUM = 0 + +''' +plantDict = {# 字典 植物名称:(卡片名称, 阳光, 冷却时间) + c.SUNFLOWER:(c.CARD_SUNFLOWER, + 50, + 7500), + c.PEASHOOTER:(c.CARD_PEASHOOTER, + 100, + 7500), + c.SNOWPEASHOOTER:(c.CARD_SNOWPEASHOOTER, + 175, + 7500), + c.WALLNUT:(c.CARD_WALLNUT, + 50, + 30000), + c.CHERRYBOMB:(c.CARD_CHERRYBOMB, + 150, + 50000), + c.THREEPEASHOOTER:(c.CARD_THREEPEASHOOTER, + 325, + 7500), + c.REPEATERPEA:(c.CARD_REPEATERPEA, + 200, + 7500), + c.CHOMPER:(c.CARD_CHOMPER, + 150, + 7500), + c.PUFFSHROOM:(c.CARD_PUFFSHROOM, + 0, + 7500), + c.POTATOMINE:(c.CARD_POTATOMINE, + 25, + 30000), + c.SQUASH:(c.CARD_SQUASH, + 50, + 30000), + c.SPIKEWEED:(c.CARD_SPIKEWEED, + 100, + 7500), + c.JALAPENO:(c.CARD_JALAPENO, + 125, + 30000), + c.SCAREDYSHROOM:(c.CARD_SCAREDYSHROOM, + 25, + 7500), + c.SUNSHROOM:(c.CARD_SUNSHROOM, + 25, + 7500), + c.ICESHROOM:(c.CARD_ICESHROOM, + 75, + 50000), + c.HYPNOSHROOM:(c.CARD_HYPNOSHROOM, + 75, + 30000), + c.WALLNUTBOWLING:(c.CARD_WALLNUT, + 0, + 0), + c.REDWALLNUTBOWLING:(c.CARD_REDWALLNUT, + 0, + 0), + c.LILYPAD:(c.CARD_LILYPAD, + 25, + 7500)} +''' 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_PUFFSHROOM, c.CARD_POTATOMINE, c.CARD_SQUASH, c.CARD_SPIKEWEED, c.CARD_JALAPENO, c.CARD_SCAREDYSHROOM, c.CARD_SUNSHROOM, c.CARD_ICESHROOM, - c.CARD_HYPNOSHROOM, c.CARD_WALLNUT, c.CARD_REDWALLNUT] + c.CARD_HYPNOSHROOM, c.CARD_WALLNUT, c.CARD_REDWALLNUT, c.CARD_LILYPAD] plant_name_list = [c.SUNFLOWER, c.PEASHOOTER, c.SNOWPEASHOOTER, c.WALLNUT, c.CHERRYBOMB, c.THREEPEASHOOTER, c.REPEATERPEA, c.CHOMPER, c.PUFFSHROOM, c.POTATOMINE, c.SQUASH, c.SPIKEWEED, c.JALAPENO, c.SCAREDYSHROOM, c.SUNSHROOM, c.ICESHROOM, - c.HYPNOSHROOM, c.WALLNUTBOWLING, c.REDWALLNUTBOWLING] -plant_sun_list = [50, 100, 175, 50, 150, 325, 200, 150, 0, 25, 50, 100, 125, 25, 25, 75, 75, 0, 0] + c.HYPNOSHROOM, c.WALLNUTBOWLING, c.REDWALLNUTBOWLING, c.LILYPAD] +plant_sun_list = [50, 100, 175, 50, 150, 325, 200, 150, 0, 25, 50, 100, 125, 25, 25, 75, 75, 0, 0, 25] plant_frozen_time_list = [7500, 7500, 7500, 30000, 50000, 7500, 7500, 7500, 7500, 30000, - 30000, 7500, 50000, 7500, 7500, 50000, 30000, 0, 0] -all_card_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] + 30000, 7500, 50000, 7500, 7500, 50000, 30000, 0, 0, 7500] +all_card_list = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 19] + def getSunValueImage(sun_value): # for pack, must include ttf @@ -55,7 +120,7 @@ def getCardPool(data): return card_pool class Card(): - def __init__(self, x, y, name_index, scale=0.78): + def __init__(self, x, y, name_index, scale=0.5): self.loadFrame(card_name_list[name_index], scale) self.rect = self.orig_image.get_rect() self.rect.x = x @@ -264,7 +329,7 @@ class Panel(): x = PANEL_X_START - PANEL_X_INTERNAL y += PANEL_Y_INTERNAL x += PANEL_X_INTERNAL - self.card_list.append(Card(x, y, index, 0.75)) + self.card_list.append(Card(x, y, index, 0.5)) def checkCardClick(self, mouse_pos): delete_card = None diff --git a/source/constants.py b/source/constants.py index d87ad86..fc892e1 100755 --- a/source/constants.py +++ b/source/constants.py @@ -1,4 +1,4 @@ -START_LEVEL_NUM = 1 +START_LEVEL_NUM = 4 START_LITTLE_GAME_NUM = 1 ORIGINAL_CAPTION = 'pypvz' @@ -105,7 +105,7 @@ MAP_STATE_TILE = {MAP_PLANT:set(), MAP_SLEEP:False, MAP_PLOT_TYPE:MAP_TILE} BACKGROUND_OFFSET_X = 220 MAP_OFFSET_X = 35 MAP_OFFSET_Y = 100 -MAP_POOL_OFFSET_X = 40 # 暂时还不清楚数据 +MAP_POOL_OFFSET_X = 45 # 暂时还不清楚数据 MAP_POOL_OFFSET_Y = 115 # 暂时还不清楚数据 MAP_ROOF_OFFSET_X = 35 # 暂时还不清楚数据 MAP_ROOF_OFFSET_Y = 105 # 暂时还不清楚数据 @@ -185,6 +185,7 @@ CARD_SUNSHROOM = 'card_sunshroom' CARD_ICESHROOM = 'card_iceshroom' CARD_HYPNOSHROOM = 'card_hypnoshroom' CARD_REDWALLNUT = 'card_redwallnut' +CARD_LILYPAD = 'card_lilypad' #BULLET INFO BULLET_PEA = 'PeaNormal'