Merge branch 'dev' into main
This commit is contained in:
commit
bdaa848b5b
@ -1,4 +1,6 @@
|
||||
from typing import List, Set, Dict, Tuple, Optional
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
import bang.expansions.high_noon.card_events as ceh
|
||||
from abc import ABC, abstractmethod
|
||||
from enum import IntEnum
|
||||
import bang.roles as r
|
||||
@ -59,7 +61,6 @@ class Card(ABC):
|
||||
self.must_be_used = False
|
||||
|
||||
def play_card(self, player, against=None, _with=None):#self --> carta
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if (player.game.check_event(ce.IlGiudice)) and self.usable_next_turn and not self.can_be_used_now:
|
||||
return False
|
||||
if self.is_equipment:
|
||||
@ -96,7 +97,6 @@ class Card(ABC):
|
||||
return self.name in [c.name for c in player.equipment] or self.name in [c.name for c in player.gold_rush_equipment]
|
||||
|
||||
def check_suit(self, game, accepted):
|
||||
import bang.expansions.high_noon.card_events as ceh
|
||||
if game.check_event(ceh.Benedizione):
|
||||
return Suit.HEARTS in accepted
|
||||
elif game.check_event(ceh.Maledizione):
|
||||
@ -149,7 +149,6 @@ class Prigione(Card):
|
||||
self.alt_text = "♥️= 🆓"
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if (player.game.check_event(ce.IlGiudice)):
|
||||
return False
|
||||
if against != None and not isinstance(player.game.get_player_named(against).role, r.Sheriff):
|
||||
@ -215,8 +214,6 @@ class Bang(Card):
|
||||
self.need_target = True
|
||||
|
||||
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) and not self.number == 42: # 42 gold rush
|
||||
return False
|
||||
if ((player.has_played_bang and not self.number == 42) and (not any([isinstance(c, Volcanic) for c in player.equipment]) or player.game.check_event(ce.Lazo)) and against != None): # 42 gold rush:
|
||||
@ -242,7 +239,6 @@ class Birra(Card):
|
||||
# self.desc_eng = "Play this card to regain a life point. You cannot heal more than your character's maximum limit. If you are about to lose your last life point, you can also play this card on your opponent's turn. Beer no longer takes effect if there are only two players"
|
||||
|
||||
def play_card(self, player, against=None, _with=None, skipChecks=False):
|
||||
import bang.expansions.high_noon.card_events as ceh
|
||||
if player.game.check_event(ceh.IlReverendo):
|
||||
return False
|
||||
if not skipChecks:
|
||||
@ -381,10 +377,8 @@ class Mancato(Card):
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.characters as chars
|
||||
if against != None and player.character.check(player.game, chars.CalamityJanet):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if player.has_played_bang and (not any([isinstance(c, Volcanic) for c in player.equipment]) or player.game.check_event(ce.Lazo)):
|
||||
return False
|
||||
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,
|
||||
|
@ -1,4 +1,5 @@
|
||||
from bang.cards import *
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
|
||||
class Binocolo(Mirino):
|
||||
def __init__(self, suit, number):
|
||||
@ -149,7 +150,6 @@ class Bibbia(Schivata):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
pass
|
||||
return False
|
||||
@ -171,7 +171,6 @@ class Cappello(Mancato):
|
||||
self.alt_text = "😅"
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
pass
|
||||
return False
|
||||
@ -205,7 +204,6 @@ class Pugnale(Pugno):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
return super().play_card(player, against=against)
|
||||
else:
|
||||
@ -227,7 +225,6 @@ class Derringer(Pugnale):
|
||||
# self.desc_eng += ' and then draw a card.'
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
player.hand.append(player.game.deck.draw(True))
|
||||
return super().play_card(player, against=against)
|
||||
@ -254,7 +251,6 @@ class Borraccia(Card):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
super().play_card(player, against)
|
||||
player.lives = min(player.lives+1, player.max_lives)
|
||||
@ -278,7 +274,6 @@ class PonyExpress(WellsFargo):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
return super().play_card(player, against)
|
||||
else:
|
||||
@ -299,7 +294,6 @@ class Howitzer(Gatling):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
return super().play_card(player, against)
|
||||
else:
|
||||
@ -320,7 +314,6 @@ class CanCan(CatBalou):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
player.sio.emit('chat_message', room=player.game.name, data=f'_play_card_against|{player.name}|{self.name}|{against}')
|
||||
return super().play_card(player, against)
|
||||
@ -344,7 +337,6 @@ class Conestoga(Panico):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
return super().play_card(player, against)
|
||||
else:
|
||||
@ -365,7 +357,6 @@ class Pepperbox(Bang):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
if against != None:
|
||||
Card.play_card(self, player, against=against)
|
||||
@ -391,7 +382,6 @@ class FucileDaCaccia(Card):
|
||||
self.can_be_used_now = False
|
||||
|
||||
def play_card(self, player, against, _with=None):
|
||||
import bang.expansions.fistful_of_cards.card_events as ce
|
||||
if self.can_be_used_now:
|
||||
if against != None:
|
||||
super().play_card(player, against=against)
|
||||
|
@ -258,6 +258,7 @@ class Game:
|
||||
self.choose_characters()
|
||||
if 'gold_rush' in self.expansions:
|
||||
self.notify_gold_rush_shop()
|
||||
Metrics.send_metric('start_game', points=[1], tags=([f"exp:{e}" for e in self.expansions] + [f"players:{self.initial_players}"]))
|
||||
|
||||
def distribute_roles(self):
|
||||
available_roles: List[roles.Role] = []
|
||||
|
@ -272,7 +272,6 @@ def start_game(sid):
|
||||
ses: Player = sio.get_session(sid)
|
||||
ses.game.start_game()
|
||||
advertise_lobbies()
|
||||
Metrics.send_metric('start_game', points=[1], tags=[f"exp:{e}" for e in ses.game.expansions])
|
||||
|
||||
@sio.event
|
||||
def set_character(sid, name):
|
||||
|
Loading…
Reference in New Issue
Block a user