Examples of ExileZone


Examples of mage.game.ExileZone

    @Override
    public boolean apply(Game game, Ability source) {
        Card card = game.getCard(source.getSourceId());
        if (card != null) {
            ExileZone currentZone = game.getState().getExile().getExileZone(source.getSourceId());
            // return it only from the own exile zone
            if (currentZone.size() > 0) {
                Player owner = game.getPlayer(card.getOwnerId());
                if (owner != null && owner.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId())) {
                    return true;
                }
            }
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
      Card card = game.getCard(objectId);
      if (affectedControllerId.equals(source.getControllerId()) && card != null && game.getState().getZone(card.getId()) == Zone.EXILED) {
          ExileZone zone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
          return zone != null && zone.contains(card.getId());
      }
      return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

    public boolean apply(Game game, Ability source) {
        CardsImpl cardsInExile = new CardsImpl();
        TargetCard target = new TargetCard(Zone.PICK, new FilterCard());
        Player you = game.getPlayer(source.getControllerId());
        if (you != null) {
            ExileZone exile = game.getExile().getExileZone(exileId);
            if (exile != null) {
                LinkedList<UUID> cards = new LinkedList<UUID>(exile);
                for (UUID cardId : cards) {
                    Card card = game.getCard(cardId);
                    cardsInExile.add(card);
View Full Code Here

Examples of mage.game.ExileZone

    }

    @Override
    public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
        if (sourceId.equals(cardId)) {
            ExileZone exileZone = game.getState().getExile().getExileZone(exileId);
            return exileZone != null && exileZone.contains(cardId);
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

    }

    @Override
    public boolean apply(Game game, Ability source) {
        UUID exileId = source.getSourceId();
        ExileZone exile = game.getExile().getExileZone(exileId);
        if (exile != null) {
            exile = exile.copy();
            for (UUID cardId : exile) {
                Card card = game.getCard(cardId);
                card.putOntoBattlefield(game, Zone.EXILED, source.getSourceId(), card.getOwnerId());
            }
            game.getExile().getExileZone(exileId).clear();
View Full Code Here

Examples of mage.game.ExileZone

        return new ParallaxWaveEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ExileZone exileZone = game.getExile().getExileZone(source.getSourceId());
        if (exileZone != null) {
            for (Card card: exileZone.getCards(game)) {
                Player player = game.getPlayer(card.getOwnerId());
                if (player != null) {
                    player.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
                }
            }
            exileZone.clear();
            return true;
        }
        return false;
    }
View Full Code Here

Examples of mage.game.ExileZone

        Card card;
        Player player = game.getPlayer(source.getControllerId());
        if (player == null) {
            return false;
        }
        ExileZone exile = game.getExile().createZone(source.getSourceId(), player.getName() + " Cascade");
        Card stackCard = game.getCard(targetPointer.getFirst(game, source));
        if (stackCard == null) {
            return false;
        }
        int sourceCost = stackCard.getManaCost().convertedManaCost();
        do {
            card = player.getLibrary().removeFromTop(game);
            if (card == null) {
                break;
            }
               
            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) {
            card = exile.getRandom(game);
            exile.remove(card.getId());
            player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.EXILED, false, false);
        }

        return true;
    }
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            ExileZone exZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
            if (exZone != null) {
                for (Card card : exZone.getCards(game)) {
                    if (card != null) {
                        controller.moveCardToHandWithInfo(card, source.getSourceId(), game, Zone.EXILED);
                    }
                }
                return true;
View Full Code Here

Examples of mage.game.ExileZone

    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        Card sourceCard = game.getCard(sourceId);
        if (sourceCard != null) {
            UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
            ExileZone exile = game.getExile().getExileZone(exileId);
            if (exile != null && exile.size() > 0) {
                possibleTargets.addAll(exile);
            }
        }
        return possibleTargets;
    }
View Full Code Here

Examples of mage.game.ExileZone

    @Override
    public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
        Card sourceCard = game.getCard(sourceId);
        if (sourceCard != null) {
            UUID exileId = CardUtil.getCardExileZoneId(game, sourceId);
            ExileZone exile = game.getExile().getExileZone(exileId);
            if (exile != null && exile.size() > 0) {
                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.