diff --git a/Mage.Sets/src/mage/cards/t/TawnossTinkering.java b/Mage.Sets/src/mage/cards/t/TawnossTinkering.java new file mode 100644 index 00000000000..47c4dca43ce --- /dev/null +++ b/Mage.Sets/src/mage/cards/t/TawnossTinkering.java @@ -0,0 +1,89 @@ +package mage.cards.t; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.UntapTargetEffect; +import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; +import mage.abilities.effects.common.counter.AddCountersTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.counters.CounterType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledPermanent; +import mage.filter.predicate.Predicates; +import mage.game.Game; +import mage.game.permanent.Permanent; +import mage.game.permanent.token.custom.CreatureToken; +import mage.target.TargetPermanent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class TawnossTinkering extends CardImpl { + + private static final FilterPermanent filter + = new FilterControlledPermanent("artifact, creature, or land you control"); + + static { + filter.add(Predicates.or( + CardType.ARTIFACT.getPredicate(), + CardType.CREATURE.getPredicate(), + CardType.LAND.getPredicate() + )); + } + + public TawnossTinkering(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{3}{G}"); + + // Put two +1/+1 counters on target artifact, creature, or land you control. Untap that permanent. If it isn't a creature, it becomes a 0/0 creature in addition to its other types. + this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.P1P1.createInstance(2))); + this.getSpellAbility().addEffect(new UntapTargetEffect("Untap that permanent")); + this.getSpellAbility().addEffect(new TawnossTinkeringEffect()); + this.getSpellAbility().addTarget(new TargetPermanent(filter)); + } + + private TawnossTinkering(final TawnossTinkering card) { + super(card); + } + + @Override + public TawnossTinkering copy() { + return new TawnossTinkering(this); + } +} + +class TawnossTinkeringEffect extends OneShotEffect { + + TawnossTinkeringEffect() { + super(Outcome.Benefit); + staticText = "if it isn't a creature, it becomes a 0/0 creature in addition to its other types"; + } + + private TawnossTinkeringEffect(final TawnossTinkeringEffect effect) { + super(effect); + } + + @Override + public TawnossTinkeringEffect copy() { + return new TawnossTinkeringEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source)); + if (permanent == null || !permanent.isCreature(game)) { + return false; + } + game.addEffect(new BecomesCreatureTargetEffect( + new CreatureToken(0, 0), + false, false, Duration.Custom + ).setTargetPointer(new FixedTarget(permanent, game)), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/TheBrothersWar.java b/Mage.Sets/src/mage/sets/TheBrothersWar.java index fc0adcbc430..fb1b63b5456 100644 --- a/Mage.Sets/src/mage/sets/TheBrothersWar.java +++ b/Mage.Sets/src/mage/sets/TheBrothersWar.java @@ -238,6 +238,7 @@ public final class TheBrothersWar extends ExpansionSet { cards.add(new SetCardInfo("Swiftgear Drake", 251, Rarity.COMMON, mage.cards.s.SwiftgearDrake.class)); cards.add(new SetCardInfo("Symmetry Matrix", 252, Rarity.UNCOMMON, mage.cards.s.SymmetryMatrix.class)); cards.add(new SetCardInfo("Take Flight", 65, Rarity.UNCOMMON, mage.cards.t.TakeFlight.class)); + cards.add(new SetCardInfo("Tawnos's Tinkering", 191, Rarity.COMMON, mage.cards.t.TawnossTinkering.class)); cards.add(new SetCardInfo("Tawnos, the Toymaker", 222, Rarity.RARE, mage.cards.t.TawnosTheToymaker.class)); cards.add(new SetCardInfo("Teething Wurmlet", 192, Rarity.RARE, mage.cards.t.TeethingWurmlet.class)); cards.add(new SetCardInfo("Teferi, Temporal Pilgrim", 66, Rarity.MYTHIC, mage.cards.t.TeferiTemporalPilgrim.class));