Package mage.target

Examples of mage.target.Target.chooseTarget()


                            game.informPlayer(player, "You may only select exactly one target that must be different from the origin target!");
                        }
                        iteration++;
                        newTarget.clearChosen();
                        // TODO: Distinction between "spell controller" and "player that can change the target" - here player is used for both
                        newTarget.chooseTarget(mode.getEffects().get(0).getOutcome(), player.getId(), spellAbility, game);
                    } while (player.isInGame() && (targetId.equals(newTarget.getFirstTarget()) || newTarget.getTargets().size() != 1));
                // choose a new target
                } else {
                    // build a target definition with exactly one possible target to select that replaces old target
                    Target tempTarget = target.copy();
View Full Code Here


                    tempTarget.setMaxNumberOftargets(1);
                    boolean again;
                    do {
                        again = false;
                        tempTarget.clearChosen();
                        if (!tempTarget.chooseTarget(mode.getEffects().get(0).getOutcome(), player.getId(), spellAbility, game)) {
                            if (player.chooseUse(Outcome.Benefit, "No target object selected. Reset to original target?", game)) {
                                // use previous target no target was selected
                                newTarget.addTarget(targetId, target.getTargetAmount(targetId), spellAbility, game, false);
                            } else {
                                again = true;
View Full Code Here

                        firstInactivePlayer = currentPlayer.getId();
                    }
                    target.clearChosen();
                    if (target.canChoose(source.getSourceId(), currentPlayer.getId(), game)
                            && currentPlayer.chooseUse(outcome, "Put permanent from your hand to play?", game)) {
                        if (target.chooseTarget(outcome, currentPlayer.getId(), source, game)) {
                            Card card = game.getCard(target.getFirstTarget());
                            if (card != null) {
                                currentPlayer.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                                firstInactivePlayer = null;
                            }
View Full Code Here

            for (UUID playerId : game.getOpponents(controller.getId())) {
                Player opponent = game.getPlayer(playerId);
                Target target = new TargetCardInHand(filter);
                if (opponent != null && target.canChoose(source.getSourceId(), opponent.getId(), game)) {
                    if (opponent.chooseUse(Outcome.PutCreatureInPlay, "Put a legendary creature card from your hand onto the battlefield?", game)) {
                        if (target.chooseTarget(Outcome.PutCreatureInPlay, opponent.getId(), source, game)) {
                            Card card = game.getCard(target.getFirstTarget());
                            if (card != null) {
                                cards.add(card);
                            }
                        }
View Full Code Here

                        firstInactivePlayer = currentPlayer.getId();
                    }
                    target.clearChosen();
                    if (target.canChoose(source.getSourceId(), currentPlayer.getId(), game)
                            && currentPlayer.chooseUse(outcome, "Put card from your hand to play?", game)) {
                        if (target.chooseTarget(outcome, currentPlayer.getId(), source, game)) {
                            Card card = game.getCard(target.getFirstTarget());
                            if (card != null) {
                                currentPlayer.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId());
                                firstInactivePlayer = null;
                            }
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.