add tornado
This commit is contained in:
parent
e1fe906dbf
commit
c13b79c38b
@ -104,6 +104,15 @@ class Tomahawk(Card):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
class Tornado(Card):
|
||||||
|
def __init__(self, suit, number):
|
||||||
|
super().__init__(suit, 'Tornado', number)
|
||||||
|
self.icon = '🌪️'
|
||||||
|
|
||||||
|
def play_card(self, player, against, _with=None):
|
||||||
|
player.game.discard_others(player, card_name=self.name)
|
||||||
|
return True
|
||||||
|
|
||||||
class Sventagliata(Bang):
|
class Sventagliata(Bang):
|
||||||
def __init__(self, suit, number):
|
def __init__(self, suit, number):
|
||||||
super().__init__(suit, number)
|
super().__init__(suit, number)
|
||||||
@ -217,6 +226,7 @@ def get_starting_deck() -> List[Card]:
|
|||||||
# Mira(Suit.CLUBS, 6),
|
# Mira(Suit.CLUBS, 6),
|
||||||
# Poker(Suit.HEARTS, 'J'), # tutti gli altri scartano 1 carta a scelta, se non ci sono assi allora pesca 2 dal mazzo
|
# Poker(Suit.HEARTS, 'J'), # tutti gli altri scartano 1 carta a scelta, se non ci sono assi allora pesca 2 dal mazzo
|
||||||
RitornoDiFiamma(Suit.CLUBS, 'Q'), # un mancato che fa bang
|
RitornoDiFiamma(Suit.CLUBS, 'Q'), # un mancato che fa bang
|
||||||
|
Tornado(Suit.CLUBS, "A"),
|
||||||
]
|
]
|
||||||
for c in cards:
|
for c in cards:
|
||||||
c.expansion_icon = '👻️'
|
c.expansion_icon = '👻️'
|
||||||
|
@ -315,6 +315,22 @@ class Game:
|
|||||||
self.players[i].notify_self()
|
self.players[i].notify_self()
|
||||||
self.notify_event_card()
|
self.notify_event_card()
|
||||||
|
|
||||||
|
def discard_others(self, attacker: pl.Player, card_name:str=None):
|
||||||
|
self.attack_in_progress = True
|
||||||
|
attacker.pending_action = pl.PendingAction.WAIT
|
||||||
|
attacker.notify_self()
|
||||||
|
self.waiting_for = 0
|
||||||
|
self.ready_count = 0
|
||||||
|
for p in self.get_alive_players():
|
||||||
|
if len(p.hand) > 0:
|
||||||
|
if p.get_discarded(attacker=attacker, card_name=card_name):
|
||||||
|
self.waiting_for += 1
|
||||||
|
p.notify_self()
|
||||||
|
if self.waiting_for == 0:
|
||||||
|
attacker.pending_action = pl.PendingAction.PLAY
|
||||||
|
attacker.notify_self()
|
||||||
|
self.attack_in_progress = False
|
||||||
|
|
||||||
def attack_others(self, attacker: pl.Player, card_name:str=None):
|
def attack_others(self, attacker: pl.Player, card_name:str=None):
|
||||||
self.attack_in_progress = True
|
self.attack_in_progress = True
|
||||||
attacker.pending_action = pl.PendingAction.WAIT
|
attacker.pending_action = pl.PendingAction.WAIT
|
||||||
|
@ -828,6 +828,14 @@ class Player:
|
|||||||
self.sio.emit('chat_message', room=player.game.name, data=f'_play_card_against|{player.name}|Fantasma|{player.name}')
|
self.sio.emit('chat_message', room=player.game.name, data=f'_play_card_against|{player.name}|Fantasma|{player.name}')
|
||||||
self.pending_action = PendingAction.PLAY
|
self.pending_action = PendingAction.PLAY
|
||||||
self.notify_self()
|
self.notify_self()
|
||||||
|
elif 'choose_tornado' in self.choose_text:
|
||||||
|
if card_index <= len(self.available_cards):
|
||||||
|
self.game.deck.scrap_pile.append(self.hand.pop(card_index))
|
||||||
|
self.hand.append(self.game.deck.draw())
|
||||||
|
self.hand.append(self.game.deck.draw())
|
||||||
|
self.pending_action = PendingAction.WAIT
|
||||||
|
self.game.responders_did_respond_resume_turn()
|
||||||
|
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
|
||||||
@ -1036,6 +1044,13 @@ class Player:
|
|||||||
self.on_failed_response_cb = self.take_no_damage_response
|
self.on_failed_response_cb = self.take_no_damage_response
|
||||||
self.notify_self()
|
self.notify_self()
|
||||||
|
|
||||||
|
def get_discarded(self, attacker=None, card_name=None):
|
||||||
|
self.pending_action = PendingAction.CHOOSE
|
||||||
|
if card_name == 'Tornado':
|
||||||
|
self.choose_text = 'choose_tornado'
|
||||||
|
self.available_cards = self.hand
|
||||||
|
return True
|
||||||
|
|
||||||
def get_banged(self, attacker, double=False, no_dmg=False, card_index=None, card_name=None):
|
def get_banged(self, attacker, double=False, no_dmg=False, card_index=None, card_name=None):
|
||||||
self.attacker = attacker
|
self.attacker = attacker
|
||||||
self.attacking_card = card_name
|
self.attacking_card = card_name
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
"choose_ranch": "Choose the cards to replace",
|
"choose_ranch": "Choose the cards to replace",
|
||||||
"choose_dalton": "Choose which equipment to discard",
|
"choose_dalton": "Choose which equipment to discard",
|
||||||
"choose_fratelli_di_sangue": "Choose who you want to donate one of your lives",
|
"choose_fratelli_di_sangue": "Choose who you want to donate one of your lives",
|
||||||
|
"choose_fantasma": "Choose who to bring back to life",
|
||||||
|
"choose_tornado": "Choose a card to discard for the tornado",
|
||||||
"choose_cecchino": "Choose who to shoot",
|
"choose_cecchino": "Choose who to shoot",
|
||||||
"choose_rimbalzo_player": "Choose the target of the bang",
|
"choose_rimbalzo_player": "Choose the target of the bang",
|
||||||
"choose_rimbalzo_card": "Choose the card to discard the bang to",
|
"choose_rimbalzo_card": "Choose the card to discard the bang to",
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
"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",
|
||||||
"choose_fratelli_di_sangue": "Scegli a chi donare una delle tue vite",
|
"choose_fratelli_di_sangue": "Scegli a chi donare una delle tue vite",
|
||||||
|
"choose_fantasma": "Scegli chi riportare in vita",
|
||||||
|
"choose_tornado": "Scegli una carta da scartare per il tornado",
|
||||||
"choose_cecchino": "Scegli contro chi sparare",
|
"choose_cecchino": "Scegli contro chi sparare",
|
||||||
"choose_rimbalzo_player": "Scegli contro chi scartare il bang",
|
"choose_rimbalzo_player": "Scegli contro chi scartare il bang",
|
||||||
"choose_rimbalzo_card": "Scegli contro che carta scartare il bang",
|
"choose_rimbalzo_card": "Scegli contro che carta scartare il bang",
|
||||||
|
Loading…
Reference in New Issue
Block a user