- Converted Demonic Consultation to script.

This commit is contained in:
jeffwadsworth
2012-01-22 17:27:29 +00:00
parent b1588bda51
commit 89a6989c76
2 changed files with 4 additions and 54 deletions

View File

@@ -1,7 +1,10 @@
Name:Demonic Consultation Name:Demonic Consultation
ManaCost:B ManaCost:B
Types:Instant Types:Instant
Text:Name a card. Exile the top six cards of your library, then reveal cards from the top of your library until you reveal the named card. Put that card into your hand and exile all other cards revealed this way. Text:no text
A:SP$ NameCard | Cost$ B | Defined$ You | SubAbility$ DBMill | SpellDescription$ Name a card. Exile the top six cards of your library, then reveal cards from the top of your library until you reveal the named card. Put that card into your hand and exile all other cards revealed this way.
SVar:DBMill:DB$ Mill | Defined$ You | NumCards$ 6 | Destination$ Exile | SubAbility$ DBDigUntil
SVar:DBDigUntil:DB$ DigUntil | Valid$ Card.NamedCard | FoundDestination$ Hand | RevealedDestination$ Exile | ValidDescription$ named card
SVar:RemAIDeck:True SVar:RemAIDeck:True
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/demonic_consultation.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/demonic_consultation.jpg

View File

@@ -442,59 +442,6 @@ public class CardFactoryInstants {
card.addSpellAbility(spell); card.addSpellAbility(spell);
} // *************** END ************ END ************************** } // *************** END ************ END **************************
// *************** START *********** START **************************
else if (cardName.equals("Demonic Consultation")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 1481101852928051519L;
@Override
public void resolve() {
final Player player = card.getController();
final CardList libList = player.getCardsIn(Zone.Library);
final String[] input = new String[1];
input[0] = JOptionPane.showInputDialog(null, "Which card?", "Pick card",
JOptionPane.QUESTION_MESSAGE);
for (int i = 0; i < 7; i++) {
final Card c = libList.get(i);
AllZone.getGameAction().exile(c);
}
final int max = libList.size();
int stop = 0;
for (int i = 0; i < max; i++) {
final Card c = libList.get(i);
if (c.getName().equals(input[0])) {
if (stop == 0) {
AllZone.getGameAction().moveToHand(c);
stop = 1;
}
} else if (stop == 0) {
AllZone.getGameAction().exile(c);
}
}
}
@Override
public boolean canPlay() {
final CardList libList = card.getController().getCardsIn(Zone.Library);
return (libList.size() > 6) && super.canPlay();
}
@Override
public boolean canPlayAI() {
return false;
}
}; // SpellAbility
final StringBuilder sb = new StringBuilder();
sb.append("Name a card. Exile the top six cards of your library, ");
sb.append("then reveal cards from the top of your library until you reveal the named card. ");
sb.append("Put that card into your hand and exile all other cards revealed this way");
spell.setStackDescription(sb.toString());
card.addSpellAbility(spell);
} // *************** END ************ END **************************
// *************** START *********** START ************************** // *************** START *********** START **************************
else if (cardName.equals("Siren's Call")) { else if (cardName.equals("Siren's Call")) {