Package mage.players

Examples of mage.players.Player.chooseTarget()


        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Target target = new TargetCardInHand(new FilterArtifactCard("an Equipment card from your hand"));
            if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && controller.chooseUse(outcome, "Put an Equipment from your hand to battlefield?", game)
                    && controller.chooseTarget(outcome, target, source, game)) {
                Card card = game.getCard(target.getFirstTarget());
                if (card != null) {
                     controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                }
            }
View Full Code Here


        if (controller != null) {
            if (controller.getHand().count(filter, game) > 0) {
                if (controller.chooseUse(Outcome.PutCreatureInPlay,
                        "Put a green creature card onto the battlefield?", game)) {
                    Target target = new TargetCardInHand(filter);
                    if (controller.chooseTarget(outcome, target, source, game)) {
                        Card card = game.getCard(target.getFirstTarget());
                        if (card != null) {
                            controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                        }
                    }
View Full Code Here

        FilterCard filter = new FilterCard("creature in that player's graveyard");
        filter.add(new CardTypePredicate(CardType.CREATURE));
        filter.add(new OwnerIdPredicate(damagedPlayer.getId()));
        TargetCardInGraveyard target = new TargetCardInGraveyard(filter);
        if (target.canChoose(source.getSourceId(), you.getId(), game)) {
            if (you.chooseTarget(Outcome.PutCreatureInPlay, target, source, game)) {
                Card card = game.getCard(target.getFirstTarget());
                if (card != null) {
                    card.putOntoBattlefield(game, Zone.GRAVEYARD, id, you.getId());
                    return true;
                }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        TargetOpponent target = new TargetOpponent();
        Player you = game.getPlayer(source.getControllerId());
        if (target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
            you.chooseTarget(Outcome.DrawCard, target, source, game);
            Player opponent = game.getPlayer(target.getFirstTarget());
            if (opponent != null) {
                you.drawCards(opponent.getHand().size(), game);
                return true;
            }
View Full Code Here

            target4.setNotTarget(false);
            target5.setNotTarget(false);

            if (target1.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target1.isChosen() && target1.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target1, source, game);
                }
                Permanent artifact = game.getPermanent(target1.getFirstTarget());
                if (artifact != null) {
                    chosen.add(artifact.getId());
                }
View Full Code Here

                target1.clearChosen();
            }

            if (target2.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target2.isChosen() && target2.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target2, source, game);
                }
                Permanent creature = game.getPermanent(target2.getFirstTarget());
                if (creature != null) {
                    chosen.add(creature.getId());
                }
View Full Code Here

                target2.clearChosen();
            }

            if (target3.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target3.isChosen() && target3.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target3, source, game);
                }
                Permanent enchantment = game.getPermanent(target3.getFirstTarget());
                if (enchantment != null) {
                    chosen.add(enchantment.getId());
                }
View Full Code Here

                target3.clearChosen();
            }

            if (target4.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target4.isChosen() && target4.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target4, source, game);
                }
                Permanent land = game.getPermanent(target4.getFirstTarget());
                if (land != null) {
                    chosen.add(land.getId());
                }
View Full Code Here

                target4.clearChosen();
            }

            if (target5.canChoose(player.getId(), game)) {
                while (player.isInGame() && !target5.isChosen() && target5.canChoose(player.getId(), game)) {
                    player.chooseTarget(Outcome.Benefit, target5, source, game);
                }
                Permanent planeswalker = game.getPermanent(target5.getFirstTarget());
                if (planeswalker != null) {
                    chosen.add(planeswalker.getId());
                }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            TargetCardInHand target = new TargetCardInHand();
            player.chooseTarget(Outcome.ReturnToHand, target, source, game);
            Card card = player.getHand().get(target.getFirstTarget(), game);
            if (card != null) {
                player.getHand().remove(card);
                card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
            }
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.