tidy up reply_to_query

This commit is contained in:
Jannes Höke 2016-03-08 02:59:46 +01:00
parent 71ebb72215
commit d631506d04

13
bot.py
View file

@ -146,23 +146,18 @@ def reply_to_query(bot, update):
if game.choosing_color:
add_choose_color(results)
else:
playable = player.playable_cards()
if playable:
playable = list(sorted(playable))
playable = list(sorted(player.playable_cards()))
if playable:
for card in playable:
add_play_card(card, results)
if playable is not False and not game.choosing_color and not player.drew:
if not player.drew:
add_draw(player, results, could_play_card=bool(len(playable)))
if player.drew and not game.choosing_color:
else:
add_pass(results)
if game.last_card.special == c.DRAW_FOUR \
and not game.choosing_color \
and game.draw_counter:
if game.last_card.special == c.DRAW_FOUR and game.draw_counter:
add_call_bluff(results)
add_other_cards(playable, player, results)