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;
}
Aggregations