use of mage.abilities.common.LandfallAbility in project mage by magefree.
the class EmeriaShepherdReturnToHandTargetEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent triggeringLand = ((LandfallAbility) source).getTriggeringPermanent();
if (controller == null || triggeringLand == null) {
return false;
}
Zone toZone = Zone.HAND;
if (triggeringLand.hasSubtype(SubType.PLAINS, game) && controller.chooseUse(Outcome.PutCardInPlay, "Put the card to battlefield instead?", source, game)) {
toZone = Zone.BATTLEFIELD;
}
return controller.moveCards(new CardsImpl(targetPointer.getTargets(game, source)), toZone, source, game);
}
Aggregations