Implemented Reap the Past

This commit is contained in:
Evan Kranzler 2019-05-30 10:22:15 -04:00
parent d3bedf9ba7
commit 78643b4c7d
3 changed files with 72 additions and 1 deletions

View file

@ -0,0 +1,70 @@
package mage.cards.r;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class ReapThePast extends CardImpl {
public ReapThePast(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}{G}");
// Return X cards at random from your graveyard to your hand. Exile Reap the Past.
this.getSpellAbility().addEffect(new ReapThePastEffect());
}
private ReapThePast(final ReapThePast card) {
super(card);
}
@Override
public ReapThePast copy() {
return new ReapThePast(this);
}
}
class ReapThePastEffect extends OneShotEffect {
ReapThePastEffect() {
super(Outcome.Benefit);
staticText = "Return X cards at random from your graveyard to your hand. Exile {this}.";
}
private ReapThePastEffect(final ReapThePastEffect effect) {
super(effect);
}
@Override
public ReapThePastEffect copy() {
return new ReapThePastEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
int xValue = source.getManaCostsToPay().getX();
Cards cards = new CardsImpl(player.getGraveyard());
while (cards.size() > xValue) {
cards.remove(cards.getRandom(game));
}
player.moveCards(cards, Zone.HAND, source, game);
return ExileSpellEffect.getInstance().apply(game, source);
}
}

View file

@ -133,6 +133,7 @@ public final class ModernHorizons extends ExpansionSet {
cards.add(new SetCardInfo("Pyrophobia", 141, Rarity.COMMON, mage.cards.p.Pyrophobia.class));
cards.add(new SetCardInfo("Ranger-Captain of Eos", 21, Rarity.MYTHIC, mage.cards.r.RangerCaptainOfEos.class));
cards.add(new SetCardInfo("Ravenous Giant", 143, Rarity.UNCOMMON, mage.cards.r.RavenousGiant.class));
cards.add(new SetCardInfo("Reap the Past", 211, Rarity.RARE, mage.cards.r.ReapThePast.class));
cards.add(new SetCardInfo("Rebuild", 66, Rarity.UNCOMMON, mage.cards.r.Rebuild.class));
cards.add(new SetCardInfo("Reckless Charge", 144, Rarity.COMMON, mage.cards.r.RecklessCharge.class));
cards.add(new SetCardInfo("Regrowth", 175, Rarity.UNCOMMON, mage.cards.r.Regrowth.class));

View file

@ -35249,7 +35249,7 @@ Lavabelly Sliver|Modern Horizons|207|U|{1}{R}{W}|Creature - Sliver|2|2|Sliver cr
Lightning Skelemental|Modern Horizons|208|R|{B}{R}{R}|Creature - Elemental Skeleton|6|1|Trample, haste$Whenever Lightning Skelemental deals combat damage to a player, that player discards two cards.$At the beginning of the end step, sacrifice Lightning Skelemental.|
Munitions Expert|Modern Horizons|209|U|{B}{R}|Creature - Goblin|1|1|Flash$When Munitions Expert enters the battlefield, you may have it deal damage to target creature or planeswalker equal to the number of Goblins you control.|
Nature's Chant|Modern Horizons|210|C|{1}{G/W}|Instant|||Destroy target artifact or enchantment.|
Reap The Past|Modern Horizons|211|R|{X}{R}{G}|Sorcery|||Return X cards at random from your graveyard to your hand. Exile Reap The Past.|
Reap the Past|Modern Horizons|211|R|{X}{R}{G}|Sorcery|||Return X cards at random from your graveyard to your hand. Exile Reap the Past.|
Ruination Rioter|Modern Horizons|213|U|{R}{G}|Creature - Human Berserker|2|2|When Ruination Rioter dies, you may have it deal damage to any target equal to the number of land cards in your graveyard.|
Thundering Djinn|Modern Horizons|215|U|{3}{U}{R}|Creature - Djinn|3|4|Flying$Whenever Thundering Djinn attacks, it deals damage to any target equal to the number of cards you've drawn this turn.|
Unsettled Mariner|Modern Horizons|216|R|{W}{U}|Creature - Shapeshifter|2|2|Changeling$Whenever you or a permanent you control becomes the target of a spell or ability an opponent controls, counter that spell or ability unless its controller pays {1}.|