From 3792870cf374d615c1f824665d195061f24aac11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Thu, 28 Apr 2022 13:31:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=83=B5=E5=B0=B8=E8=B4=B4?= =?UTF-8?q?=E5=9B=BE=E6=98=BE=E7=A4=BA=E5=BC=82=E5=B8=B8=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 ++ source/component/zombie.py | 1 - source/state/level.py | 14 ++++++-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 3a5ac38..f4e8a01 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,8 @@ nuitka --mingw --standalone --onefile --show-progress --show-memory --output-dir * 目前的设想与原版不同,在完成两轮冒险模式(初始冒险模式 + 戴夫选关的冒险模式)后可以自主选关~~(当然现在只是画饼)~~ * 更改僵尸生成方式 * 使僵尸生成更随机化,由JSON记录改为随机数生成 + * 使用原版设定,每面旗帜出10波僵尸,9个小波,1个大波 + * 采用手机版设定,无尽模式没有红眼计数和变速设定,每波红眼权重为1000,平均分布 * 增加僵尸死亡后有概率掉落奖励的机制 * 增加更多植物、僵尸类型与游戏功能、模式,尽量符合原版基本设计 * 细分伤害种类 diff --git a/source/component/zombie.py b/source/component/zombie.py index f55d837..609796a 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -53,7 +53,6 @@ class Zombie(pg.sprite.Sprite): if name in tool.ZOMBIE_RECT: data = tool.ZOMBIE_RECT[name] x, width = data['x'], data['width'] - width -= x else: x = 0 for frame in frame_list: diff --git a/source/state/level.py b/source/state/level.py index 8edb896..7269313 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -357,6 +357,7 @@ class Level(tool.State): pg.mixer.music.play(-1, 0) return + # 旧僵尸生成方式 if self.zombie_start_time == 0: self.zombie_start_time = self.current_time elif len(self.zombie_list) > 0: @@ -474,19 +475,16 @@ class Level(tool.State): zombieList += newZombie volume -= self.createZombieInfo[newZombie][0] if volume < 0: - volume = 0 # 避免手动指定的最后一个僵尸被while循环的else删除 print('警告:第{}波中手动设置的僵尸级别总数超过上限!'.format(wave)) - while (volume >= 0) and (len(zombieList) <= 50): + while (volume > 0) and (len(zombieList) < 50): newZombie = choices(useableZombies, weights) # 注意这个的输出是列表 - zombieList += newZombie - volume -= self.createZombieInfo[newZombie][0] - else: - zombieList.pop() + if self.createZombieInfo[newZombie][0] <= volume: + zombieList += newZombie + volume -= self.createZombieInfo[newZombie][0] waves.append(zombieList) - return waves # 输出为分波列出的本关所有波的僵尸 - + self.waves = waves def createZombie(self, name, map_y=None):