mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 15:02:13 -08:00
59 lines
2 KiB
Java
59 lines
2 KiB
Java
package mage.cards.c;
|
|
|
|
import mage.ObjectColor;
|
|
import mage.abilities.Ability;
|
|
import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
|
|
import mage.abilities.effects.common.AttachEffect;
|
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
|
import mage.abilities.keyword.EnchantAbility;
|
|
import mage.cards.CardImpl;
|
|
import mage.cards.CardSetInfo;
|
|
import mage.constants.CardType;
|
|
import mage.constants.Outcome;
|
|
import mage.constants.SubType;
|
|
import mage.filter.common.FilterCreaturePermanent;
|
|
import mage.filter.predicate.Predicates;
|
|
import mage.filter.predicate.mageobject.ColorPredicate;
|
|
import mage.target.TargetPermanent;
|
|
import mage.target.common.TargetCreaturePermanent;
|
|
|
|
import java.util.UUID;
|
|
|
|
/**
|
|
* @author TheElk801
|
|
*/
|
|
public final class ChimeOfNight extends CardImpl {
|
|
|
|
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature");
|
|
|
|
static {
|
|
filter.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
|
}
|
|
|
|
public ChimeOfNight(UUID ownerId, CardSetInfo setInfo) {
|
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
|
|
|
|
this.subtype.add(SubType.AURA);
|
|
|
|
// Enchant creature
|
|
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
|
this.getSpellAbility().addTarget(auraTarget);
|
|
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
|
|
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
|
this.addAbility(ability);
|
|
|
|
// When Chime of Night is put into a graveyard from the battlefield, destroy target nonblack creature.
|
|
ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DestroyTargetEffect());
|
|
ability.addTarget(new TargetPermanent(filter));
|
|
this.addAbility(ability);
|
|
}
|
|
|
|
public ChimeOfNight(final ChimeOfNight card) {
|
|
super(card);
|
|
}
|
|
|
|
@Override
|
|
public ChimeOfNight copy() {
|
|
return new ChimeOfNight(this);
|
|
}
|
|
}
|