Package mage.target

Examples of mage.target.TargetCard.canChoose()


                    List<CardIdPredicate> uuidPredicates = new ArrayList<>();
                    for (UUID uuid :selectedObjects) {
                        uuidPredicates.add(new CardIdPredicate(uuid));
                    }
                    filterInHand.add(Predicates.not(Predicates.or(uuidPredicates)));                   
                    if (targetInHand.canChoose(player.getId(), game) &&
                            player.choose(Outcome.Exile, player.getHand(), targetInHand, game)) {

                        Card card = player.getHand().get(targetInHand.getFirstTarget(), game);
                        if (card != null) {
                            selectedObjects.add(targetInHand.getFirstTarget());
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player.getHand().size() > 0) {
            TargetCard target = new TargetCard(Zone.HAND, filter);
            if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && player.choose(Outcome.Benefit, player.getHand(), target, game)) {
                Card card = player.getHand().get(target.getFirstTarget(), game);
                if (card != null) {
                    card.moveToExile(source.getSourceId(), "Elite Arcanist", source.getSourceId(), game);
                    Permanent permanent = game.getPermanent(source.getSourceId());
View Full Code Here

        Player controller = game.getPlayer(source.getControllerId());
        Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
        if (controller != null) {
            if (controller.getHand().size() > 0) {
                TargetCard target = new TargetCard(Zone.HAND, filter);
                if (target.canChoose(source.getSourceId(), source.getControllerId(), game)
                        && controller.choose(Outcome.Benefit, controller.getHand(), target, game)) {
                    Card card = controller.getHand().get(target.getFirstTarget(), game);
                    if (card != null) {
                        controller.moveCardToExileWithInfo(card, source.getSourceId(), sourcePermanent.getLogName() +" (Imprint)", source.getSourceId(), game, Zone.HAND);
                        Permanent permanent = game.getPermanent(source.getSourceId());
View Full Code Here

        }
        player.lookAtCards(sourcePermanent.getName(), cards, game);

        if (!cards.isEmpty()) {
            TargetCard target = new TargetCard(Zone.LIBRARY, new FilterCreatureCard("creature card to put into your hand"));
            if (target.canChoose(source.getSourceId(), player.getId(), game) && player.choose(Outcome.DrawCard, cards, target, game)) {
                Card card = cards.get(target.getFirstTarget(), game);
                if (card != null) {
                    player.revealCards(sourcePermanent.getName(), new CardsImpl(card), game);
                    cards.remove(card);
                    player.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
View Full Code Here

            FilterCard filter = new FilterCard("creature and/or land cards to put onto the battlefield");
            filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE),
                                     new CardTypePredicate(CardType.LAND)));
            TargetCard target1 = new TargetCard(0, Integer.MAX_VALUE, Zone.EXILED, filter);
            if (cards.size() > 0
                    && target1.canChoose(source.getSourceId(), source.getControllerId(), game)
                    && player.choose(Outcome.PutCardInPlay, cards, target1, game)) {
                for (UUID targetId: target1.getTargets()) {
                    Card card = cards.get(targetId, game);
                    if (card != null) {
                        player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
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.