Eladamri's Call

I haven't really tested this with the AI yet, but I think it should work?
cards.txt:
cards.txt:
- Code: Select all
Eladamri's Call
G W
Instant
Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library.
- Code: Select all
//*************** START *********** START **************************
if(cardName.equals("Eladamri's Call"))
{
final SpellAbility spell = new Spell(card)
{
public void resolve()
{
String player = card.getController();
if(player.equals(Constant.Player.Human))
humanResolve();
else
computerResolve();
}
public void humanResolve()
{
CardList creatures = new CardList(AllZone.Human_Library.getCards());
creatures = creatures.getType("Creature");
Object check = AllZone.Display.getChoiceOptional("Select creature", creatures.toArray());
if(check != null)
{
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
AllZone.GameAction.moveTo(hand, (Card)check);
}
AllZone.GameAction.shuffle(Constant.Player.Human);
}
public void computerResolve()
{
Card[] library = AllZone.Computer_Library.getCards();
CardList list = new CardList(library);
list = list.getType("Creature");
//pick best creature
Card c = CardFactoryUtil.AI_getBestCreature(list);
if(c == null)
c = library[0];
System.out.println("computer picked - " +c);
AllZone.Computer_Library.remove(c);
AllZone.Computer_Hand.add(c);
}
public boolean canPlay()
{
PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getController());
return library.getCards().length != 0;
}
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 **************************