fix prigione
This commit is contained in:
parent
3b9e16f1c1
commit
5068eafe5b
@ -97,6 +97,9 @@ class Game:
|
||||
attacker.pending_action = players.PendingAction.WAIT
|
||||
attacker.notify_self()
|
||||
|
||||
def get_player_named(self, name:str):
|
||||
return self.players[self.players_map[name]]
|
||||
|
||||
def responders_did_respond(self):
|
||||
self.players[self.turn].pending_action = players.PendingAction.PLAY
|
||||
self.players[self.turn].notify_self()
|
||||
|
@ -134,7 +134,9 @@ class Player:
|
||||
if picked.suit != cards.Suit.HEARTS and pickable_cards == 0:
|
||||
self.game.deck.scrap(self.equipment.pop(i))
|
||||
self.end_turn(forced=True)
|
||||
return
|
||||
else:
|
||||
self.game.deck.scrap(self.equipment.pop(i))
|
||||
break
|
||||
break
|
||||
self.pending_action = PendingAction.DRAW
|
||||
@ -166,9 +168,9 @@ class Player:
|
||||
return
|
||||
card: cards.Card = self.hand.pop(hand_index)
|
||||
print(self.name, 'is playing ', card, ' against:', againts)
|
||||
if isinstance(card, cards.Prigione) and isinstance(self.game.players_map[againts].role, roles.Sheriff):
|
||||
self.game.players_map[againts].equipment.append(card)
|
||||
self.game.players_map[againts].notify_self()
|
||||
if isinstance(card, cards.Prigione) and not isinstance(self.game.get_player_named(againts).role, roles.Sheriff):
|
||||
self.game.get_player_named(againts).equipment.append(card)
|
||||
self.game.get_player_named(againts).notify_self()
|
||||
elif card.is_equipment and card.name not in [c.name for c in self.equipment]:
|
||||
if card.is_weapon:
|
||||
has_weapon = False
|
||||
@ -201,6 +203,9 @@ class Player:
|
||||
if isinstance(card, cards.Emporio):
|
||||
pass
|
||||
if isinstance(card, cards.Gatling):
|
||||
for p in self.game.players:
|
||||
if p != self:
|
||||
self.game.attack(self, p)
|
||||
pass
|
||||
if isinstance(card, cards.Indiani):
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user