* 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;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
@ -35,14 +36,17 @@ import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.MaximumHandSizeControllerEffect;
import mage.cards.Card;
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.turn.Step;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import java.util.UUID;
/**
*
* @author LevelX2
@ -53,7 +57,6 @@ public class EnterTheInfinite extends CardImpl {
super(ownerId, 34, "Enter the Infinite", Rarity.MYTHIC, new CardType[]{CardType.SORCERY}, "{8}{U}{U}{U}{U}");
this.expansionSetCode = "GTC";
// Draw cards equal to the number of cards in your library,
this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(new CardsInControllerLibraryCount()));
//then put a card from your hand on top of your library.
@ -72,8 +75,8 @@ public class EnterTheInfinite extends CardImpl {
}
}
class CardsInControllerLibraryCount implements DynamicValue {
@Override
public int calculate(Game game, Ability sourceAbility, Effect effect) {
if (sourceAbility != null) {
@ -119,14 +122,13 @@ class PutCardOnLibraryEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
TargetCardInHand target = new TargetCardInHand();
player.chooseTarget(Outcome.ReturnToHand, target, source, game);
Card card = player.getHand().get(target.getFirstTarget(), game);
controller.chooseTarget(Outcome.ReturnToHand, target, source, game);
Card card = controller.getHand().get(target.getFirstTarget(), game);
if (card != null) {
player.getHand().remove(card);
card.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
controller.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false);
}
return true;
}
@ -134,10 +136,9 @@ 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);
staticText = "You have no maximum hand size until your next turn";
}
@ -148,8 +149,7 @@ class MaximumHandSizeEffect extends MaximumHandSizeControllerEffect{
@Override
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())) {
return true;
}

View file

@ -147,7 +147,7 @@ class TheGreatAuroraEffect extends OneShotEffect {
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;
}

View file

@ -30,12 +30,13 @@ package mage.sets.tempest;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
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}");
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.
this.getSpellAbility().addEffect(new DreamCacheEffect());
}
@ -83,30 +83,23 @@ class DreamCacheEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.drawCards(3, game);
boolean putOnTop = player.chooseUse(Outcome.Neutral, "Put cards on top?", source, game);
putInLibrary(player, source, game, putOnTop);
putInLibrary(player, source, game, putOnTop);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.drawCards(3, game);
boolean putOnTop = controller.chooseUse(Outcome.Neutral, "Put cards on top?", source, game);
TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard());
controller.chooseTarget(Outcome.Detriment, target, source, game);
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 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.common.ReturnToHandChosenControlledPermanentEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
@ -110,21 +111,15 @@ class SawtoothLoonEffect extends OneShotEffect {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.drawCards(2, game);
putOnLibrary(controller, source, game);
putOnLibrary(controller, source, game);
TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard());
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 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.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import mage.target.TargetPlayer;
@ -148,27 +149,19 @@ class JaceTheMindSculptorEffect2 extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
player.drawCards(3, game);
putOnLibrary(player, source, game);
putOnLibrary(player, source, game);
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
controller.drawCards(3, game);
TargetCardInHand target = new TargetCardInHand(2, 2, new FilterCard());
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 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 {

View file

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