convert Grim Tutor to AF_ChangeZone

This commit is contained in:
jendave
2011-08-06 13:47:11 +00:00
parent 1de5642e76
commit c93b16ca7c
2 changed files with 2 additions and 67 deletions

View File

@@ -1,7 +1,8 @@
Name:Grim Tutor
ManaCost:1 B B
Types:Sorcery
Text:Search your library for a card and put that card into your hand. Then shuffle your library. You lose 3 life.
Text:no text
A:SP$ChangeZone | Cost$ 1 B B| Origin$ Library | Destination$ Hand | ChangeType$ Card | ChangeNum$ 1 | SpellDescription$ Search your library for a card and put that card into your hand, then shuffle your library. You lose 3 life.| SubAbility$YouLoseLife/3
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/grim_tutor.jpg
SetInfo:S99|Rare|http://magiccards.info/scans/en/st/79.jpg

View File

@@ -416,72 +416,6 @@ public class CardFactory_Sorceries {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Grim Tutor")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 1481169060428051519L;
@Override
public void resolve() {
Player player = card.getController();
if(player.equals(AllZone.HumanPlayer)) humanResolve();
else computerResolve();
}
public void humanResolve() {
Object check = AllZone.Display.getChoiceOptional("Select card",
AllZone.Human_Library.getCards());
if(check != null) {
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
AllZone.GameAction.moveTo(hand, (Card) check);
}
AllZone.HumanPlayer.shuffle();
//lose 3 life
if(cardName.equals("Grim Tutor")) {
Player player = AllZone.HumanPlayer;
player.loseLife(3, card);
}
}
public void computerResolve() {
Card[] library = AllZone.Computer_Library.getCards();
CardList list = new CardList(library);
//pick best creature
Card c = CardFactoryUtil.AI_getBestCreature(list);
if(c == null) c = library[0];
AllZone.Computer_Library.remove(c);
AllZone.Computer_Hand.add(c);
//lose 3 life
if(cardName.equals("Grim Tutor")) {
Player player = AllZone.ComputerPlayer;
player.loseLife(3, card);
}
}
@Override
public boolean canPlay() {
PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getController());
return library.getCards().length != 0
&& Phase.canCastSorcery(card.getController()) && super.canPlay();
}
@Override
public boolean canPlayAI() {
CardList creature = new CardList();
creature.addAll(AllZone.Computer_Library.getCards());
creature = creature.getType("Creature");
return creature.size() != 0;
}
};//SpellAbility
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Do or Die")) {
final SpellAbility spell = new Spell(card) {