foul-magics/Mage.Sets/src/mage/cards/a/AgonizingDemise.java
Oleg Agafonov 4d362d7edc * Copy spells - improved combo support with other abilities like Kicker or Entwine (#7192):
* Now ZCC of copied spells syncs with source card or coping spell (allows to keep ability settings that depends on ZCC);
  * Fixed bug that allows to lost kicked status in copied spells after counter the original spell or moves the original card (see #7192);
  * Test framework: improved support of targeting copy or non copy spells on stack;
2020-12-15 20:06:53 +04:00

57 lines
2.1 KiB
Java

package mage.cards.a;
import mage.ObjectColor;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.dynamicvalue.common.TargetPermanentPowerCount;
import mage.abilities.effects.common.DamageTargetControllerEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author FenrisulfrX
*/
public final class AgonizingDemise extends CardImpl {
private static final FilterCreaturePermanent filterNonBlackCreature = new FilterCreaturePermanent("nonblack creature");
static {
filterNonBlackCreature.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
}
public AgonizingDemise(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{B}");
// Kicker {1}{R}
this.addAbility(new KickerAbility("{1}{R}"));
// Destroy target nonblack creature. It can't be regenerated.
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterNonBlackCreature));
// If Agonizing Demise was kicked, it deals damage equal to that creature's power to the creature's controller.
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new DamageTargetControllerEffect(TargetPermanentPowerCount.instance),
KickedCondition.instance,
"if this spell was kicked, it deals damage equal to that creature's power to the creature's controller."));
}
public AgonizingDemise(final AgonizingDemise card) {
super(card);
}
@Override
public AgonizingDemise copy() {
return new AgonizingDemise(this);
}
}