forked from External/mage
57 lines
1.9 KiB
Java
57 lines
1.9 KiB
Java
package mage.cards.p;
|
|
|
|
import java.util.UUID;
|
|
|
|
import mage.abilities.common.SimpleStaticAbility;
|
|
import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect;
|
|
import mage.constants.SubType;
|
|
import mage.filter.FilterPermanent;
|
|
import mage.filter.predicate.Predicates;
|
|
import mage.target.common.TargetArtifactPermanent;
|
|
import mage.abilities.effects.common.AttachEffect;
|
|
import mage.constants.Outcome;
|
|
import mage.target.TargetPermanent;
|
|
import mage.abilities.keyword.EnchantAbility;
|
|
import mage.cards.CardImpl;
|
|
import mage.cards.CardSetInfo;
|
|
import mage.constants.CardType;
|
|
|
|
/**
|
|
* @author TheElk801
|
|
*/
|
|
public final class PlanarDisruption extends CardImpl {
|
|
|
|
private static final FilterPermanent filter = new FilterPermanent("artifact, creature, or planeswalker");
|
|
|
|
static {
|
|
filter.add(Predicates.or(
|
|
CardType.ARTIFACT.getPredicate(),
|
|
CardType.CREATURE.getPredicate(),
|
|
CardType.PLANESWALKER.getPredicate()
|
|
));
|
|
}
|
|
|
|
public PlanarDisruption(UUID ownerId, CardSetInfo setInfo) {
|
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
|
|
|
this.subtype.add(SubType.AURA);
|
|
|
|
// Enchant artifact, creature, or planeswalker
|
|
TargetPermanent auraTarget = new TargetPermanent(filter);
|
|
this.getSpellAbility().addTarget(auraTarget);
|
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
|
this.addAbility(new EnchantAbility(auraTarget));
|
|
|
|
// Enchanted permanent can't attack or block, and it's activated abilities can't be activated.
|
|
this.addAbility(new SimpleStaticAbility(new CantBlockAttackActivateAttachedEffect("permanent")));
|
|
}
|
|
|
|
private PlanarDisruption(final PlanarDisruption card) {
|
|
super(card);
|
|
}
|
|
|
|
@Override
|
|
public PlanarDisruption copy() {
|
|
return new PlanarDisruption(this);
|
|
}
|
|
}
|