mezzogiorno di fuoco

This commit is contained in:
Alberto Xamin 2020-12-23 15:50:22 +01:00
parent 39377bbb31
commit d6a84bbb88
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2
3 changed files with 9 additions and 2 deletions

View File

@ -33,7 +33,7 @@ class Deck:
print(f'Deck initialized with {len(self.cards)} cards') print(f'Deck initialized with {len(self.cards)} cards')
def flip_event(self): def flip_event(self):
if len(self.event_cards) > 0 and not isinstance(self.event_cards[0], ce.PerUnPugnoDiCarte): if len(self.event_cards) > 0 and not (isinstance(self.event_cards[0], ce.PerUnPugnoDiCarte) or isinstance(self.event_cards[0], ceh.MezzogiornoDiFuoco)):
self.event_cards.append(self.event_cards.pop(0)) self.event_cards.append(self.event_cards.pop(0))
self.game.notify_event_card() self.game.notify_event_card()

View File

@ -78,7 +78,7 @@ def get_all_events():
Sparatoria(), Sparatoria(),
] ]
random.shuffle(cards) random.shuffle(cards)
# cards.append(MezzogiornoDiFuoco()) cards.append(MezzogiornoDiFuoco())
for c in cards: for c in cards:
c.expansion = 'high-noon' c.expansion = 'high-noon'
return cards return cards

View File

@ -321,6 +321,13 @@ class Player:
self.has_played_bang = False self.has_played_bang = False
self.special_use_count = 0 self.special_use_count = 0
self.bang_used = 0 self.bang_used = 0
if self.game.check_event(ceh.MezzogiornoDiFuoco):
self.lives -= 1
if self.character.check(self.game, chars.BartCassidy) and self.lives > 0:
self.hand.append(self.game.deck.draw(True))
self.sio.emit('chat_message', room=self.game.name, data=f'_special_bart_cassidy|{self.name}')
if self.lives <= 0:
return self.notify_self()
if self.game.check_event(ce.FratelliDiSangue) and self.lives > 1 and not self.is_giving_life and len([p for p in self.game.players if p != self and p.lives < p.max_lives]): if self.game.check_event(ce.FratelliDiSangue) and self.lives > 1 and not self.is_giving_life and len([p for p in self.game.players if p != self and p.lives < p.max_lives]):
self.available_cards = [{ self.available_cards = [{
'name': p.name, 'name': p.name,