convert Sleight of Hand to AF_Dig

This commit is contained in:
jendave
2011-08-06 23:09:12 +00:00
parent 77fdb5057e
commit 0f7480df53
2 changed files with 2 additions and 54 deletions

View File

@@ -1,7 +1,8 @@
Name:Sleight of Hand
ManaCost:U
Types:Sorcery
Text:Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
Text:no text
A:AB$Dig | Cost$ U | DigNum$ 2 | SpellDescription$ Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
SVar:RemAIDeck:True
SVar:Rarity:Common
SVar:Picture:http://www.wizards.com/global/images/magic/general/sleight_of_hand.jpg

View File

@@ -1995,59 +1995,6 @@ public class CardFactory_Sorceries {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Sleight of Hand")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 5608200094037045828L;
@Override
public boolean canPlay() {
PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getController());
if(library.size() >= 1 && super.canPlay()) return true;
else return false;
}
@Override
public void resolve() {
CardList lib = AllZoneUtil.getPlayerCardsInLibrary(card.getController());
if (lib.size() == 0)
return;
if (lib.size() == 1){
AllZone.GameAction.moveToHand(lib.get(0));
return;
}
CardList topTwo = new CardList();
topTwo.add(lib.get(0));
topTwo.add(lib.get(1));
Card toHand = null;
if(card.getController().isHuman()) {
Object o = GuiUtils.getChoice("Select card to put in hand: ",
topTwo.toArray());
toHand = (Card) o;
}
else{
toHand = CardUtil.getRandom(topTwo.toArray());
}
topTwo.remove(toHand);
AllZone.GameAction.moveToHand(toHand);
for(Card c : topTwo) // Unnecessary for Sleight of Hand, but will be useful for other things
AllZone.GameAction.moveToBottomOfLibrary(c);
}
};
// Do not remove SpellAbilities created by AbilityFactory or Keywords.
card.clearFirstSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Invincible Hymn")) {
final Player player = card.getController();