join +1 and wild percentage

This commit is contained in:
Pesakitan22 2018-04-11 11:16:26 +07:00
parent 3f1da81514
commit 9d2c1d0ce8
3 changed files with 6 additions and 4 deletions

View file

@ -109,7 +109,7 @@ def do_play_card(bot, player, result_id):
.format(name=user.first_name))
if us.stats:
us.games_played += 1
# us.games_played += 1
if game.players_won is 0:
us.first_places += 1
@ -124,7 +124,7 @@ def do_play_card(bot, player, result_id):
us2 = UserSetting.get(id=game.current_player.user.id)
if us2 and us2.stats:
us2.games_played += 1
# us2.games_played += 1
us2.last_places += 1
gm.end_game(chat, user)

View file

@ -78,9 +78,9 @@ class Deck(object):
self.cards.clear()
for color in c.COLORS:
for value in c.WILD_VALUES:
for _ in range(4):
for _ in range(2):
self.cards.append(Card(color, value))
for special in c.SPECIALS:
for _ in range(6):
for _ in range(8):
self.cards.append(Card(None, None, special=special))
self.shuffle()

View file

@ -62,6 +62,8 @@ class GameManager(object):
self.logger.info("Joining game with id " + str(chat.id))
try:
us = UserSetting.get(id=user.id)
us.game_played += 1
game = self.chatid_games[chat.id][-1]
except (KeyError, IndexError):
raise NoGameInChatError()