From 451bf710f11f01bb40fb4c05bc0e12285ebd7150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Tue, 23 Jun 2020 04:50:20 +0300 Subject: [PATCH] Handle bot winning separately from other cases of non-player winning Previously a person who has left the game winning would be treated like a bot winning, where the czar stays the same. Now, in that case the czar will be randomized while old behaviour remains for a bot winning --- gameloop.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gameloop.py b/gameloop.py index ead9b10..2afe01a 100644 --- a/gameloop.py +++ b/gameloop.py @@ -1189,10 +1189,17 @@ def game(send, notice, voice, devoice, get_event): player_bot.points += 1 # Winner is Czar semantics if a - # player won, keep same czar - # otherwise + # player who's still in the game + # won, keep same czar if a bot + # won, randomize otherwise if player_bot in players.values(): czar = player_bot + elif player_bot in bots.values(): + pass + else: + # setup_round() will + # randomize + czar = None send('The winner is %s with: %s' % (player_bot.nick, combine_cards(round_call_card, card_choices[player_bot])))