- Fix for Unearth mistakenly being Exiled after it Resolves

This commit is contained in:
jendave
2011-08-06 15:02:44 +00:00
parent 1dcd531156
commit cad43f8a49
2 changed files with 15 additions and 56 deletions

View File

@@ -898,72 +898,31 @@ public class CardFactoryUtil {
}//ability_Flashback() }//ability_Flashback()
public static Ability ability_Unearth(final Card sourceCard, String manaCost) { public static Ability_Activated ability_Unearth(final Card sourceCard, String manaCost) {
final Ability unearth = new Ability(sourceCard, manaCost) {
Ability_Cost cost = new Ability_Cost(manaCost, sourceCard.getName(), true);
final Ability_Activated unearth = new Ability_Activated(sourceCard, cost, null) {
private static final long serialVersionUID = -5633945565395478009L; private static final long serialVersionUID = -5633945565395478009L;
@Override @Override
public void resolve() { public void resolve() {
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, sourceCard.getController()); Card card = AllZone.GameAction.moveToPlay(sourceCard);
//PlayerZone removed = AllZone.getZone(Constant.Zone.Removed_From_Play, sourceCard.getController());
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, sourceCard.getController());
grave.remove(sourceCard);
play.add(sourceCard);
sourceCard.addIntrinsicKeyword("At the beginning of the end step, sacrifice CARDNAME.");
sourceCard.addIntrinsicKeyword("Haste");
sourceCard.setUnearthed(true);
/*
final Command entersPlay = new Command()
{
public void execute()
{
sourceCard.setUnearthed(true);
}
};
sourceCard.addComesIntoPlayCommand(entersPlay);
final Command leavesPlay = new Command()
{
private static final long serialVersionUID = -8640915882354670864L;
public void execute()
{
AllZone.GameAction.removeUnearth(sourceCard);
}
};
sourceCard.addLeavesPlayCommand(leavesPlay);
*/
card.addIntrinsicKeyword("At the beginning of the end step, sacrifice CARDNAME.");
card.addIntrinsicKeyword("Haste");
card.setUnearthed(true);
} }
@Override
public boolean canPlay() {
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, sourceCard.getController());
return AllZone.GameAction.isCardInZone(sourceCard, grave)
&& Phase.canCastSorcery(sourceCard.getController());
}
}; };
SpellAbility_Restriction restrict = new SpellAbility_Restriction();
unearth.setFlashBackAbility(true); restrict.setActivateZone("Graveyard");
//unearth.setManaCost(manaCost); restrict.setSorcerySpeed(true);
//unearth.setDescription("Unearth: " + manaCost); unearth.setRestrictions(restrict);
StringBuilder sbStack = new StringBuilder(); StringBuilder sbStack = new StringBuilder();
sbStack.append("Unearth: ").append(sourceCard.getName()); sbStack.append("Unearth: ").append(sourceCard.getName());
unearth.setStackDescription(sbStack.toString()); unearth.setStackDescription(sbStack.toString());
return unearth; return unearth;
}//ability_Unearth() }//ability_Unearth()
/* /*

View File

@@ -177,9 +177,9 @@ public class GameAction {
else moveTo(hand, c); else moveTo(hand, c);
} }
public void moveToPlay(Card c) { public Card moveToPlay(Card c) {
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getOwner()); PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, c.getOwner());
moveTo(play, c); return moveTo(play, c);
} }
public void moveToTopOfLibrary(Card c) { public void moveToTopOfLibrary(Card c) {