[WOE] Implement Ice Out

This commit is contained in:
theelk801 2023-08-21 10:16:23 -04:00
parent 3b2a7f6a23
commit 042109f2f0
3 changed files with 59 additions and 1 deletions

View file

@ -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("<br>"));
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);
}
}
}

View file

@ -56,4 +56,4 @@ enum JohannsStopgapAdjuster implements CostAdjuster {
CardUtil.reduceCost(ability, 2);
}
}
}
}

View file

@ -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));