Skip to content

Commit

Permalink
add circus wagon
Browse files Browse the repository at this point in the history
  • Loading branch information
albertoxamin committed Jun 13, 2024
1 parent 344b7cc commit c171739
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions backend/bang/expansions/train_robbery/trains.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,17 @@ def __init__(self):
self.icon = "🚋🎪"

def play_card(self, player, against=None, _with=None) -> bool:
player.game.discard_others(player, card_name=self.name)
return True

@classmethod
def choose_circus_wagon(cls, player: 'Player', card_index):
player.game.deck.scrap(player.hand.pop(card_index), player=player)
player.pending_action = PendingAction.WAIT
player.game.responders_did_respond_resume_turn()
player.notify_self()



class CoalHopper(TrainCard):
"""Scartalo: pesca una carta e scarta un vagone in gioco davanti a un giocatore a ma scelta."""
Expand Down
9 changes: 8 additions & 1 deletion backend/bang/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,7 @@ def barrel_pick_no_dmg(self):
self.notify_self()

def get_discarded(self, attacker=None, card_name=None, action=None):
if card_name in {"Tornado", "Poker", "Bandidos"}:
if card_name in {"Tornado", "Poker", "Bandidos", "Circus Wagon"}:
self.pending_action = PendingAction.CHOOSE
self.available_cards = self.hand.copy()
if card_name == "Tornado":
Expand All @@ -1941,6 +1941,13 @@ def get_discarded(self, attacker=None, card_name=None, action=None):
self.available_cards.append(
{"name": "-1hp", "icon": "💔", "noDesc": True}
)
if card_name == "Circus Wagon":
from bang.expansions.train_robbery.trains import CircusWagon
self.set_choose_action(
"choose_circus_wagon",
self.hand.copy(),
CircusWagon.choose_circus_wagon,
)
return True
else:
if self.can_escape(card_name) or self.character.check(
Expand Down

0 comments on commit c171739

Please sign in to comment.