Package mage.filter.predicate.permanent

Examples of mage.filter.predicate.permanent.ControllerPredicate


        this("permanent you control");
    }

    public FilterControlledPermanent(String name) {
        super(name);
        this.add(new ControllerPredicate(TargetController.YOU));
    }
View Full Code Here


        this.toughness = new MageInt(2);

        String rule = "you may gain control of target creature for as long as you control Roil Elemental";

        FilterPermanent filter = new FilterPermanent();
        filter.add(new ControllerPredicate(TargetController.YOU));
        filter.add(new CardIdPredicate(this.getId()));

        // Flying
        this.addAbility(FlyingAbility.getInstance());
View Full Code Here

    }

    public FilterControlledCreatureInPlay(String name) {
        super(name);
        creatureFilter = new FilterCreaturePermanent();
        creatureFilter.add(new ControllerPredicate(TargetController.YOU));
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        boolean conditionApplies = false;

        FilterPermanent localFilter = filter.copy();
        localFilter.add(new ControllerPredicate(TargetController.OPPONENT));

        switch ( this.type ) {
            case FEWER_THAN:
                conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) < this.count;
                break;
View Full Code Here

        if (player == null) {
            return false;
        }

        filter.add(new ControllerPredicate(TargetController.YOU));

        int amount = count.calculate(game, source, this);
        int realCount = game.getBattlefield().countAll(filter, player.getId(), game);
        amount = Math.min(amount, realCount);
View Full Code Here

        if (doorOfDestinies != null) {
            String subtype = (String) game.getState().getValue(doorOfDestinies.getId() + "_type");
            if (subtype != null) {
                if (event.getType() == GameEvent.EventType.SPELL_CAST) {
                    FilterSpell filter = new FilterSpell();
                    filter.add(new ControllerPredicate(TargetController.YOU));
                    filter.add(new SubtypePredicate(subtype));
                    Spell spell = game.getStack().getSpell(event.getTargetId());
                    if (spell != null && filter.match(spell, controllerId, game)) {
                        return true;
                    }
View Full Code Here

        // Fumiko the Lowblood has bushido X, where X is the number of attacking creatures.
        this.addAbility(new BushidoAbility(new AttackingCreatureCount("the number of attacking creatures")));

        // Creatures your opponents control attack each turn if able.
        FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures your opponents control");
        filter.add(new ControllerPredicate(TargetController.OPPONENT));
        this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(filter)));

    }
View Full Code Here

    private Permanent firstTarget = null;
           
    public DaringThiefSecondTarget() {
        super();
        filter.add(new ControllerPredicate(TargetController.OPPONENT));
        setTargetName("permanent an opponent controls that shares a card type with it");
   }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            int islands = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
            FilterPermanent creatureFilter = new FilterCreaturePermanent();
            creatureFilter.add(new ControllerPredicate(TargetController.OPPONENT));
            creatureFilter.add(new ToughnessPredicate(Filter.ComparisonType.LessThan, islands +1));
            for (Permanent permanent: game.getBattlefield().getActivePermanents(creatureFilter, source.getControllerId(), source.getSourceId(), game)) {
                controller.moveCardToHandWithInfo(permanent, source.getSourceId(), game, Zone.BATTLEFIELD);
            }
            return true;
View Full Code Here

        this.toughness = new MageInt(3);
       
        String rule = "Gain control of target Vampire for as long as you control Olivia Voldaren";

        FilterPermanent filter2 = new FilterPermanent();
        filter2.add(new ControllerPredicate(TargetController.YOU));
        filter2.add(new CardIdPredicate(this.getId()));

        this.addAbility(FlyingAbility.getInstance());

        // {1}{R}: Olivia Voldaren deals 1 damage to another target creature. That creature becomes a Vampire in addition to its other types. Put a +1/+1 counter on Olivia Voldaren.
View Full Code Here

TOP

Related Classes of mage.filter.predicate.permanent.ControllerPredicate

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.