diff --git a/backend/bang/cards.py b/backend/bang/cards.py index 4fdf07e..d7f237c 100644 --- a/backend/bang/cards.py +++ b/backend/bang/cards.py @@ -83,6 +83,7 @@ class Card(ABC): return False else: player.equipment.append(self) + self.must_be_used = False self.can_be_used_now = False if against: G.sio.emit('card_against', room=player.game.name, data={'player': player.name, 'target': against, 'card': self.__dict__}) diff --git a/backend/bang/players.py b/backend/bang/players.py index 1858653..d4fef62 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -724,13 +724,13 @@ class Player: withCard = self.hand.pop(_with) if hand_index > _with else self.hand.pop(_with - 1) print(self.name, 'is playing ', card, ' against:', against, ' with:', _with) did_play_card = False - event_blocks_card = (self.game.check_event(ce.IlGiudice) and (card.is_equipment or (card.usable_next_turn and not card.can_be_used_now))) or (self.game.check_event(ce.Lazo) and card.usable_next_turn and card.can_be_used_now) or ((self.game.check_event(ceh.Manette) and card.suit != self.committed_suit_manette) and not (card.usable_next_turn and card.can_be_used_now)) + event_blocks_card = (self.game.check_event(ce.IlGiudice) and (card.is_equipment or (card.usable_next_turn and not card.can_be_used_now))) or (self.game.check_event(ce.Lazo) and card.usable_next_turn and card.can_be_used_now) or ((self.game.check_event(ceh.Manette) and card.suit != self.committed_suit_manette)) if not(against is not None and (self.game.get_player_named(against).character.check(self.game, chd.ApacheKid) or any((isinstance(c, grc.Calumet) for c in self.game.get_player_named(against).gold_rush_equipment))) and card.check_suit(self.game, [cs.Suit.DIAMONDS])) or (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK) and not event_blocks_card: if (against == self.name and not isinstance(card, csd.Tequila) and not isinstance(card, cs.Panico) and not isinstance(card, cs.CatBalou)) or event_blocks_card: did_play_card = False else: did_play_card = card.play_card(self, against, withCard) - if not card.is_equipment and not card.usable_next_turn and not (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK) or event_blocks_card: + if not card.is_equipment and not card.usable_next_turn and not (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK) or (event_blocks_card and not (card.usable_next_turn and card.can_be_used_now)): if did_play_card: self.game.deck.scrap(card, True) else: @@ -738,7 +738,7 @@ class Player: if withCard: self.hand.insert(_with, withCard) G.sio.emit('cant_play_card', room=self.sid) - elif (card.usable_next_turn and card.can_be_used_now) or (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK): + elif (card.usable_next_turn and card.can_be_used_now) or (isinstance(card, grc.ShopCard) and card.kind == grc.ShopCardKind.BLACK) or event_blocks_card: if did_play_card: self.game.deck.scrap(card, True) else: