mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Converted Reclaim to the spReturnTgt keyword and deleted the unneeded code block. Modified the spReturnTgt code to handle to top of library.
This commit is contained in:
@@ -2,6 +2,7 @@ Name:Reclaim
|
||||
ManaCost:G
|
||||
Types:Instant
|
||||
Text:Put target card from your graveyard on top of your library.
|
||||
K:spReturnTgt:1:Artifact,Creature,Enchantment,Land,Instant,Sorcery:TopofLibrary
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/reclaim.jpg
|
||||
|
||||
@@ -3785,14 +3785,19 @@ public class CardFactory implements NewConstants {
|
||||
for (Card c:targets) {
|
||||
|
||||
if (AllZone.GameAction.isCardInZone(c, grave)) {
|
||||
|
||||
if (Destination.equals("Hand")) {
|
||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Hand, player);
|
||||
AllZone.GameAction.moveTo(zone, c);
|
||||
|
||||
} else {
|
||||
}
|
||||
else if (Destination.equals("Battlefield")) {
|
||||
PlayerZone zone = AllZone.getZone(Constant.Zone.Play, player);
|
||||
AllZone.GameAction.moveTo(zone, c);
|
||||
}
|
||||
else if (Destination.equals("TopofLibrary")) {
|
||||
// PlayerZone zone = AllZone.getZone(Constant.Zone.Play, player);
|
||||
AllZone.GameAction.moveToTopOfLibrary(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
}// resolve()
|
||||
@@ -3880,7 +3885,6 @@ public class CardFactory implements NewConstants {
|
||||
list = list.getValidCards(Tgts);
|
||||
return list;
|
||||
}
|
||||
|
||||
};// Input
|
||||
|
||||
spRtrnTgt.setBeforePayMana(target);
|
||||
|
||||
@@ -2533,73 +2533,6 @@ public class CardFactory_Instants {
|
||||
}//*************** END ************ END **************************
|
||||
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if( cardName.equals("Reclaim")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
private static final long serialVersionUID = -7352293983206222113L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
PlayerZone graveyard = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
|
||||
|
||||
if(AllZone.GameAction.isCardInZone(getTargetCard(), graveyard)) {
|
||||
graveyard.remove(getTargetCard());
|
||||
AllZone.GameAction.moveToTopOfLibrary(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 = -1438178075940689742L;
|
||||
|
||||
@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 = "top of owner's library";
|
||||
|
||||
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("Eladamri's Call")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
Reference in New Issue
Block a user