diff --git a/cards.py b/cards.py index d3bcc8b..73f8b8a 100644 --- a/cards.py +++ b/cards.py @@ -53,7 +53,8 @@ def getperm(update, context): else: tuser = from_user tplayer = get_player(int(tuser.id)) - update.message.reply_text(f"{display_username(tuser)} 等级为 {tplayer.permission}", + update.message.reply_text((f"{display_username(tuser)} 等级为 {tplayer.permission}\n" + f"口袋里有 {tplayer.immunity_cards} 张免疫卡"), parse_mode="Markdown") @run_async @@ -235,6 +236,7 @@ def dist_cards(update, context): (cards, damount) = [int(a) for a in context.args] assert (cards > 0 and damount > 0) fplayer = get_player(int(from_user.id)) + assert fplayer.immunity_cards >= cards fplayer.immunity_cards -= cards fplayer.save() red_packets = context.chat_data.setdefault('red_packets', dict()) diff --git a/mscore.py b/mscore.py index 4540b8e..035b90e 100644 --- a/mscore.py +++ b/mscore.py @@ -152,7 +152,7 @@ class Board(): self.__open(row, col) def gen_statistics(self): - if self.__op != 0: + if self.__3bv != 0: return (self.__op, self.__is, self.__3bv) self.__visited = np.zeros((self.height, self.width), dtype=np.int8) def scan_open(row, col):