emporio faster

This commit is contained in:
Alberto Xamin 2021-06-25 17:13:15 +02:00
parent 62863b38a0
commit 2bb39311c3
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -296,7 +296,12 @@ class Game:
player.notify_self()
pls = self.get_alive_players()
nextPlayer = pls[(pls.index(self.players[self.turn])+(len(pls)-len(self.available_cards))) % len(pls)]
if nextPlayer == self.players[self.turn]:
if len(self.available_cards) == 1:
nextPlayer.hand.append(self.available_cards.pop())
self.sio.emit('emporio', room=self.name, data='{"name":"","cards":[]}')
self.players[self.turn].pending_action = pl.PendingAction.PLAY
self.players[self.turn].notify_self()
elif nextPlayer == self.players[self.turn]:
self.sio.emit('emporio', room=self.name, data='{"name":"","cards":[]}')
self.players[self.turn].pending_action = pl.PendingAction.PLAY
self.players[self.turn].notify_self()