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):