targetPlayer.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
}
}
// then repeats this process for an artifact,
FilterControlledPermanent filter = new FilterControlledPermanent("artifact you control");
filter.add(new CardTypePredicate(CardType.ARTIFACT));
target = new TargetControlledPermanent(filter);
target.setNotTarget(true);
if (target.choose(Outcome.ReturnToHand, targetPlayer.getId(), source.getSourceId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {
targetPlayer.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
}
}
// an enchantment,
filter = new FilterControlledPermanent("enchantment you control");
filter.add(new CardTypePredicate(CardType.ENCHANTMENT));
target = new TargetControlledPermanent(filter);
target.setNotTarget(true);
if (target.choose(Outcome.ReturnToHand, targetPlayer.getId(), source.getSourceId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {
targetPlayer.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
}
}
// and a land.
filter = new FilterControlledPermanent("land you control");
filter.add(new CardTypePredicate(CardType.LAND));
target = new TargetControlledPermanent(filter);
target.setNotTarget(true);
if (target.choose(Outcome.ReturnToHand, targetPlayer.getId(), source.getSourceId(), game)) {
Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) {