convert Necropotence to script

This commit is contained in:
slapshot5
2011-09-28 19:22:11 +00:00
parent cc046bcb0e
commit 1450c72a44
2 changed files with 4 additions and 75 deletions

View File

@@ -4,6 +4,10 @@ Types:Enchantment
Text:Skip your draw step. 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. 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 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:RemAIDeck:True
SVar:Rarity:Rare SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/necropotence.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/necropotence.jpg

View File

@@ -691,81 +691,6 @@ public abstract class AbstractCardFactory implements NewConstants, CardFactoryIn
} //*************** END ************ END ************************** } //*************** 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 ************************** //*************** START *********** START **************************
else if (cardName.equals("Aluren")) { else if (cardName.equals("Aluren")) {
final Ability ability1 = new Ability(card, "0") { final Ability ability1 = new Ability(card, "0") {