diff --git a/Mage.Sets/src/mage/cards/j/JohannsStopgap.java b/Mage.Sets/src/mage/cards/j/JohannsStopgap.java new file mode 100644 index 00000000000..3a949978adc --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JohannsStopgap.java @@ -0,0 +1,59 @@ +package mage.cards.j; + +import mage.abilities.Ability; +import mage.abilities.condition.common.BargainedCondition; +import mage.abilities.costs.CostAdjuster; +import mage.abilities.effects.common.DrawCardSourceControllerEffect; +import mage.abilities.effects.common.InfoEffect; +import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.keyword.BargainAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.game.Game; +import mage.target.common.TargetNonlandPermanent; +import mage.util.CardUtil; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class JohannsStopgap extends CardImpl { + + public JohannsStopgap(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{3}{U}"); + + // Bargain + this.addAbility(new BargainAbility()); + + // This spell costs {2} less to cast if it's bargained. + this.getSpellAbility().addEffect(new InfoEffect("this spell costs {2} less to cast if it's bargained")); + this.getSpellAbility().setCostAdjuster(JohannsStopgapAdjuster.instance); + + // Return target nonland permanent to its owner's hand. Draw a card. + this.getSpellAbility().addEffect(new ReturnToHandTargetEffect().concatBy("
")); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().addTarget(new TargetNonlandPermanent().withChooseHint("to return to hand")); + } + + private JohannsStopgap(final JohannsStopgap card) { + super(card); + } + + @Override + public JohannsStopgap copy() { + return new JohannsStopgap(this); + } +} + +enum JohannsStopgapAdjuster implements CostAdjuster { + instance; + + @Override + public void adjustCosts(Ability ability, Game game) { + if (BargainedCondition.instance.apply(game, ability)) { + 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 c22cc3d46c9..5ce85aad836 100644 --- a/Mage.Sets/src/mage/sets/WildsOfEldraine.java +++ b/Mage.Sets/src/mage/sets/WildsOfEldraine.java @@ -70,6 +70,7 @@ public final class WildsOfEldraine extends ExpansionSet { 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)); cards.add(new SetCardInfo("Island", 263, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); + cards.add(new SetCardInfo("Johann's Stopgap", 58, Rarity.COMMON, mage.cards.j.JohannsStopgap.class)); cards.add(new SetCardInfo("Johann, Apprentice Sorcerer", 207, Rarity.UNCOMMON, mage.cards.j.JohannApprenticeSorcerer.class)); cards.add(new SetCardInfo("Kellan, the Fae-Blooded", 230, Rarity.MYTHIC, mage.cards.k.KellanTheFaeBlooded.class)); cards.add(new SetCardInfo("Knight of Doves", 19, Rarity.UNCOMMON, mage.cards.k.KnightOfDoves.class)); diff --git a/Utils/keywords.txt b/Utils/keywords.txt index ba113c5ea2d..43dd2a2e1c6 100644 --- a/Utils/keywords.txt +++ b/Utils/keywords.txt @@ -5,6 +5,7 @@ Ascend|new| Assist|new| Backup|card, number| Basic landcycling|cost| +Bargain|new| Battle cry|new| Bestow|card, manaString| Blitz|card, manaString|