bluffing and calling a bluff

This commit is contained in:
Jannes Höke 2016-03-01 01:56:33 +01:00
parent fb6da7cfa7
commit 7c502598c7

17
bot.py
View file

@ -187,6 +187,23 @@ def chosen_card(bot, update):
if result_id in ('hand', 'not_your_turn'): if result_id in ('hand', 'not_your_turn'):
return return
elif result_id == 'call_bluff':
if player.prev.bluffing:
bot.sendMessage(chat_id, text="Bluff called! Giving %d cards to %s"
% (game.draw_counter + 2,
player.prev.user.first_name))
for i in range(game.draw_counter + 2):
player.prev.cards.append(game.deck.draw())
else:
bot.sendMessage(chat_id, text="%s didn't bluff! Giving %d cards to"
" %s"
% (player.prev.user.first_name,
game.draw_counter,
player.user.first_name))
for i in range(game.draw_counter):
player.cards.append(game.deck.draw())
game.turn()
elif result_id == 'draw': elif result_id == 'draw':
for n in range(game.draw_counter or 1): for n in range(game.draw_counter or 1):
player.cards.append(game.deck.draw()) player.cards.append(game.deck.draw())