- moveTo() now only copies a card if it's on the Battlefield, and it's leaving the Battlefield.

- Fix for Animate Dead/Dance of the Dead
- Fix for Unearthed cards being exiled instead of going to the Library
- Fix for Infinite Loop in Target from List
This commit is contained in:
jendave
2011-08-06 15:17:19 +00:00
parent ca9ed478b8
commit b7810af94a
5 changed files with 25 additions and 16 deletions

View File

@@ -1,7 +1,8 @@
Name:Animate Dead
ManaCost:1 B
Types:Enchantment Aura
Text:Enchant creature card in a graveyard\r\nWhen Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.\r\n Enchanted creature gets -1/-0.
Text:Enchant creature card in a graveyard\r\nWhen Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard" and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.
K:stPumpEnchanted:Creature:-1/0:No Condition:Enchanted creature gets -1/-0.
SVar:Rarity:Uncommon
SVar:Picture:http://resources.wizards.com/magic/cards/5e/en-us/card3823.jpg
SetInfo:5ED|Uncommon|http://magiccards.info/scans/en/5e/2.jpg

View File

@@ -1595,7 +1595,6 @@ class CardFactory_Auras {
}
// Everything worked out perfectly.
if(card.getName().equals("Animate Dead")) animated.addSemiPermanentAttackBoost(-1);
}
};//Ability
@@ -1616,7 +1615,6 @@ class CardFactory_Auras {
PlayerZone play = AllZone.getZone(Constant.Zone.Battlefield, card.getController());
if(AllZone.GameAction.isCardInZone(c, play)) {
if(card.getName().equals("Animate Dead")) c.addSemiPermanentAttackBoost(+1);
AllZone.GameAction.sacrifice(c);
}
}

View File

@@ -63,7 +63,7 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
if (c.isUnearthed() && (is("Graveyard") || is("Hand")))
if (c.isUnearthed() && (is("Graveyard") || is("Hand") || is("Library")))
{
PlayerZone removed = AllZone.getZone(Constant.Zone.Exile, c.getOwner());
removed.add(c);

View File

@@ -34,29 +34,39 @@ public class GameAction {
}
public Card moveTo(PlayerZone zone, Card c) {
// Ideally move to should never be called without a prevZone
// Remove card from Current Zone, if it has one
String prevZone = "";
PlayerZone p = AllZone.getZone(c);
if(p != null)
{
if(p != null){
prevZone = p.getZoneName();
p.remove(c);
}
else{
//System.out.println(c.getName() + " " + zone.getZoneName());
}
//create new Card, which resets stats and anything that might have changed during play
Card moving = c.isToken() ? c : AllZone.CardFactory.copyCard(c);
Card moving;
if (!c.isToken() && p != null && p.is(Constant.Zone.Battlefield) && !zone.is(Constant.Zone.Battlefield)){
// If a nontoken card is moving from the Battlefield, to non-Battlefield zone copy it
moving = AllZone.CardFactory.copyCard(c);
}
else{
moving = c;
}
moving.setUnearthed(c.isUnearthed());
if (c.wasSuspendCast()){
moving.setUnearthed(c.isUnearthed()); // this might be unnecessary
if (c.wasSuspendCast()){ // these probably can be moved back to SubtractCounters
moving = addSuspendTriggers(moving);
}
//boolean dontTrigger = p != null && p.is(Constant.Zone.Battlefield) && zone.is(Constant.Zone.Battlefield);
// todo: if zone is battlefied and prevZone is battlefield, temporarily disable enters battlefield triggers
zone.add(moving);
//Run triggers
HashMap<String,Object> runParams = new HashMap<String,Object>();
// Should the MovedCard be the LKI, aka the original card that came in, not the card that's leaving?
// runParams.put("MovedCard", c);
runParams.put("MovedCard",moving);
runParams.put("Origin", prevZone);
runParams.put("Destination", zone.getZoneName());

View File

@@ -104,7 +104,7 @@ public class Target_Selection {
stopSetNext(input_targetSpecific(sa, choices, message, true, canTargetPlayer, canTargetOpponent, select, req));
}
else{
AllZone.InputControl.setInput(input_cardFromList(sa, choices, message, true, select, req));
stopSetNext(input_cardFromList(sa, choices, message, true, select, req));
}
}
};