[STX] Implemented Introduction to Annihilation

This commit is contained in:
Evan Kranzler 2021-03-27 08:20:26 -04:00
parent 730ac37930
commit 728b58b480
2 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,73 @@
package mage.cards.i;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetNonlandPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class IntroductionToAnnihilation extends CardImpl {
public IntroductionToAnnihilation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{5}");
this.subtype.add(SubType.LESSON);
// Exile target nonland permanent. Its controller draws a card.
this.getSpellAbility().addEffect(new IntroductionToAnnihilationEffect());
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
}
private IntroductionToAnnihilation(final IntroductionToAnnihilation card) {
super(card);
}
@Override
public IntroductionToAnnihilation copy() {
return new IntroductionToAnnihilation(this);
}
}
class IntroductionToAnnihilationEffect extends OneShotEffect {
IntroductionToAnnihilationEffect() {
super(Outcome.Benefit);
staticText = "exile target nonland permanent. Its controller draws a card";
}
private IntroductionToAnnihilationEffect(final IntroductionToAnnihilationEffect effect) {
super(effect);
}
@Override
public IntroductionToAnnihilationEffect copy() {
return new IntroductionToAnnihilationEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (controller == null || permanent == null) {
return false;
}
controller.moveCards(permanent, Zone.EXILED, source, game);
Player player = game.getPlayer(permanent.getControllerId());
if (player != null) {
player.drawCards(1, source, game);
}
return true;
}
}

View file

@ -38,6 +38,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
cards.add(new SetCardInfo("Forest", 375, Rarity.LAND, mage.cards.basiclands.Forest.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Frostboil Snarl", 265, Rarity.RARE, mage.cards.f.FrostboilSnarl.class));
cards.add(new SetCardInfo("Furycalm Snarl", 266, Rarity.RARE, mage.cards.f.FurycalmSnarl.class));
cards.add(new SetCardInfo("Introduction to Annihilation", 3, Rarity.COMMON, mage.cards.i.IntroductionToAnnihilation.class));
cards.add(new SetCardInfo("Introduction to Prophecy", 4, Rarity.COMMON, mage.cards.i.IntroductionToProphecy.class));
cards.add(new SetCardInfo("Island", 368, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Island", 369, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));