* The Great Aurora - Fixed that the lands came always tapped onto the battlefield.

* Some minor changes to card movement.
This commit is contained in:
LevelX2 2015-10-22 13:31:32 +02:00
parent 02f88b94c0
commit d26b8aeae0
6 changed files with 66 additions and 108 deletions

View file

@ -27,6 +27,7 @@
*/ */
package mage.sets.gatecrash; package mage.sets.gatecrash;
import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect; import mage.abilities.effects.Effect;
@ -35,14 +36,17 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect; import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.constants.*; import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.Rarity;
import mage.game.Game; import mage.game.Game;
import mage.game.turn.Step; import mage.game.turn.Step;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
import java.util.UUID;
/** /**
* *
* @author LevelX2 * @author LevelX2
@ -53,8 +57,7 @@ public class EnterTheInfinite extends CardImpl {
super(ownerId, 34, "Enter the Infinite", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{8}{U}{U}{U}{U}"); super(ownerId, 34, "Enter the Infinite", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{8}{U}{U}{U}{U}");
this.expansionSetCode = "GTC"; this.expansionSetCode = "GTC";
// Draw cards equal to the number of cards in your library,
// Draw cards equal to the number of cards in your library,
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new CardsInControllerLibraryCount())); this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new CardsInControllerLibraryCount()));
//then put a card from your hand on top of your library. //then put a card from your hand on top of your library.
this.getSpellAbility().addEffect(new PutCardOnLibraryEffect()); this.getSpellAbility().addEffect(new PutCardOnLibraryEffect());
@ -72,8 +75,8 @@ public class EnterTheInfinite extends CardImpl {
} }
} }
class CardsInControllerLibraryCount implements DynamicValue { class CardsInControllerLibraryCount implements DynamicValue {
@Override @Override
public int calculate(Game game, Ability sourceAbility, Effect effect) { public int calculate(Game game, Ability sourceAbility, Effect effect) {
if (sourceAbility != null) { if (sourceAbility != null) {
@ -119,14 +122,13 @@ class PutCardOnLibraryEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (player != null) { if (controller != null) {
TargetCardInHand target = new TargetCardInHand(); TargetCardInHand target = new TargetCardInHand();
player.chooseTarget(Outcome.ReturnToHand, target, source, game); controller.chooseTarget(Outcome.ReturnToHand, target, source, game);
Card card = player.getHand().get(target.getFirstTarget(), game); Card card = controller.getHand().get(target.getFirstTarget(), game);
if (card != null) { if (card != null) {
player.getHand().remove(card); controller.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false);
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
} }
return true; return true;
} }
@ -134,29 +136,27 @@ class PutCardOnLibraryEffect extends OneShotEffect {
} }
} }
class MaximumHandSizeEffect extends MaximumHandSizeControllerEffect {
class MaximumHandSizeEffect extends MaximumHandSizeControllerEffect{ public MaximumHandSizeEffect() {
public MaximumHandSizeEffect(){
super(Integer.MAX_VALUE, Duration.Custom, MaximumHandSizeControllerEffect.HandSizeModification.SET); super(Integer.MAX_VALUE, Duration.Custom, MaximumHandSizeControllerEffect.HandSizeModification.SET);
staticText = "You have no maximum hand size until your next turn"; staticText = "You have no maximum hand size until your next turn";
} }
public MaximumHandSizeEffect(final MaximumHandSizeEffect effect) { public MaximumHandSizeEffect(final MaximumHandSizeEffect effect) {
super(effect); super(effect);
} }
@Override @Override
public boolean isInactive(Ability source, Game game) { public boolean isInactive(Ability source, Game game) {
if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) if (game.getPhase().getStep().getType() == PhaseStep.UNTAP && game.getStep().getStepPart() == Step.StepPart.PRE) {
{
if (game.getActivePlayerId().equals(source.getControllerId())) { if (game.getActivePlayerId().equals(source.getControllerId())) {
return true; return true;
} }
} }
return false; return false;
} }
@Override @Override
public MaximumHandSizeEffect copy() { public MaximumHandSizeEffect copy() {
return new MaximumHandSizeEffect(this); return new MaximumHandSizeEffect(this);

View file

@ -147,7 +147,7 @@ class TheGreatAuroraEffect extends OneShotEffect {
toBattlefield.addAll(target.getTargets()); toBattlefield.addAll(target.getTargets());
} }
} }
return controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, true, false, true, null); return controller.moveCards(toBattlefield.getCards(game), Zone.BATTLEFIELD, source, game, false, false, true, null);
} }
return false; return false;
} }

View file

@ -30,12 +30,13 @@ package mage.sets.tempest;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.filter.FilterCard;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.common.TargetCardInHand; import mage.target.common.TargetCardInHand;
@ -50,7 +51,6 @@ public class DreamCache extends CardImpl {
super(ownerId, 59, "Dream Cache", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}"); super(ownerId, 59, "Dream Cache", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{U}");
this.expansionSetCode = "TMP"; this.expansionSetCode = "TMP";
// Draw three cards, then put two cards from your hand both on top of your library or both on the bottom of your library. // Draw three cards, then put two cards from your hand both on top of your library or both on the bottom of your library.
this.getSpellAbility().addEffect(new DreamCacheEffect()); this.getSpellAbility().addEffect(new DreamCacheEffect());
} }
@ -71,7 +71,7 @@ class DreamCacheEffect extends OneShotEffect {
super(Outcome.DrawCard); super(Outcome.DrawCard);
this.staticText = "Draw three cards, then put two cards from your hand both on top of your library or both on the bottom of your library."; this.staticText = "Draw three cards, then put two cards from your hand both on top of your library or both on the bottom of your library.";
} }
public DreamCacheEffect(final DreamCacheEffect effect) { public DreamCacheEffect(final DreamCacheEffect effect) {
super(effect); super(effect);
} }
@ -80,33 +80,26 @@ class DreamCacheEffect extends OneShotEffect {
public DreamCacheEffect copy() { public DreamCacheEffect copy() {
return new DreamCacheEffect(this); return new DreamCacheEffect(this);
} }
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (player != null) { if (controller != null) {
player.drawCards(3, game); controller.drawCards(3, game);
boolean putOnTop = controller.chooseUse(Outcome.Neutral, "Put cards on top?", source, game);
boolean putOnTop = player.chooseUse(Outcome.Neutral, "Put cards on top?", source, game); TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard());
putInLibrary(player, source, game, putOnTop); controller.chooseTarget(Outcome.Detriment, target, source, game);
putInLibrary(player, source, game, putOnTop); Cards cardsToLibrary = new CardsImpl(target.getTargets());
if (!cardsToLibrary.isEmpty()) {
if (putOnTop) {
controller.putCardsOnTopOfLibrary(cardsToLibrary, game, source, false);
} else {
controller.putCardsOnBottomOfLibrary(cardsToLibrary, game, source, false);
}
}
return true; return true;
} }
return false; return false;
} }
private boolean putInLibrary(Player player, Ability source, Game game, boolean putOnTop) {
if (player.getHand().size() > 0) {
TargetCardInHand target = new TargetCardInHand();
player.chooseTarget(Outcome.Detriment, target, source, game);
Card card = player.getHand().get(target.getFirstTarget(), game);
if (card != null) {
player.getHand().remove(card);
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, putOnTop);
return true;
}
}
return false;
}
} }

View file

@ -35,12 +35,13 @@ import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect; import mage.abilities.effects.common.ReturnToHandChosenControlledPermanentEffect;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType; import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.filter.FilterCard;
import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates; import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate; import mage.filter.predicate.mageobject.ColorPredicate;
@ -58,8 +59,8 @@ public class SawtoothLoon extends CardImpl {
static { static {
Predicates.or( Predicates.or(
new ColorPredicate(ObjectColor.WHITE), new ColorPredicate(ObjectColor.WHITE),
new ColorPredicate(ObjectColor.BLUE)); new ColorPredicate(ObjectColor.BLUE));
} }
public SawtoothLoon(UUID ownerId) { public SawtoothLoon(UUID ownerId) {
@ -110,21 +111,15 @@ class SawtoothLoonEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
controller.drawCards(2, game); controller.drawCards(2, game);
putOnLibrary(controller, source, game); TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard());
putOnLibrary(controller, source, game); controller.chooseTarget(Outcome.Detriment, target, source, game);
Cards cardsToLibrary = new CardsImpl(target.getTargets());
if (!cardsToLibrary.isEmpty()) {
controller.putCardsOnBottomOfLibrary(cardsToLibrary, game, source, false);
}
return true; return true;
} }
return false; return false;
} }
private boolean putOnLibrary(Player player, Ability source, Game game) {
TargetCardInHand target = new TargetCardInHand();
player.chooseTarget(Outcome.ReturnToHand, target, source, game);
Card card = player.getHand().get(target.getFirstTarget(), game);
if (card != null) {
player.getHand().remove(card);
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, false, false);
}
return true;
}
} }

View file

@ -41,6 +41,7 @@ import mage.constants.CardType;
import mage.constants.Outcome; import mage.constants.Outcome;
import mage.constants.Rarity; import mage.constants.Rarity;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game; import mage.game.Game;
import mage.players.Player; import mage.players.Player;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
@ -148,27 +149,19 @@ class JaceTheMindSculptorEffect2 extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (player != null) { if (controller != null) {
player.drawCards(3, game); controller.drawCards(3, game);
putOnLibrary(player, source, game); TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard());
putOnLibrary(player, source, game); controller.chooseTarget(Outcome.Detriment, target, source, game);
Cards cardsToLibrary = new CardsImpl(target.getTargets());
if (!cardsToLibrary.isEmpty()) {
controller.putCardsOnTopOfLibrary(cardsToLibrary, game, source, true);
}
return true; return true;
} }
return false; return false;
} }
private boolean putOnLibrary(Player player, Ability source, Game game) {
TargetCardInHand target = new TargetCardInHand();
player.chooseTarget(Outcome.ReturnToHand, target, source, game);
Card card = player.getHand().get(target.getFirstTarget(), game);
if (card != null) {
player.getHand().remove(card);
player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
}
return true;
}
} }
class JaceTheMindSculptorEffect3 extends OneShotEffect { class JaceTheMindSculptorEffect3 extends OneShotEffect {

View file

@ -27,12 +27,10 @@
*/ */
package mage.abilities.effects.common.search; package mage.abilities.effects.common.search;
import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.Mode; import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.Cards; import mage.cards.Cards;
import mage.cards.CardsImpl; import mage.cards.CardsImpl;
import mage.constants.Outcome; import mage.constants.Outcome;
@ -98,14 +96,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
filter.setMessage("card named " + cardName + " in the graveyard of " + targetPlayer.getLogName()); filter.setMessage("card named " + cardName + " in the graveyard of " + targetPlayer.getLogName());
TargetCard target = new TargetCard((graveyardExileOptional ? 0 : cardsCount), cardsCount, Zone.GRAVEYARD, filter); TargetCard target = new TargetCard((graveyardExileOptional ? 0 : cardsCount), cardsCount, Zone.GRAVEYARD, filter);
if (controller.choose(Outcome.Exile, targetPlayer.getGraveyard(), target, game)) { if (controller.choose(Outcome.Exile, targetPlayer.getGraveyard(), target, game)) {
List<UUID> targets = target.getTargets(); controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game);
for (UUID targetId : targets) {
Card targetCard = targetPlayer.getGraveyard().get(targetId, game);
if (targetCard != null) {
targetPlayer.getGraveyard().remove(targetCard);
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.GRAVEYARD, true);
}
}
} }
} }
@ -114,14 +105,7 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
filter.setMessage("card named " + cardName + " in the hand of " + targetPlayer.getLogName()); filter.setMessage("card named " + cardName + " in the hand of " + targetPlayer.getLogName());
TargetCard target = new TargetCard(0, cardsCount, Zone.HAND, filter); TargetCard target = new TargetCard(0, cardsCount, Zone.HAND, filter);
if (controller.choose(Outcome.Exile, targetPlayer.getHand(), target, game)) { if (controller.choose(Outcome.Exile, targetPlayer.getHand(), target, game)) {
List<UUID> targets = target.getTargets(); controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game);
for (UUID targetId : targets) {
Card targetCard = targetPlayer.getHand().get(targetId, game);
if (targetCard != null) {
targetPlayer.getHand().remove(targetCard);
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.HAND, true);
}
}
} }
// cards in Library // cards in Library
@ -131,15 +115,8 @@ public abstract class SearchTargetGraveyardHandLibraryForCardNameAndExileEffect
filter.setMessage("card named " + cardName + " in the library of " + targetPlayer.getLogName()); filter.setMessage("card named " + cardName + " in the library of " + targetPlayer.getLogName());
TargetCardInLibrary targetLib = new TargetCardInLibrary(0, cardsCount, filter); TargetCardInLibrary targetLib = new TargetCardInLibrary(0, cardsCount, filter);
if (controller.choose(Outcome.Exile, cardsInLibrary, targetLib, game)) { if (controller.choose(Outcome.Exile, cardsInLibrary, targetLib, game)) {
List<UUID> targets = targetLib.getTargets(); controller.moveCards(new CardsImpl(target.getTargets()), Zone.EXILED, source, game);
for (UUID targetId : targets) {
Card targetCard = targetPlayer.getLibrary().remove(targetId, game);
if (targetCard != null) {
controller.moveCardToExileWithInfo(targetCard, null, null, source.getSourceId(), game, Zone.LIBRARY, true);
}
}
} }
targetPlayer.shuffleLibrary(game); targetPlayer.shuffleLibrary(game);
} }