Implemented Essence Vortex

This commit is contained in:
Evan Kranzler 2019-10-03 16:39:38 -04:00
parent bc8cfab679
commit 2d14a1d12e
2 changed files with 70 additions and 0 deletions

View file

@ -0,0 +1,69 @@
package mage.cards.e;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class EssenceVortex extends CardImpl {
public EssenceVortex(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{B}");
// Destroy target creature unless its controller pays life equal to its toughness. A creature destroyed this way can't be regenerated.
this.getSpellAbility().addEffect(new EssenceVortexEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
private EssenceVortex(final EssenceVortex card) {
super(card);
}
@Override
public EssenceVortex copy() {
return new EssenceVortex(this);
}
}
class EssenceVortexEffect extends OneShotEffect {
EssenceVortexEffect() {
super(Outcome.Benefit);
staticText = "Destroy target creature unless its controller pays life equal to its toughness. " +
"A creature destroyed this way can't be regenerated.";
}
private EssenceVortexEffect(final EssenceVortexEffect effect) {
super(effect);
}
@Override
public EssenceVortexEffect copy() {
return new EssenceVortexEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
Cost cost = new PayLifeCost(permanent.getToughness().getValue());
if (cost.pay(source, game, source.getSourceId(), permanent.getControllerId(), true)) {
return true;
}
return permanent.destroy(source.getSourceId(), game, true);
}
}

View file

@ -108,6 +108,7 @@ public final class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Errantry", 183, Rarity.COMMON, mage.cards.e.Errantry.class));
cards.add(new SetCardInfo("Essence Filter", 233, Rarity.COMMON, mage.cards.e.EssenceFilter.class));
cards.add(new SetCardInfo("Essence Flare", 69, Rarity.COMMON, mage.cards.e.EssenceFlare.class));
cards.add(new SetCardInfo("Essence Vortex", 287, Rarity.UNCOMMON, mage.cards.e.EssenceVortex.class));
cards.add(new SetCardInfo("Fanatical Fever", 234, Rarity.UNCOMMON, mage.cards.f.FanaticalFever.class));
cards.add(new SetCardInfo("Fear", 124, Rarity.COMMON, mage.cards.f.Fear.class));
cards.add(new SetCardInfo("Fiery Justice", 288, Rarity.RARE, mage.cards.f.FieryJustice.class));