From ccc2b8f36328f99a27d98111aa3cab8882c03485 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 08:56:03 +0000 Subject: [PATCH] - Converted Elven Cache and Regrowth to spReturnTgt keyword. - Deleted the code block for Elven Cache and Regrowth. --- res/cardsfolder/elven_cache.txt | 3 +- res/cardsfolder/regrowth.txt | 3 +- src/forge/CardFactory_Sorceries.java | 71 ---------------------------- 3 files changed, 4 insertions(+), 73 deletions(-) diff --git a/res/cardsfolder/elven_cache.txt b/res/cardsfolder/elven_cache.txt index ac8d1bd9e36..086ac08a968 100644 --- a/res/cardsfolder/elven_cache.txt +++ b/res/cardsfolder/elven_cache.txt @@ -1,7 +1,8 @@ Name:Elven Cache ManaCost:2 G G Types:Sorcery -Text:Return target card from your graveyard to your hand. +Text:Return target card from your graveyard to your hand. +K:spReturnTgt:1:Artifact,Creature,Enchantment,Land,Instant,Sorcery:Hand SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/elven_cache.jpg End diff --git a/res/cardsfolder/regrowth.txt b/res/cardsfolder/regrowth.txt index f43d6ca09b0..72962f8c678 100644 --- a/res/cardsfolder/regrowth.txt +++ b/res/cardsfolder/regrowth.txt @@ -1,7 +1,8 @@ Name:Regrowth ManaCost:1 G Types:Sorcery -Text:Return target card from your graveyard to your hand. +Text:Return target card from your graveyard to your hand. +K:spReturnTgt:1:Artifact,Creature,Enchantment,Land,Instant,Sorcery:Hand SVar:Rarity:Uncommon SVar:Picture:http://resources.wizards.com/magic/cards/1e/en-us/card170.jpg End diff --git a/src/forge/CardFactory_Sorceries.java b/src/forge/CardFactory_Sorceries.java index 048887716dc..4245f7f8856 100644 --- a/src/forge/CardFactory_Sorceries.java +++ b/src/forge/CardFactory_Sorceries.java @@ -3322,77 +3322,6 @@ public class CardFactory_Sorceries { }//*************** END ************ END ************************** - //*************** START *********** START ************************** - else if(cardName.equals("Regrowth") || cardName.equals("Elven Cache")) { - // added cousin Reclaim since 90% of the code is shared - final SpellAbility spell = new Spell(card) { - - private static final long serialVersionUID = -2069974600304157248L; - - @Override - public void resolve() { - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - - if(AllZone.GameAction.isCardInZone(getTargetCard(), graveyard)) { - graveyard.remove(getTargetCard()); - hand.add(getTargetCard()); - } - }//resolve() - - @Override - public boolean canPlay() { - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - return graveyard.getCards().length != 0 && super.canPlay(); - } - }; - Input runtime = new Input() { - - private static final long serialVersionUID = 3706956894704891104L; - - @Override - public void showMessage() { - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - Object o = AllZone.Display.getChoiceOptional("Select target card", graveyard.getCards()); - if(o == null) stop(); - else { - String location = "owner's hand"; - - spell.setStackDescription("Return " + o + " to " + location); - spell.setTargetCard((Card) o); - if(this.isFree()) - { - // WARNING: Read this before copying! - // When we have an 'if (this.isFree())' in most input objects, - // it's inside 'selectCard' not 'showMessage', and the usual - // order is - // AllZone.Stack.add(spell); - // stop(); - // Here, we had to reverse the order of those two lines, or - // else the dialog for Regrowth would get put up twice - // when the card was played from Cascade. I think this - // has to do with when showMessage() is called versus - // selectCard(). - // This appears to be the only place we use this pattern. Be - // careful when copying this code, and test your card with - // Cascade or Isochron Scepter. - this.setFree(false); - stop(); - AllZone.Stack.add(spell); - } - else - stopSetNext(new Input_PayManaCost(spell)); - } - }//showMessage() - }; - spell.setChooseTargetAI(CardFactoryUtil.AI_targetType("All", AllZone.Computer_Graveyard)); - spell.setBeforePayMana(runtime); - card.clearSpellAbility(); - card.addSpellAbility(spell); - }//*************** END ************ END ************************** - - - //*************** START *********** START ************************** else if(cardName.equals("Ichor Slick")) { final SpellAbility spell = new Spell(card) {