Package mage.players

Examples of mage.players.Player.chooseUse()


                    return true;
                }
            }
        }
        // Hand check
        if (player.chooseUse(Outcome.Benefit, "Do you want to search your hand for Scion of Darkness?", game)) {
            Cards hand = player.getHand().copy();
            for (UUID card : hand) {
                Card checkCard = game.getCard(card);
                if (checkCard.getName().equals("Scion of Darkness")) {
                    checkCard.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId());
View Full Code Here


        if (ability != null && controller != null && sourcePermanent != null) {
            Ability newAbility = ability.copy();
            newAbility.newId();
            game.getStack().push(new StackAbility(newAbility, source.getControllerId()));
            if (newAbility.getTargets().size() > 0) {
                if (controller.chooseUse(newAbility.getEffects().get(0).getOutcome(), "Choose new targets?", game)) {
                    newAbility.getTargets().clearChosen();
                    if (newAbility.getTargets().chooseTargets(newAbility.getEffects().get(0).getOutcome(), source.getControllerId(), newAbility, game) == false) {
                        return false;
                    }
                }
View Full Code Here

                cards.add(card);
                game.setZone(card.getId(), Zone.PICK);
            }
        }
        player.lookAtCards("Petals of Insight", cards, game);
        if (player.chooseUse(outcome, "Put the cards on the bottom of your library in any order?", game)) {
            TargetCard target = new TargetCard(Zone.PICK, new FilterCard("card to put on the bottom of your library"));
            while (player.isInGame() && cards.size() > 1) {
                player.choose(Outcome.Neutral, cards, target, game);
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
View Full Code Here

                    for (UUID cardId :target.getTargets()) {
                        Card card = cards.get(cardId, game);
                        if (card != null) {
                            if (controller.canPayLifeCost()
                                    && controller.getLife() >= 4
                                    && controller.chooseUse(outcome, new StringBuilder("Pay 4 life for ").append(card.getName()).append("? (Otherwise it's put on top of your library)").toString(), game)) {
                                controller.loseLife(4, game);
                                game.informPlayers(new StringBuilder(controller.getName()).append(" pays 4 life to keep a card on hand").toString());
                            } else {
                                cardsPutBack.add(card);
                            }
View Full Code Here

        if (permanent != null && player != null) {
            int toRemove = source.getManaCostsToPay().getX();
            int removed = 0;
            String[] counterNames = permanent.getCounters().keySet().toArray(new String[0]);
            for (String counterName : counterNames) {
                if (player.chooseUse(Outcome.Neutral, "Do you want to remove " + counterName + " counters?", game)) {
                    if (permanent.getCounters().get(counterName).getCount() == 1 || toRemove == 1) {
                        permanent.getCounters().removeCounter(counterName, 1);
                    }
                    else {
                        int amount = player.getAmount(1, Math.min(permanent.getCounters().get(counterName).getCount(), toRemove - removed), "How many?", game);
View Full Code Here

                int lifePaid = 0;
                int playerLife = player.getLife();
                for (Permanent creature : creatures) {
                    String message = "Pay " + amount + " life? If you don't, " + creature.getName() + " will be sacrificed.";
                    if (playerLife - amount - lifePaid >= 0 && player != null && player.chooseUse(Outcome.Neutral, message, game)) {
                        game.informPlayers(player.getName() + " pays " + amount + " life. He will not sacrifice " + creature.getName());
                        lifePaid += amount;
                    } else {
                        game.informPlayers(player.getName() + " will sacrifice " + creature.getName());
                        sacrifices.add(creature);
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        ManaCosts cost = new ManaCostsImpl("{X}{R}");
        if (player != null) {
            if (player.chooseUse(Outcome.Damage, "Pay " + cost.getText() + "? If you do, Flameblast Dragon deals X damage to target creature or player", game)) {
                int costX = player.announceXMana(0, Integer.MAX_VALUE, "Announce the value for {X}", game, source);
                cost.add(new GenericManaCost(costX));
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    Permanent permanent = game.getPermanent(source.getFirstTarget());
                    if (permanent != null) {
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(targetPointer.getFirst(game, source));
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        Player player = game.getPlayer(source.getControllerId());
        if (p != null && player != null && sourcePermanent != null) {
            if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + "?", game)) {
                sourcePermanent.addAttachment(p.getId(), game);
            }
            return true;
        }
        return false;
View Full Code Here

            if (player != null) {
                for (UUID targetId : source.getTargets().get(0).getTargets()) {
                    Permanent permanent = game.getPermanent(targetId);
                    if (permanent != null) {
                        if (permanent.isTapped()) {
                            if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), game)) {                               
                                permanent.untap(game);
                            }
                        } else {
                            if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), game)) {
                                permanent.tap(game);
View Full Code Here

                        if (permanent.isTapped()) {
                            if (player.chooseUse(Outcome.Untap, new StringBuilder("Untap ").append(permanent.getName()).append("?").toString(), game)) {                               
                                permanent.untap(game);
                            }
                        } else {
                            if (player.chooseUse(Outcome.Tap, new StringBuilder("Tap ").append(permanent.getName()).append("?").toString(), game)) {
                                permanent.tap(game);
                            }
                        }
                    }
                }
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.