Search in sources :

Example 11 with Predicate

use of mage.filter.predicate.Predicate in project mage by magefree.

the class MasterOfTheVeilEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Predicate pred = new PermanentIdPredicate(UUID.randomUUID());
    for (Target target : source.getTargets()) {
        for (UUID targetId : target.getTargets()) {
            pred = Predicates.or(pred, new PermanentIdPredicate(targetId));
        }
    }
    FilterCreaturePermanent filter = new FilterCreaturePermanent();
    filter.add(pred);
    game.addEffect(new BecomesFaceDownCreatureAllEffect(filter), source);
    return true;
}
Also used : PermanentIdPredicate(mage.filter.predicate.permanent.PermanentIdPredicate) Target(mage.target.Target) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) BecomesFaceDownCreatureAllEffect(mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect) UUID(java.util.UUID) PermanentIdPredicate(mage.filter.predicate.permanent.PermanentIdPredicate) Predicate(mage.filter.predicate.Predicate) AbilityPredicate(mage.filter.predicate.mageobject.AbilityPredicate)

Example 12 with Predicate

use of mage.filter.predicate.Predicate in project mage by magefree.

the class WeaverOfLiesEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Predicate pred = new PermanentIdPredicate(UUID.randomUUID());
    for (Target target : source.getTargets()) {
        for (UUID targetId : target.getTargets()) {
            pred = Predicates.or(pred, new PermanentIdPredicate(targetId));
        }
    }
    FilterCreaturePermanent filter = new FilterCreaturePermanent();
    filter.add(pred);
    game.addEffect(new BecomesFaceDownCreatureAllEffect(filter), source);
    return true;
}
Also used : PermanentIdPredicate(mage.filter.predicate.permanent.PermanentIdPredicate) Target(mage.target.Target) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) BecomesFaceDownCreatureAllEffect(mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect) UUID(java.util.UUID) PermanentIdPredicate(mage.filter.predicate.permanent.PermanentIdPredicate) Predicate(mage.filter.predicate.Predicate) AbilityPredicate(mage.filter.predicate.mageobject.AbilityPredicate) AnotherPredicate(mage.filter.predicate.mageobject.AnotherPredicate)

Example 13 with Predicate

use of mage.filter.predicate.Predicate in project mage by magefree.

the class BackslideEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Predicate pred = new PermanentIdPredicate(UUID.randomUUID());
    for (Target target : source.getTargets()) {
        for (UUID targetId : target.getTargets()) {
            pred = Predicates.or(pred, new PermanentIdPredicate(targetId));
        }
    }
    FilterCreaturePermanent filter = new FilterCreaturePermanent();
    filter.add(pred);
    game.addEffect(new BecomesFaceDownCreatureAllEffect(filter), source);
    return true;
}
Also used : PermanentIdPredicate(mage.filter.predicate.permanent.PermanentIdPredicate) Target(mage.target.Target) FilterCreaturePermanent(mage.filter.common.FilterCreaturePermanent) BecomesFaceDownCreatureAllEffect(mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect) UUID(java.util.UUID) PermanentIdPredicate(mage.filter.predicate.permanent.PermanentIdPredicate) Predicate(mage.filter.predicate.Predicate) AbilityPredicate(mage.filter.predicate.mageobject.AbilityPredicate)

Aggregations

Predicate (mage.filter.predicate.Predicate)13 UUID (java.util.UUID)5 FilterCard (mage.filter.FilterCard)5 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)5 PermanentIdPredicate (mage.filter.predicate.permanent.PermanentIdPredicate)5 Player (mage.players.Player)5 Target (mage.target.Target)5 ArrayList (java.util.ArrayList)4 AbilityPredicate (mage.filter.predicate.mageobject.AbilityPredicate)4 BecomesFaceDownCreatureAllEffect (mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect)3 CardIdPredicate (mage.filter.predicate.mageobject.CardIdPredicate)3 Permanent (mage.game.permanent.Permanent)3 MageObject (mage.MageObject)2 Ability (mage.abilities.Ability)2 FilterPermanent (mage.filter.FilterPermanent)2 FilterCreatureCard (mage.filter.common.FilterCreatureCard)2 ColorPredicate (mage.filter.predicate.mageobject.ColorPredicate)2 TargetCardInHand (mage.target.common.TargetCardInHand)2 ApprovingObject (mage.ApprovingObject)1 MageItem (mage.MageItem)1