- Added Yavimaya Elder.

This commit is contained in:
jendave
2011-08-06 05:22:00 +00:00
parent c71a407958
commit f739006170
2 changed files with 74 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
Yavimaya Elder
1 G G
Creature Human Druid
When Yavimaya Elder is put into a graveyard from the battlefield, you may search your library for up to two basic land cards, reveal them, and put them into your hand. If you do, shuffle your library.
2/1
Scavenger Drake Scavenger Drake
3 B 3 B
Creature Drake Creature Drake

View File

@@ -20631,6 +20631,74 @@ public class CardFactory_Creatures {
}//*************** END ************ END ************************** }//*************** END ************ END **************************
if (cardName.equals("Yavimaya Elder"))
{
final SpellAbility ability = new Ability(card, "2") {
@Override
public boolean canPlay() {
return AllZone.GameAction.isCardInPlay(card)
&& !AllZone.Stack.getSourceCards().contains(card);//in play and not already activated(Sac cost problems)
}
@Override
public boolean canPlayAI() {
return (AllZone.Computer_Hand.size() < 3) && (AllZone.Computer_Library.size() > 0)
&& MyRandom.random.nextBoolean();
}
@Override
public void resolve() {
//if (card.getController().equals(Constant.Player.Computer))
//for now, sac happens during resolution:
AllZone.GameAction.sacrifice(getSourceCard());
AllZone.GameAction.drawCard(card.getController());
}
};
ability.setDescription("2, Sacrifice " + card.getName() + ": Draw a card.");
ability.setStackDescription(card.getName() + " - Draw a card.");
final Command destroy = new Command()
{
private static final long serialVersionUID = -5552202665064265632L;
public void execute()
{
AllZone.GameAction.searchLibraryTwoBasicLand(card.getController(), Constant.Zone.Hand, false, Constant.Zone.Hand, false);
}
};
/*
Input runtime = new Input() {
private static final long serialVersionUID = -4361362367624073190L;
boolean once = true;
@Override
public void showMessage() {
//this is necessary in order not to have a StackOverflowException
//because this updates a card, it creates a circular loop of observers
if(once) {
once = false;
stopSetNext(new Input_PayManaCost(ability));
AllZone.GameAction.sacrifice(card);
//AllZone.Stack.add(ability);
//stop();
}
}//showMessage()
};
ability.setBeforePayMana(runtime);
*/
card.addSpellAbility(ability);
card.addDestroyCommand(destroy);
}
//*************** END ************ END **************************
// Cards with Cycling abilities // Cards with Cycling abilities
// -1 means keyword "Cycling" not found // -1 means keyword "Cycling" not found
if(shouldCycle(card) != -1) { if(shouldCycle(card) != -1) {