Package mage.watchers.common

Examples of mage.watchers.common.CardsPutIntoGraveyardWatcher


        this.color.setBlack(true);

        // If an opponent had three or more cards put into his or her graveyard from anywhere this turn, you may pay {0} rather than pay Ravenous Trap's mana cost.
        this.getSpellAbility().addAlternativeCost(
                new RavenousTrapAlternativeCost());
        this.addWatcher(new CardsPutIntoGraveyardWatcher());

        // Exile all cards from target player's graveyard.
        this.getSpellAbility().addEffect(new ExileGraveyardAllTargetPlayerEffect());
        this.getSpellAbility().addTarget(new TargetPlayer());
    }
View Full Code Here


        return new RavenousTrapAlternativeCost(this);
    }

    @Override
    public boolean isAvailable(Game game, Ability source) {
        CardsPutIntoGraveyardWatcher watcher = (CardsPutIntoGraveyardWatcher) game.getState().getWatchers().get("CardsPutIntoGraveyardWatcher");
        if (watcher != null) {
            for (UUID opponentId: game.getOpponents(source.getControllerId())) {
                if (watcher.getAmountCardsPutToGraveyard(opponentId) > 2) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

        // Choose target creature card in a graveyard that was put there from the battlefield this turn. Put that card onto the battlefield under your control.
        Effect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
        effect.setText("Choose target creature card in a graveyard that was put there from the battlefield this turn. Put that card onto the battlefield under your control");
        this.getSpellAbility().addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect());
        this.getSpellAbility().addTarget(new TargetCardInGraveyard(new FilterCreatureCard(textFilter)));
        this.addWatcher(new CardsPutIntoGraveyardWatcher());
    }
View Full Code Here

        return new GrimReturn(this);
    }

    @Override
    public void adjustTargets(Ability ability, Game game) {
        CardsPutIntoGraveyardWatcher watcher = (CardsPutIntoGraveyardWatcher) game.getState().getWatchers().get("CardsPutIntoGraveyardWatcher");
        if (watcher != null) {
            FilterCard filter = new FilterCreatureCard(textFilter);
            List<CardIdPredicate> uuidPredicates = new ArrayList<>();
            for (UUID uuid :watcher.getCardsPutToGraveyardFromBattlefield()) {
                uuidPredicates.add(new CardIdPredicate(uuid));
            }
            filter.add(Predicates.or(uuidPredicates));
            ability.getTargets().clear();
            ability.addTarget(new TargetCardInGraveyard(filter));
View Full Code Here

        // Vigilance
        this.addAbility(VigilanceAbility.getInstance());

        // When Twilight Shepherd enters the battlefield, return to your hand all cards in your graveyard that were put there from the battlefield this turn.
        this.addWatcher(new CardsPutIntoGraveyardWatcher());
        this.addAbility(new EntersBattlefieldTriggeredAbility(new TwilightShepherdEffect(), false));

        // Persist
        this.addAbility(new PersistAbility());
    }
View Full Code Here

        return new TwilightShepherdEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        CardsPutIntoGraveyardWatcher watcher = (CardsPutIntoGraveyardWatcher) game.getState().getWatchers().get("CardsPutIntoGraveyardWatcher");
        if (watcher != null) {
            Set<UUID> cardsInGraveyardId = watcher.getCardsPutToGraveyardFromBattlefield();
            for (UUID cardId : cardsInGraveyardId) {
                Card card = game.getCard(cardId);
                if (card != null
                        && card.getOwnerId().equals(source.getControllerId())
                        && game.getState().getZone(card.getId()).match(Zone.GRAVEYARD)) {
View Full Code Here

TOP

Related Classes of mage.watchers.common.CardsPutIntoGraveyardWatcher

Copyright © 2018 www.massapicom. 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.