!card to for communism
This commit is contained in:
parent
59bcafe1f7
commit
929f54430d
1 changed files with 26 additions and 11 deletions
37
gameloop.py
37
gameloop.py
|
@ -716,24 +716,39 @@ def game(send, notice, voice, devoice, get_event):
|
||||||
notice(nick, 'Only the czar can choose now')
|
notice(nick, 'Only the czar can choose now')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if len(choices) != 1:
|
if len(choices) == 1:
|
||||||
notice(nick, 'Select one choice')
|
choice = choices[0]
|
||||||
continue
|
|
||||||
choice = choices[0]
|
|
||||||
|
|
||||||
if 0 <= choice < len(choosers):
|
if 0 <= choice < len(choosers):
|
||||||
player = choosers[choice]
|
player = choosers[choice]
|
||||||
player.points += 1
|
player.points += 1
|
||||||
|
|
||||||
# Winner is Czar semantics
|
# Winner is Czar semantics
|
||||||
czar = player
|
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
|
break
|
||||||
|
|
||||||
else:
|
else:
|
||||||
notice(nick, '%i not in range' % choice)
|
notice(nick, 'Select one or zero choices')
|
||||||
|
|
||||||
elif event == events.origins:
|
elif event == events.origins:
|
||||||
nick, = args
|
nick, = args
|
||||||
|
|
Loading…
Reference in a new issue