fix rissa

This commit is contained in:
Alberto Xamin 2020-12-24 10:23:27 +01:00
parent 25bf088c3e
commit 6de8c8e84d
No known key found for this signature in database
GPG Key ID: 4F026F48309500A2

View File

@ -541,15 +541,15 @@ class Player:
self.hand.append(card) self.hand.append(card)
else: else:
self.game.deck.scrap(card, True) self.game.deck.scrap(card, True)
if self.event_type != 'rissa' or (self.event_type == 'rissa' and self.target_p == [p.name for p in self.game.players if p != self and (len(p.hand)+len(p.equipment)) > 0][-1]): if self.event_type != 'rissa' or (self.event_type == 'rissa' and (len([p.name for p in self.game.players if p != self and (len(p.hand)+len(p.equipment)) > 0]) == 0 or self.target_p == [p.name for p in self.game.players if p != self and (len(p.hand)+len(p.equipment)) > 0][-1])):
self.event_type = '' self.event_type = ''
self.target_p = '' self.target_p = ''
self.choose_action = '' self.choose_action = ''
self.pending_action = PendingAction.PLAY self.pending_action = PendingAction.PLAY
else: else:
self.target_p = self.game.players[self.game.players_map[self.target_p]+1].name self.target_p = self.game.players[(self.game.players_map[self.target_p]+1)%len(self.game.players)].name
while self.target_p == self.name or len(self.game.players[self.game.players_map[self.target_p]].hand) + len(self.game.players[self.game.players_map[self.target_p]].equipment) == 0: while self.target_p == self.name or len(self.game.players[self.game.players_map[self.target_p]].hand) + len(self.game.players[self.game.players_map[self.target_p]].equipment) == 0:
self.target_p = self.game.players[self.game.players_map[self.target_p]+1].name self.target_p = self.game.players[(self.game.players_map[self.target_p]+1)%len(self.game.players)].name
self.notify_self() self.notify_self()
elif self.is_giving_life and self.game.check_event(ce.FratelliDiSangue): elif self.is_giving_life and self.game.check_event(ce.FratelliDiSangue):
try: try: