[DMU] Implemented Tear Asunder

This commit is contained in:
Evan Kranzler 2022-08-27 10:26:13 -04:00
parent d951cdbecc
commit 5d3b9a551b
2 changed files with 57 additions and 0 deletions

View file

@ -0,0 +1,56 @@
package mage.cards.t;
import mage.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.target.TargetPermanent;
import mage.target.common.TargetNonlandPermanent;
import mage.target.targetadjustment.TargetAdjuster;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class TearAsunder extends CardImpl {
public TearAsunder(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{G}");
// Kicker {1}{B}
this.addAbility(new KickerAbility("{1}{B}"));
// Exile target artifact or enchantment. If this spell was kicked, exile target nonland permanent instead.
this.getSpellAbility().addEffect(new ExileTargetEffect());
this.getSpellAbility().setTargetAdjuster(TearAsunderAdjuster.instance);
}
private TearAsunder(final TearAsunder card) {
super(card);
}
@Override
public TearAsunder copy() {
return new TearAsunder(this);
}
}
enum TearAsunderAdjuster implements TargetAdjuster {
instance;
@Override
public void adjustTargets(Ability ability, Game game) {
ability.getTargets().clear();
if (KickedCondition.ONCE.apply(game, ability)) {
ability.addTarget(new TargetNonlandPermanent());
} else {
ability.addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
}
}
}

View file

@ -183,6 +183,7 @@ public final class DominariaUnited extends ExpansionSet {
cards.add(new SetCardInfo("Talas Lookout", 68, Rarity.COMMON, mage.cards.t.TalasLookout.class));
cards.add(new SetCardInfo("Tangled Islet", 258, Rarity.COMMON, mage.cards.t.TangledIslet.class));
cards.add(new SetCardInfo("Tattered Apparition", 111, Rarity.COMMON, mage.cards.t.TatteredApparition.class));
cards.add(new SetCardInfo("Tear Asunder", 183, Rarity.UNCOMMON, mage.cards.t.TearAsunder.class));
cards.add(new SetCardInfo("Temporal Firestorm", 147, Rarity.RARE, mage.cards.t.TemporalFirestorm.class));
cards.add(new SetCardInfo("Territorial Maro", 184, Rarity.UNCOMMON, mage.cards.t.TerritorialMaro.class));
cards.add(new SetCardInfo("The Raven Man", 103, Rarity.RARE, mage.cards.t.TheRavenMan.class));