Package mage.filter

Examples of mage.filter.FilterObject


public class PreventNextDamageFromChosenSourceToYouEffect extends PreventionEffectImpl {

    private final TargetSource targetSource;
   
    public PreventNextDamageFromChosenSourceToYouEffect(Duration duration) {
        this(duration, new FilterObject("source"));
    }
View Full Code Here


public class TargetSource extends TargetObject {

    protected FilterObject filter;

    public TargetSource() {
        this(1, 1, new FilterObject("source of your choice"));
    }
View Full Code Here

            colorPredicates.add(new ColorPredicate(ObjectColor.RED));
        }
        if (color.isWhite()) {
            colorPredicates.add(new ColorPredicate(ObjectColor.WHITE));
        }
        Filter protectionFilter = new FilterObject("the colors of permanents you control");
        protectionFilter.add(Predicates.or(colorPredicates));
        this.filter = protectionFilter;
        return super.canTarget(source, game);
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        String cardName = (String) game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY);
        if (controller != null && cardName != null && !cardName.isEmpty()) {           
            FilterObject filter = new FilterObject("the name [" + cardName + "]");
            filter.add(new NamePredicate(cardName));           
            ContinuousEffect effect = new GainAbilityControllerEffect(new ProtectionAbility(filter), Duration.Custom);
            game.addEffect(effect, source);
            return true;
        }
        return false;
View Full Code Here

TOP

Related Classes of mage.filter.FilterObject

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.