diff --git a/Mage.Sets/src/mage/cards/j/JetmirsFixer.java b/Mage.Sets/src/mage/cards/j/JetmirsFixer.java new file mode 100644 index 0000000000..10a0bd5506 --- /dev/null +++ b/Mage.Sets/src/mage/cards/j/JetmirsFixer.java @@ -0,0 +1,75 @@ +package mage.cards.j; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.BoostSourceEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.constants.SubType; +import mage.counters.CounterType; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.watchers.common.ManaPaidSourceWatcher; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class JetmirsFixer extends CardImpl { + + public JetmirsFixer(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}"); + + this.subtype.add(SubType.CAT); + this.subtype.add(SubType.WARRIOR); + this.power = new MageInt(2); + this.toughness = new MageInt(2); + + // {R}{G}: Jetmir's Fixer gets +1/+1 until end of turn. If mana from a Treasure was spent to activate this ability, put a +1/+1 counter on Jetmir's Fixer instead. + this.addAbility(new SimpleActivatedAbility(new JetmirsFixerEffect(), new ManaCostsImpl<>("{R}{G}"))); + } + + private JetmirsFixer(final JetmirsFixer card) { + super(card); + } + + @Override + public JetmirsFixer copy() { + return new JetmirsFixer(this); + } +} + +class JetmirsFixerEffect extends OneShotEffect { + + JetmirsFixerEffect() { + super(Outcome.Benefit); + staticText = "{this} gets +1/+1 until end of turn. If mana from a Treasure " + + "was spent to activate this ability, put a +1/+1 counter on {this} instead"; + } + + private JetmirsFixerEffect(final JetmirsFixerEffect effect) { + super(effect); + } + + @Override + public JetmirsFixerEffect copy() { + return new JetmirsFixerEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + if (ManaPaidSourceWatcher.getTreasurePaid(source.getId(), game) < 1) { + game.addEffect(new BoostSourceEffect(1, 1, Duration.EndOfTurn), source); + return true; + } + Permanent permanent = source.getSourcePermanentIfItStillExists(game); + return permanent != null && permanent.addCounters(CounterType.P1P1.createInstance(), source, game); + } +} diff --git a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java index 11d8a93a24..a1fbd32772 100644 --- a/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java +++ b/Mage.Sets/src/mage/sets/StreetsOfNewCapenna.java @@ -97,6 +97,7 @@ public final class StreetsOfNewCapenna extends ExpansionSet { cards.add(new SetCardInfo("Involuntary Employment", 110, Rarity.UNCOMMON, mage.cards.i.InvoluntaryEmployment.class)); cards.add(new SetCardInfo("Island", 264, Rarity.LAND, mage.cards.basiclands.Island.class, NON_FULL_USE_VARIOUS)); cards.add(new SetCardInfo("Jaxis, the Troublemaker", 112, Rarity.RARE, mage.cards.j.JaxisTheTroublemaker.class)); + cards.add(new SetCardInfo("Jetmir's Fixer", 194, Rarity.COMMON, mage.cards.j.JetmirsFixer.class)); cards.add(new SetCardInfo("Jetmir's Garden", 250, Rarity.RARE, mage.cards.j.JetmirsGarden.class)); cards.add(new SetCardInfo("Jetmir, Nexus of Revels", 193, Rarity.MYTHIC, mage.cards.j.JetmirNexusOfRevels.class)); cards.add(new SetCardInfo("Jewel Thief", 151, Rarity.COMMON, mage.cards.j.JewelThief.class));