major change in game creation, fixed some bugs

This commit is contained in:
Jannes Höke
2016-03-11 09:23:53 +01:00
parent c144fb7c3b
commit 367d16e85f
4 changed files with 117 additions and 74 deletions

View File

@ -77,7 +77,11 @@ class Player(object):
self.logger.debug("Last card was " + str(last))
for card in self.cards:
cards = self.cards
if self.drew:
cards = self.cards[-1:]
for card in cards:
if self.card_playable(card, playable):
self.logger.debug("Matching!")
playable.append(card)
@ -85,8 +89,9 @@ class Player(object):
# You may only play a +4 if it's the only card you can play
self.bluffing = bool(len(playable) - 1)
# You may not play a +4 as your last card
if len(self.cards) == 1 and self.cards[0].special == c.DRAW_FOUR:
# You may not play a chooser or +4 as your last card
if len(self.cards) == 1 and (self.cards[0].special == c.DRAW_FOUR
or self.cards[0].special == c.CHOOSE):
return list()
return playable