Examples of chooseTarget()


Examples of mage.players.Player.chooseTarget()

                Card spellToCast = game.getCard(source.getSourceId());
                Player player = game.getPlayer(source.getControllerId());
                if (player != null &&  !CardUtil.isCheckPlayableMode(affectedAbility) &&
                        player.chooseUse(Outcome.Benefit, "Offer a " + filter.getMessage() + " to cast " + spellToCast.getName() + "?", game)) {
                    Target target = new TargetControlledCreaturePermanent(1,1,filter,true);
                    player.chooseTarget(Outcome.Sacrifice, target, source, game);
                    if (!target.isChosen()) {
                        return false;
                    }
                    game.getState().setValue("offering_" + card.getId(), true);
                    Permanent offer = game.getPermanent(target.getFirstTarget());
View Full Code Here

Examples of mage.players.Player.chooseTarget()

                    if (getBattlefield().contains(filterPlaneswalker, planeswalker.getControllerId(), this, 2)) {
                        Player controller = this.getPlayer(planeswalker.getControllerId());
                        if (controller != null) {
                            Target targetPlaneswalkerToKeep = new TargetPermanent(filterPlaneswalker);
                            targetPlaneswalkerToKeep.setTargetName(new StringBuilder(planeswalker.getName()).append(" to keep?").toString());
                            controller.chooseTarget(Outcome.Benefit, targetPlaneswalkerToKeep, null, this);
                            for (Permanent dupPlaneswalker: this.getBattlefield().getActivePermanents(filterPlaneswalker, planeswalker.getControllerId(), this)) {
                                if (!targetPlaneswalkerToKeep.getTargets().contains(dupPlaneswalker.getId())) {
                                    movePermanentToGraveyardWithInfo(dupPlaneswalker);
                                }
                            }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

                if (getBattlefield().contains(filterLegendName, legend.getControllerId(), this, 2)) {
                    Player controller = this.getPlayer(legend.getControllerId());
                    if (controller != null) {
                        Target targetLegendaryToKeep = new TargetPermanent(filterLegendName);
                        targetLegendaryToKeep.setTargetName(new StringBuilder(legend.getName()).append(" to keep (Legendary Rule)?").toString());
                        controller.chooseTarget(Outcome.Benefit, targetLegendaryToKeep, null, this);
                        for (Permanent dupLegend: getBattlefield().getActivePermanents(filterLegendName, legend.getControllerId(), this)) {
                            if (!targetLegendaryToKeep.getTargets().contains(dupLegend.getId())) {
                                movePermanentToGraveyardWithInfo(dupLegend);
                            }
                        }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

            declareAttacker(creatureId, defenders.iterator().next(), game);
            return true;
        } else {
            TargetDefender target = new TargetDefender(defenders, creatureId);
            target.setRequired(true);
            player.chooseTarget(Outcome.Damage, target, null, game);
            if (target.getFirstTarget() != null) {
                declareAttacker(creatureId, target.getFirstTarget(), game);
                return true;
            }
        }
View Full Code Here

Examples of mage.players.Player.chooseTarget()

    @Override
    public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) {
        Player controller = game.getPlayer(controllerId);
        if (controller != null) {
            TargetPlayer target = new TargetPlayer(1, 1, true, filter);
            if (controller.chooseTarget(Outcome.Detriment, target, ability, game)) {
                Player opponent = game.getPlayer(target.getFirstTarget());
                if (opponent != null) {
                    opponent.gainLife(amount, game);
                    paid = true;
View Full Code Here

Examples of mage.players.Player.chooseTarget()

        target.setTargetName("cards to delve from your graveyard");
        if (!target.canChoose(sourceId, controllerId, game)) {
            return;
        }
        if (!CardUtil.isCheckPlayableMode(ability) && player.chooseUse(Outcome.Detriment, "Delve cards from your graveyard?", game)) {
            player.chooseTarget(Outcome.Detriment, target, ability, game);
            if (target.getTargets().size() > 0) {
                int adjCost = 0;
                for (UUID cardId: target.getTargets()) {
                    Card card = game.getCard(cardId);
                    if (card == null) {
View Full Code Here

Examples of mage.players.Player.chooseTarget()

        Player controller = game.getPlayer(source.getControllerId());
        TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent();
        if (controller != null) {
            if (target.canChoose(source.getControllerId(), game)
                && controller.chooseUse(outcome, "Cipher this spell to a creature?", game)) {
                controller.chooseTarget(outcome, target, source, game);
                Card sourceCard = game.getCard(source.getSourceId());
                Permanent targetCreature = game.getPermanent(target.getFirstTarget());
                if (targetCreature != null && sourceCard != null) {
                    String ruleText = new StringBuilder("you may cast a copy of ").append(sourceCard.getLogName()).append(" without paying its mana cost").toString();
                    Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new CipherStoreEffect(source.getSourceId(), ruleText), true);
View Full Code Here

Examples of mage.players.Player.chooseTarget()

            target.setRequired(false);
            if (!target.canChoose(source.getSourceId(), source.getControllerId(), game)) {
                return false;
            }
            if (controller.chooseUse(Outcome.Detriment, "Devour creatures?", game)) {
                controller.chooseTarget(Outcome.Detriment, target, source, game);
                if (target.getTargets().size() > 0) {
                    List<ArrayList<String>> cardSubtypes = new ArrayList<>();
                    int devouredCreatures = target.getTargets().size();
                    game.informPlayers(new StringBuilder(creature.getName()).append(" devours ").append(devouredCreatures).append(" creatures").toString());
                    for (UUID targetId: target.getTargets()) {
View Full Code Here

Examples of mage.players.Player.chooseTarget()

            }
        }

        if (cards.getCards(new FilterInstantOrSorceryCard(), game).size() > 0) {
            TargetCard target = new TargetCard(Zone.EXILED, new FilterInstantOrSorceryCard());
            if (you.chooseTarget(Outcome.PlayForFree, cards, target, source, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    Card copy1 = card.copy();
                    Card copy2 = card.copy();
                    Card copy3 = card.copy();
View Full Code Here

Examples of mage.players.Player.chooseTarget()

                    for (SpliceOntoArcaneAbility ability : spliceAbilities) {
                        idPredicates.add(new CardIdPredicate((ability.getSourceId())));
                    }
                    filter.add(Predicates.or(idPredicates));
                    TargetCardInHand target = new TargetCardInHand(filter);
                    controller.chooseTarget(Outcome.Benefit, target, abilityToModify, game);
                    UUID cardId = target.getFirstTarget();
                    if (cardId != null) {
                        SpliceOntoArcaneAbility selectedAbility = null;
                        for(SpliceOntoArcaneAbility ability :spliceAbilities) {
                            if (ability.getSourceId().equals(cardId)) {
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.