Package mage.target.common

Examples of mage.target.common.TargetControlledCreaturePermanent.choose()


            Player targetPlayer = game.getPlayer(source.getFirstTarget());
            if (targetPlayer != null) {
                // Target player returns a creature he or she controls to its owner's hand,
                Target target = new TargetControlledCreaturePermanent();
                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);
                    }
                }
View Full Code Here


                // 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);
                    }
                }
View Full Code Here

                // 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);
                    }
                }
View Full Code Here

                // 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) {
                        targetPlayer.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
                    }
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.