diff --git a/backend/bang/cards.py b/backend/bang/cards.py index 3662673..10d0a69 100644 --- a/backend/bang/cards.py +++ b/backend/bang/cards.py @@ -189,6 +189,9 @@ class Bang(Card): def play_card(self, player, against, _with=None): import bang.expansions.fistful_of_cards.card_events as ce + import bang.expansions.high_noon.card_events as ceh + if player.game.check_event(ceh.Sermone): + return False if player.has_played_bang and (not any([isinstance(c, Volcanic) for c in player.equipment]) or player.game.check_event(ce.Lazo)) and against != None: return False elif against != None: @@ -327,6 +330,9 @@ class Mancato(Card): def play_card(self, player, against, _with=None): import bang.characters as chars if (not player.has_played_bang and against != None and player.character.check(player.game, chars.CalamityJanet)): + import bang.expansions.high_noon.card_events as ceh + if player.game.check_event(ceh.Sermone): + return False player.sio.emit('chat_message', room=player.game.name, data=f'_special_calamity|{player.name}|{self.name}|{against}') player.has_played_bang = True diff --git a/backend/bang/expansions/high_noon/card_events.py b/backend/bang/expansions/high_noon/card_events.py index ec57619..6a58765 100644 --- a/backend/bang/expansions/high_noon/card_events.py +++ b/backend/bang/expansions/high_noon/card_events.py @@ -43,6 +43,13 @@ class IlDottore(CardEvent): self.desc = "Il giocatore con meno vite recupera 1 vita" self.desc_eng = "" + +class Sermone(CardEvent): + def __init__(self): + super().__init__("Sermone", "✝️") + self.desc = "I giocatori non possono giocare Bang!" + self.desc_eng = "" + class MezzogiornoDiFuoco(CardEvent): def __init__(self): super().__init__("Mezzogiorno di Fuoco", "🔥") @@ -60,7 +67,7 @@ def get_all_events(): IlReverendo(), IlTreno(), Sbornia(), - # Seromone(), + Sermone(), Sete(), # Sparatoria(), ] diff --git a/backend/bang/players.py b/backend/bang/players.py index f6fed02..2b141ca 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -230,7 +230,9 @@ class Player: elif self.pending_action == PendingAction.PLAY: equippables = [c for c in self.hand if (c.is_equipment or c.usable_next_turn) and not isinstance(c, cs.Prigione) and not any([type(c) == type(x) for x in self.equipment])] misc = [c for c in self.hand if (isinstance(c, cs.WellsFargo) and not c.usable_next_turn) or isinstance(c, cs.Diligenza) or isinstance(c, cs.Emporio) or (isinstance(c, cs.Birra) and self.lives < self.max_lives and not self.game.check_event(ceh.IlReverendo))] - need_target = [c for c in self.hand if c.need_target and c.can_be_used_now and not (c.need_with and len(self.hand) < 2) and not (self.has_played_bang and not (any([isinstance(c, cs.Volcanic) for c in self.equipment]) and not self.game.check_event(ce.Lazo))) and not ( isinstance(c, cs.Prigione) and self.game.check_event(ce.IlGiudice))] + need_target = [c for c in self.hand if c.need_target and c.can_be_used_now and not (c.need_with and len(self.hand) < 2) and not ( + (self.game.check_event(ceh.Sermone) or self.has_played_bang and not (any([isinstance(c, cs.Volcanic) for c in self.equipment]) and type(c) == type(cs.Bang) + ) and not self.game.check_event(ce.Lazo))) and not ( isinstance(c, cs.Prigione) and self.game.check_event(ce.IlGiudice))] green_cards = [c for c in self.equipment if not self.game.check_event(ce.Lazo) and not isinstance(c, cs.Mancato) and c.usable_next_turn and c.can_be_used_now] if len(equippables) > 0 and not self.game.check_event(ce.IlGiudice): for c in equippables: @@ -770,7 +772,7 @@ class Player: def get_dueled(self, attacker): self.attacker = attacker - if not self.game.is_competitive and len([c for c in self.hand if isinstance(c, cs.Bang) or (self.character.check(self.game, chars.CalamityJanet) and isinstance(c, cs.Mancato))]) == 0: + if self.game.check_event(ceh.Sermone) or (not self.game.is_competitive and len([c for c in self.hand if isinstance(c, cs.Bang) or (self.character.check(self.game, chars.CalamityJanet) and isinstance(c, cs.Mancato))]) == 0): print('Cant defend') self.take_damage_response() self.game.responders_did_respond_resume_turn(did_lose=True)