Combining with "patch" branch (#29)
* Update unobot.po * Update test_player.py * Update test_player.py * Update test_player.py * Update test_player.py * Update player.py * Update player.py * Update internationalization.py * Update internationalization.py * Update test_player.py * Update test_player.py * Update test_player.py * Update player.py * Update player.py * Update player.py * Update test_player.py * Update test_player.py * revert play 4 then 4 rule * Update test_player.py * Update player.py * Update player.py * Update player.py * Update game.py * Update game_manager.py * Update game_manager.py * Update game_manager.py * Update player.py * Update test_player.py * Update player.py * Update bot.py * Update credentials.py * Update credentials.py * Update bot.py * Update game.py * Update game_manager.py * Update game_manager.py * Update player.py
This commit is contained in:
13
player.py
13
player.py
@ -167,17 +167,20 @@ class Player(object):
|
||||
self.logger.debug("Card's color or value doesn't match")
|
||||
is_playable = False
|
||||
elif last.value == c.DRAW_TWO and not \
|
||||
card.value == c.DRAW_TWO and self.game.draw_counter:
|
||||
(card.value == c.DRAW_TWO or card.special == c.DRAW_FOUR) and self.game.draw_counter:
|
||||
self.logger.debug("Player has to draw and can't counter")
|
||||
is_playable = False
|
||||
elif last.special == c.DRAW_FOUR and self.game.draw_counter:
|
||||
elif last.special == c.DRAW_FOUR and self.game.draw_counter and not card.special == c.DRAW_FOUR:
|
||||
self.logger.debug("Player has to draw and can't counter")
|
||||
is_playable = False
|
||||
elif (last.special == c.CHOOSE or last.special == c.DRAW_FOUR) and \
|
||||
(card.special == c.CHOOSE or card.special == c.DRAW_FOUR):
|
||||
elif (last.special == c.CHOOSE) and \
|
||||
(card.special == c.CHOOSE or card.special == c.DRAW_FOUR) or \
|
||||
(last.special == c.DRAW_FOUR and card.special == c.CHOOSE):
|
||||
self.logger.debug("Can't play colorchooser on another one")
|
||||
is_playable = False
|
||||
elif not last.color:
|
||||
# Pervent game locks by choose colors.
|
||||
# When player is going leave and he didn't selected a color, it cause game locks.
|
||||
elif not last.color and not (last.special == c.CHOOSE or last.special == c.DRAW_FOUR):
|
||||
self.logger.debug("Last card has no color")
|
||||
is_playable = False
|
||||
|
||||
|
Reference in New Issue
Block a user