Package mage.players

Examples of mage.players.Player.chooseUse()


            Player controller = game.getPlayer(source.getControllerId());
            MageObject object = game.getObject(source.getSourceId());
            if (controller == null || object == null) {
                return false;
            }
            if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append("?").toString(), game)) {
                return false;
            }
        }
        for (Effect effect: baseEffects) {
            if (source.activate(game, false)) {
View Full Code Here


    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player player = game.getPlayer(event.getPlayerId());
        if ( player != null ) {
            ManaCostsImpl attackTax = new ManaCostsImpl("{2}");
            if ( attackTax.canPay(source, source.getSourceId(), event.getPlayerId(), game) &&
                 player.chooseUse(Outcome.Neutral, "Pay {2} to attack player?", game) )
            {
                if (attackTax.payOrRollback(source, game, source.getSourceId(), event.getPlayerId()) ) {
                    return false;
                }
            }
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player player = game.getPlayer(event.getPlayerId());
        if (player != null) {
            boolean secondCoinFlip = player.flipCoin(game, event.getAppliedEffects());
            if (player.chooseUse(outcome, "Ignore the first coin flip?", game)) {
                event.setFlag(secondCoinFlip);
                game.informPlayers(new StringBuilder(player.getName()).append(" ignores the first coin flip.").toString());
            } else {
                game.informPlayers(new StringBuilder(player.getName()).append(" ignores the second coin flip.").toString());
            }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Card card = game.getCard(getTargetPointer().getFirst(game, source));
        if (player != null && card != null) {           
            if (player.chooseUse(Outcome.PlayForFree, "Play " + card.getName() + " without paying its mana cost?", game)) {
                if (card.getCardType().contains(CardType.LAND)) {
                    // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
                    if (game.getActivePlayerId().equals(player.getId()) && player.canPlayLand()) {
                        player.playLand(card, game);
                    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            player.drawCards(3, game);
           
            boolean putOnTop = player.chooseUse(Outcome.Neutral, "Put cards on top?", game);
            putInLibrary(player, source, game, putOnTop);
            putInLibrary(player, source, game, putOnTop);
           
            return true;
        }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        Player player = game.getPlayer(source.getControllerId());
        if (permanent != null && !permanent.isTapped()
                && player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card?", game)) {
            return true;
        }
        return false;
    }
}
View Full Code Here

        FilterCard filter = new FilterCard("card named Arachnus Web");
        filter.add(new NamePredicate("Arachnus Web"));

        Card card = null;
        Zone zone = null;
        if (player.chooseUse(Outcome.Neutral, "Search your graveyard for Arachnus Web?", game)) {
            TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(filter);
            if (player.choose(Outcome.PutCardInPlay, player.getGraveyard(), target, game)) {
                card = game.getCard(target.getFirstTarget());
                if (card != null) {
                    zone = Zone.GRAVEYARD;
View Full Code Here

            sb.append("Make ").append(permanent.getName()).append(" deal 4 damage to you?");

            Set<UUID> opponents = game.getOpponents(source.getControllerId());
            for (UUID opponentUuid : opponents) {
                Player opponent = game.getPlayer(opponentUuid);
                if (opponent != null && opponent.chooseUse(Outcome.LoseLife, sb.toString(), game)) {
                    game.informPlayers(opponent.getName() + " has chosen to receive 4 damage from " + permanent.getName());
                    int dealt = opponent.damage(4, permanent.getId(), game, false, true);
                    if (dealt == 4) {
                        game.informPlayers(opponent.getName() + " was dealt 4 damage so " + permanent.getName() + " will be sacrificed.");
                        permanent.sacrifice(source.getSourceId(), game);
View Full Code Here

        TargetCardInLibrary target = new TargetCardInLibrary(filter);
        if (player == null) {
            return false;
        }
        // Library check
        if (player.chooseUse(Outcome.Benefit, "Do you want to search your library for Scion of Darkness?", game)) {
            if (player.searchLibrary(target, game)) {
                if (target.getTargets().size() > 0) {
                    for (UUID cardId : (List<UUID>) target.getTargets()) {
                        Card card = player.getLibrary().getCard(cardId, game);
                        if (card != null) {
View Full Code Here

                }
            }
            player.shuffleLibrary(game);
        }
        // Graveyard check
        if (player.chooseUse(Outcome.Benefit, "Do you want to search your graveyard for Scion of Darkness?", game)) {
            Cards graveyard = player.getGraveyard().copy();
            for (UUID card : graveyard) {
                Card checkCard = game.getCard(card);
                if (checkCard.getName().equals("Scion of Darkness")) {
                    checkCard.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
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.