From bdd38efcdcb64fb7f6eb16d5f1651f4353b0d2e6 Mon Sep 17 00:00:00 2001 From: Alberto Xamin Date: Sat, 26 Jun 2021 14:32:14 +0200 Subject: [PATCH] Zaino save --- backend/bang/players.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/bang/players.py b/backend/bang/players.py index 1e536e8..f1ab484 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -174,6 +174,11 @@ class Player: self.hand.append(self.game.deck.draw(True)) if self.lives <= 0 and self.max_lives > 0 and not self.is_dead: print('dying, attacker', self.attacker) + if self.gold_nuggets >= 2 and len([c for c in self.gold_rush_equipment if isinstance(c, grc.Zaino)]) > 0: + for i in range(len(self.gold_rush_equipment)): + if isinstance(self.gold_rush_equipment[i], grc.Zaino): + self.play_card(len(self.hand) + len(self.equipment) + i) + return # play card will notify the player if self.character.check(self.game, chars.SidKetchum) and len(self.hand) > 1 and self.lives == 0: if self.game.players[self.game.turn] != self: self.game.players[self.game.turn].pending_action = PendingAction.WAIT