forked from test/mau_mau_bot
Update player.py
Reverting back to the original rule.
This commit is contained in:
parent
f2e7a14318
commit
75e3076285
1 changed files with 5 additions and 5 deletions
10
player.py
10
player.py
|
@ -166,11 +166,11 @@ class Player(object):
|
||||||
not card.special):
|
not card.special):
|
||||||
self.logger.debug("Card's color or value doesn't match")
|
self.logger.debug("Card's color or value doesn't match")
|
||||||
is_playable = False
|
is_playable = False
|
||||||
elif last.value == c.DRAW_TWO and not \
|
elif last.value == c.DRAW_TWO and self.game.draw_counter: """and not \
|
||||||
(card.value == c.DRAW_TWO or card.special == c.DRAW_FOUR) and self.game.draw_counter:
|
(card.value == c.DRAW_TWO or card.special == c.DRAW_FOUR):"""
|
||||||
self.logger.debug("Player has to draw and can't counter")
|
self.logger.debug("Player has to draw and can't counter")
|
||||||
is_playable = False
|
is_playable = False
|
||||||
elif last.special == c.DRAW_FOUR and self.game.draw_counter and not card.special == c.DRAW_FOUR:
|
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")
|
self.logger.debug("Player has to draw and can't counter")
|
||||||
is_playable = False
|
is_playable = False
|
||||||
elif (last.special == c.CHOOSE) and \
|
elif (last.special == c.CHOOSE) and \
|
||||||
|
@ -178,8 +178,8 @@ class Player(object):
|
||||||
(last.special == c.DRAW_FOUR and card.special == c.CHOOSE):
|
(last.special == c.DRAW_FOUR and card.special == c.CHOOSE):
|
||||||
self.logger.debug("Can't play colorchooser on another one")
|
self.logger.debug("Can't play colorchooser on another one")
|
||||||
is_playable = False
|
is_playable = False
|
||||||
# Pervent game locks by choose colors.
|
# Prevent game being locked by choosing colors.
|
||||||
# When player is going leave and he didn't selected a color, it cause game locks.
|
# When player is going to 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):
|
elif not last.color and not (last.special == c.CHOOSE or last.special == c.DRAW_FOUR):
|
||||||
self.logger.debug("Last card has no color")
|
self.logger.debug("Last card has no color")
|
||||||
is_playable = False
|
is_playable = False
|
||||||
|
|
Loading…
Reference in a new issue