[MH2] Implemented Scour the Desert

This commit is contained in:
Evan Kranzler 2021-06-02 08:28:18 -04:00
parent 22a14f430f
commit f653ba91fc
2 changed files with 74 additions and 0 deletions

View file

@ -0,0 +1,73 @@
package mage.cards.s;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.BirdToken;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ScourTheDesert extends CardImpl {
public ScourTheDesert(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{W}{W}");
// Exile target creature card from your graveyard. Create X 1/1 white Bird creature tokens with flying, where X is the exiled card's toughness.
this.getSpellAbility().addEffect(new ScourTheDesertEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD));
}
private ScourTheDesert(final ScourTheDesert card) {
super(card);
}
@Override
public ScourTheDesert copy() {
return new ScourTheDesert(this);
}
}
class ScourTheDesertEffect extends OneShotEffect {
ScourTheDesertEffect() {
super(Outcome.Benefit);
staticText = "exile target creature card from your graveyard. " +
"Create X 1/1 white Bird creature tokens with flying, where X is the exiled card's toughness";
}
private ScourTheDesertEffect(final ScourTheDesertEffect effect) {
super(effect);
}
@Override
public ScourTheDesertEffect copy() {
return new ScourTheDesertEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
Card card = game.getCard(source.getFirstTarget());
if (player == null || card == null) {
return false;
}
int toughness = card.getToughness().getValue();
player.moveCards(card, Zone.EXILED, source, game);
if (toughness > 0) {
new BirdToken().putOntoBattlefield(toughness, game, source, source.getControllerId());
}
return true;
}
}

View file

@ -174,6 +174,7 @@ public final class ModernHorizons2 extends ExpansionSet {
cards.add(new SetCardInfo("Sanctum Weaver", 171, Rarity.RARE, mage.cards.s.SanctumWeaver.class));
cards.add(new SetCardInfo("Scalding Tarn", 254, Rarity.RARE, mage.cards.s.ScaldingTarn.class));
cards.add(new SetCardInfo("Scion of Draco", 234, Rarity.MYTHIC, mage.cards.s.ScionOfDraco.class));
cards.add(new SetCardInfo("Scour the Desert", 28, Rarity.UNCOMMON, mage.cards.s.ScourTheDesert.class));
cards.add(new SetCardInfo("Scurry Oak", 172, Rarity.UNCOMMON, mage.cards.s.ScurryOak.class));
cards.add(new SetCardInfo("Scuttletide", 61, Rarity.UNCOMMON, mage.cards.s.Scuttletide.class));
cards.add(new SetCardInfo("Sea Drake", 268, Rarity.UNCOMMON, mage.cards.s.SeaDrake.class));