!card to for communism

This commit is contained in:
Juhani Krekelä 2019-05-06 20:58:40 +03:00
parent 59bcafe1f7
commit 929f54430d
1 changed files with 26 additions and 11 deletions

View File

@ -716,24 +716,39 @@ def game(send, notice, voice, devoice, get_event):
notice(nick, 'Only the czar can choose now')
continue
if len(choices) != 1:
notice(nick, 'Select one choice')
continue
choice = choices[0]
if len(choices) == 1:
choice = choices[0]
if 0 <= choice < len(choosers):
player = choosers[choice]
player.points += 1
if 0 <= choice < len(choosers):
player = choosers[choice]
player.points += 1
# Winner is Czar semantics
czar = player
# Winner is Czar semantics
czar = player
send('The winner is %s with: %s' % (player.nick, combine_cards(round_call_card.text, [player.hand[i].text for i in card_choices[player]])))
send('The winner is %s with: %s' % (player.nick, combine_cards(round_call_card.text, [player.hand[i].text for i in card_choices[player]])))
break
else:
notice(nick, '%i not in range' % choice)
elif len(choices) == 0:
# Special case: award everyone a point
# and randomize czar
for player in card_choices:
player.points += 1
# If we set czar to None, setup_round()
# will handle ramdomizing it for us
czar = None
send('Everyone is a winner!')
break
else:
notice(nick, '%i not in range' % choice)
notice(nick, 'Select one or zero choices')
elif event == events.origins:
nick, = args