diff --git a/app/routers/games/action_functions.py b/app/routers/games/action_functions.py index ab95db7..4304748 100644 --- a/app/routers/games/action_functions.py +++ b/app/routers/games/action_functions.py @@ -1,7 +1,7 @@ from pony.orm import db_session, select from app.database.models import Game, Card, Player from ..players.schemas import PlayerRol -from ..cards.schemas import CardType, CardResponse +from ..cards.schemas import CardType, CardResponse, CardSubtype from ..websockets.utils import player_connections from .utils import Events from .schemas import RoundDirection, GameStatus @@ -164,6 +164,14 @@ def process_card_exchange(player: Player, objective_player: Player, player_card: objective_player.hand.remove(objective_player_card) objective_player.hand.add(player_card) + if (player.rol == PlayerRol.THE_THING and player_card.type == CardSubtype.CONTAGION): + objective_player.rol = PlayerRol.INFECTED + objective_player.game_last_infected = objective_player.game + + elif (objective_player.rol == PlayerRol.THE_THING and objective_player_card.type == CardSubtype.CONTAGION): + player.rol = PlayerRol.INFECTED + player.game_last_infected = player.game + # enviar evento de intercambio de carta