Examples of chooseUse()


Examples of mage.players.Player.chooseUse()

            } else {
                if (card.getSpellAbility() != null) {
                    // The land's last ability allows you to play the removed card as part of the resolution of that ability.
                    // Timing restrictions based on the card's type are ignored (for instance, if it's a creature or sorcery).
                    // Other play restrictions are not (such as "Play [this card] only during combat").
                    if (controller.chooseUse(Outcome.Benefit, new StringBuilder("Cast ").append(card.getName()).append(" without paying it's mana cost?").toString(), game)) {
                        card.setFaceDown(false);
                        return controller.cast(card.getSpellAbility(), game, true);
                    }
                } else {
                    Logger.getLogger(HideawayPlayEffect.class).error("Non land card had no spell ability: " + card.getName());
View Full Code Here

Examples of mage.players.Player.chooseUse()

            } else {
                message = chooseUseText;
            }
            message = CardUtil.replaceSourceName(message, mageObject.getLogName());
            boolean result = true;
            if (cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(executingEffects.get(0).getOutcome(), message, game)) {
                cost.clearPaid();
                if (cost.pay(source, game, source.getSourceId(), player.getId(), false)) {
                   
                    for(Effect effect: executingEffects) {
                        effect.setTargetPointer(this.targetPointer);
View Full Code Here

Examples of mage.players.Player.chooseUse()

        if (sourceCard == null) {
            return false;
        }
        Player player = game.getPlayer(source.getControllerId());
        if (player != null && player.getLibrary().size() >= amount
                && player.chooseUse(outcome, new StringBuilder("Dredge ").append(sourceCard.getName()).
                append("? (").append(amount).append(" cards go from top of library to graveyard)").toString(), game)) {
            game.informPlayers(new StringBuilder(player.getName()).append(" dreges ").append(sourceCard.getName()).toString());
            for (int i = 0; i < amount; i++) {
                Card card = player.getLibrary().removeFromTop(game);
                if (card != null) {
View Full Code Here

Examples of mage.players.Player.chooseUse()

        Card card = game.getCard(source.getSourceId());
        Player controller = game.getPlayer(source.getControllerId());
        if (card != null && controller != null) {
            // check if the user really wants to suspend the card (only if the spell can't be casted because else the choose ability dialog appears)
            if (!card.getSpellAbility().canActivate(source.getControllerId(), game)) {
                if (!controller.chooseUse(outcome, new StringBuilder("Suspend ").append(card.getName()).append("?").toString(), game)) {
                    return false;
                }
            }
            UUID exileId = (UUID) game.getState().getValue("SuspendExileId" + source.getControllerId().toString());
            if (exileId == null) {
View Full Code Here

Examples of mage.players.Player.chooseUse()

        if (player != null && permanent != null) {
            StringBuilder sb = new StringBuilder(cost.getText()).append("?");
            if (!sb.toString().toLowerCase().startsWith("exile ") && !sb.toString().toLowerCase().startsWith("return ") ) {
                sb.insert(0, "Pay ");
            }
            if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
                cost.clearPaid();
                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false)) {
                    return true;
                }
            }
View Full Code Here

Examples of mage.players.Player.chooseUse()

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            if (!optional || player.chooseUse(outcome, "User draw, then discard effect?", game)) {
                player.drawCards(cardsToDraw, game);
                player.discard(cardsToDiscard, source, game);
            }
            return true;
        }
View Full Code Here

Examples of mage.players.Player.chooseUse()

        for (UUID playerId: state.getPlayerList(startingPlayerId)) {
            Player player = getPlayer(playerId);
            for (Card card: player.getHand().getCards(this)) {
                if (player.getHand().contains(card.getId())) {
                    if (card.getAbilities().containsKey(LeylineAbility.getInstance().getId())) {
                        if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getName() + " on the battlefield?", this)) {
                            card.putOntoBattlefield(this, Zone.HAND, null, player.getId());
                        }
                    }
                    for (Ability ability: card.getAbilities()) {
                        if (ability instanceof ChancellorAbility) {
View Full Code Here

Examples of mage.players.Player.chooseUse()

                            card.putOntoBattlefield(this, Zone.HAND, null, player.getId());
                        }
                    }
                    for (Ability ability: card.getAbilities()) {
                        if (ability instanceof ChancellorAbility) {
                            if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to reveal " + card.getName() + "?", this)) {
                                Cards cards = new CardsImpl();
                                cards.add(card);
                                player.revealCards("Revealed", cards, this);
                                ability.resolve(this);
                            }
View Full Code Here

Examples of mage.players.Player.chooseUse()

                                ability.resolve(this);
                            }
                        }
                        if (ability instanceof GemstoneCavernsAbility) {
                            if (!playerId.equals(startingPlayerId)) {
                                if (player.chooseUse(Outcome.PutCardInPlay, "Do you wish to put " + card.getName() + " into play?", this)) {
                                    Cards cards = new CardsImpl();
                                    cards.add(card);
                                    player.revealCards("Revealed", cards, this);
                                    ability.resolve(this);
                                }
View Full Code Here

Examples of mage.players.Player.chooseUse()

    public boolean apply(Game game, Ability source) {
        Permanent target = game.getPermanent(targetPointer.getFirst(game, source));
        Player player = game.getPlayer(source.getControllerId());
        if (target != null && player != null) {
            if (target.isTapped()) {
                if (player.chooseUse(Outcome.Untap, "Untap that permanent?", game)) {
                    target.untap(game);
                }
            } else {
                if (player.chooseUse(Outcome.Tap, "Tap that permanent?", game)) {
                    target.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.