add RegolamentoDiConti

This commit is contained in:
Alberto Xamin 2023-03-05 17:57:31 +00:00
parent 47a099d624
commit e33c2c3c48
No known key found for this signature in database
GPG Key ID: 5ABFCD8A22EA6F5D
3 changed files with 18 additions and 4 deletions

View File

@ -56,7 +56,7 @@ class RegolamentoDiConti(CardEvent):
Tutte le carte possono essere giocate come se fossero BANG!. Le carte BANG! come se fossero Mancato!
"""
def __init__(self):
super().__init__("Regolamento di conti", "🤠")
super().__init__("Regolamento di Conti", "🤠")
class Sacagaway(CardEvent):
"""
@ -84,8 +84,8 @@ def get_all_events(rng=random):
# DorothyRage(),
HelenaZontero(),
# LadyRosaDelTexas(),
# MissSusanna(),
# RegolamentoDiConti(),
MissSusanna(),
RegolamentoDiConti(),
Sacagaway(),
]
rng.shuffle(cards)

View File

@ -519,6 +519,12 @@ class Player:
self.choose_text = 'choose_cecchino'
self.pending_action = PendingAction.CHOOSE
self.notify_self()
if self.is_my_turn and self.pending_action == PendingAction.PLAY and pile == 'event' and self.game.check_event(cew.RegolamentoDiConti) and len(self.hand) > 0:
if not self.has_played_bang and any((self.get_sight() >= p['dist'] for p in self.game.get_visible_players(self))):
self.available_cards = self.hand.copy()
self.pending_action = PendingAction.CHOOSE
self.choose_text = 'choose_play_as_bang'
self.notify_self()
elif self.is_my_turn and self.pending_action == PendingAction.PLAY and pile == 'event' and self.game.check_event(ce.Rimbalzo) and any((c.name == cs.Bang(0,0).name for c in self.hand)):
self.available_cards = [{
'name': p.name,

View File

@ -4,6 +4,7 @@ from tests import started_game, set_events, current_player, next_player, current
from bang.expansions.wild_west_show.card_events import *
from bang.cards import Card, Suit
import bang.roles as roles
from bang.players import PendingAction
# test Camposanto
@ -52,6 +53,7 @@ def test_helena_zontero():
# test LadyRosaDelTexas
# test MissSusanna
def test_miss_suzanna():
g = started_game(['wild_west_show'], 4)
@ -71,8 +73,14 @@ def test_miss_suzanna():
# test RegolamentoDiConti
def test_miss_suzanna():
g = started_game(['wild_west_show'], 4)
set_events(g, [None, RegolamentoDiConti()])
p = current_player_with_cards(g, [Card(0,'card',0)]*4)
p.draw('event')
assert p.pending_action == PendingAction.CHOOSE
p.choose(0)
# test Sacagaway
# test WildWestShow
def test_miss_suzanna():