From 4acf803f0f5fe73c2aef3de6574f4eb866fdee57 Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 08:56:11 +0000 Subject: [PATCH] - Converted Reclaim to the spReturnTgt keyword and deleted the unneeded code block. Modified the spReturnTgt code to handle to top of library. --- res/cardsfolder/reclaim.txt | 3 +- src/forge/CardFactory.java | 10 +++-- src/forge/CardFactory_Instants.java | 67 ----------------------------- 3 files changed, 9 insertions(+), 71 deletions(-) diff --git a/res/cardsfolder/reclaim.txt b/res/cardsfolder/reclaim.txt index 1396f80560c..cec6c6397d9 100644 --- a/res/cardsfolder/reclaim.txt +++ b/res/cardsfolder/reclaim.txt @@ -1,7 +1,8 @@ Name:Reclaim ManaCost:G Types:Instant -Text:Put target card from your graveyard on top of your library. +Text:Put target card from your graveyard on top of your library. +K:spReturnTgt:1:Artifact,Creature,Enchantment,Land,Instant,Sorcery:TopofLibrary SVar:RemAIDeck:True SVar:Rarity:Common SVar:Picture:http://www.wizards.com/global/images/magic/general/reclaim.jpg diff --git a/src/forge/CardFactory.java b/src/forge/CardFactory.java index 56a9dbb931b..080293fddb0 100644 --- a/src/forge/CardFactory.java +++ b/src/forge/CardFactory.java @@ -3785,14 +3785,19 @@ public class CardFactory implements NewConstants { for (Card c:targets) { if (AllZone.GameAction.isCardInZone(c, grave)) { + if (Destination.equals("Hand")) { PlayerZone zone = AllZone.getZone(Constant.Zone.Hand, player); AllZone.GameAction.moveTo(zone, c); - - } else { + } + else if (Destination.equals("Battlefield")) { PlayerZone zone = AllZone.getZone(Constant.Zone.Play, player); AllZone.GameAction.moveTo(zone, c); } + else if (Destination.equals("TopofLibrary")) { + // PlayerZone zone = AllZone.getZone(Constant.Zone.Play, player); + AllZone.GameAction.moveToTopOfLibrary(c); + } } } }// resolve() @@ -3880,7 +3885,6 @@ public class CardFactory implements NewConstants { list = list.getValidCards(Tgts); return list; } - };// Input spRtrnTgt.setBeforePayMana(target); diff --git a/src/forge/CardFactory_Instants.java b/src/forge/CardFactory_Instants.java index 941fe80e771..aeecb868ed0 100644 --- a/src/forge/CardFactory_Instants.java +++ b/src/forge/CardFactory_Instants.java @@ -2533,73 +2533,6 @@ public class CardFactory_Instants { }//*************** END ************ END ************************** - //*************** START *********** START ************************** - else if( cardName.equals("Reclaim")) { - final SpellAbility spell = new Spell(card) { - - private static final long serialVersionUID = -7352293983206222113L; - - @Override - public void resolve() { - PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - - if(AllZone.GameAction.isCardInZone(getTargetCard(), graveyard)) { - graveyard.remove(getTargetCard()); - AllZone.GameAction.moveToTopOfLibrary(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 = -1438178075940689742L; - - @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 = "top of owner's library"; - - 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("Eladamri's Call")) { final SpellAbility spell = new Spell(card) {