From e344dc0a11fa17d99787ff5f9cf82cc1c858db37 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 14:19:05 +0000 Subject: [PATCH] - Added Lost Auramancers. --- .gitattributes | 1 + res/cardsfolder/lost_auramancers.txt | 10 ++ src/forge/CardFactory_Creatures.java | 139 +++++++-------------------- 3 files changed, 46 insertions(+), 104 deletions(-) create mode 100644 res/cardsfolder/lost_auramancers.txt diff --git a/.gitattributes b/.gitattributes index 8959ece0c0f..ea863df245f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2932,6 +2932,7 @@ res/cardsfolder/lord_of_the_undead.txt -text svneol=native#text/plain res/cardsfolder/lorescale_coatl.txt -text svneol=native#text/plain res/cardsfolder/lorthos_the_tidemaker.txt -text svneol=native#text/plain res/cardsfolder/lose_hope.txt -text svneol=native#text/plain +res/cardsfolder/lost_auramancers.txt -text svneol=native#text/plain res/cardsfolder/lost_soul.txt -text svneol=native#text/plain res/cardsfolder/lotus_bloom.txt -text svneol=native#text/plain res/cardsfolder/lotus_cobra.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/lost_auramancers.txt b/res/cardsfolder/lost_auramancers.txt new file mode 100644 index 00000000000..b0f95193e79 --- /dev/null +++ b/res/cardsfolder/lost_auramancers.txt @@ -0,0 +1,10 @@ +Name:Lost Auramancers +ManaCost:2 W W +Types:Creature Human Wizard +Text:When Lost Auramancers is put into a graveyard from the battlefield, if it had no time counters on it, you may search your library for an enchantment card and put it onto the battlefield. If you do, shuffle your library. +PT:3/3 +K:Vanishing:3 +SVar:SacMe:4 +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/lost_auramancers.jpg +End \ No newline at end of file diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 55fab1b31e6..0fe2f6e0484 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -9198,7 +9198,7 @@ public class CardFactory_Creatures { //*************** START *********** START ************************** - else if(cardName.equals("Academy Rector")) { + else if(cardName.equals("Academy Rector") || cardName.equals("Lost Auramancers")) { final SpellAbility ability = new Ability(card, "0") { @Override @@ -9206,11 +9206,17 @@ public class CardFactory_Creatures { if (card.getController().equals(AllZone.HumanPlayer)) { StringBuilder question = new StringBuilder(); - question.append("Exile ").append(card.getName()); - question.append(" and place an enchantment from your library onto the battlefield?"); + if (card.getName().equals("Academy Rector")) { + question.append("Exile ").append(card.getName()).append(" and place "); + } else { + question.append("Place "); + } + question.append("an enchantment from your library onto the battlefield?"); if (GameActionUtil.showYesNoDialog(card, question.toString())) { - AllZone.GameAction.exile(card); + if (card.getName().equals("Academy Rector")) { + AllZone.GameAction.exile(card); + } PlayerZone lib = AllZone.getZone(Constant.Zone.Library, AllZone.HumanPlayer); CardList list = AllZoneUtil.getPlayerCardsInLibrary(AllZone.HumanPlayer); list = list.getType("Enchantment"); @@ -9233,11 +9239,11 @@ public class CardFactory_Creatures { // Note that I am being overly cautious. if (c.getKeyword().contains("Enchant creature without flying") - || c.getKeyword().contains("Enchant Creature without flying")) { + || c.getKeyword().contains("Enchant Creature without flying")) { enchantThisType[0] = "Creature.withoutFlying"; message[0] = "Select a creature without flying"; } else if (c.getKeyword().contains("Enchant creature with converted mana cost 2 or less") - || c.getKeyword().contains("Enchant Creature with converted mana cost 2 or less")) { + || c.getKeyword().contains("Enchant Creature with converted mana cost 2 or less")) { enchantThisType[0] = "Creature.cmcLE2"; message[0] = "Select a creature with converted mana cost 2 or less"; } else if (c.getKeyword().contains("Enchant red or green creature")) { @@ -9247,27 +9253,27 @@ public class CardFactory_Creatures { enchantThisType[0] = "Creature.tapped"; message[0] = "Select a tapped creature"; } else if (c.getKeyword().contains("Enchant creature") - || c.getKeyword().contains("Enchant Creature")) { + || c.getKeyword().contains("Enchant Creature")) { enchantThisType[0] = "Creature"; message[0] = "Select a creature"; } else if (c.getKeyword().contains("Enchant wall") - || c.getKeyword().contains("Enchant Wall")) { + || c.getKeyword().contains("Enchant Wall")) { enchantThisType[0] = "Wall"; message[0] = "Select a Wall"; } else if (c.getKeyword().contains("Enchant land you control") - || c.getKeyword().contains("Enchant Land you control")) { + || c.getKeyword().contains("Enchant Land you control")) { enchantThisType[0] = "Land.YouCtrl"; message[0] = "Select a land you control"; } else if (c.getKeyword().contains("Enchant land") - || c.getKeyword().contains("Enchant Land")) { + || c.getKeyword().contains("Enchant Land")) { enchantThisType[0] = "Land"; message[0] = "Select a land"; } else if (c.getKeyword().contains("Enchant artifact") - || c.getKeyword().contains("Enchant Artifact")) { + || c.getKeyword().contains("Enchant Artifact")) { enchantThisType[0] = "Artifact"; message[0] = "Select an artifact"; } else if (c.getKeyword().contains("Enchant enchantment") - || c.getKeyword().contains("Enchant Enchantment")) { + || c.getKeyword().contains("Enchant Enchantment")) { enchantThisType[0] = "Enchantment"; message[0] = "Select an enchantment"; } @@ -9332,116 +9338,41 @@ public class CardFactory_Creatures { Card c = CardFactoryUtil.AI_getBestEnchantment(list, card, false); lib.remove(c); play.add(c); - AllZone.GameAction.exile(card); + if (card.getName().equals("Academy Rector")) { + AllZone.GameAction.exile(card); + } } }// player is the computer }// resolve() };// ability StringBuilder sb = new StringBuilder(); - sb.append("Academy Rector - ").append(card.getController()); - sb.append(" may exile this card and place an enchantment from his library onto the battlefield."); + if (card.getName().equals("Academy Rector")) { + sb.append("Academy Rector - ").append(card.getController()); + sb.append(" may exile this card and place an enchantment from his library onto the battlefield."); + } else { + sb.append("Lost Auramancers - ").append(card.getController()); + sb.append(" may place an enchantment from his library onto the battlefield."); + } ability.setStackDescription(sb.toString()); final Command destroy = new Command() { private static final long serialVersionUID = -4352349741511065318L; public void execute() { - AllZone.Stack.add(ability); + if (card.getName().equals("Lost Auramancers") + && card.getCounters(Counters.TIME) <= 0) { + AllZone.Stack.add(ability); + } else if (card.getName().equals("Academy Rector")) { + AllZone.Stack.add(ability); + } }// execute() };// Command destroy card.addDestroyCommand(destroy); }//*************** END ************ END ************************** - - /* - //*************** START *********** START ************************** - else if(cardName.equals("Academy Rector")) { - final Command destroy = new Command() { - private static final long serialVersionUID = -4352349741511065318L; - - public void execute() { - if(card.getController().equals(AllZone.HumanPlayer)) { - String[] choices = {"Yes", "No"}; - Object q = null; - - q = AllZone.Display.getChoiceOptional("Exile " + card.getName() + "?", choices); - - if(q == null || q.equals("No")) ; - else { - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, AllZone.HumanPlayer); - CardList list = new CardList(lib.getCards()); - list = list.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isEnchantment(); - } - }); - - if(list.size() > 0) { - Object o = AllZone.Display.getChoiceOptional( - "Choose enchantment card to put onto the battlefield", list.toArray()); - if(o != null) { - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer); - PlayerZone oppPlay = AllZone.getZone(Constant.Zone.Battlefield, - AllZone.ComputerPlayer); - Card c = (Card) o; - lib.remove(c); - play.add(c); - - if(c.isAura()) { - Object obj = null; - if(c.getKeyword().contains("Enchant creature")) { - CardList creats = new CardList(play.getCards()); - creats.addAll(oppPlay.getCards()); - creats = creats.getType("Creature"); - obj = AllZone.Display.getChoiceOptional("Pick a creature to attach " - + c.getName() + " to", creats.toArray()); - } else if(c.getKeyword().contains("Enchant land") - || c.getKeyword().contains("Enchant land you control")) { - CardList lands = new CardList(play.getCards()); - //lands.addAll(oppPlay.getCards()); - lands = lands.getType("Land"); - if(lands.size() > 0) obj = AllZone.Display.getChoiceOptional( - "Pick a land to attach " + c.getName() + " to", - lands.toArray()); - } - if(obj != null) { - Card target = (Card) obj; - if(AllZone.GameAction.isCardInPlay(target)) { - c.enchantCard(target); - } - } - } - } - } - AllZone.GameAction.exile(card); - } - }//if human - else { - PlayerZone lib = AllZone.getZone(Constant.Zone.Library, AllZone.ComputerPlayer); - CardList list = new CardList(lib.getCards()); - list = list.filter(new CardListFilter() { - public boolean addCard(Card c) { - return c.isEnchantment() && !c.isAura(); - } - }); - - if(list.size() > 0) { - PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, AllZone.ComputerPlayer); - Card c = CardFactoryUtil.AI_getBestEnchantment(list, card, false); - lib.remove(c); - play.add(c); - AllZone.GameAction.exile(card); - - } - } - } - }; - - card.addDestroyCommand(destroy); - }//*************** END ************ END ************************** - */ + //*************** START *********** START ************************** else if(cardName.equals("Deadly Grub")) {