From dc5cb286c06cfe7885943db29fbb07a6237be82a Mon Sep 17 00:00:00 2001 From: Giulio Date: Sat, 26 Jun 2021 16:44:14 +0200 Subject: [PATCH] edit & fix beer in gold rush --- backend/bang/cards.py | 6 +++--- backend/bang/players.py | 1 + frontend/src/i18n/en.json | 5 +++++ frontend/src/i18n/it.json | 5 +++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/backend/bang/cards.py b/backend/bang/cards.py index 43e1a05..028c7d7 100644 --- a/backend/bang/cards.py +++ b/backend/bang/cards.py @@ -247,7 +247,7 @@ class Birra(Card): if 'gold_rush' in player.game.expansions and self.number != 42: from bang.players import PendingAction player.available_cards = [{ - 'name': '', + 'name': 'Pepita', 'icon': '💵️', 'alt_text': '1', 'noDesc': True @@ -256,14 +256,14 @@ class Birra(Card): player.pending_action = PendingAction.CHOOSE player.notify_self() return True - if len(player.game.get_alive_players()) != 2 or self.number == 42: + if (len(player.game.get_alive_players()) != 2 or self.number == 42) and player.lives < player.max_lives: super().play_card(player, against=against) player.lives = min(player.lives+1, player.max_lives) import bang.expansions.dodge_city.characters as chd if player.character.check(player.game, chd.TequilaJoe): player.lives = min(player.lives+1, player.max_lives) return True - elif len(player.game.get_alive_players()) == 2: + elif len(player.game.get_alive_players()) == 2 or player.lives == player.max_lives: player.sio.emit('chat_message', room=player.game.name, data=f'_spilled_beer|{player.name}|{self.name}') return True diff --git a/backend/bang/players.py b/backend/bang/players.py index 631873a..56e4715 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -672,6 +672,7 @@ class Player: elif self.choose_text == 'choose_birra_function': if card_index == 0: self.gold_nuggets += 1 + self.sio.emit('chat_message', room=self.game.name, data=f'_get_nugget|{self.name}') else: cs.Birra(1,1).play_card(self, skipChecks=True) self.pending_action = PendingAction.PLAY diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json index a0037f0..feb0779 100644 --- a/frontend/src/i18n/en.json +++ b/frontend/src/i18n/en.json @@ -99,6 +99,7 @@ "flipped": "{0} flipped a {1} {2}.", "explode": "{0} blew up the dynamite.", "beer_save": "{0} used a beer to save his life.", + "get_nugget":"{0} got a gold nugget using a Beer.", "play_card": "{0} played {1}.", "purchase_card": "{0} purchased {1}.", "play_card_against": "{0} played {1} against {2}.", @@ -574,6 +575,10 @@ "name": "A Fistful of Cards", "desc": "On the beginning of his turn, the player is target of as many Bang as how many cards he has in his hand" }, + "Pepita": { + "name": "Gold Nugget", + "desc": "" + }, "Bicchierino": { "name": "Shot Glass", "desc": "You can choose a player that regains 1 HP (even you)" diff --git a/frontend/src/i18n/it.json b/frontend/src/i18n/it.json index 1e4c509..adf7bfd 100644 --- a/frontend/src/i18n/it.json +++ b/frontend/src/i18n/it.json @@ -99,6 +99,7 @@ "flipped": "{0} ha estratto {1} {2}.", "explode": "{0} ha fatto esplodere la dinamite.", "beer_save": "{0} ha usato una birra per recuperare una vita.", + "get_nugget":"{0} ha ottenuto una pepita d'oro usando una Birra.", "play_card": "{0} ha giocato {1}.", "purchase_card": "{0} ha comprato {1}.", "play_card_against": "{0} ha giocato {1} contro {2}.", @@ -574,6 +575,10 @@ "name": "Per Un Pugno Di Carte", "desc": "All'inizio del proprio turno, il giocatore subisce tanti bang quante carte ha in mano" }, + "Pepita": { + "name": "Pepita D'oro", + "desc": "" + }, "Bicchierino": { "name": "Bicchierino", "desc": "Un giocatore a scelta recupera una vita (anche se stessi)"