维护清理

This commit is contained in:
星外之神 2022-05-15 14:32:43 +08:00
parent 9d56c8a73c
commit c87f5b3dc8

View File

@ -52,6 +52,7 @@ class Map():
return True return True
else: else:
return False return False
# 被非植物障碍占据的格子对于一般植物不可种植
if any((i in c.NON_PLANT_OBJECTS) for i in self.map[map_y][map_x][c.MAP_PLANT]): if any((i in c.NON_PLANT_OBJECTS) for i in self.map[map_y][map_x][c.MAP_PLANT]):
return False return False
if self.map[map_y][map_x][c.MAP_PLOT_TYPE] == c.MAP_GRASS: # 草地 if self.map[map_y][map_x][c.MAP_PLOT_TYPE] == c.MAP_GRASS: # 草地
@ -104,7 +105,6 @@ class Map():
return False return False
def getMapIndex(self, x, y): def getMapIndex(self, x, y):
# 引入新地图后需要增加这里的内容
if self.background_type in c.POOL_EQUIPPED_BACKGROUNDS: if self.background_type in c.POOL_EQUIPPED_BACKGROUNDS:
x -= c.MAP_POOL_OFFSET_X x -= c.MAP_POOL_OFFSET_X
y -= c.MAP_POOL_OFFSET_Y y -= c.MAP_POOL_OFFSET_Y