diff --git a/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java b/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java index ac7dea5b40..857458b0f7 100644 --- a/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java +++ b/Mage.Sets/src/mage/sets/magic2010/SolemnOffering.java @@ -49,7 +49,7 @@ public class SolemnOffering extends CardImpl { static { filter.getCardType().add(CardType.ARTIFACT); filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeColor(ComparisonScope.Any); + filter.setScopeCardType(ComparisonScope.Any); } public SolemnOffering(UUID ownerId) { diff --git a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java index c1b443b12a..de332845d4 100644 --- a/Mage.Sets/src/mage/sets/magic2011/Corrupt.java +++ b/Mage.Sets/src/mage/sets/magic2011/Corrupt.java @@ -32,6 +32,7 @@ import java.util.UUID; import mage.Constants.CardType; import mage.Constants.Outcome; import mage.Constants.Rarity; +import mage.Constants.TargetController; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.cards.CardImpl; @@ -74,6 +75,14 @@ public class Corrupt extends CardImpl { class CorruptEffect extends OneShotEffect { + private static FilterLandPermanent filter = new FilterLandPermanent("Swamps"); + + static { + filter.getSubtype().add("Swamp"); + filter.setScopeSubtype(ComparisonScope.Any); + filter.setTargetController(TargetController.YOU); + } + public CorruptEffect() { super(Outcome.Damage); } @@ -84,10 +93,6 @@ class CorruptEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - FilterLandPermanent filter = new FilterLandPermanent("Swamps"); - filter.getSubtype().add("Swamp"); - filter.setScopeSubtype(ComparisonScope.Any); - filter.getControllerId().add(source.getControllerId()); int amount = game.getBattlefield().count(filter, source.getControllerId(), game); if (amount > 0) { int damageDealt = amount; diff --git a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java index ca7066fa27..658592c225 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java +++ b/Mage.Sets/src/mage/sets/magic2011/MystifyingMaze.java @@ -127,7 +127,7 @@ class MystifyingMazeEffect extends OneShotEffect { class MystifyingMazeDelayedTriggeredAbility extends DelayedTriggeredAbility { public MystifyingMazeDelayedTriggeredAbility(UUID exileId) { - super(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD)); + super(new ReturnFromExileEffect(exileId, Zone.BATTLEFIELD, true)); } public MystifyingMazeDelayedTriggeredAbility(final MystifyingMazeDelayedTriggeredAbility ability) { diff --git a/Mage.Sets/src/mage/sets/tenth/Naturalize.java b/Mage.Sets/src/mage/sets/tenth/Naturalize.java index 977403a31c..de89f57082 100644 --- a/Mage.Sets/src/mage/sets/tenth/Naturalize.java +++ b/Mage.Sets/src/mage/sets/tenth/Naturalize.java @@ -48,7 +48,7 @@ public class Naturalize extends CardImpl { static { filter.getCardType().add(CardType.ARTIFACT); filter.getCardType().add(CardType.ENCHANTMENT); - filter.setScopeColor(ComparisonScope.Any); + filter.setScopeCardType(ComparisonScope.Any); } public Naturalize(UUID ownerId){ diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java index 0fa633190b..7603b57a78 100644 --- a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java +++ b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java @@ -33,7 +33,6 @@ import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.game.Game; import mage.game.permanent.token.Token; -import mage.players.Player; /** * diff --git a/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java b/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java index e4ea5d504b..bcf88fb93f 100644 --- a/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java +++ b/Mage/src/mage/abilities/effects/common/ReturnFromExileEffect.java @@ -36,7 +36,6 @@ import mage.abilities.effects.OneShotEffect; import mage.cards.Card; import mage.game.ExileZone; import mage.game.Game; -import mage.players.Player; /** * @@ -46,17 +45,24 @@ public class ReturnFromExileEffect extends OneShotEffect private UUID exileId; private Zone zone; + private boolean tapped; public ReturnFromExileEffect(UUID exileId, Zone zone) { + this(exileId, zone, false); + } + + public ReturnFromExileEffect(UUID exileId, Zone zone, boolean tapped) { super(Outcome.PutCardInPlay); this.exileId = exileId; this.zone = zone; + this.tapped = tapped; } public ReturnFromExileEffect(final ReturnFromExileEffect effect) { super(effect); this.exileId = effect.exileId; this.zone = effect.zone; + this.tapped = effect.tapped; } @Override @@ -70,7 +76,7 @@ public class ReturnFromExileEffect extends OneShotEffect if (exile != null) { for (UUID cardId: exile) { Card card = game.getCard(cardId); - card.moveToZone(zone, game, false); + card.moveToZone(zone, game, tapped); } exile.clear(); return true; @@ -85,6 +91,8 @@ public class ReturnFromExileEffect extends OneShotEffect switch(zone) { case BATTLEFIELD: sb.append("to the battlefield under its owner's control"); + if (tapped) + sb.append(" tapped"); break; case HAND: sb.append("to their owner's hand"); diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java index f8b8dbfaa1..b1c5c23367 100644 --- a/Mage/src/mage/cards/CardImpl.java +++ b/Mage/src/mage/cards/CardImpl.java @@ -182,10 +182,9 @@ public abstract class CardImpl> extends MageObjectImpl this.expansionSetCode = expansionSetCode; } - @Override - public boolean moveToZone(Zone toZone, Game game, boolean flag) { + public boolean moveToZone(Zone toZone, UUID controllerId, Game game, boolean flag) { Zone fromZone = zone; - ZoneChangeEvent event = new ZoneChangeEvent(this.getId(), ownerId, fromZone, toZone); + ZoneChangeEvent event = new ZoneChangeEvent(this.getId(), controllerId, fromZone, toZone); if (!game.replaceEvent(event)) { switch (event.getToZone()) { case GRAVEYARD: @@ -208,15 +207,22 @@ public abstract class CardImpl> extends MageObjectImpl game.getBattlefield().addPermanent(permanent); permanent.entersBattlefield(game); game.applyEffects(); + if (flag) + permanent.setTapped(true); break; } zone = event.getToZone(); - game.fireEvent(new ZoneChangeEvent(this.getId(), ownerId, fromZone, event.getToZone())); + game.fireEvent(event); return zone == toZone; } return false; } + @Override + public boolean moveToZone(Zone toZone, Game game, boolean flag) { + return moveToZone(toZone, ownerId, game, flag); + } + @Override public boolean moveToExile(UUID exileId, String name, Game game) { Zone fromZone = zone; diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java index 56a085579b..8150d306a9 100644 --- a/Mage/src/mage/game/permanent/PermanentCard.java +++ b/Mage/src/mage/game/permanent/PermanentCard.java @@ -37,6 +37,7 @@ import mage.MageInt; import mage.abilities.Ability; import mage.abilities.keyword.LevelAbility; import mage.cards.Card; +import mage.cards.CardImpl; import mage.cards.LevelerCard; import mage.game.Game; import mage.game.events.ZoneChangeEvent; @@ -116,8 +117,8 @@ public class PermanentCard extends PermanentImpl { ZoneChangeEvent event = new ZoneChangeEvent(this.getId(), this.getControllerId(), Zone.BATTLEFIELD, zone); if (!game.replaceEvent(event)) { if (game.getPlayer(controllerId).removeFromBattlefield(this, game)) { - Card card = game.getCard(objectId); - return card.moveToZone(event.getToZone(), game, flag); + CardImpl card = (CardImpl) game.getCard(objectId); + return card.moveToZone(event.getToZone(), controllerId, game, flag); } } return false; diff --git a/Mage/src/mage/game/permanent/PermanentImpl.java b/Mage/src/mage/game/permanent/PermanentImpl.java index 8ca173c404..aa61c26fd3 100644 --- a/Mage/src/mage/game/permanent/PermanentImpl.java +++ b/Mage/src/mage/game/permanent/PermanentImpl.java @@ -344,6 +344,7 @@ public abstract class PermanentImpl> extends CardImpl this.removeFromCombat(game); this.controlledFromStartOfTurn = false; this.controllerId = controllerId; + this.abilities.setControllerId(controllerId); return true; } }