From 1450c72a44d5fbbfb1d64132decd6a39ba872562 Mon Sep 17 00:00:00 2001 From: slapshot5 Date: Wed, 28 Sep 2011 19:22:11 +0000 Subject: [PATCH] convert Necropotence to script --- res/cardsfolder/n/necropotence.txt | 4 + .../card/cardFactory/AbstractCardFactory.java | 75 ------------------- 2 files changed, 4 insertions(+), 75 deletions(-) diff --git a/res/cardsfolder/n/necropotence.txt b/res/cardsfolder/n/necropotence.txt index a54092c9c62..fe8b38e7a6a 100644 --- a/res/cardsfolder/n/necropotence.txt +++ b/res/cardsfolder/n/necropotence.txt @@ -4,6 +4,10 @@ Types:Enchantment Text:Skip your draw step. T:Mode$ Discarded | ValidCard$ Card.YouCtrl | TriggerZones$ Battlefield | Execute$ TrigChange | TriggerDescription$ Whenever you discard a card, exile that card from your graveyard. SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Exile +A:AB$ ChangeZone | Cost$ PayLife<1> | Defined$ TopOfLibrary | Origin$ Library | Destination$ Exile | ExileFaceDown$ True | RememberChanged$ True | SubAbility$ DelayedReturn | SpellDescription$ Exile the top card of your library face down. Put that card into your hand at the beginning of your next end step. +SVar:DelayedReturn:DB$ DelayedTrigger | Mode$ Phase | Phase$ End of Turn | Execute$ TrigReturn | TriggerDescription$ Put the exiled card into your hand. +SVar:TrigReturn:DB$ ChangeZone | Origin$ Exile | Destination$ Hand | Defined$ Remembered | SubAbility$ DBCleanup +SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/necropotence.jpg diff --git a/src/main/java/forge/card/cardFactory/AbstractCardFactory.java b/src/main/java/forge/card/cardFactory/AbstractCardFactory.java index 85fc948749a..e36c46555c8 100644 --- a/src/main/java/forge/card/cardFactory/AbstractCardFactory.java +++ b/src/main/java/forge/card/cardFactory/AbstractCardFactory.java @@ -691,81 +691,6 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn } //*************** END ************ END ************************** - //*************** START *********** START ************************** - else if (cardName.equals("Necropotence")) { - final CardList necroCards = new CardList(); - - final Command necro = new Command() { - private static final long serialVersionUID = 4511445425867383336L; - - public void execute() { - //put cards removed by Necropotence into the player's hand - if (necroCards.size() > 0) { - PlayerZone hand = card.getController().getZone(Constant.Zone.Hand); - - for (int i = 0; i < necroCards.size(); i++) { - hand.add(necroCards.get(i)); - } - necroCards.clear(); - } - } - }; - - final SpellAbility ability = new Ability(card, "0") { - @Override - public void resolve() { - PlayerZone library = card.getController().getZone(Constant.Zone.Library); - - if (library.size() != 0) { - Card c = library.get(0); - library.remove(c); - - // TODO Necro really exiles face down, but for now we'll just do it this way - // c.setIsFaceDown(true); - // AllZone.getGameAction().exile(c); - necroCards.add(c); //add card to necro so that it goes into hand at end of turn - AllZone.getEndOfTurn().addAt(necro); - } - } - - @Override - public boolean canPlayAI() { - return false; - } - }; //SpellAbility - - ability.setDescription("Pay 1 life: Exile the top card of your library face down. " + - "Put that card into your hand at the beginning of your next end step."); - - StringBuilder sb = new StringBuilder(); - sb.append(card.getName()); - sb.append(" - Exile the top card of your library face down. " + - "Put that card into your hand at the beginning of your next end step."); - ability.setStackDescription(sb.toString()); - - card.addSpellAbility(ability); - - //instead of paying mana, pay life and add to stack - //Input showMessage() is always the first method called - Input payLife = new Input() { - private static final long serialVersionUID = -3846772748411690084L; - - @Override - public void showMessage() { - boolean paid = card.getController().payLife(1, card); - - //this order is very important, do not change - stop(); - if (paid) { - AllZone.getStack().add(ability); - } - } - }; //Input - ability.setBeforePayMana(payLife); - - } //*************** END ************ END ************************** - - //*************** START *********** START ************************** else if (cardName.equals("Aluren")) { final Ability ability1 = new Ability(card, "0") {