From 47ea9c69038ec59adf1560e4b6b91b9b2309ce70 Mon Sep 17 00:00:00 2001 From: Giulio Date: Sun, 20 Jun 2021 18:22:24 +0200 Subject: [PATCH] fix icon logic --- backend/bang/players.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/bang/players.py b/backend/bang/players.py index 261060f..ef25c7b 100644 --- a/backend/bang/players.py +++ b/backend/bang/players.py @@ -330,7 +330,7 @@ class Player: if self.game.check_event(ce.FratelliDiSangue) and self.lives > 1 and not self.is_giving_life and len([p for p in self.game.get_alive_players() if p != self and p.lives < p.max_lives]): self.available_cards = [{ 'name': p.name, - 'icon': p.role.icon if(self.game.initial_players == 3) else '⭐️' if p['is_sheriff'] else '🤠', + 'icon': p.role.icon if(self.game.initial_players == 3) else '⭐️' if isinstance(p.role, r.Sheriff) else '🤠', 'alt_text': ''.join(['❤️']*p.lives)+''.join(['💀']*(p.max_lives-p.lives)), 'noDesc': True } for p in self.game.get_alive_players() if p != self and p.lives < p.max_lives] @@ -369,7 +369,7 @@ class Player: elif self.is_my_turn and self.pending_action == PendingAction.PLAY and pile == 'event' and self.game.check_event(ce.Rimbalzo) and len([c for c in self.hand if c.name == cs.Bang(0,0).name]) > 0: self.available_cards = [{ 'name': p.name, - 'icon': p.role.icon if(self.game.initial_players == 3) else '⭐️' if p['is_sheriff'] else '🤠', + 'icon': p.role.icon if(self.game.initial_players == 3) else '⭐️' if isinstance(p.role, r.Sheriff) else '🤠', 'noDesc': True } for p in self.game.get_alive_players() if len(p.equipment) > 0 and p != self] self.available_cards.append({'icon': '❌', 'noDesc': True})