* Desertion - Fixed that the countered spell was wrongly moved to battlefield under owner control instad of Desertion caster control (fixed
*/
package mage.cards.d;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
+import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Zone;
-import mage.constants.ZoneDetail;
import mage.game.Game;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.TargetSpell;
-import java.util.UUID;
-
/**
*
* @author Quercitron
@@ -70,7 +69,7 @@ class DesertionEffect extends OneShotEffect {
public DesertionEffect() {
super(Outcome.Detriment);
- this.staticText = "Counter target spell. If an artifact or creature spell is countered this way, put that card onto the battlefield under your control instead of into its owner's graveyard.";
+ this.staticText = "Counter target spell. If an artifact or creature spell is countered this way, put that card onto the battlefield under your control instead of into its owner's graveyard";
}
public DesertionEffect(final DesertionEffect effect) {
@@ -86,18 +85,18 @@ class DesertionEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
- Spell targetSpell = game.getStack().getSpell(targetPointer.getFirst(game, source));
+ Spell targetSpell = game.getStack().getSpell(getTargetPointer().getFirst(game, source));
if (targetSpell != null) {
- //targetPointer.getFirst(game, source)
+ if (game.getStack().counter(targetSpell.getId(), source.getSourceId(), game)) {
+ game.applyEffects();
if (targetSpell.isArtifact() || targetSpell.isCreature()) {
- return game.getStack().counter(targetSpell.getId(), source.getSourceId(), game, Zone.BATTLEFIELD, false, ZoneDetail.NONE);
- } else {
- return game.getStack().counter(targetSpell.getId(), source.getSourceId(), game);
+ Card card = game.getCard(targetSpell.getSourceId());
+ controller.moveCards(card, Zone.BATTLEFIELD, source, game);
+ }
}
-
}
+ return true;
}
return false;
}
-
}
