add wild-west-show endgame
This commit is contained in:
parent
9f5d037437
commit
47a099d624
@ -57,7 +57,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) or isinstance(self.event_cards[0], ceh.MezzogiornoDiFuoco)):
|
if len(self.event_cards) > 0 and not (isinstance(self.event_cards[0], ce.PerUnPugnoDiCarte) or isinstance(self.event_cards[0], ceh.MezzogiornoDiFuoco) or isinstance(self.event_cards[0], cew.WildWestShow)):
|
||||||
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()
|
||||||
self.game.notify_all()
|
self.game.notify_all()
|
||||||
|
@ -649,6 +649,9 @@ class Game:
|
|||||||
if self.waiting_for != 0:
|
if self.waiting_for != 0:
|
||||||
return
|
return
|
||||||
self.dalton_on = False
|
self.dalton_on = False
|
||||||
|
elif self.check_event(cew.WildWestShow):
|
||||||
|
for p in self.players:
|
||||||
|
p.set_role(roles.Renegade())
|
||||||
|
|
||||||
if self.check_event(ce.PerUnPugnoDiCarte) and len(self.players[self.turn].hand) > 0:
|
if self.check_event(ce.PerUnPugnoDiCarte) and len(self.players[self.turn].hand) > 0:
|
||||||
self.player_bangs = len(self.players[self.turn].hand)
|
self.player_bangs = len(self.players[self.turn].hand)
|
||||||
|
@ -3,6 +3,7 @@ from tests import started_game, set_events, current_player, next_player, current
|
|||||||
|
|
||||||
from bang.expansions.wild_west_show.card_events import *
|
from bang.expansions.wild_west_show.card_events import *
|
||||||
from bang.cards import Card, Suit
|
from bang.cards import Card, Suit
|
||||||
|
import bang.roles as roles
|
||||||
|
|
||||||
|
|
||||||
# test Camposanto
|
# test Camposanto
|
||||||
@ -73,4 +74,11 @@ def test_miss_suzanna():
|
|||||||
|
|
||||||
# test Sacagaway
|
# test Sacagaway
|
||||||
|
|
||||||
# test WildWestShow
|
# test WildWestShow
|
||||||
|
def test_miss_suzanna():
|
||||||
|
g = started_game(['wild_west_show'], 8)
|
||||||
|
set_events(g, [None, WildWestShow()])
|
||||||
|
for i in range(len(g.players)):
|
||||||
|
current_player_with_cards(g, []).end_turn()
|
||||||
|
for p in g.players:
|
||||||
|
assert isinstance(p.role, roles.Renegade)
|
Loading…
Reference in New Issue
Block a user