mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
convert Necropotence to script
This commit is contained in:
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user