beer save

This commit is contained in:
Alberto Xamin 2020-11-23 00:06:30 +01:00
parent 174a0a376a
commit 4969bdff97
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -368,6 +368,11 @@ class Player:
elif isinstance(self.character, characters.ElGringo) and self.attacker and len(self.attacker.hand) > 0: elif isinstance(self.character, characters.ElGringo) and self.attacker and len(self.attacker.hand) > 0:
self.hand.append(self.attacker.hand.pop(randrange(0, len(self.attacker.hand)))) self.hand.append(self.attacker.hand.pop(randrange(0, len(self.attacker.hand))))
self.attacker.notify_self() self.attacker.notify_self()
elif self.lives == 0 and len(self.game.players) > 2 and len([c for c in self.hand if isinstance(c, cards.Birra)]) > 0:
for i in range(len(self.hand)):
if isinstance(self.hand[i], cards.Birra):
self.game.deck.scrap(self.hand.pop(i))
break
self.notify_self() self.notify_self()
self.attacker = None self.attacker = None