add miss suzanna
This commit is contained in:
parent
9598a6f811
commit
9f5d037437
@ -619,7 +619,7 @@ class Game:
|
|||||||
newroles = [p.role for p in pls]
|
newroles = [p.role for p in pls]
|
||||||
random.shuffle(newroles)
|
random.shuffle(newroles)
|
||||||
for p in pls:
|
for p in pls:
|
||||||
p.set_role(newroles.pop())
|
p.set_role(newroles.pop(random.randint(0, len(newroles)-1)))
|
||||||
if self.check_event(ce.DeadMan):
|
if self.check_event(ce.DeadMan):
|
||||||
self.did_resuscitate_deadman = False
|
self.did_resuscitate_deadman = False
|
||||||
elif self.check_event(ce.RouletteRussa):
|
elif self.check_event(ce.RouletteRussa):
|
||||||
|
@ -89,6 +89,7 @@ class Player:
|
|||||||
self.is_bot = bot
|
self.is_bot = bot
|
||||||
self.discord_token = discord_token
|
self.discord_token = discord_token
|
||||||
self.discord_id = None
|
self.discord_id = None
|
||||||
|
self.played_cards = 0
|
||||||
self.avatar = ''
|
self.avatar = ''
|
||||||
if self.is_bot:
|
if self.is_bot:
|
||||||
self.avatar = robot_pictures[randrange(len(robot_pictures))]
|
self.avatar = robot_pictures[randrange(len(robot_pictures))]
|
||||||
@ -440,6 +441,7 @@ class Player:
|
|||||||
return self.end_turn(forced=True)
|
return self.end_turn(forced=True)
|
||||||
self.scrapped_cards = 0
|
self.scrapped_cards = 0
|
||||||
self.setaccio_count = 0
|
self.setaccio_count = 0
|
||||||
|
self.played_cards = 0
|
||||||
self.can_play_ranch = True
|
self.can_play_ranch = True
|
||||||
self.is_playing_ranch = False
|
self.is_playing_ranch = False
|
||||||
self.can_play_vendetta = can_play_vendetta
|
self.can_play_vendetta = can_play_vendetta
|
||||||
@ -762,6 +764,8 @@ class Player:
|
|||||||
if not self.game.is_replay:
|
if not self.game.is_replay:
|
||||||
Metrics.send_metric('play_card', points=[1], tags=[f'success:{did_play_card}', f'card:{card.name}', f'bot:{self.is_bot}', f'exp:{card.expansion if "expansion" in card.__dict__ else "vanilla"}'])
|
Metrics.send_metric('play_card', points=[1], tags=[f'success:{did_play_card}', f'card:{card.name}', f'bot:{self.is_bot}', f'exp:{card.expansion if "expansion" in card.__dict__ else "vanilla"}'])
|
||||||
print("did play card:", did_play_card)
|
print("did play card:", did_play_card)
|
||||||
|
if did_play_card:
|
||||||
|
self.played_cards += 1
|
||||||
self.notify_self()
|
self.notify_self()
|
||||||
if self.is_bot:
|
if self.is_bot:
|
||||||
return did_play_card or card.is_equipment or (card.usable_next_turn and not card.can_be_used_now)
|
return did_play_card or card.is_equipment or (card.usable_next_turn and not card.can_be_used_now)
|
||||||
@ -1563,6 +1567,9 @@ class Player:
|
|||||||
for i in range(len(self.equipment)):
|
for i in range(len(self.equipment)):
|
||||||
self.game.deck.scrap(self.equipment.pop(), True)
|
self.game.deck.scrap(self.equipment.pop(), True)
|
||||||
self.is_my_turn = False
|
self.is_my_turn = False
|
||||||
|
if self.played_cards < 3 and self.game.check_event(cew.MissSusanna):
|
||||||
|
self.lives -= 1
|
||||||
|
self.played_cards = 0
|
||||||
self.can_play_again_don_bell = True
|
self.can_play_again_don_bell = True
|
||||||
self.committed_suit_manette = None
|
self.committed_suit_manette = None
|
||||||
self.pending_action = PendingAction.WAIT
|
self.pending_action = PendingAction.WAIT
|
||||||
|
@ -39,10 +39,10 @@ def test_darling_valentine():
|
|||||||
|
|
||||||
# test HelenaZontero
|
# test HelenaZontero
|
||||||
def test_helena_zontero():
|
def test_helena_zontero():
|
||||||
g = started_game(['wild_west_show'], 6)
|
g = started_game(['wild_west_show'], 8)
|
||||||
set_events(g, [None, HelenaZontero()])
|
set_events(g, [None, HelenaZontero()])
|
||||||
roles = [p.role.name for p in g.players]
|
roles = [p.role.name for p in g.players]
|
||||||
for i in range(5):
|
for i in range(len(g.players)-1):
|
||||||
current_player_with_cards(g, []).end_turn()
|
current_player_with_cards(g, []).end_turn()
|
||||||
g.deck.cards = [Card(Suit.HEARTS, 'card', 0)]*5
|
g.deck.cards = [Card(Suit.HEARTS, 'card', 0)]*5
|
||||||
current_player_with_cards(g, []).end_turn()
|
current_player_with_cards(g, []).end_turn()
|
||||||
@ -52,6 +52,22 @@ def test_helena_zontero():
|
|||||||
# test LadyRosaDelTexas
|
# test LadyRosaDelTexas
|
||||||
|
|
||||||
# test MissSusanna
|
# test MissSusanna
|
||||||
|
def test_miss_suzanna():
|
||||||
|
g = started_game(['wild_west_show'], 4)
|
||||||
|
set_events(g, [MissSusanna()])
|
||||||
|
p = current_player_with_cards(g, [])
|
||||||
|
p.end_turn()
|
||||||
|
assert p.lives == 4 # sceriffo 5-1
|
||||||
|
p = current_player_with_cards(g, [Card(0,'card',0)]*4)
|
||||||
|
p.play_card(0)
|
||||||
|
p.play_card(0)
|
||||||
|
p.play_card(0)
|
||||||
|
p.end_turn()
|
||||||
|
assert p.lives == 4
|
||||||
|
p = current_player_with_cards(g, [])
|
||||||
|
p.end_turn()
|
||||||
|
assert p.lives == 3
|
||||||
|
|
||||||
|
|
||||||
# test RegolamentoDiConti
|
# test RegolamentoDiConti
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user