Implemented Extravagant Spirit

This commit is contained in:
Evan Kranzler 2018-06-09 23:27:07 -04:00
parent 5751b07d7f
commit 955ec5064c
2 changed files with 77 additions and 0 deletions

View file

@ -0,0 +1,76 @@
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.constants.SubType;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author TheElk801
*/
public final class ExtravagantSpirit extends CardImpl {
public ExtravagantSpirit(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.subtype.add(SubType.SPIRIT);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
// Flying
this.addAbility(FlyingAbility.getInstance());
// At the beginning of your upkeep, sacrifice Extravagant Spirit unless you pay {1} for each card in your hand.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new ExtravagantSpiritEffect(), TargetController.YOU, false));
}
public ExtravagantSpirit(final ExtravagantSpirit card) {
super(card);
}
@Override
public ExtravagantSpirit copy() {
return new ExtravagantSpirit(this);
}
}
class ExtravagantSpiritEffect extends OneShotEffect {
public ExtravagantSpiritEffect() {
super(Outcome.Sacrifice);
this.staticText = "sacrifice {this} unless you pay {1} for each card in your hand";
}
public ExtravagantSpiritEffect(final ExtravagantSpiritEffect effect) {
super(effect);
}
@Override
public ExtravagantSpiritEffect copy() {
return new ExtravagantSpiritEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player == null) {
return false;
}
return new SacrificeSourceUnlessPaysEffect(
new GenericManaCost(player.getHand().size())
).apply(game, source);
}
}

View file

@ -119,6 +119,7 @@ public final class MercadianMasques extends ExpansionSet {
cards.add(new SetCardInfo("Energy Flux", 78, Rarity.UNCOMMON, mage.cards.e.EnergyFlux.class));
cards.add(new SetCardInfo("Enslaved Horror", 134, Rarity.UNCOMMON, mage.cards.e.EnslavedHorror.class));
cards.add(new SetCardInfo("Extortion", 135, Rarity.RARE, mage.cards.e.Extortion.class));
cards.add(new SetCardInfo("Extravagant Spirit", 79, Rarity.RARE, mage.cards.e.ExtravagantSpirit.class));
cards.add(new SetCardInfo("Eye of Ramos", 294, Rarity.RARE, mage.cards.e.EyeOfRamos.class));
cards.add(new SetCardInfo("False Demise", 80, Rarity.UNCOMMON, mage.cards.f.FalseDemise.class));
cards.add(new SetCardInfo("Ferocity", 245, Rarity.COMMON, mage.cards.f.Ferocity.class));