Skip to content

Commit

Permalink
增加可读性
Browse files Browse the repository at this point in the history
  • Loading branch information
wszqkzqk committed Aug 10, 2022
1 parent 777e937 commit da1eb13
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pypvz.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
os.makedirs(os.path.dirname(c.USERLOG_PATH))
logger = logging.getLogger("main")
formatter = logging.Formatter("%(asctime)s - %(levelname)s: %(message)s")
fileHandler = RotatingFileHandler(c.USERLOG_PATH, "a", 1024*1024, 0, "utf-8")
fileHandler = RotatingFileHandler(c.USERLOG_PATH, "a", 1_000_000, 0, "utf-8")
os.chmod(c.USERLOG_PATH, 420) # 设置日志文件权限,Unix为644,Windows为可读、可写
fileHandler.setFormatter(formatter)
streamHandler = logging.StreamHandler()
Expand Down
2 changes: 1 addition & 1 deletion source/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@
# 子弹伤害
BULLET_DAMAGE_NORMAL = 20
BULLET_DAMAGE_FIREBALL_BODY = 27 # 这是火球本体的伤害,注意不是40,本体(27) + 溅射(13)才是40
BULLET_DAMAGE_FIREBALL_RANGE = 13
BULLET_DAMAGE_FIREBALL_RANGE = 13 # 原版溅射伤害会随着僵尸数量增多而减少,这里相当于做了一个增强
# 子弹效果
BULLET_EFFECT_ICE = "ice"
BULLET_EFFECT_UNICE = "unice"
Expand Down
4 changes: 2 additions & 2 deletions source/state/level.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def setupGroups(self):


# 按照规则生成每一波僵尸
# 可以考虑将波刷新和一波中的僵尸生成分开
# 将波刷新和一波中的僵尸生成分开
# useableZombie是指可用的僵尸种类的元组
# inevitableZombie指在本轮必然出现的僵尸,输入形式为字典: {波数1:(僵尸1, 僵尸2……), 波数2:(僵尸1, 僵尸2……)……}
def createWaves(self, useable_zombies, num_flags, survival_rounds=0, inevitable_zombie_dict=None):
Expand All @@ -126,7 +126,7 @@ def createWaves(self, useable_zombies, num_flags, survival_rounds=0, inevitable_
zombie_list.append(c.FLAG_ZOMBIE)
zombie_volume -= c.CREATE_ZOMBIE_DICT[c.FLAG_ZOMBIE][0]

# 保龄球模式应当增大僵尸容量
# 传送带模式应当增大僵尸容量
if (self.bar_type != c.CHOOSEBAR_STATIC):
zombie_volume += 2

Expand Down

0 comments on commit da1eb13

Please sign in to comment.