diff --git a/res/card-pictures.txt b/res/card-pictures.txt index e568c4c7cb1..30cbf684b50 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 +lodestone_bauble.jpg http://www.wizards.com/global/images/magic/general/lodestone_bauble.jpg winter_orb.jpg http://www.wizards.com/global/images/magic/general/winter_orb.jpg keldon_warlord.jpg http://www.wizards.com/global/images/magic/general/keldon_warlord.jpg zuran_orb.jpg http://www.wizards.com/global/images/magic/general/zuran_orb.jpg diff --git a/res/cards.txt b/res/cards.txt index 74c419fdf40..c79a19ad4d2 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,8 @@ +Lodestone Bauble +0 +Artifact +tap, 1: Sacrifice Lodestone Bauble: Put up to four target basic land cards from a player's graveyard on top of his or her library in any order. That player draws a card at the beginning of the next turn's upkeep. + Transcendent Master 1 W W Creature Human Cleric Avatar diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 42e54b723a5..b44ff443a0d 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -18186,7 +18186,103 @@ public class CardFactory implements NewConstants { card.addSpellAbility(ability); ability.setBeforePayMana(runtime); }//*************** END ************ END ************************** + + //*************** START *********** START ************************** + else if(cardName.equals("Lodestone Bauble")) { + /* 1, Tap, Sacrifice Lodestone Bauble: Put up to four target basic + * land cards from a player's graveyard on top of his or her library + * in any order. That player draws a card at the beginning of the next + * turn's upkeep. + */ + final Ability_Tap ability = new Ability_Tap(card, "1") { + private static final long serialVersionUID = -6711849408085138636L; + + @Override + public boolean canPlayAI() { + return getComputerLands().size() >= 4; + } + + @Override + public void chooseTargetAI() { + setTargetPlayer(Constant.Player.Computer); + }//chooseTargetAI() + + @Override + public void resolve() { + final int limit = 4; //at most, this can target 4 cards + final String player = getTargetPlayer(); + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + + CardList lands = new CardList(grave.getCards()); + lands = lands.filter(basicLands); + //this should probably be card.getController().equals(Constant.Player.Human) instead of player + //if(player.equals(Constant.Player.Human)) { + if(card.getController().equals(Constant.Player.Human)){ + //now, select up to four lands + int end = -1; + end = Math.min(lands.size(), limit); + //TODO - maybe pop a message box here that no basic lands found (if necessary) + for(int i = 1; i <= end; i++) { + String Title = "Put on top of library: "; + if(i == 2) Title = "Put second from top of library: "; + if(i == 3) Title = "Put third from top of library: "; + if(i == 4) Title = "Put fourth from top of library: "; + Object o = AllZone.Display.getChoiceOptional(Title, lands.toArray()); + if(o == null) break; + Card c_1 = (Card) o; + lands.remove(c_1); //remove from the display list + grave.remove(c_1); //remove from graveyard + lib.add(c_1, i - 1); //add to library + } + } + else { //Computer + //based on current AI, computer should always target himself. + CardList list = getComputerLands(); + int max = list.size(); + if (max > limit) max = limit; + + for(int i=0;i