From 05770cf5020bc6ed6e009236c0b46366665872e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Wed, 5 Oct 2022 21:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=8F=98=E9=87=8F=E5=91=BD?= =?UTF-8?q?=E5=90=8D=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/map.py | 10 +++++----- source/constants.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) 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)