fix johnpain, bigspencer and tests

This commit is contained in:
Alberto Xamin 2023-03-05 19:49:34 +00:00
parent 499763ffca
commit e4f9cfc886
No known key found for this signature in database
GPG Key ID: 5ABFCD8A22EA6F5D
3 changed files with 9 additions and 9 deletions

View File

@ -86,7 +86,7 @@ class Deck:
card = self.cards.pop(0)
jpain = None
for p in self.game.players:
if isinstance(p, chw.JohnPain) and len(p.hand) < 6:
if p.character.check(self.game, chw.JohnPain) and len(p.hand) < 6:
jpain = p
break
if jpain:

View File

@ -1133,7 +1133,7 @@ class Player:
self.expected_response = self.game.deck.mancato_cards.copy()
if self.character.check(self.game, chars.CalamityJanet) and cs.Bang(0, 0).name not in self.expected_response:
self.expected_response.append(cs.Bang(0, 0).name)
if self.character.check(chw.BigSpencer):
if self.character.check(self.game, chw.BigSpencer):
self.expected_response = []
self.on_failed_response_cb = self.take_damage_response
self.notify_self()
@ -1165,7 +1165,7 @@ class Player:
self.expected_response = self.game.deck.mancato_cards.copy()
if self.character.check(self.game, chars.CalamityJanet) and cs.Bang(0, 0).name not in self.expected_response:
self.expected_response.append(cs.Bang(0, 0).name)
if self.character.check(chw.BigSpencer):
if self.character.check(self.game, chw.BigSpencer):
self.expected_response = []
self.on_failed_response_cb = self.take_no_damage_response
self.notify_self()
@ -1263,7 +1263,7 @@ class Player:
self.expected_response = self.game.deck.mancato_cards_not_green_or_blue.copy()
if self.character.check(self.game, chars.CalamityJanet) and cs.Bang(0, 0).name not in self.expected_response:
self.expected_response.append(cs.Bang(0, 0).name)
if self.character.check(chw.BigSpencer):
if self.character.check(self.game, chw.BigSpencer):
self.expected_response = []
if self.can_escape(card_name, with_mancato=False):
self.expected_response.append(tvosc.Fuga(0, 0).name)

View File

@ -52,9 +52,9 @@ def test_helena_zontero():
assert roles != roles2
# test LadyRosaDelTexas
def test_miss_suzanna():
def test_LadyRosaDelTexas():
g = started_game(['wild_west_show'], 4)
set_events(g, [None, LadyRosaDelTexas()])
set_events(g, [LadyRosaDelTexas()])
p = current_player_with_cards(g, [Card(0,'card',0)]*4)
t = g.turn
p.draw('event')
@ -79,9 +79,9 @@ def test_miss_suzanna():
# test RegolamentoDiConti
def test_miss_suzanna():
def test_RegolamentoDiConti():
g = started_game(['wild_west_show'], 4)
set_events(g, [None, RegolamentoDiConti()])
set_events(g, [RegolamentoDiConti()])
p = current_player_with_cards(g, [Card(0,'card',0)]*4)
p.draw('event')
assert p.pending_action == PendingAction.CHOOSE
@ -89,7 +89,7 @@ def test_miss_suzanna():
# test WildWestShow
def test_miss_suzanna():
def test_WildWestShow():
g = started_game(['wild_west_show'], 8)
set_events(g, [None, WildWestShow()])
for i in range(len(g.players)):