统一变量命名风格

This commit is contained in:
星外之神 2022-08-30 15:06:03 +08:00
parent 57501a8f22
commit 8ce2ccf734
2 changed files with 7 additions and 7 deletions

View File

@ -1606,9 +1606,9 @@ class DoomShroom(Plant):
# 用于描述毁灭菇的坑 # 用于描述毁灭菇的坑
class Hole(Plant): class Hole(Plant):
def __init__(self, x, y, plotType): def __init__(self, x, y, plot_type):
# 指定区域类型这一句必须放在前面,否则加载图片判断将会失败 # 指定区域类型这一句必须放在前面,否则加载图片判断将会失败
self.plotType = plotType self.plot_type = plot_type
Plant.__init__(self, x, y, c.HOLE, c.INF, None) Plant.__init__(self, x, y, c.HOLE, c.INF, None)
self.timer = 0 self.timer = 0
self.shallow = False self.shallow = False
@ -1638,9 +1638,9 @@ class Hole(Plant):
for i, name in enumerate(name_list): for i, name in enumerate(name_list):
self.loadFrames(frame_list[i], name) self.loadFrames(frame_list[i], name)
if self.plotType == c.MAP_TILE: if self.plot_type == c.MAP_TILE:
self.frames = self.roof_frames self.frames = self.roof_frames
elif self.plotType == c.MAP_WATER: elif self.plot_type == c.MAP_WATER:
self.frames = self.water_frames self.frames = self.water_frames
else: else:
self.frames = self.idle_frames self.frames = self.idle_frames
@ -1649,9 +1649,9 @@ class Hole(Plant):
if self.timer == 0: if self.timer == 0:
self.timer = self.current_time self.timer = self.current_time
elif (not self.shallow) and (self.current_time - self.timer >= 90000): elif (not self.shallow) and (self.current_time - self.timer >= 90000):
if self.plotType == c.MAP_TILE: if self.plot_type == c.MAP_TILE:
self.frames = self.roof2_frames self.frames = self.roof2_frames
elif self.plotType == c.MAP_WATER: elif self.plot_type == c.MAP_WATER:
self.frames = self.water2_frames self.frames = self.water2_frames
else: else:
self.frames = self.idle2_frames self.frames = self.idle2_frames

View File

@ -180,7 +180,7 @@ SURVIVAL_ROUNDS = "survival_rounds"
# 地图单元格属性 # 地图单元格属性
MAP_PLANT = "plantnames" MAP_PLANT = "plantnames"
MAP_SLEEP = "sleep" # 有没有休眠的蘑菇,作是否能种植咖啡豆的判断 MAP_SLEEP = "sleep" # 有没有休眠的蘑菇,作是否能种植咖啡豆的判断
MAP_PLOT_TYPE = "plotType" MAP_PLOT_TYPE = "plot_type"
# 地图单元格区域类型 # 地图单元格区域类型
MAP_GRASS = "grass" MAP_GRASS = "grass"
MAP_WATER = "water" MAP_WATER = "water"