From bc71ecc6739fc769d153ebfb1bf032d5a5c95e7b Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 02:55:20 +0000 Subject: [PATCH] Corrected Mind Funeral. Addad Dovescake and Lurking Informant. --- res/card-pictures.txt | 2 + res/cards.txt | 11 +++ src/forge/CardFactory.java | 70 ++++++++-------- src/forge/CardFactory_Creatures.java | 114 +++++++++++++++++++++------ src/forge/GameActionUtil.java | 58 ++++++++++++++ 5 files changed, 195 insertions(+), 60 deletions(-) diff --git a/res/card-pictures.txt b/res/card-pictures.txt index c58ed540035..85fa439d226 100644 --- a/res/card-pictures.txt +++ b/res/card-pictures.txt @@ -18,6 +18,8 @@ forest.jpg http://resources.wizards.com/magic/cards/unh/en-us/card73946.jpg forest1.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=2748 forest2.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=587 forest3.jpg http://gatherer.wizards.com/handlers/image.ashx?type=card&multiverseid=586 +dovescape.jpg http://www.wizards.com/global/images/magic/general/dovescape.jpg +lurking_informant.jpg http://www.wizards.com/global/images/magic/general/lurking_informant.jpg Belligerent_Hatchling.jpg http://www.wizards.com/global/images/magic/general/Belligerent_Hatchling.jpg Noxious_Hatchling.jpg http://www.wizards.com/global/images/magic/general/Noxious_Hatchling.jpg Sturdy_Hatchling.jpg http://www.wizards.com/global/images/magic/general/Sturdy_Hatchling.jpg diff --git a/res/cards.txt b/res/cards.txt index 3bcb48b5c0c..17a40881647 100644 --- a/res/cards.txt +++ b/res/cards.txt @@ -1,3 +1,14 @@ +Dovescape +3 WU WU WU +Enchantment +Whenever a player casts a noncreature spell, counter that spell. That player puts X 1/1 white and blue Bird creature tokens with flying onto the battlefield, where X is the spell’s converted mana cost. + +Lurking Informant +1 UB +Creature Human Rogue +no text +1/2 + Belligerent Hatchling 3 RW Creature Elemental diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index c75ca16d614..860e36afac6 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -17430,50 +17430,48 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase(); { final SpellAbility spell = new Spell(card) { - private static final long serialVersionUID = 42470566751344693L; + private static final long serialVersionUID = 42470566751344693L; public boolean canPlayAI() { - String player = getTargetPlayer(); - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); - CardList libList = new CardList(lib.getCards()); - return libList.size() > 0; + String player = getTargetPlayer(); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + CardList libList = new CardList(lib.getCards()); + return libList.size() > 0; } public void resolve() { - String player = getTargetPlayer(); - - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player); - CardList libList = new CardList(lib.getCards()); + String player = getTargetPlayer(); + + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player); + CardList libList = new CardList(lib.getCards()); - int max = libList.size(); - int prev = 0 ; - int count = 0; - int total =0; - int once = 0; - - for (int i=0;i 5 && !c.getType().contains("Land")) + { + lib.remove(c); + grave.add(c); + } + if (countLands(card) <= 5) + { + lib.remove(c); + grave.add(c); + } + } + + + } + private int countLands(Card c) + { + PlayerZone play = AllZone.getZone(Constant.Zone.Play, c + .getController()); + CardList lands = new CardList(play.getCards()); + lands = lands.getType("Land"); + return lands.size(); + } + + public boolean canPlayAI() + { + String player = getTargetPlayer(); + PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player); + CardList libList = new CardList(lib.getCards()); + return libList.size() > 0; + } + };//SpellAbility + card.addSpellAbility(a1); + a1.setDescription("2, tap: Look at the top card of target player's library. You may put that card into that player's graveyard."); + a1.setStackDescription("Lurking Informant ability"); + a1.setBeforePayMana(new Input_PayManaCost(a1)); + a1.setBeforePayMana(CardFactoryUtil.input_targetPlayer(a1)); + }//*************** END ************ END ************************** + //*************** START *********** START ************************** else if(cardName.equals("Shinka Gatekeeper")) { diff --git a/src/forge/GameActionUtil.java b/src/forge/GameActionUtil.java index cbffb2c9f96..5e9a6c65872 100644 --- a/src/forge/GameActionUtil.java +++ b/src/forge/GameActionUtil.java @@ -83,6 +83,7 @@ public class GameActionUtil // card gets played // (called in MagicStack.java) Card c = sa.getSourceCard(); + playCard_Dovescape(c); playCard_Belligerent_Hatchling(c); playCard_Voracious_Hatchling(c); playCard_Sturdy_Hatchling(c); @@ -102,6 +103,63 @@ public class GameActionUtil playCard_Mold_Adder(c); playCard_Fable_of_Wolf_and_Owl(c); } + + public static void playCard_Dovescape(Card c) + { + PlayerZone hplay = AllZone.getZone(Constant.Zone.Play, + Constant.Player.Human); + PlayerZone cplay = AllZone.getZone(Constant.Zone.Play, + Constant.Player.Computer); + + CardList list = new CardList(); + list.addAll(hplay.getCards()); + list.addAll(cplay.getCards()); + int cmc = CardUtil.getConvertedManaCost(c.getManaCost()); + list = list.getName("Dovescape"); + if ( ! c.getType().contains("Creature") && list.size()>0 ) { + + + final Card card = list.get(0); + + Ability ability2 = new Ability(card, "0") + { + public void resolve() + { + SpellAbility sa = AllZone.Stack.pop(); + + AllZone.GameAction.moveToGraveyard(sa.getSourceCard()); + + } + }; // ability2 + + ability2.setStackDescription("Dovescape Ability"); + AllZone.Stack.add(ability2); + + for (int j = 0; j < list.size()*cmc; j++) + { + Card crd = new Card(); + String controller = c.getController(); + crd.setOwner(controller); + crd.setController(controller); + + crd.setName("Bird"); + crd.setImageName("WU 1 1 Bird"); + crd.setManaCost("WU"); + crd.setToken(true); + + crd.addType("Creature"); + crd.addType("Bird"); + crd.addIntrinsicKeyword("Flying"); + + crd.setBaseAttack(1); + crd.setBaseDefense(1); + + PlayerZone play = AllZone.getZone(Constant.Zone.Play, controller); + play.add(crd); + } + } + } // Dovescape + public static void playCard_Belligerent_Hatchling(Card c) { final String controller = c.getController();