forked from External/mage
[TDM] Implement Riverwheel Sweep
This commit is contained in:
parent
c9148aa2d3
commit
97adeca9be
2 changed files with 101 additions and 0 deletions
100
Mage.Sets/src/mage/cards/r/RiverwheelSweep.java
Normal file
100
Mage.Sets/src/mage/cards/r/RiverwheelSweep.java
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
package mage.cards.r;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInExile;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class RiverwheelSweep extends CardImpl {
|
||||
|
||||
public RiverwheelSweep(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2/U}{2/R}{2/W}");
|
||||
|
||||
// Tap target creature. Put three stun counters on it.
|
||||
this.getSpellAbility().addEffect(new TapTargetEffect());
|
||||
this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.STUN.createInstance(3))
|
||||
.setText("put three stun counters on it"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
|
||||
// Exile the top two cards of your library. Choose one of them. Until the end of your next turn, you may play that card.
|
||||
this.getSpellAbility().addEffect(new RiverwheelSweepEffect());
|
||||
}
|
||||
|
||||
private RiverwheelSweep(final RiverwheelSweep card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RiverwheelSweep copy() {
|
||||
return new RiverwheelSweep(this);
|
||||
}
|
||||
}
|
||||
|
||||
class RiverwheelSweepEffect extends OneShotEffect {
|
||||
|
||||
RiverwheelSweepEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Exile the top two cards of your library. Choose one of them. " +
|
||||
"Until the end of your next turn, you may play that card";
|
||||
this.concatBy("<br>");
|
||||
}
|
||||
|
||||
private RiverwheelSweepEffect(final RiverwheelSweepEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RiverwheelSweepEffect copy() {
|
||||
return new RiverwheelSweepEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 2));
|
||||
player.moveCards(cards, Zone.EXILED, source, game);
|
||||
cards.retainZone(Zone.EXILED, game);
|
||||
Card card;
|
||||
switch (cards.size()) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
card = cards.getRandom(game);
|
||||
break;
|
||||
default:
|
||||
TargetCard target = new TargetCardInExile(StaticFilters.FILTER_CARD);
|
||||
target.withNotTarget(true);
|
||||
player.choose(Outcome.DrawCard, cards, target, source, game);
|
||||
card = game.getCard(target.getFirstTarget());
|
||||
}
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
CardUtil.makeCardPlayable(
|
||||
game, source, card, false,
|
||||
Duration.UntilEndOfYourNextTurn, false
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -174,6 +174,7 @@ public final class TarkirDragonstorm extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Revival of the Ancestors", 218, Rarity.RARE, mage.cards.r.RevivalOfTheAncestors.class));
|
||||
cards.add(new SetCardInfo("Ringing Strike Mastery", 53, Rarity.COMMON, mage.cards.r.RingingStrikeMastery.class));
|
||||
cards.add(new SetCardInfo("Riverwalk Technique", 54, Rarity.COMMON, mage.cards.r.RiverwalkTechnique.class));
|
||||
cards.add(new SetCardInfo("Riverwheel Sweep", 219, Rarity.UNCOMMON, mage.cards.r.RiverwheelSweep.class));
|
||||
cards.add(new SetCardInfo("Roamer's Routine", 154, Rarity.COMMON, mage.cards.r.RoamersRoutine.class));
|
||||
cards.add(new SetCardInfo("Roar of Endless Song", 220, Rarity.RARE, mage.cards.r.RoarOfEndlessSong.class));
|
||||
cards.add(new SetCardInfo("Roiling Dragonstorm", 55, Rarity.UNCOMMON, mage.cards.r.RoilingDragonstorm.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue