diff --git a/Mage.Sets/src/mage/cards/i/InfernalJudgment.java b/Mage.Sets/src/mage/cards/i/InfernalJudgment.java new file mode 100644 index 00000000000..729bbf6002f --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/InfernalJudgment.java @@ -0,0 +1,76 @@ +package mage.cards.i; + +import java.util.UUID; +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Outcome; +import mage.filter.common.FilterCreaturePermanent; +import mage.filter.predicate.mageobject.ColorlessPredicate; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.players.Player; +import mage.target.common.TargetCreaturePermanent; + +/** + * + * @author TheElk801 + */ +public final class InfernalJudgment extends CardImpl { + + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("colorless creature"); + + static { + filter.add(new ColorlessPredicate()); + } + + public InfernalJudgment(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{B}"); + + // Exile target colorless creature. You gain life equal to its power. + this.getSpellAbility().addEffect(new InfernalJudgmentEffect()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter)); + } + + public InfernalJudgment(final InfernalJudgment card) { + super(card); + } + + @Override + public InfernalJudgment copy() { + return new InfernalJudgment(this); + } +} + +class InfernalJudgmentEffect extends OneShotEffect { + + public InfernalJudgmentEffect() { + super(Outcome.GainLife); + staticText = "exile target colorless creature. You gain life equal to its power"; + } + + public InfernalJudgmentEffect(final InfernalJudgmentEffect effect) { + super(effect); + } + + @Override + public InfernalJudgmentEffect copy() { + return new InfernalJudgmentEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source)); + Player player = game.getPlayer(source.getControllerId()); + if (permanent == null || player == null) { + return false; + } + int creaturePower = permanent.getPower().getValue(); + permanent.moveToExile(null, null, source.getSourceId(), game); + game.applyEffects(); + player.gainLife(creaturePower, game, source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CoreSet2019.java b/Mage.Sets/src/mage/sets/CoreSet2019.java index 53de63e406c..82aa328b8fc 100644 --- a/Mage.Sets/src/mage/sets/CoreSet2019.java +++ b/Mage.Sets/src/mage/sets/CoreSet2019.java @@ -63,6 +63,7 @@ public final class CoreSet2019 extends ExpansionSet { cards.add(new SetCardInfo("Herald of Faith", 13, Rarity.UNCOMMON, mage.cards.h.HeraldOfFaith.class)); cards.add(new SetCardInfo("Highland Game", 188, Rarity.COMMON, mage.cards.h.HighlandGame.class)); cards.add(new SetCardInfo("Hostile Minotaur", 147, Rarity.COMMON, mage.cards.h.HostileMinotaur.class)); + cards.add(new SetCardInfo("Infernal Judgment", 102, Rarity.RARE, mage.cards.i.InfernalJudgment.class)); cards.add(new SetCardInfo("Infernal Scarring", 103, Rarity.COMMON, mage.cards.i.InfernalScarring.class)); cards.add(new SetCardInfo("Inspired Charge", 15, Rarity.COMMON, mage.cards.i.InspiredCharge.class)); cards.add(new SetCardInfo("Kargan Dragonrider", 297, Rarity.COMMON, mage.cards.k.KarganDragonrider.class));