From 042109f2f03769429ce73c62e106e4b91d45baf2 Mon Sep 17 00:00:00 2001 From: theelk801 Date: Mon, 21 Aug 2023 10:16:23 -0400 Subject: [PATCH] [WOE] Implement Ice Out --- Mage.Sets/src/mage/cards/i/IceOut.java | 57 +++++++++++++++++++ .../src/mage/cards/j/JohannsStopgap.java | 2 +- Mage.Sets/src/mage/sets/WildsOfEldraine.java | 1 + 3 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 Mage.Sets/src/mage/cards/i/IceOut.java diff --git a/Mage.Sets/src/mage/cards/i/IceOut.java b/Mage.Sets/src/mage/cards/i/IceOut.java new file mode 100644 index 00000000000..4fec3375feb --- /dev/null +++ b/Mage.Sets/src/mage/cards/i/IceOut.java @@ -0,0 +1,57 @@ +package mage.cards.i; + +import mage.abilities.Ability; +import mage.abilities.condition.common.BargainedCondition; +import mage.abilities.costs.CostAdjuster; +import mage.abilities.effects.common.CounterTargetEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.keyword.BargainAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.target.TargetSpell; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class IceOut extends CardImpl { + + public IceOut(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); + + // Bargain + this.addAbility(new BargainAbility()); + + // This spell costs {1} less to cast if it's bargained. + this.getSpellAbility().addEffect(new InfoEffect("this spell costs {1} less to cast if it's bargained")); + this.getSpellAbility().setCostAdjuster(IceOutAdjuster.instance); + + // Counter target spell. + this.getSpellAbility().addEffect(new CounterTargetEffect().concatBy("
")); + this.getSpellAbility().addTarget(new TargetSpell()); + } + + private IceOut(final IceOut card) { + super(card); + } + + @Override + public IceOut copy() { + return new IceOut(this); + } +} + +enum IceOutAdjuster implements CostAdjuster { + instance; + + @Override + public void adjustCosts(Ability ability, Game game) { + if (BargainedCondition.instance.apply(game, ability)) { + CardUtil.reduceCost(ability, 1); + } + } +} diff --git a/Mage.Sets/src/mage/cards/j/JohannsStopgap.java b/Mage.Sets/src/mage/cards/j/JohannsStopgap.java index 3a949978adc..c976d9e7c74 100644 --- a/Mage.Sets/src/mage/cards/j/JohannsStopgap.java +++ b/Mage.Sets/src/mage/cards/j/JohannsStopgap.java @@ -56,4 +56,4 @@ enum JohannsStopgapAdjuster implements CostAdjuster { CardUtil.reduceCost(ability, 2); } } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/sets/WildsOfEldraine.java b/Mage.Sets/src/mage/sets/WildsOfEldraine.java index 5ce85aad836..0c46ac533df 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraine.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraine.java @@ -66,6 +66,7 @@ public final class WildsOfEldraine extends ExpansionSet { cards.add(new SetCardInfo("Hopeless Nightmare", 95, Rarity.COMMON, mage.cards.h.HopelessNightmare.class)); cards.add(new SetCardInfo("Howling Galefang", 175, Rarity.UNCOMMON, mage.cards.h.HowlingGalefang.class)); cards.add(new SetCardInfo("Hylda of the Icy Crown", 206, Rarity.MYTHIC, mage.cards.h.HyldaOfTheIcyCrown.class)); + cards.add(new SetCardInfo("Ice Out", 54, Rarity.COMMON, mage.cards.i.IceOut.class)); cards.add(new SetCardInfo("Icewrought Sentry", 55, Rarity.UNCOMMON, mage.cards.i.IcewroughtSentry.class)); cards.add(new SetCardInfo("Ingenious Prodigy", 56, Rarity.RARE, mage.cards.i.IngeniousProdigy.class)); cards.add(new SetCardInfo("Into the Fae Court", 57, Rarity.COMMON, mage.cards.i.IntoTheFaeCourt.class));