Package mage.players

Examples of mage.players.Player.chooseUse()


            Cards cards = new CardsImpl();
            cards.add(card);
            player.lookAtCards("Explorer's Scope", cards, game);
            if (card.getCardType().contains(CardType.LAND)) {
                String message = "Put " + card.getName() + " onto the battlefield tapped?";
                if (player.chooseUse(Outcome.PutLandInPlay, message, game)) {
                    if (card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), source.getControllerId())) {
                        Permanent permanent = game.getPermanent(card.getId());
                        if (permanent != null) {
                            permanent.setTapped(true);
                        }
View Full Code Here


                    Player controller = game.getPlayer(ability.getControllerId());
                    if (controller != null) {
                        Cards cards = new CardsImpl();
                        cards.add(card);
                        controller.lookAtCards("Miracle", cards, game);
                        if (controller.chooseUse(Outcome.Benefit, "Reveal card to be able to use Miracle?", game)) {
                            controller.revealCards("Miracle", cards, game);
                            game.fireEvent(GameEvent.getEvent(GameEvent.EventType.MIRACLE_CARD_REVEALED, card.getId(), card.getId(),controller.getId()));
                            break;
                        }
                    }
View Full Code Here

            }
            player.moveCardToExileWithInfo(card, exile.getId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY);
        } while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost);

        if (card != null) {
            if (player.chooseUse(outcome, "Use cascade effect on " + card.getName() + "?", game)) {
                if(player.cast(card.getSpellAbility(), game, true)){
                    exile.remove(card.getId());
                }
            }
        }
View Full Code Here

            Player player = game.getPlayer(controllerId);
            if (player != null) {
                this.resetEvoke();
                for (AlternativeCost2 evokeCost: evokeCosts) {
                    if (evokeCost.canPay(ability, sourceId, controllerId, game) &&
                        player.chooseUse(Outcome.Benefit, new StringBuilder(EVOKE_KEYWORD).append(" the creature for ").append(evokeCost.getText(true)).append(" ?").toString(), game)) {
                        activateEvoke(evokeCost, game);
                        ability.getManaCostsToPay().clear();
                        ability.getCosts().clear();
                        for (Iterator it = ((Costs) evokeCost).iterator(); it.hasNext();) {
                            Cost cost = (Cost) it.next();
View Full Code Here

            if (chooseUseText != null) {
                message = chooseUseText;
                message = CardUtil.replaceSourceName(message, mageObject.getLogName());
            }
           
            if (chooseUseText == null || player.chooseUse(executingEffect.getOutcome(), message, game)) {
                if (ClashEffect.getInstance().apply(game, source)) {
                    if (setTargetPointerToClashedOpponent) {
                        Object opponent = getValue("clashOpponent");
                        if (opponent instanceof Player) {
                            executingEffect.setTargetPointer(new FixedTarget(((Player)opponent).getId()));
View Full Code Here

                }
            }
            Player player = game.getPlayer(ability.getControllerId());
            if (player != null) {
                if (alternateCosts.canPay(ability, ability.getSourceId(), ability.getControllerId(), game) &&
                        player.chooseUse(Outcome.Detriment, alternateCosts.isEmpty() ? "Cast without paying its mana cost?":"Pay alternative costs? (" + alternateCosts.getText() +")", game)) {
                    ability.getManaCostsToPay().clear();
                    if(!onlyMana) {
                        ability.getCosts().clear();
                    }
                    for (Cost cost : alternateCosts) {
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent creature = game.getPermanent(event.getTargetId());
        Player controller = game.getPlayer(source.getControllerId());
        if (creature != null && controller != null) {
            if (controller.chooseUse(outcome, "Unleash "+ creature.getName() +"?", game)) {
                game.informPlayers(controller.getName() + " unleashes " + creature.getName());
                creature.addCounters(CounterType.P1P1.createInstance(), game);
            }
        }
        return false;
View Full Code Here

                StringBuilder sb  = new StringBuilder();
                if (firstCost instanceof ManaCost) {
                    sb.append("Pay ");
                }
                sb.append(firstCost.getText()).append("?");
                if (controller.chooseUse(Outcome.Detriment, sb.toString(), game)) {
                    selectedCost = firstCost;
                } else {
                    selectedCost = secondCost;
                }
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (player != null && permanent != null) {
            if (player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() /* + " or sacrifice " + permanent.getName() */ + "?", game)) {
                cost.clearPaid();
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    return true;
                                }
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        boolean result = false;
        if (optional) {
            Player controller = game.getPlayer(source.getControllerId());
            if (controller == null || !controller.chooseUse(Outcome.PutCreatureInPlay,
                    new StringBuilder("Put ")
                    .append(source.getTargets() != null ? source.getTargets().get(0).getTargetName() : "target")
                    .append(" onto the battlefield?").toString(), game)) {
                return false;
            }
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.