diff --git a/res/card-pictures.txt b/res/card-pictures.txt index 86e2660a0e7..cf6584112e5 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -38,6 +38,7 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg +doomsday.jpg http://www.wizards.com/global/images/magic/general/doomsday.jpg eternal_dragon.jpg http://www.wizards.com/global/images/magic/general/eternal_dragon.jpg rite_of_replication.jpg http://www.wizards.com/global/images/magic/general/rite_of_replication.jpg undead_gladiator.jpg http://www.wizards.com/global/images/magic/general/undead_gladiator.jpg diff --git a/res/cards.txt b/res/cards.txt index 6821d9f2379..b04489047a4 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Doomsday +B B B +Sorcery +Search your library and graveyard for five cards and exile the rest. Put the chosen cards on top of your library in any order. You lose half your life, rounded up. + Eternal Dragon 5 W W Creature Dragon Spirit diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index cd9524867f7..e154006e049 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -7960,14 +7960,7 @@ public class CardFactory implements NewConstants { } else { JOptionPane.showMessageDialog(null, "You can't play any more lands this turn.", "", JOptionPane.INFORMATION_MESSAGE); } - /** } else if(c.getName().equals("Recall")) { - // Fake playing the spell - Phase.StormCount = Phase.StormCount + 1; - if(c.getController() == "Human") { - Phase.PlayerSpellCount = Phase.PlayerSpellCount + 1; - } else Phase.ComputerSpellCount = Phase.ComputerSpellCount + 1; - card.unattachCard(c); - **/ } else if(c.isPermanent() == true && c.isAura() == false) { + } else if(c.isPermanent() == true && c.isAura() == false) { c.removeIntrinsicKeyword("Flash"); // Stops the player from re-casting the flash spell. PlayCreature.setStackDescription(c.getName() + " - Copied from Mind's Desire"); Card [] ReAttach = new Card[Attached.length]; @@ -8003,46 +7996,43 @@ public class CardFactory implements NewConstants { }; freeCast.setStackDescription("Mind's Desire - play card without paying its mana cost."); - - - final SpellAbility ability = new Ability(card, "0") { - @Override - public void resolve() { - String player = AllZone.Phase.getActivePlayer(); - if(player == "Human") AllZone.GameAction.shuffle(card.getController()); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); - CardList libList = new CardList(lib.getCards()); - Card c = null; - if(libList.size() > 0) { - c = libList.get(0); - } - if(c != null) { - PlayerZone RFG = AllZone.getZone(Constant.Zone.Removed_From_Play, player); - AllZone.GameAction.moveTo(RFG, c); - card.attachCard(c); - } - JOptionPane.showMessageDialog(null, "Click Mind's Desire to see the available cards to play without paying its mana cost.", "", JOptionPane.INFORMATION_MESSAGE); - final Card Minds = card; - AllZone.GameAction.exile(Minds); - Command untilEOT = new Command() { - private static final long serialVersionUID = -28032591440730370L; - - public void execute() { - String player = AllZone.Phase.getActivePlayer(); - PlayerZone play = AllZone.getZone(Constant.Zone.Play, player); - play.remove(Minds); - } - }; - AllZone.EndOfTurn.addUntil(untilEOT); - }//resolve() - };//SpellAbility - + Command intoPlay = new Command() { private static final long serialVersionUID = 920148510259054021L; public void execute() { - ability.setStackDescription(card.getController() + " - Shuffle your library. Then exile the top card of your library."); - AllZone.Stack.add(ability); + String player = AllZone.Phase.getActivePlayer(); + PlayerZone Play = AllZone.getZone(Constant.Zone.Play, player); + if(player == "Human") AllZone.GameAction.shuffle(card.getController()); + CardList MindsList = new CardList(Play.getCards()); + MindsList = MindsList.getName("Mind's Desire"); + MindsList.remove(card); + if(MindsList.contains(card) == true) { + Play.remove(card); + } else JOptionPane.showMessageDialog(null, "Click Mind's Desire to see the available cards to play without paying its mana cost.", "", JOptionPane.INFORMATION_MESSAGE); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + CardList libList = new CardList(lib.getCards()); + Card c = null; + if(libList.size() > 0) { + c = libList.get(0); + } + if(c != null) { + PlayerZone RFG = AllZone.getZone(Constant.Zone.Removed_From_Play, player); + AllZone.GameAction.moveTo(RFG, c); + card.attachCard(c); + } + final Card Minds = card; + // AllZone.GameAction.exile(Minds); + Command untilEOT = new Command() { + private static final long serialVersionUID = -28032591440730370L; + + public void execute() { + String player = AllZone.Phase.getActivePlayer(); + PlayerZone play = AllZone.getZone(Constant.Zone.Play, player); + play.remove(Minds); + } + }; + AllZone.EndOfTurn.addUntil(untilEOT); } }; @@ -8059,7 +8049,54 @@ public class CardFactory implements NewConstants { card.addSpellAbility(spell); card.addSpellAbility(freeCast); } - //*************** END ************ END ************************** + //*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if(cardName.equals("Doomsday")) { + final SpellAbility spell = new Spell(card) { + private static final long serialVersionUID = 1481112451519L; + + @Override + public void resolve() { + CardList GraveandLibrary = new CardList(); + String Player = card.getController(); + GraveandLibrary.add(new CardList(AllZone.getZone(Constant.Zone.Library, Player).getCards())); + GraveandLibrary.add(new CardList(AllZone.getZone(Constant.Zone.Graveyard, Player).getCards())); + CardList NewLibrary = new CardList(); + int Count = 5; + if(GraveandLibrary.size() < 5) Count = GraveandLibrary.size(); + + for(int i = 0; i < Count; i++) { + Card[] Search = GraveandLibrary.toArray(); + AllZone.Display.showMessage("Select a card to put " + i + " from the top of the new library: " + (Count - i) + " Choices to go."); + ButtonUtil.enableOnlyCancel(); + Object check = AllZone.Display.getChoice("Select a card: ", Search); + NewLibrary.add((Card) check); + GraveandLibrary.remove((Card) check); + + } + + PlayerZone RFG = AllZone.getZone(Constant.Zone.Removed_From_Play, Player); + PlayerZone Library = AllZone.getZone(Constant.Zone.Library, Player); + for(int i = 0; i < GraveandLibrary.size(); i++) AllZone.GameAction.moveTo(RFG,GraveandLibrary.get(i)); + AllZone.GameAction.moveTo(RFG,card); // Not sure if Doomsday is supposed to be exiled + for(int i = 0; i < NewLibrary.size(); i++) AllZone.GameAction.moveTo(Library,NewLibrary.get(i)); + + //lose half life + String player = Constant.Player.Human; + PlayerLife life = AllZone.GameAction.getPlayerLife(player); + life.subtractLife(life.getLife() / 2); + } + + @Override + public boolean canPlayAI() { + return false; + } + };//SpellAbility + card.clearSpellAbility(); + card.addSpellAbility(spell); + }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Temporal Fissure")) { final SpellAbility spell = new Spell(card) { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index dbfaa1ad6e0..30f1a8f47e3 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -869,6 +869,13 @@ public class GameActionUtil { else if(StormCard.getName().equals("Mind's Desire")) { String player = AllZone.Phase.getActivePlayer(); if(player == "Human") AllZone.GameAction.shuffle(StormCard.getController()); + // New + PlayerZone Play = AllZone.getZone(Constant.Zone.Play, player); + + if(AllZone.GameAction.isCardInZone(StormCard,Play) == false) { + Play.add(StormCard); + } else { + // New PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); CardList libList = new CardList(lib.getCards()); Card c = null; @@ -880,6 +887,7 @@ public class GameActionUtil { AllZone.GameAction.moveTo(RFG, c); StormCard.attachCard(c); } + } } // Mind's Desire } // Resolve