adding Recall (from Legends). The first "X X" mana cost card in Forge!

This commit is contained in:
jendave
2011-08-06 04:31:46 +00:00
parent 79bbbd524a
commit 462ce6318e
5 changed files with 120 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ snow_covered_mountain.jpg http://www.wizards.com/global/images/magic/gene
snow_covered_mountain1.jpg http://www.wizards.com/global/images/magic/general/snow_covered_mountain.jpg
snow_covered_mountain2.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
snow_covered_mountain3.jpg http://www.magickartenmarkt.de/img/cards/Ice_Age/snow_covered_mountain.jpg
recall.jpg http://www.wizards.com/global/images/magic/general/recall.jpg
moldervine_cloak.jpg http://www.wizards.com/global/images/magic/general/moldervine_cloak.jpg
dakmor_salvage.jpg http://www.wizards.com/global/images/magic/general/dakmor_salvage.jpg
grave_defiler.jpg http://www.wizards.com/global/images/magic/general/grave_defiler.jpg

View File

@@ -1,3 +1,15 @@
Recall
X X U
Sorcery
Discard X cards, then return a card from your graveyard to your hand for each card discarded this way. Exile Recall.
Coffin Queen
2 B
Creature Zombie Wizard
2B, tap: Put target creature card from a graveyard onto the battlefield under your control. When Coffin Queen becomes untapped or you lose control of Coffin Queen, exile that creature.
1/1
You may choose not to untap CARDNAME during your untap step.
Moldervine Cloak
2 G
Enchantment Aura

View File

@@ -19839,6 +19839,53 @@ public class CardFactory implements NewConstants {
spell.setBeforePayMana(target);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Recall")) {
/*
* Discard X cards, then return a card from your graveyard to your
* hand for each card discarded this way. Exile Recall.
*/
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -3935814273439962834L;
@Override
public boolean canPlayAI() {
//for compy to play this wisely, it should check hand, and if there
//are no spells that canPlayAI(), then use recall. maybe.
return false;
}
@Override
public void resolve() {
int numCards = card.getXManaCostPaid();
final String player = card.getController();
int maxCards = AllZoneUtil.getPlayerHand(player).size();
numCards = Math.min(numCards, maxCards);
if(player.equals(Constant.Player.Human)) {
AllZone.InputControl.setInput(CardFactoryUtil.input_discardRecall(numCards, card));
}
/*else { //computer
AllZone.GameAction.discardRandom(Constant.Player.Computer, numCards);
AllZone.GameAction.removeFromGame(card);
CardList grave = AllZoneUtil.getPlayerGraveyard(card.getController());
for(int i = 1; i <= numCards; i ++) {
Card t1 = CardFactoryUtil.AI_getBestCreature(grave);
if(null != t1) {
t1 = grave.get(0);
grave.remove(t1);
AllZone.GameAction.moveToHand(t1);
}
}
}*/
}//resolve()
};//SpellAbility
spell.setStackDescription(card.getName()+" - discard X cards and return X cards to your hand.");
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
// Cards with Cycling abilities
// -1 means keyword "Cycling" not found
if(hasKeyword(card, "Cycling") != -1) {

View File

@@ -2209,6 +2209,57 @@ public class CardFactoryUtil {
return target;
}//input_discard()
/**
* custom input method only for use in Recall
*
* @param numCards
* @param recall
* @return
*/
public static Input input_discardRecall(final int numCards, final Card recall) {
Input target = new Input() {
private static final long serialVersionUID = 1942999595292561944L;
int n = 0;
@Override
public void showMessage() {
if (AllZone.Human_Hand.getCards().length == 0) stop();
AllZone.Display.showMessage("Select a card to discard");
ButtonUtil.disableAll();
}
@Override
public void selectCard(Card card, PlayerZone zone) {
if(zone.is(Constant.Zone.Hand)) {
AllZone.GameAction.discard(card);
n++;
//in case no more cards in hand
if(n == numCards || AllZone.Human_Hand.getCards().length == 0) done();
else
showMessage();
}
}
void done() {
AllZone.Display.showMessage("Returning cards to hand.");
AllZone.GameAction.exile(recall);
CardList grave = AllZoneUtil.getPlayerGraveyard(Constant.Player.Human);
for(int i = 1; i <= n; i++) {
String title = "Return card from grave to hand";
Object o = AllZone.Display.getChoice(title, grave.toArray());
if(o == null) break;
Card toHand = (Card) o;
grave.remove(toHand);
AllZone.GameAction.moveToHand(toHand);
}
stop();
}
};
return target;
}//input_discardRecall()
/*
//cardType is like "Creature", "Land", "Artifact", "Goblin", "Legendary"

View File

@@ -782,6 +782,15 @@ public class GameAction {
}
/**
* basically an alias for removeFromGame to bring the language in the code
* to match the mechanics in Forge
* @param c
*/
public void exile(Card c) {
removeFromGame(c);
}
public void removeUnearth(Card c)
{
PlayerZone removed = AllZone.getZone(Constant.Zone.Removed_From_Play, c.getOwner());