forked from test/mau_mau_bot
tidy up reply_to_query
This commit is contained in:
parent
71ebb72215
commit
d631506d04
1 changed files with 7 additions and 12 deletions
19
bot.py
19
bot.py
|
@ -146,24 +146,19 @@ def reply_to_query(bot, update):
|
||||||
if game.choosing_color:
|
if game.choosing_color:
|
||||||
add_choose_color(results)
|
add_choose_color(results)
|
||||||
else:
|
else:
|
||||||
playable = player.playable_cards()
|
playable = list(sorted(player.playable_cards()))
|
||||||
if playable:
|
|
||||||
playable = list(sorted(playable))
|
|
||||||
|
|
||||||
if playable:
|
|
||||||
for card in playable:
|
for card in playable:
|
||||||
add_play_card(card, results)
|
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)))
|
add_draw(player, results, could_play_card=bool(len(playable)))
|
||||||
|
|
||||||
if player.drew and not game.choosing_color:
|
else:
|
||||||
add_pass(results)
|
add_pass(results)
|
||||||
|
|
||||||
if game.last_card.special == c.DRAW_FOUR \
|
if game.last_card.special == c.DRAW_FOUR and game.draw_counter:
|
||||||
and not game.choosing_color \
|
add_call_bluff(results)
|
||||||
and game.draw_counter:
|
|
||||||
add_call_bluff(results)
|
|
||||||
|
|
||||||
add_other_cards(playable, player, results)
|
add_other_cards(playable, player, results)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue