Search in sources :

Example 1 with ReturnToHandChosenControlledPermanentEffect

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

the class KefnetTheMindfulEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    FilterControlledPermanent filterControlledLand = new FilterControlledPermanent("land you control");
    filterControlledLand.add(CardType.LAND.getPredicate());
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        controller.drawCards(1, source, game);
        if (controller.chooseUse(Outcome.AIDontUseIt, "Return a land you control to its owner's hand?", source, game)) {
            Effect effect = new ReturnToHandChosenControlledPermanentEffect(filterControlledLand);
            effect.apply(game, source);
        }
        return true;
    }
    return false;
}
Also used : ReturnToHandChosenControlledPermanentEffect(mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect) Player(mage.players.Player) RestrictionEffect(mage.abilities.effects.RestrictionEffect) OneShotEffect(mage.abilities.effects.OneShotEffect) Effect(mage.abilities.effects.Effect) ReturnToHandChosenControlledPermanentEffect(mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect) FilterControlledPermanent(mage.filter.common.FilterControlledPermanent)

Aggregations

Effect (mage.abilities.effects.Effect)1 OneShotEffect (mage.abilities.effects.OneShotEffect)1 RestrictionEffect (mage.abilities.effects.RestrictionEffect)1 ReturnToHandChosenControlledPermanentEffect (mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect)1 FilterControlledPermanent (mage.filter.common.FilterControlledPermanent)1 Player (mage.players.Player)1