Search in sources :

Example 1 with BecomesFaceDownCreatureAllEffect

use of mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect 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 2 with BecomesFaceDownCreatureAllEffect

use of mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect 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 3 with BecomesFaceDownCreatureAllEffect

use of mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect 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

UUID (java.util.UUID)3 BecomesFaceDownCreatureAllEffect (mage.abilities.effects.common.continuous.BecomesFaceDownCreatureAllEffect)3 FilterCreaturePermanent (mage.filter.common.FilterCreaturePermanent)3 Predicate (mage.filter.predicate.Predicate)3 AbilityPredicate (mage.filter.predicate.mageobject.AbilityPredicate)3 PermanentIdPredicate (mage.filter.predicate.permanent.PermanentIdPredicate)3 Target (mage.target.Target)3 AnotherPredicate (mage.filter.predicate.mageobject.AnotherPredicate)1