mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 20:29:19 -08:00
Implemented Reap the Past
This commit is contained in:
parent
d3bedf9ba7
commit
78643b4c7d
3 changed files with 72 additions and 1 deletions
70
Mage.Sets/src/mage/cards/r/ReapThePast.java
Normal file
70
Mage.Sets/src/mage/cards/r/ReapThePast.java
Normal 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -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));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue