mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Converted Elven Cache and Regrowth to spReturnTgt keyword.
- Deleted the code block for Elven Cache and Regrowth.
This commit is contained in:
@@ -2,6 +2,7 @@ Name:Elven Cache
|
||||
ManaCost:2 G G
|
||||
Types:Sorcery
|
||||
Text:Return target card from your graveyard to your hand.
|
||||
K:spReturnTgt:1:Artifact,Creature,Enchantment,Land,Instant,Sorcery:Hand
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/elven_cache.jpg
|
||||
End
|
||||
|
||||
@@ -2,6 +2,7 @@ Name:Regrowth
|
||||
ManaCost:1 G
|
||||
Types:Sorcery
|
||||
Text:Return target card from your graveyard to your hand.
|
||||
K:spReturnTgt:1:Artifact,Creature,Enchantment,Land,Instant,Sorcery:Hand
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://resources.wizards.com/magic/cards/1e/en-us/card170.jpg
|
||||
End
|
||||
|
||||
@@ -3322,77 +3322,6 @@ public class CardFactory_Sorceries {
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Regrowth") || cardName.equals("Elven Cache")) {
|
||||
// added cousin Reclaim since 90% of the code is shared
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
private static final long serialVersionUID = -2069974600304157248L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
|
||||
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
|
||||
if(AllZone.GameAction.isCardInZone(getTargetCard(), graveyard)) {
|
||||
graveyard.remove(getTargetCard());
|
||||
hand.add(getTargetCard());
|
||||
}
|
||||
}//resolve()
|
||||
|
||||
@Override
|
||||
public boolean canPlay() {
|
||||
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
return graveyard.getCards().length != 0 && super.canPlay();
|
||||
}
|
||||
};
|
||||
Input runtime = new Input() {
|
||||
|
||||
private static final long serialVersionUID = 3706956894704891104L;
|
||||
|
||||
@Override
|
||||
public void showMessage() {
|
||||
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
Object o = AllZone.Display.getChoiceOptional("Select target card", graveyard.getCards());
|
||||
if(o == null) stop();
|
||||
else {
|
||||
String location = "owner's hand";
|
||||
|
||||
spell.setStackDescription("Return " + o + " to " + location);
|
||||
spell.setTargetCard((Card) o);
|
||||
if(this.isFree())
|
||||
{
|
||||
// WARNING: Read this before copying!
|
||||
// When we have an 'if (this.isFree())' in most input objects,
|
||||
// it's inside 'selectCard' not 'showMessage', and the usual
|
||||
// order is
|
||||
// AllZone.Stack.add(spell);
|
||||
// stop();
|
||||
// Here, we had to reverse the order of those two lines, or
|
||||
// else the dialog for Regrowth would get put up twice
|
||||
// when the card was played from Cascade. I think this
|
||||
// has to do with when showMessage() is called versus
|
||||
// selectCard().
|
||||
// This appears to be the only place we use this pattern. Be
|
||||
// careful when copying this code, and test your card with
|
||||
// Cascade or Isochron Scepter.
|
||||
this.setFree(false);
|
||||
stop();
|
||||
AllZone.Stack.add(spell);
|
||||
}
|
||||
else
|
||||
stopSetNext(new Input_PayManaCost(spell));
|
||||
}
|
||||
}//showMessage()
|
||||
};
|
||||
spell.setChooseTargetAI(CardFactoryUtil.AI_targetType("All", AllZone.Computer_Graveyard));
|
||||
spell.setBeforePayMana(runtime);
|
||||
card.clearSpellAbility();
|
||||
card.addSpellAbility(spell);
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if(cardName.equals("Ichor Slick")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
Reference in New Issue
Block a user