mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
[MID] Implemented Spectral Adversary
This commit is contained in:
parent
f65d18c0a6
commit
b2787786de
3 changed files with 123 additions and 0 deletions
121
Mage.Sets/src/mage/cards/s/SpectralAdversary.java
Normal file
121
Mage.Sets/src/mage/cards/s/SpectralAdversary.java
Normal file
|
@ -0,0 +1,121 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.delayed.ReflexiveTriggeredAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PhaseOutTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.keyword.FlashAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class SpectralAdversary extends CardImpl {
|
||||
|
||||
public SpectralAdversary(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Flash
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// When Spectral Adversary enters the battlefield, you may pay {1}{U} any number of times. When you pay this cost one or more times, put that many +1/+1 counters on Spectral Adversary, then up to that many other target artifacts, creatures, and/or enchantments phase out.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new SpectralAdversaryEffect()));
|
||||
}
|
||||
|
||||
private SpectralAdversary(final SpectralAdversary card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpectralAdversary copy() {
|
||||
return new SpectralAdversary(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SpectralAdversaryEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPermanent filter
|
||||
= new FilterPermanent("artifacts, creatures, and/or enchantments");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.or(
|
||||
CardType.ARTIFACT.getPredicate(),
|
||||
CardType.CREATURE.getPredicate(),
|
||||
CardType.ENCHANTMENT.getPredicate()
|
||||
));
|
||||
}
|
||||
|
||||
SpectralAdversaryEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "you may pay {1}{U} any number of times. When you pay this cost one or more times, " +
|
||||
"put that many +1/+1 counters on {this}, then up to that many other target " +
|
||||
"artifacts, creatures, and/or enchantments phase out";
|
||||
}
|
||||
|
||||
private SpectralAdversaryEffect(final SpectralAdversaryEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpectralAdversaryEffect copy() {
|
||||
return new SpectralAdversaryEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Cost cost = new ManaCostsImpl<>("{1}{U}");
|
||||
int amount = 0;
|
||||
while (player.canRespond()) {
|
||||
cost.clearPaid();
|
||||
if (cost.canPay(source, source, source.getControllerId(), game)
|
||||
&& player.chooseUse(
|
||||
outcome, "Pay {1}{U}? You have paid this cost " +
|
||||
amount + " time" + (amount != 1 ? "s" : ""), source, game
|
||||
) && cost.pay(source, game, source, source.getControllerId(), false)) {
|
||||
amount++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (amount == 0) {
|
||||
return false;
|
||||
}
|
||||
ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(
|
||||
new AddCountersSourceEffect(CounterType.P1P1.createInstance(amount)),
|
||||
false, "put that many +1/+1 counters on {this}, then " +
|
||||
"up to that many other target artifacts, creatures, and/or enchantments phase out"
|
||||
);
|
||||
ability.addEffect(new PhaseOutTargetEffect());
|
||||
ability.addTarget(new TargetPermanent(0, amount, filter));
|
||||
game.fireReflexiveTriggeredAbility(ability, source);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -86,6 +86,7 @@ public final class InnistradMidnightHunt extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Shipwreck Marsh", 267, Rarity.RARE, mage.cards.s.ShipwreckMarsh.class));
|
||||
cards.add(new SetCardInfo("Sigarda, Champion of Light", 240, Rarity.MYTHIC, mage.cards.s.SigardaChampionOfLight.class));
|
||||
cards.add(new SetCardInfo("Snarling Wolf", 199, Rarity.COMMON, mage.cards.s.SnarlingWolf.class));
|
||||
cards.add(new SetCardInfo("Spectral Adversary", 77, Rarity.MYTHIC, mage.cards.s.SpectralAdversary.class));
|
||||
cards.add(new SetCardInfo("Stormrider Spirit", 79, Rarity.COMMON, mage.cards.s.StormriderSpirit.class));
|
||||
cards.add(new SetCardInfo("Sungold Barrage", 36, Rarity.COMMON, mage.cards.s.SungoldBarrage.class));
|
||||
cards.add(new SetCardInfo("Swamp", 272, Rarity.LAND, mage.cards.basiclands.Swamp.class, FULL_ART_BFZ_VARIOUS));
|
||||
|
|
|
@ -42194,6 +42194,7 @@ Poppet Stitcher|Innistrad: Midnight Hunt|71|M|{2}{U}|Creature - Human Wizard|2|3
|
|||
Poppet Factory|Innistrad: Midnight Hunt|71|M||Artifact|||Creature tokens you control lose all abilities and have base power and toughness 3/3.$At the beginning of your upkeep, you may transform Poppet Factory.|
|
||||
Secrets of the Key|Innistrad: Midnight Hunt|73|C|{U}|Instant|||Investigate. If this spell was cast from a graveyard, investigate twice instead.$Flashback {3}{U}|
|
||||
Sludge Monster|Innistrad: Midnight Hunt|76|R|{3}{U}{U}|Creature - Horror|5|5|Whenever Sludge Monster enters the battlefield or attacks, put a slime counter on up to one other target creature.$Non-Horror creatures with slime counters on them lose all abilities and have base power and toughness 2/2.|
|
||||
Spectral Adversary|Innistrad: Midnight Hunt|77|M|{1}{U}|Creature - Spirit|2|1|Flash$Flying$When Spectral Adversary enters the battlefield, you may pay {1}{U} any number of times. When you pay this cost one or more times, put that many +1/+1 counters on Spectral Adversary, then up to that many other target artifacts, creatures, and/or enchantments phase out.|
|
||||
Stormrider Spirit|Innistrad: Midnight Hunt|79|C|{4}{U}|Creature - Spirit|3|3|Flash$Flying|
|
||||
Triskaidekaphile|Innistrad: Midnight Hunt|81|R|{1}{U}|Creature - Human Wizard|1|3|You have no maximum hand size.$At the beginning of your upkeep, if you have exactly thirteen cards in your hand, you win the game.${3}{U}: Draw a card.|
|
||||
Arrogant Outlaw|Innistrad: Midnight Hunt|84|C|{2}{B}|Creature - Vampire Noble|3|2|When Arrogant Outlaw enters the battlefield, if an opponent lost life this turn, each opponent loses 2 life and you gain 2 life.|
|
||||
|
|
Loading…
Reference in a new issue