forked from External/mage
[FDN] Implement Inspiration from Beyond
This commit is contained in:
parent
85f3c4ec83
commit
e5de8ba044
2 changed files with 85 additions and 0 deletions
84
Mage.Sets/src/mage/cards/i/InspirationFromBeyond.java
Normal file
84
Mage.Sets/src/mage/cards/i/InspirationFromBeyond.java
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.MillCardsControllerEffect;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.cards.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class InspirationFromBeyond extends CardImpl {
|
||||
|
||||
public InspirationFromBeyond(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}");
|
||||
|
||||
// Mill three cards, then return an instant or sorcery card from your graveyard to your hand.
|
||||
this.getSpellAbility().addEffect(new MillCardsControllerEffect(3));
|
||||
this.getSpellAbility().addEffect(new InspirationFromBeyondEffect());
|
||||
|
||||
// Flashback {5}{U}{U}
|
||||
this.addAbility(new FlashbackAbility(this, new ManaCostsImpl<>("{5}{U}{U}")));
|
||||
}
|
||||
|
||||
private InspirationFromBeyond(final InspirationFromBeyond card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InspirationFromBeyond copy() {
|
||||
return new InspirationFromBeyond(this);
|
||||
}
|
||||
}
|
||||
|
||||
class InspirationFromBeyondEffect extends OneShotEffect {
|
||||
|
||||
InspirationFromBeyondEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = ", then return an instant or sorcery card from your graveyard to your hand";
|
||||
}
|
||||
|
||||
private InspirationFromBeyondEffect(final InspirationFromBeyondEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public InspirationFromBeyondEffect copy() {
|
||||
return new InspirationFromBeyondEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Card card;
|
||||
Cards cards = new CardsImpl(player.getGraveyard().getCards(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game));
|
||||
switch (cards.size()) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
card = cards.getRandom(game);
|
||||
break;
|
||||
default:
|
||||
TargetCard target = new TargetCardInGraveyard();
|
||||
target.withNotTarget(true);
|
||||
player.choose(Outcome.ReturnToHand, cards, target, source, game);
|
||||
card = cards.get(target.getFirstTarget(), game);
|
||||
}
|
||||
return card != null && player.moveCards(card, Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
|
|
@ -166,6 +166,7 @@ public final class Foundations extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Imperious Perfect", 719, Rarity.UNCOMMON, mage.cards.i.ImperiousPerfect.class));
|
||||
cards.add(new SetCardInfo("Imprisoned in the Moon", 156, Rarity.UNCOMMON, mage.cards.i.ImprisonedInTheMoon.class));
|
||||
cards.add(new SetCardInfo("Ingenious Leonin", 495, Rarity.UNCOMMON, mage.cards.i.IngeniousLeonin.class));
|
||||
cards.add(new SetCardInfo("Inspiration from Beyond", 43, Rarity.UNCOMMON, mage.cards.i.InspirationFromBeyond.class));
|
||||
cards.add(new SetCardInfo("Island", 274, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Izzet Guildgate", 691, Rarity.COMMON, mage.cards.i.IzzetGuildgate.class));
|
||||
cards.add(new SetCardInfo("Jazal Goldmane", 497, Rarity.RARE, mage.cards.j.JazalGoldmane.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue