diff --git a/Mage.Sets/src/mage/cards/w/WrongTurn.java b/Mage.Sets/src/mage/cards/w/WrongTurn.java new file mode 100644 index 0000000000..fd4b1457c2 --- /dev/null +++ b/Mage.Sets/src/mage/cards/w/WrongTurn.java @@ -0,0 +1,65 @@ +package mage.cards.w; + +import mage.abilities.Ability; +import mage.abilities.effects.OneShotEffect; +import mage.abilities.effects.common.continuous.GainControlTargetEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Outcome; +import mage.game.Game; +import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetOpponent; +import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class WrongTurn extends CardImpl { + + public WrongTurn(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{U}"); + + // Target opponent gains control of target creature. + this.getSpellAbility().addEffect(new WrongTurnEffect()); + this.getSpellAbility().addTarget(new TargetOpponent()); + this.getSpellAbility().addTarget(new TargetCreaturePermanent()); + } + + private WrongTurn(final WrongTurn card) { + super(card); + } + + @Override + public WrongTurn copy() { + return new WrongTurn(this); + } +} + +class WrongTurnEffect extends OneShotEffect { + + WrongTurnEffect() { + super(Outcome.Benefit); + staticText = "target opponent gains control of target creature"; + } + + private WrongTurnEffect(final WrongTurnEffect effect) { + super(effect); + } + + @Override + public WrongTurnEffect copy() { + return new WrongTurnEffect(this); + } + + @Override + public boolean apply(Game game, Ability source) { + game.addEffect(new GainControlTargetEffect( + Duration.Custom, true, source.getFirstTarget() + ).setTargetPointer(new FixedTarget(source.getTargets().get(1).getFirstTarget(), game)), source); + return true; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegends.java b/Mage.Sets/src/mage/sets/CommanderLegends.java index 2bc9d103da..5cf7872925 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegends.java +++ b/Mage.Sets/src/mage/sets/CommanderLegends.java @@ -191,6 +191,7 @@ public final class CommanderLegends extends ExpansionSet { cards.add(new SetCardInfo("War Room", 361, Rarity.RARE, mage.cards.w.WarRoom.class)); cards.add(new SetCardInfo("Warden of Evos Isle", 106, Rarity.UNCOMMON, mage.cards.w.WardenOfEvosIsle.class)); cards.add(new SetCardInfo("Wild Celebrants", 212, Rarity.COMMON, mage.cards.w.WildCelebrants.class)); + cards.add(new SetCardInfo("Wrong Turn", 107, Rarity.RARE, mage.cards.w.WrongTurn.class)); cards.add(new SetCardInfo("Xenagos, God of Revels", 541, Rarity.MYTHIC, mage.cards.x.XenagosGodOfRevels.class)); cards.add(new SetCardInfo("Zur the Enchanter", 544, Rarity.MYTHIC, mage.cards.z.ZurTheEnchanter.class)); }