Search in sources :

Example 1 with SearchLibraryPutInPlayTargetPlayerEffect

use of mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect in project mage by magefree.

the class OathOfLiegesPredicate method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player activePlayer = game.getPlayer(game.getActivePlayerId());
    if (activePlayer != null) {
        if (activePlayer.chooseUse(outcome, "Search your library for a basic land card, put that card onto the battlefield, then shuffle?", source, game)) {
            Effect effect = new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), false, false, Outcome.PutLandInPlay, true);
            effect.setTargetPointer(new FixedTarget(game.getActivePlayerId()));
            return effect.apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : FixedTarget(mage.target.targetpointer.FixedTarget) TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) FilterPlayer(mage.filter.FilterPlayer) ObjectSourcePlayer(mage.filter.predicate.ObjectSourcePlayer) SearchLibraryPutInPlayTargetPlayerEffect(mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect) OneShotEffect(mage.abilities.effects.OneShotEffect) SearchLibraryPutInPlayTargetPlayerEffect(mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect) Effect(mage.abilities.effects.Effect) TargetCardInLibrary(mage.target.common.TargetCardInLibrary)

Aggregations

Effect (mage.abilities.effects.Effect)1 OneShotEffect (mage.abilities.effects.OneShotEffect)1 SearchLibraryPutInPlayTargetPlayerEffect (mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect)1 FilterPlayer (mage.filter.FilterPlayer)1 ObjectSourcePlayer (mage.filter.predicate.ObjectSourcePlayer)1 Player (mage.players.Player)1 TargetPlayer (mage.target.TargetPlayer)1 TargetCardInLibrary (mage.target.common.TargetCardInLibrary)1 FixedTarget (mage.target.targetpointer.FixedTarget)1