Bicchierino working
This commit is contained in:
parent
7e644cd456
commit
374e963cec
@ -35,21 +35,25 @@ class Bicchierino(ShopCard):
|
|||||||
super().__init__('Bicchierino', 1, ShopCardKind.BROWN)
|
super().__init__('Bicchierino', 1, ShopCardKind.BROWN)
|
||||||
self.icon = '🍸️'
|
self.icon = '🍸️'
|
||||||
|
|
||||||
def play_card(self, player, against, _with=None):
|
def play_card(self, player, against=None, _with=None):
|
||||||
if against != None:
|
import bang.players as pl
|
||||||
player.sio.emit('chat_message', room=player.game.name, data=f'_play_card_for|{player.name}|{self.name}|{against}')
|
player.available_cards = [{
|
||||||
player.game.deck.scrap(_with)
|
'name': p.name,
|
||||||
player.game.get_player_named(against).lives = min(player.game.get_player_named(against).lives+1, player.game.get_player_named(against).max_lives)
|
'icon': p.role.icon if(player.game.initial_players == 3) else '⭐️' if p['is_sheriff'] else '🤠',
|
||||||
player.game.get_player_named(against).notify_self()
|
'alt_text': ''.join(['❤️']*p.lives)+''.join(['💀']*(p.max_lives-p.lives)),
|
||||||
|
'noDesc': True
|
||||||
|
} for p in player.game.get_alive_players()]
|
||||||
|
player.choose_text = 'choose_bicchierino'
|
||||||
|
player.pending_action = pl.PendingAction.CHOOSE
|
||||||
|
player.notify_self()
|
||||||
return True
|
return True
|
||||||
return False
|
|
||||||
|
|
||||||
class Bottiglia(ShopCard):
|
class Bottiglia(ShopCard):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__('Bottiglia', 2, ShopCardKind.BROWN)
|
super().__init__('Bottiglia', 2, ShopCardKind.BROWN)
|
||||||
self.icon = '🍾️'
|
self.icon = '🍾️'
|
||||||
|
|
||||||
def play_card(self, player, against, _with=None):
|
def play_card(self, player, against=None, _with=None):
|
||||||
if against != None:
|
if against != None:
|
||||||
pass # bang, birra, panico
|
pass # bang, birra, panico
|
||||||
return False
|
return False
|
||||||
@ -59,7 +63,7 @@ class Complice(ShopCard):
|
|||||||
super().__init__('Complice', 2, ShopCardKind.BROWN)
|
super().__init__('Complice', 2, ShopCardKind.BROWN)
|
||||||
self.icon = '😉️'
|
self.icon = '😉️'
|
||||||
|
|
||||||
def play_card(self, player, against, _with=None):
|
def play_card(self, player, against=None, _with=None):
|
||||||
if against != None:
|
if against != None:
|
||||||
pass # emporio, duello, Cat balou
|
pass # emporio, duello, Cat balou
|
||||||
return False
|
return False
|
||||||
@ -201,6 +205,18 @@ class Zaino(ShopCard):
|
|||||||
|
|
||||||
def get_cards() -> List[Card]:
|
def get_cards() -> List[Card]:
|
||||||
cards = [
|
cards = [
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
|
Bicchierino(),
|
||||||
Bicchierino(),
|
Bicchierino(),
|
||||||
# Bottiglia(),
|
# Bottiglia(),
|
||||||
# Complice(),
|
# Complice(),
|
||||||
|
@ -620,6 +620,12 @@ 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_bicchierino':
|
||||||
|
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}')
|
||||||
|
player.lives = min(player.lives+1, player.max_lives)
|
||||||
|
self.pending_action = PendingAction.PLAY
|
||||||
|
self.notify_self()
|
||||||
elif self.game.check_event(ceh.NuovaIdentita) and self.choose_text == 'choose_nuova_identita':
|
elif self.game.check_event(ceh.NuovaIdentita) and self.choose_text == 'choose_nuova_identita':
|
||||||
if card_index == 1: # the other character
|
if card_index == 1: # the other character
|
||||||
self.character = self.not_chosen_character
|
self.character = self.not_chosen_character
|
||||||
|
Loading…
Reference in New Issue
Block a user