Search in sources :

Example 21 with TurnMod

use of mage.game.turn.TurnMod in project mage by magefree.

the class HellkiteChargerEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
        ManaCosts cost = new ManaCostsImpl("{5}{R}{R}");
        if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + '?', source, game)) {
            cost.clearPaid();
            if (cost.pay(source, game, source, source.getControllerId(), false, null)) {
                new UntapAllControllerEffect(new FilterAttackingCreature(), "").apply(game, source);
                game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
                return true;
            }
        }
    }
    return false;
}
Also used : ManaCosts(mage.abilities.costs.mana.ManaCosts) FilterAttackingCreature(mage.filter.common.FilterAttackingCreature) Player(mage.players.Player) TurnMod(mage.game.turn.TurnMod) ManaCostsImpl(mage.abilities.costs.mana.ManaCostsImpl) UntapAllControllerEffect(mage.abilities.effects.common.UntapAllControllerEffect)

Example 22 with TurnMod

use of mage.game.turn.TurnMod in project mage by magefree.

the class KarnsTemporalSunderingEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller == null) {
        return false;
    }
    game.getState().getTurnMods().add(new TurnMod(source.getTargets().getFirstTarget(), false));
    Permanent returnPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
    if (returnPermanent != null) {
        controller.moveCards(returnPermanent, Zone.HAND, source, game);
    }
    return true;
}
Also used : TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) Permanent(mage.game.permanent.Permanent) TargetNonlandPermanent(mage.target.common.TargetNonlandPermanent) TurnMod(mage.game.turn.TurnMod)

Example 23 with TurnMod

use of mage.game.turn.TurnMod in project mage by magefree.

the class TeferiMasterOfTimeTurnEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false));
    game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), false));
    return true;
}
Also used : TurnMod(mage.game.turn.TurnMod)

Example 24 with TurnMod

use of mage.game.turn.TurnMod in project mage by magefree.

the class MomirGame method init.

@Override
protected void init(UUID choosingPlayerId) {
    Ability ability = new SimpleStaticAbility(Zone.COMMAND, new InfoEffect("Vanguard effects"));
    for (UUID playerId : state.getPlayerList(startingPlayerId)) {
        Player player = getPlayer(playerId);
        if (player != null) {
            CardInfo cardInfo = CardRepository.instance.findCard("Momir Vig, Simic Visionary");
            addEmblem(new MomirEmblem(), cardInfo.getCard(), playerId);
        }
    }
    getState().addAbility(ability, null);
    super.init(choosingPlayerId);
    state.getTurnMods().add(new TurnMod(startingPlayerId, PhaseStep.DRAW));
}
Also used : SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) Ability(mage.abilities.Ability) Player(mage.players.Player) SimpleStaticAbility(mage.abilities.common.SimpleStaticAbility) CardInfo(mage.cards.repository.CardInfo) TurnMod(mage.game.turn.TurnMod) UUID(java.util.UUID) MomirEmblem(mage.game.command.emblems.MomirEmblem) InfoEffect(mage.abilities.effects.common.InfoEffect)

Example 25 with TurnMod

use of mage.game.turn.TurnMod in project mage by magefree.

the class TwoPlayerDuel method init.

@Override
protected void init(UUID choosingPlayerId) {
    super.init(choosingPlayerId);
    state.getTurnMods().add(new TurnMod(startingPlayerId, PhaseStep.DRAW));
}
Also used : TurnMod(mage.game.turn.TurnMod)

Aggregations

TurnMod (mage.game.turn.TurnMod)26 Player (mage.players.Player)13 UUID (java.util.UUID)6 Ability (mage.abilities.Ability)5 Permanent (mage.game.permanent.Permanent)5 SimpleStaticAbility (mage.abilities.common.SimpleStaticAbility)3 InfoEffect (mage.abilities.effects.common.InfoEffect)3 TargetPlayer (mage.target.TargetPlayer)3 CardInfo (mage.cards.repository.CardInfo)2 MomirEmblem (mage.game.command.emblems.MomirEmblem)2 TargetPermanent (mage.target.TargetPermanent)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Objects (java.util.Objects)1 EntersBattlefieldTriggeredAbility (mage.abilities.common.EntersBattlefieldTriggeredAbility)1 Cost (mage.abilities.costs.Cost)1 RemoveAllCountersSourceCost (mage.abilities.costs.common.RemoveAllCountersSourceCost)1 ManaCosts (mage.abilities.costs.mana.ManaCosts)1 ManaCostsImpl (mage.abilities.costs.mana.ManaCostsImpl)1