Package mage.filter.common

Examples of mage.filter.common.FilterCreaturePermanent


    }

    @Override
    public boolean apply(Game game, Ability source) {
        int value = Integer.MIN_VALUE;
        for (Permanent permanent: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), game)) {
            if (value < permanent.getToughness().getValue()) {
                value = permanent.getToughness().getValue();
            }
        }
View Full Code Here


    public boolean apply(Game game, Ability source) {
        Permanent enchantment = game.getPermanent(source.getSourceId());
        if (enchantment != null && enchantment.getAttachedTo() != null) {
            Player player = game.getPlayer(enchantment.getAttachedTo());
            if (player != null) {
                for (Permanent perm: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) {
                    perm.addPower(-1);
                    perm.addToughness(-1);
                }
                return true;
            }
View Full Code Here

        this.color.setWhite(true);

        // Whenever you cast a noncreature spell, creatures you control get +1/+1 until end of turn. Untap those creatures.
        Effect effect = new BoostControlledEffect(1,1,Duration.EndOfTurn);
        Ability ability = new SpellCastControllerTriggeredAbility(effect, filterNonCreature, false);
        effect = new UntapAllControllerEffect(new FilterCreaturePermanent(),"Untap those creatures");
        ability.addEffect(effect);
        this.addAbility(ability);

        // Whenever you cast a noncreature spell, you may draw a card. If you do, discard a card.
        effect = new DrawDiscardControllerEffect(1,1);
View Full Code Here

        this.color.setRed(true);

        // Barrage of Boulders deals 1 damage to each creature you don't control.
        this.getSpellAbility().addEffect(new DamageAllEffect(1, filter));
        // Ferocious - If you control a creature with power 4 or greater, creatures can't block this turn
        Effect effect = new BarrageOfBouldersCantBlockAllEffect(new FilterCreaturePermanent("creatures"), Duration.EndOfTurn);
        effect.setText("<br/><br/><i>Ferocious</i> - If you control a creature with power 4 or greater, creatures can't block this turn");
        this.getSpellAbility().addEffect(effect);
    }
View Full Code Here

                        chosen.add(permanent);
                    }
                }
            }

            for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) {
                if (!chosen.contains(permanent)) {
                    permanent.destroy(source.getSourceId(), game, false);
                }
            }
            return true;
View Full Code Here

        // +1: Each player discards a card.
        this.addAbility(new LoyaltyAbility(new DiscardEachPlayerEffect(), 1));
       
        // -2: Target player sacrifices a creature.
        LoyaltyAbility ability = new LoyaltyAbility(new SacrificeEffect(new FilterCreaturePermanent(), 1, "Target player"), -2);
        ability.addTarget(new TargetPlayer());
        this.addAbility(ability);
       
        // -6: Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice.
        ability = new LoyaltyAbility(new LilianaOfTheVeilEffect(), -6);
View Full Code Here

        // Deathtouch
        this.addAbility(DeathtouchAbility.getInstance());
        // Other Minotaur creatures you control have deathtouch.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(
                DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield,
                new FilterCreaturePermanent("Minotaur","Minotaur creatures"),
                true)
        ));
    }
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
            FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
            UUID defenderId = game.getCombat().getDefenderId(sourceId);
            filter.add(new ControllerIdPredicate(defenderId));

            this.getTargets().clear();
            TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
            this.addTarget(target);
            return true;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent targetPermanent = game.getPermanent(targetPointer.getFirst(game, source));
        if (targetPermanent != null) {
            FilterCreaturePermanent filter = new FilterCreaturePermanent();
            filter.add(new NamePredicate(targetPermanent.getName()));
            List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
            for (Permanent permanent : permanents) {
                permanent.moveToExile(null, "", source.getSourceId(), game);
            }
            return true;
View Full Code Here

        this.power = new MageInt(3);
        this.toughness = new MageInt(3);

        // Sliver creatures you control get +2/+0.
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
                new BoostControlledEffect(2, 0, Duration.WhileOnBattlefield, new FilterCreaturePermanent("Sliver","Sliver creatures"))));
       
    }
View Full Code Here

TOP

Related Classes of mage.filter.common.FilterCreaturePermanent

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.