Search in sources :

Example 1 with LoseControlOnOtherPlayersControllerEffect

use of mage.abilities.effects.common.LoseControlOnOtherPlayersControllerEffect in project mage by magefree.

the class PlayerImpl method controlPlayersTurn.

@Override
public void controlPlayersTurn(Game game, UUID playerId) {
    Player player = game.getPlayer(playerId);
    player.setTurnControlledBy(this.getId());
    game.informPlayers(getLogName() + " controls the turn of " + player.getLogName());
    if (!playerId.equals(this.getId())) {
        this.playersUnderYourControl.add(playerId);
        if (!player.hasLeft() && !player.hasLost()) {
            player.setGameUnderYourControl(false);
        }
        DelayedTriggeredAbility ability = new AtTheEndOfTurnStepPostDelayedTriggeredAbility(new LoseControlOnOtherPlayersControllerEffect(this.getLogName(), player.getLogName()));
        ability.setSourceId(getId());
        ability.setControllerId(getId());
        game.addDelayedTriggeredAbility(ability, null);
    }
}
Also used : MatchPlayer(mage.game.match.MatchPlayer) AtTheEndOfTurnStepPostDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility) AtTheEndOfTurnStepPostDelayedTriggeredAbility(mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility) LoseControlOnOtherPlayersControllerEffect(mage.abilities.effects.common.LoseControlOnOtherPlayersControllerEffect)

Aggregations

AtTheEndOfTurnStepPostDelayedTriggeredAbility (mage.abilities.common.delayed.AtTheEndOfTurnStepPostDelayedTriggeredAbility)1 LoseControlOnOtherPlayersControllerEffect (mage.abilities.effects.common.LoseControlOnOtherPlayersControllerEffect)1 MatchPlayer (mage.game.match.MatchPlayer)1