add RegolamentoDiConti
This commit is contained in:
parent
47a099d624
commit
e33c2c3c48
@ -56,7 +56,7 @@ class RegolamentoDiConti(CardEvent):
|
|||||||
Tutte le carte possono essere giocate come se fossero BANG!. Le carte BANG! come se fossero Mancato!
|
Tutte le carte possono essere giocate come se fossero BANG!. Le carte BANG! come se fossero Mancato!
|
||||||
"""
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__("Regolamento di conti", "🤠")
|
super().__init__("Regolamento di Conti", "🤠")
|
||||||
|
|
||||||
class Sacagaway(CardEvent):
|
class Sacagaway(CardEvent):
|
||||||
"""
|
"""
|
||||||
@ -84,8 +84,8 @@ def get_all_events(rng=random):
|
|||||||
# DorothyRage(),
|
# DorothyRage(),
|
||||||
HelenaZontero(),
|
HelenaZontero(),
|
||||||
# LadyRosaDelTexas(),
|
# LadyRosaDelTexas(),
|
||||||
# MissSusanna(),
|
MissSusanna(),
|
||||||
# RegolamentoDiConti(),
|
RegolamentoDiConti(),
|
||||||
Sacagaway(),
|
Sacagaway(),
|
||||||
]
|
]
|
||||||
rng.shuffle(cards)
|
rng.shuffle(cards)
|
||||||
|
@ -519,6 +519,12 @@ class Player:
|
|||||||
self.choose_text = 'choose_cecchino'
|
self.choose_text = 'choose_cecchino'
|
||||||
self.pending_action = PendingAction.CHOOSE
|
self.pending_action = PendingAction.CHOOSE
|
||||||
self.notify_self()
|
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)):
|
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 = [{
|
self.available_cards = [{
|
||||||
'name': p.name,
|
'name': p.name,
|
||||||
|
@ -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.expansions.wild_west_show.card_events import *
|
||||||
from bang.cards import Card, Suit
|
from bang.cards import Card, Suit
|
||||||
import bang.roles as roles
|
import bang.roles as roles
|
||||||
|
from bang.players import PendingAction
|
||||||
|
|
||||||
|
|
||||||
# test Camposanto
|
# test Camposanto
|
||||||
@ -52,6 +53,7 @@ def test_helena_zontero():
|
|||||||
|
|
||||||
# test LadyRosaDelTexas
|
# test LadyRosaDelTexas
|
||||||
|
|
||||||
|
|
||||||
# test MissSusanna
|
# test MissSusanna
|
||||||
def test_miss_suzanna():
|
def test_miss_suzanna():
|
||||||
g = started_game(['wild_west_show'], 4)
|
g = started_game(['wild_west_show'], 4)
|
||||||
@ -71,8 +73,14 @@ def test_miss_suzanna():
|
|||||||
|
|
||||||
|
|
||||||
# test RegolamentoDiConti
|
# 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
|
# test WildWestShow
|
||||||
def test_miss_suzanna():
|
def test_miss_suzanna():
|
||||||
|
Loading…
Reference in New Issue
Block a user