forked from External/mage
Implemented Experimental Overload
This commit is contained in:
parent
0af261aeb3
commit
e8a99ec7f3
3 changed files with 111 additions and 0 deletions
78
Mage.Sets/src/mage/cards/e/ExperimentalOverload.java
Normal file
78
Mage.Sets/src/mage/cards/e/ExperimentalOverload.java
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
package mage.cards.e;
|
||||
|
||||
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.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.WeirdToken2;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class ExperimentalOverload extends CardImpl {
|
||||
|
||||
public ExperimentalOverload(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{U}{R}");
|
||||
|
||||
// Create an X/X blue and red Weird creature token, where X is the number of instant and sorcery cards in your graveyard. Then you may return an instant or sorcery card from your graveyard to your hand. Exile Experimental Overload.
|
||||
this.getSpellAbility().addEffect(new ExperimentalOverloadEffect());
|
||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||
}
|
||||
|
||||
private ExperimentalOverload(final ExperimentalOverload card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExperimentalOverload copy() {
|
||||
return new ExperimentalOverload(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ExperimentalOverloadEffect extends OneShotEffect {
|
||||
|
||||
ExperimentalOverloadEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Create an X/X blue and red Weird creature token, " +
|
||||
"where X is the number of instant and sorcery cards in your graveyard. " +
|
||||
"Then you may return an instant or sorcery card from your graveyard to your hand.";
|
||||
}
|
||||
|
||||
private ExperimentalOverloadEffect(final ExperimentalOverloadEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ExperimentalOverloadEffect copy() {
|
||||
return new ExperimentalOverloadEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
int spellCount = player.getGraveyard().count(StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, game);
|
||||
new WeirdToken2(spellCount).putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
if (spellCount < 1) {
|
||||
return true;
|
||||
}
|
||||
TargetCard target = new TargetCardInYourGraveyard(
|
||||
0, 1, StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY, true
|
||||
);
|
||||
player.choose(outcome, player.getGraveyard(), target, game);
|
||||
return player.moveCards(game.getCard(target.getFirstTarget()), Zone.HAND, source, game);
|
||||
}
|
||||
}
|
||||
|
|
@ -73,6 +73,7 @@ public final class CoreSet2021 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Duress", 96, Rarity.COMMON, mage.cards.d.Duress.class));
|
||||
cards.add(new SetCardInfo("Elder Gargaroth", 179, Rarity.MYTHIC, mage.cards.e.ElderGargaroth.class));
|
||||
cards.add(new SetCardInfo("Eliminate", 97, Rarity.UNCOMMON, mage.cards.e.Eliminate.class));
|
||||
cards.add(new SetCardInfo("Experimental Overload", 218, Rarity.UNCOMMON, mage.cards.e.ExperimentalOverload.class));
|
||||
cards.add(new SetCardInfo("Fabled Passage", 246, Rarity.RARE, mage.cards.f.FabledPassage.class));
|
||||
cards.add(new SetCardInfo("Faith's Fetters", 17, Rarity.UNCOMMON, mage.cards.f.FaithsFetters.class));
|
||||
cards.add(new SetCardInfo("Falconer Adept", 18, Rarity.UNCOMMON, mage.cards.f.FalconerAdept.class));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class WeirdToken2 extends TokenImpl {
|
||||
|
||||
public WeirdToken2(int xValue) {
|
||||
super("Weird", "X/X blue and red Weird creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlue(true);
|
||||
color.setRed(true);
|
||||
subtype.add(SubType.WEIRD);
|
||||
power = new MageInt(xValue);
|
||||
toughness = new MageInt(xValue);
|
||||
}
|
||||
|
||||
private WeirdToken2(final WeirdToken2 token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public WeirdToken2 copy() {
|
||||
return new WeirdToken2(this);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue