edit & fix beer in gold rush

This commit is contained in:
Giulio 2021-06-26 16:44:14 +02:00
parent 83a61b7466
commit dc5cb286c0
4 changed files with 14 additions and 3 deletions

View File

@ -247,7 +247,7 @@ class Birra(Card):
if 'gold_rush' in player.game.expansions and self.number != 42: if 'gold_rush' in player.game.expansions and self.number != 42:
from bang.players import PendingAction from bang.players import PendingAction
player.available_cards = [{ player.available_cards = [{
'name': '', 'name': 'Pepita',
'icon': '💵️', 'icon': '💵️',
'alt_text': '1', 'alt_text': '1',
'noDesc': True 'noDesc': True
@ -256,14 +256,14 @@ class Birra(Card):
player.pending_action = PendingAction.CHOOSE player.pending_action = PendingAction.CHOOSE
player.notify_self() player.notify_self()
return True 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) super().play_card(player, against=against)
player.lives = min(player.lives+1, player.max_lives) player.lives = min(player.lives+1, player.max_lives)
import bang.expansions.dodge_city.characters as chd import bang.expansions.dodge_city.characters as chd
if player.character.check(player.game, chd.TequilaJoe): if player.character.check(player.game, chd.TequilaJoe):
player.lives = min(player.lives+1, player.max_lives) player.lives = min(player.lives+1, player.max_lives)
return True 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, player.sio.emit('chat_message', room=player.game.name,
data=f'_spilled_beer|{player.name}|{self.name}') data=f'_spilled_beer|{player.name}|{self.name}')
return True return True

View File

@ -672,6 +672,7 @@ class Player:
elif self.choose_text == 'choose_birra_function': elif self.choose_text == 'choose_birra_function':
if card_index == 0: if card_index == 0:
self.gold_nuggets += 1 self.gold_nuggets += 1
self.sio.emit('chat_message', room=self.game.name, data=f'_get_nugget|{self.name}')
else: else:
cs.Birra(1,1).play_card(self, skipChecks=True) cs.Birra(1,1).play_card(self, skipChecks=True)
self.pending_action = PendingAction.PLAY self.pending_action = PendingAction.PLAY

View File

@ -99,6 +99,7 @@
"flipped": "{0} flipped a {1} {2}.", "flipped": "{0} flipped a {1} {2}.",
"explode": "{0} blew up the dynamite.", "explode": "{0} blew up the dynamite.",
"beer_save": "{0} used a beer to save his life.", "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}.", "play_card": "{0} played {1}.",
"purchase_card": "{0} purchased {1}.", "purchase_card": "{0} purchased {1}.",
"play_card_against": "{0} played {1} against {2}.", "play_card_against": "{0} played {1} against {2}.",
@ -574,6 +575,10 @@
"name": "A Fistful of Cards", "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" "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": { "Bicchierino": {
"name": "Shot Glass", "name": "Shot Glass",
"desc": "You can choose a player that regains 1 HP (even you)" "desc": "You can choose a player that regains 1 HP (even you)"

View File

@ -99,6 +99,7 @@
"flipped": "{0} ha estratto {1} {2}.", "flipped": "{0} ha estratto {1} {2}.",
"explode": "{0} ha fatto esplodere la dinamite.", "explode": "{0} ha fatto esplodere la dinamite.",
"beer_save": "{0} ha usato una birra per recuperare una vita.", "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}.", "play_card": "{0} ha giocato {1}.",
"purchase_card": "{0} ha comprato {1}.", "purchase_card": "{0} ha comprato {1}.",
"play_card_against": "{0} ha giocato {1} contro {2}.", "play_card_against": "{0} ha giocato {1} contro {2}.",
@ -574,6 +575,10 @@
"name": "Per Un Pugno Di Carte", "name": "Per Un Pugno Di Carte",
"desc": "All'inizio del proprio turno, il giocatore subisce tanti bang quante carte ha in mano" "desc": "All'inizio del proprio turno, il giocatore subisce tanti bang quante carte ha in mano"
}, },
"Pepita": {
"name": "Pepita D'oro",
"desc": ""
},
"Bicchierino": { "Bicchierino": {
"name": "Bicchierino", "name": "Bicchierino",
"desc": "Un giocatore a scelta recupera una vita (anche se stessi)" "desc": "Un giocatore a scelta recupera una vita (anche se stessi)"