Package mage.filter.predicate.mageobject

Examples of mage.filter.predicate.mageobject.AbilityPredicate


    public FilterCreatureForAttack(String name) {
        super(name);
        this.add(Predicates.not(new AttackingPredicate()));
        this.add(Predicates.not(new BlockingPredicate()));
        this.add(Predicates.not(new TappedPredicate()));
        this.add(Predicates.not(new AbilityPredicate(DefenderAbility.class)));
        this.add(new CanTapPredicate());
    }
View Full Code Here


    public boolean apply(Game game, Ability source) {
        UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(source.getSourceId(), game);
        if (defendingPlayerId != null) {
            FilterCreaturePermanent filter = new FilterCreaturePermanent();
            filter.add(new ControllerIdPredicate(defendingPlayerId));
            filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
            List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
            for (Permanent permanent : permanents) {
                permanent.damage(2, source.getSourceId(), game, false, true);
            }
            return true;
View Full Code Here

TOP

Related Classes of mage.filter.predicate.mageobject.AbilityPredicate

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.