From 762741d20da6fd96039319bbcc8ddb5e6924290e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Fri, 27 May 2022 11:26:28 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E8=AE=BE?= =?UTF-8?q?=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 9 +++++---- resources/data/map/littleGame_1.json | 7 +++---- resources/data/map/littleGame_2.json | 17 ++++++++--------- resources/data/map/littleGame_3.json | 17 ++++++++--------- resources/data/map/littleGame_4.json | 19 +++++++++---------- source/component/menubar.py | 3 +-- source/component/plant.py | 1 - 7 files changed, 34 insertions(+), 39 deletions(-) diff --git a/main.py b/main.py index e8b9b85..39052fe 100755 --- a/main.py +++ b/main.py @@ -7,9 +7,10 @@ from source.state import mainmenu, screen, level if __name__=='__main__': # 控制状态机运行 game = tool.Control() - state_dict = {c.MAIN_MENU: mainmenu.Menu(), - c.GAME_VICTORY: screen.GameVictoryScreen(), - c.GAME_LOSE: screen.GameLoseScreen(), - c.LEVEL: level.Level()} + state_dict = { c.MAIN_MENU: mainmenu.Menu(), + c.GAME_VICTORY: screen.GameVictoryScreen(), + c.GAME_LOSE: screen.GameLoseScreen(), + c.LEVEL: level.Level() + } game.setup_states(state_dict, c.MAIN_MENU) game.run() diff --git a/resources/data/map/littleGame_1.json b/resources/data/map/littleGame_1.json index 7ac1303..700df65 100644 --- a/resources/data/map/littleGame_1.json +++ b/resources/data/map/littleGame_1.json @@ -6,8 +6,7 @@ "included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "NewspaperZombie", "PoleVaultingZombie"], "num_flags":4, "inevitable_zombie_list":{"20":["BucketheadZombie"]}, - "card_pool":[ - {"name":"WallNutBowling"}, - {"name":"RedWallNutBowling"} - ] + "card_pool":[ "WallNutBowling", + "RedWallNutBowling" + ] } diff --git a/resources/data/map/littleGame_2.json b/resources/data/map/littleGame_2.json index b5f5f52..5252f4b 100644 --- a/resources/data/map/littleGame_2.json +++ b/resources/data/map/littleGame_2.json @@ -6,13 +6,12 @@ "num_flags":3, "included_zombies":["Zombie", "ConeheadZombie", "BucketheadZombie", "PoleVaultingZombie"], "inevitable_zombie_list":{"20":["BucketheadZombie"]}, - "card_pool":[ - {"name":"Peashooter"}, - {"name":"SnowPea"}, - {"name":"WallNut"}, - {"name":"CherryBomb"}, - {"name":"RepeaterPea"}, - {"name":"Chomper"}, - {"name":"PotatoMine"} - ] + "card_pool":[ "Peashooter", + "SnowPea", + "WallNut", + "CherryBomb", + "RepeaterPea", + "Chomper", + "PotatoMine" + ] } diff --git a/resources/data/map/littleGame_3.json b/resources/data/map/littleGame_3.json index 7ede7e7..a1927c5 100644 --- a/resources/data/map/littleGame_3.json +++ b/resources/data/map/littleGame_3.json @@ -8,13 +8,12 @@ "BucketheadZombie", "NewspaperZombie", "FootballZombie", "ScreenDoorZombie"], "inevitable_zombie_list":{"30":["FootballZombie"]}, - "card_pool":[ - {"name":"PuffShroom"}, - {"name":"ScaredyShroom"}, - {"name":"IceShroom"}, - {"name":"HypnoShroom"}, - {"name":"DoomShroom"}, - {"name":"GraveBuster"}, - {"name":"FumeShroom"} - ] + "card_pool":[ "PuffShroom", + "ScaredyShroom", + "IceShroom", + "HypnoShroom", + "DoomShroom", + "GraveBuster", + "FumeShroom" + ] } diff --git a/resources/data/map/littleGame_4.json b/resources/data/map/littleGame_4.json index 561cf1b..a1600e1 100644 --- a/resources/data/map/littleGame_4.json +++ b/resources/data/map/littleGame_4.json @@ -8,14 +8,13 @@ "BucketheadZombie", "SnorkelZombie", "Zomboni"], "inevitable_zombie_list":{"30":["BucketheadZombie"]}, - "card_pool":[ - {"name":"Lilypad"}, {"name":"Lilypad"}, - {"name":"TorchWood"}, - {"name":"TallNut"}, - {"name":"TangleKlep"}, - {"name":"Spikeweed"}, - {"name":"Squash"}, - {"name":"Jalapeno"}, - {"name":"Threepeater"}, {"name":"Threepeater"}, {"name":"Threepeater"}, {"name":"Threepeater"}, {"name":"Threepeater"} - ] + "card_pool":[ "Lilypad", "Lilypad", + "TorchWood", + "TallNut", + "TangleKlep", + "Spikeweed", + "Squash", + "Jalapeno", + "Threepeater", "Threepeater", "Threepeater", "Threepeater", "Threepeater" + ] } diff --git a/source/component/menubar.py b/source/component/menubar.py index 28404ec..fd0ced8 100755 --- a/source/component/menubar.py +++ b/source/component/menubar.py @@ -148,9 +148,8 @@ def getSunValueImage(sun_value): def getCardPool(data): card_pool = [] for card in data: - tmp = card['name'] for i,name in enumerate(plantInfo): - if name[c.PLANT_NAME_INDEX] == tmp: + if name[c.PLANT_NAME_INDEX] == card: card_pool.append(i) break return card_pool diff --git a/source/component/plant.py b/source/component/plant.py index 8e9a31f..89263d4 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -1391,7 +1391,6 @@ class CoffeeBean(Plant): self.image.set_alpha(192) else: self.image.set_alpha(255) - class SeaShroom(Plant):