Package mage.players

Examples of mage.players.Player.cast()


                TargetCardInExile target = new TargetCardInExile(new FilterInstantOrSorceryCard(), CardUtil.getCardExileZoneId(game, source));
                if (controller.choose(Outcome.PlayForFree, game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source)), target, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        game.getExile().removeCard(card, game);
                        return controller.cast(card.getSpellAbility(), game, true);
                    }
                }
            }
            return true;
        }
View Full Code Here


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

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

        while (exile.size() > 0) {
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        for (Target target: source.getTargets()) {
            if (target instanceof TargetCardInOpponentsGraveyard) {
                Card targetCard = game.getCard(target.getFirstTarget());
                if (player != null && targetCard != null) {
                    player.cast(targetCard.getSpellAbility(), game, true);
                    game.addEffect(new DiluvianPrimordialReplacementEffect(targetCard.getId()), source);
                }
            }
        }
        return true;
View Full Code Here

                    } else {
                        cancel = true;
                    }
                }
                if (cardToCast != null) {
                    controller.cast(cardToCast.getSpellAbility(), game, true);
                }
            }
            return true;
        }
        return false;
View Full Code Here

                TargetCardInLibrary target = new TargetCardInLibrary(filter);
                if (you.searchLibrary(target, game, you.getId())) {
                    UUID targetId = target.getFirstTarget();
                    Card card = you.getLibrary().remove(targetId, game);
                    if (card != null) {
                        you.cast(card.getSpellAbility(), game, true);
                    }
                }
            }
            you.shuffleLibrary(game);
            return true;
View Full Code Here

            if (cardsInHand.size() > 0) {
                TargetCard target = new TargetCard(1, Zone.PICK, new FilterNonlandCard());
                if (controller.chooseTarget(outcome, cardsInHand, target, source, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        controller.cast(card.getSpellAbility(), game, true);
                    }
                }

            }
            return true;
View Full Code Here

                    && controller.chooseUse(Outcome.PlayForFree, "Cast cards exiled with Epic Experiment without paying its mana cost?", game)) {
                TargetCardInExile target = new TargetCardInExile(filter, source.getSourceId());
                while (epicExperimentExileZone.count(filter, game) > 0 && controller.choose(Outcome.PlayForFree, epicExperimentExileZone, target, game)) {
                        Card card = game.getCard(target.getFirstTarget());
                        if (card != null) {                           
                            if (controller.cast(card.getSpellAbility(), game, true))
                            {
                                game.getExile().removeCard(card, game);
                            }
                        }
                        target.clearChosen();
View Full Code Here

                filter.add(Predicates.or(types));
                TargetCardInHand target = new TargetCardInHand(filter);
                if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
                    Card card = player.getHand().get(target.getFirstTarget(), game);
                    if (card != null) {
                        player.cast(card.getSpellAbility(), game, true);
                    }
                }
            }
            return true;
        }
View Full Code Here

                    && cardsInHand.getCards(new FilterNonlandCard(), game).size() > 0) {
                TargetCard target = new TargetCard(1, Zone.PICK, new FilterNonlandCard());
                if (you.chooseTarget(Outcome.PlayForFree, cardsInHand, target, source, game)) {
                    Card card = game.getCard(target.getFirstTarget());
                    if (card != null) {
                        you.cast(card.getSpellAbility(), game, true);
                    }
                }
            }
            return true;
        }
View Full Code Here

            if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) {
                StringBuilder message = new StringBuilder("Cast ").append(card.getName()).append(" without paying its mana cost?");
                if (controller.chooseUse(Outcome.PlayForFree, message.toString(), game)) {
                    controller.getLibrary().removeFromTop(game);
                    controller.cast(card.getSpellAbility(), game, true);
                }
            }
            return true;
        }
        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.