[CMR] Implemented Wrong Turn

This commit is contained in:
Evan Kranzler 2020-11-01 11:57:59 -05:00
parent 0accdb6268
commit 1dd0c1d3f2
2 changed files with 66 additions and 0 deletions

View file

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

View file

@ -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("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("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("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("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)); cards.add(new SetCardInfo("Zur the Enchanter", 544, Rarity.MYTHIC, mage.cards.z.ZurTheEnchanter.class));
} }