diff --git a/source/component/map.py b/source/component/map.py index 11af345..efb8e73 100755 --- a/source/component/map.py +++ b/source/component/map.py @@ -155,12 +155,12 @@ class Map(): elif self.background_type in c.ON_ROOF_BACKGROUNDS: x -= c.MAP_ROOF_OFFSET_X y -= c.MAP_ROOF_OFFSET_X - gridX = x // c.GRID_ROOF_X_SIZE - if gridX >= 5: - gridY = y // c.GRID_ROOF_Y_SIZE + grid_x = x // c.GRID_ROOF_X_SIZE + if grid_x >= 5: + grid_y = y // c.GRID_ROOF_Y_SIZE else: - gridY = (y - 20*(6 - gridX)) // 85 - return (gridX, gridY) + grid_y = (y - 20*(6 - grid_x)) // 85 + return (grid_x, grid_y) else: x -= c.MAP_OFFSET_X y -= c.MAP_OFFSET_Y diff --git a/source/constants.py b/source/constants.py index 66d8c54..2e7a596 100755 --- a/source/constants.py +++ b/source/constants.py @@ -376,7 +376,7 @@ PLANT_CARD_INFO = (# 元组 (植物名称, 卡片名称, 阳光, 冷却时间) ) # 卡片中的植物名称与索引序号的对应关系,指定名称以得到索引值 -PLANT_CARD_INDEX={item[PLANT_NAME_INDEX]: index for (index, item) in enumerate(PLANT_CARD_INFO)} +PLANT_CARD_INDEX = {item[PLANT_NAME_INDEX]: index for (index, item) in enumerate(PLANT_CARD_INFO)} # 指定了哪些卡可选(排除坚果保龄球特殊植物) CARDS_TO_CHOOSE = range(len(PLANT_CARD_INFO) - 3)