sid choose cards before death
This commit is contained in:
parent
847ae5187e
commit
49bb5ee4e5
@ -175,12 +175,15 @@ class Player:
|
|||||||
if self.lives <= 0 and self.max_lives > 0 and not self.is_dead:
|
if self.lives <= 0 and self.max_lives > 0 and not self.is_dead:
|
||||||
print('dying, attacker', self.attacker)
|
print('dying, attacker', self.attacker)
|
||||||
if self.character.check(self.game, chars.SidKetchum) and len(self.hand) > 1:
|
if self.character.check(self.game, chars.SidKetchum) and len(self.hand) > 1:
|
||||||
|
if self.game.players[self.game.turn] != self:
|
||||||
|
self.game.players[self.game.turn].pending_action = PendingAction.WAIT
|
||||||
|
self.game.players[self.game.turn].notify_self()
|
||||||
|
self.scrapped_cards = 0
|
||||||
|
self.previous_pending_action = self.pending_action
|
||||||
|
self.pending_action = PendingAction.CHOOSE
|
||||||
|
self.choose_text = 'choose_sid_scrap'
|
||||||
|
self.available_cards = self.hand
|
||||||
self.lives += 1
|
self.lives += 1
|
||||||
#TODO Sid dovrebbe poter decidere cosa scartare
|
|
||||||
self.game.deck.scrap(self.hand.pop(
|
|
||||||
randrange(0, len(self.hand))), True)
|
|
||||||
self.game.deck.scrap(self.hand.pop(
|
|
||||||
randrange(0, len(self.hand))), True)
|
|
||||||
ser = self.__dict__.copy()
|
ser = self.__dict__.copy()
|
||||||
ser.pop('game')
|
ser.pop('game')
|
||||||
ser.pop('sio')
|
ser.pop('sio')
|
||||||
@ -638,6 +641,16 @@ class Player:
|
|||||||
player.notify_self()
|
player.notify_self()
|
||||||
self.pending_action = PendingAction.PLAY
|
self.pending_action = PendingAction.PLAY
|
||||||
self.notify_self()
|
self.notify_self()
|
||||||
|
elif self.choose_text == 'choose_sid_scrap':
|
||||||
|
self.scrapped_cards += 1
|
||||||
|
self.game.deck.scrap(self.hand.pop(card_index), True)
|
||||||
|
if self.scrapped_cards == 2:
|
||||||
|
self.available_cards = []
|
||||||
|
self.pending_action = self.previous_pending_action
|
||||||
|
if self.game.players[self.game.turn] != self:
|
||||||
|
self.game.players[self.game.turn].pending_action = PendingAction.PLAY
|
||||||
|
self.game.players[self.game.turn].notify_self()
|
||||||
|
self.notify_self()
|
||||||
elif self.choose_text == 'choose_bicchierino':
|
elif self.choose_text == 'choose_bicchierino':
|
||||||
player = self.game.get_player_named(self.available_cards[card_index]['name'])
|
player = self.game.get_player_named(self.available_cards[card_index]['name'])
|
||||||
self.sio.emit('chat_message', room=self.game.name, data=f'_play_card_for|{self.name}|{"Bicchierino"}|{player.name}')
|
self.sio.emit('chat_message', room=self.game.name, data=f'_play_card_for|{self.name}|{"Bicchierino"}|{player.name}')
|
||||||
@ -967,6 +980,7 @@ class Player:
|
|||||||
if self.character.check(self.game, chd.MollyStark) and not self.is_my_turn:
|
if self.character.check(self.game, chd.MollyStark) and not self.is_my_turn:
|
||||||
self.hand.append(self.game.deck.draw(True))
|
self.hand.append(self.game.deck.draw(True))
|
||||||
self.lives += 1 if not self.character.check(self.game, chd.TequilaJoe) else 2
|
self.lives += 1 if not self.character.check(self.game, chd.TequilaJoe) else 2
|
||||||
|
self.lives = min(self.lives, self.max_lives)
|
||||||
self.game.deck.scrap(self.hand.pop(i), True)
|
self.game.deck.scrap(self.hand.pop(i), True)
|
||||||
self.sio.emit('chat_message', room=self.game.name,
|
self.sio.emit('chat_message', room=self.game.name,
|
||||||
data=f'_beer_save|{self.name}')
|
data=f'_beer_save|{self.name}')
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
"choose_manette": "Choose a suit, you will be able to play only cards with that suit on this turn.",
|
"choose_manette": "Choose a suit, you will be able to play only cards with that suit on this turn.",
|
||||||
"hand": "HAND",
|
"hand": "HAND",
|
||||||
"card_against": "Who will you play your card against?",
|
"card_against": "Who will you play your card against?",
|
||||||
|
"choose_sid_scrap": "Discard 2 cards to not die",
|
||||||
"choose_card_to_get": "Choose a card",
|
"choose_card_to_get": "Choose a card",
|
||||||
"choose_guess": "Guess the color of the suit",
|
"choose_guess": "Guess the color of the suit",
|
||||||
"choose_ranch": "Choose the cards to replace",
|
"choose_ranch": "Choose the cards to replace",
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
"hand": "MANO",
|
"hand": "MANO",
|
||||||
"card_against": "Contro chi vuoi giocare la carta",
|
"card_against": "Contro chi vuoi giocare la carta",
|
||||||
"choose_card_to_get": "Scegli che carta pescare",
|
"choose_card_to_get": "Scegli che carta pescare",
|
||||||
|
"choose_sid_scrap": "Scarta 2 carte per non morire",
|
||||||
"choose_guess": "Indovina il colore del seme",
|
"choose_guess": "Indovina il colore del seme",
|
||||||
"choose_ranch": "Scegli le carte da sostituire",
|
"choose_ranch": "Scegli le carte da sostituire",
|
||||||
"choose_dalton": "Scegli che equipaggiamento scartare",
|
"choose_dalton": "Scegli che equipaggiamento scartare",
|
||||||
|
Loading…
Reference in New Issue
Block a user