From 3465d5c5d5cbd8e7287e27d5078ac493ef3f740d Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 10:13:36 +0000 Subject: [PATCH] - Fixes for Flashback so it properly removes the card from the game. - Added Retrieve to AF_Fetch for Retrieving cards from your graveyard. - Converted Hammer of Bogardan, Eternal Dragon, Undead Gladiator to AF_Retrieve - Added Soldevi Digger and Reassembling Skeleton --- .gitattributes | 2 + res/cardsfolder/eternal_dragon.txt | 1 + res/cardsfolder/hammer_of_bogardan.txt | 3 +- res/cardsfolder/reassembling_skeleton.txt | 9 + res/cardsfolder/soldevi_digger.txt | 8 + res/cardsfolder/undead_gladiator.txt | 1 + src/forge/AbilityFactory.java | 12 +- src/forge/AbilityFactory_Fetch.java | 209 +++++++++++++++++++++- src/forge/CardFactoryUtil.java | 32 ++-- src/forge/CardFactory_Creatures.java | 92 ---------- src/forge/CardFactory_Sorceries.java | 39 ---- src/forge/ComputerUtil.java | 2 +- src/forge/GuiDisplay3.java | 4 +- src/forge/GuiDisplay4.java | 4 +- src/forge/MagicStack.java | 11 +- 15 files changed, 267 insertions(+), 162 deletions(-) create mode 100644 res/cardsfolder/reassembling_skeleton.txt create mode 100644 res/cardsfolder/soldevi_digger.txt diff --git a/.gitattributes b/.gitattributes index 62ddfef96e9..8a82cb1abf3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3398,6 +3398,7 @@ res/cardsfolder/reach_of_branches.txt -text svneol=native#text/plain res/cardsfolder/reach_through_mists.txt -text svneol=native#text/plain res/cardsfolder/reanimate.txt -text svneol=native#text/plain res/cardsfolder/reaping_the_graves.txt -text svneol=native#text/plain +res/cardsfolder/reassembling_skeleton.txt -text svneol=native#text/plain res/cardsfolder/reborn_hope.txt -text svneol=native#text/plain res/cardsfolder/rebuff_the_wicked.txt -text svneol=native#text/plain res/cardsfolder/rebuild.txt -text svneol=native#text/plain @@ -3969,6 +3970,7 @@ res/cardsfolder/snow_covered_swamp.txt -text svneol=native#text/plain res/cardsfolder/snow_devil.txt -text svneol=native#text/plain res/cardsfolder/sokenzan_bruiser.txt -text svneol=native#text/plain res/cardsfolder/sol_ring.txt -text svneol=native#text/plain +res/cardsfolder/soldevi_digger.txt -text svneol=native#text/plain res/cardsfolder/soldevi_simulacrum.txt -text svneol=native#text/plain res/cardsfolder/soldevi_steam_beast.txt -text svneol=native#text/plain res/cardsfolder/soldier_replica.txt -text svneol=native#text/plain diff --git a/res/cardsfolder/eternal_dragon.txt b/res/cardsfolder/eternal_dragon.txt index 0077b95a3d2..15e84e5d3cb 100644 --- a/res/cardsfolder/eternal_dragon.txt +++ b/res/cardsfolder/eternal_dragon.txt @@ -5,6 +5,7 @@ Text:no text PT:5/5 K:Flying K:TypeCycling:Plains:2 +A:AB$Retrieve|Cost$3 W W|Destination$Hand|ActivatingZone$Graveyard|ActivatingPhases$Upkeep|PlayerTurn$True|SpellDescription$Return Eternal Dragon from your graveyard to your hand. Activate this ability only during your upkeep. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/eternal_dragon.jpg End diff --git a/res/cardsfolder/hammer_of_bogardan.txt b/res/cardsfolder/hammer_of_bogardan.txt index 3319fb62638..8ef93ffb2f0 100644 --- a/res/cardsfolder/hammer_of_bogardan.txt +++ b/res/cardsfolder/hammer_of_bogardan.txt @@ -2,7 +2,8 @@ Name:Hammer of Bogardan ManaCost:1 R R Types:Sorcery Text:no text -K:spDamageTgtCP:3 +A:SP$DealDamage|Cost$1 R R|Tgt$TgtCP|NumDmg$3|SpellDescription$CARDNAME deals 3 damage to target creature or player. +A:AB$Retrieve|Cost$2 R R R|Destination$Hand|ActivatingZone$Graveyard|ActivatingPhases$Upkeep|PlayerTurn$True|SpellDescription$Return Hammer of Bogardan from your graveyard to your hand. Activate this ability only during your upkeep. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/hammer_of_bogardan.jpg End diff --git a/res/cardsfolder/reassembling_skeleton.txt b/res/cardsfolder/reassembling_skeleton.txt new file mode 100644 index 00000000000..83b28d55cdb --- /dev/null +++ b/res/cardsfolder/reassembling_skeleton.txt @@ -0,0 +1,9 @@ +Name:Reassembling Skeleton +ManaCost:1 B +Types:Creature Skeleton Warrior +Text:no text +PT:1/1 +A:AB$Retrieve|Cost$1 B|Destination$Battlefield|ActivatingZone$Graveyard|Tapped$True|SpellDescription$Return Reassembling Skeleton from your graveyard to the battlefield tapped. +SVar:Rarity:Uncommon +SVar:Picture:http://www.wizards.com/global/images/magic/general/reassembling_skeleton.jpg +End \ No newline at end of file diff --git a/res/cardsfolder/soldevi_digger.txt b/res/cardsfolder/soldevi_digger.txt new file mode 100644 index 00000000000..707687fa3fc --- /dev/null +++ b/res/cardsfolder/soldevi_digger.txt @@ -0,0 +1,8 @@ +Name:Soldevi Digger +ManaCost:2 +Types:Artifact +Text:no text +A:AB$Retrieve|Cost$2|Destination$Library|LibraryPosition$-1|Defined$Top|SpellDescription$Put the top card of your graveyard on the bottom of your library. +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/soldevi_digger.jpg +End diff --git a/res/cardsfolder/undead_gladiator.txt b/res/cardsfolder/undead_gladiator.txt index 082d34b09f1..e6f50c83872 100644 --- a/res/cardsfolder/undead_gladiator.txt +++ b/res/cardsfolder/undead_gladiator.txt @@ -4,6 +4,7 @@ Types:Creature Zombie Barbarian Text:no text PT:3/1 K:Cycling:1 B +A:AB$Retrieve|Cost$1 B Discard<1/Any>|Destination$Hand|ActivatingZone$Graveyard|ActivatingPhases$Upkeep|PlayerTurn$True|Return Undead Gladiator from your graveyard to your hand. Activate this ability only during your upkeep. SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/undead_gladiator.jpg End diff --git a/src/forge/AbilityFactory.java b/src/forge/AbilityFactory.java index 9753dd88a9f..7e46d9b1ef6 100644 --- a/src/forge/AbilityFactory.java +++ b/src/forge/AbilityFactory.java @@ -129,9 +129,6 @@ public class AbilityFactory { isTargeted = true; } - if (mapParams.containsKey("ValidCards")) - hasValid = true; - if (mapParams.containsKey("Tgt")) { isTargeted = true; @@ -143,7 +140,6 @@ public class AbilityFactory { abTgt = new Target("TgtV", mapParams.get("TgtPrompt"), mapParams.get("ValidTgts").split(",")); else abTgt = new Target(mapParams.get("Tgt")); - if (mapParams.containsKey("TgtZone")) // if Targeting something not in play, this Key should be set abTgt.setZone(mapParams.get("TgtZone")); } @@ -195,6 +191,14 @@ public class AbilityFactory { } } + if (API.equals("Retrieve")){ + if (isAb) + SA = AbilityFactory_Fetch.createAbilityRetrieve(this); + if (isSp){ + SA = AbilityFactory_Fetch.createSpellRetrieve(this); + } + } + if (API.equals("Pump")) { AbilityFactory_Pump afPump = new AbilityFactory_Pump(this); diff --git a/src/forge/AbilityFactory_Fetch.java b/src/forge/AbilityFactory_Fetch.java index de9f16ec1f2..c6f02eaeb9d 100644 --- a/src/forge/AbilityFactory_Fetch.java +++ b/src/forge/AbilityFactory_Fetch.java @@ -5,10 +5,10 @@ import java.util.HashMap; import java.util.Random; public class AbilityFactory_Fetch { - // An AbilityFactory subclass for Fetching Cards from the Library + // An AbilityFactory subclass for Fetching Cards from Places //Destination$Battlefield|Valid$Basic|FetchNum$2|UpTo$True|[Tgt$TgtP] - + // Fetch from the library public static SpellAbility createAbilityFetch(final AbilityFactory AF){ final SpellAbility abFetch = new Ability_Activated(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()){ private static final long serialVersionUID = 3728332812890211671L; @@ -68,7 +68,7 @@ public class AbilityFactory_Fetch { HashMap params = af.getMapParams(); CardList library = AllZoneUtil.getPlayerCardsInLibrary(player); - library = filterDeck(library, params); + library = filterListByType(library, params, "FetchType"); String DrawBack = params.get("SubAbility"); String destination = params.get("Destination"); Card card = af.getHostCard(); @@ -111,7 +111,7 @@ public class AbilityFactory_Fetch { HashMap params = af.getMapParams(); Card card = af.getHostCard(); CardList library = AllZoneUtil.getPlayerCardsInLibrary(player); - library = filterDeck(library, params); + library = filterListByType(library, params, "FetchType"); String DrawBack = params.get("SubAbility"); String destination = params.get("Destination"); String type = params.get("FetchType"); @@ -206,9 +206,9 @@ public class AbilityFactory_Fetch { } - private static CardList filterDeck(CardList list, HashMap params){ - if (params.containsKey("FetchType")) - list = list.getValidCards(params.get("FetchType").split(",")); + private static CardList filterListByType(CardList list, HashMap params, String type){ + if (params.containsKey(type)) + list = list.getValidCards(params.get(type).split(",")); return list; } @@ -292,4 +292,199 @@ public class AbilityFactory_Fetch { return true; } + + // ********** Retrieve card from Graveyard *********** + // Self Retrieval + // A:AB$Retrieve|Cost$2 R R R|Destination$Hand|ActivatingZone$Graveyard + // Targeted Retrieval + // A:SP$Retrieve|Cost$B|Destination$Hand|TgtPrompt$Choose target creature card in your graveyard|ValidTgts$Creature|SpellDescription$ + // Currently limited to returning itself or targeting one Valid + // Defined Retrieval + // A:AB$Retrieve|Cost$2|Destination$Library|LibraryPosition$-1|Defined$Top + + public static SpellAbility createAbilityRetrieve(final AbilityFactory AF){ + final SpellAbility abRetrieve = new Ability_Activated(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()){ + private static final long serialVersionUID = 3728332812890211671L; + + AbilityFactory af = AF; + + public boolean canPlayAI(){ + return fetchCanPlayAI(this, AF); + } + + public boolean canPlay(){ + // super takes care of AdditionalCosts + // make sure there's a legal Target + + return super.canPlay(); + } + + @Override + public void resolve() { + Card retrieval = getTargetCard(); + + if(null == retrieval){ + // see if the choice is defined, like "Top" or "Random" + if (AF.getMapParams().containsKey("Defined")) + retrieval = retrieveDetermineDefined(AF.getMapParams().get("Defined"), getActivatingPlayer()); + else + retrieval = this.getSourceCard(); + } + + if (null != retrieval) + doRetrieve(af, this, retrieval); + } + + }; + if (abRetrieve.getTarget() != null && !AF.getMapParams().containsKey("TgtZone")) + abRetrieve.getTarget().setZone(Constant.Zone.Graveyard); + return abRetrieve; + } + + public static SpellAbility createSpellRetrieve(final AbilityFactory AF){ + final SpellAbility spRetrieve = new Spell(AF.getHostCard(), AF.getAbCost(), AF.getAbTgt()) { + private static final long serialVersionUID = 3270484211099902059L; + + AbilityFactory af = AF; + + public boolean canPlayAI(){ + return retrieveCanPlayAI(this, AF); + } + + public boolean canPlay(){ + // super takes care of AdditionalCosts + return super.canPlay(); + } + + @Override + public void resolve() { + Card retrieval = getTargetCard(); + + if(null == retrieval){ + // see if the choice is defined, like "Top" or "Random" + if (AF.getMapParams().containsKey("Defined")) + retrieval = retrieveDetermineDefined(AF.getMapParams().get("Defined"), getActivatingPlayer()); + else + retrieval = this.getSourceCard(); + } + + if (null != retrieval) + doRetrieve(af, this, retrieval); + } + }; + if (spRetrieve.getTarget() != null && !AF.getMapParams().containsKey("TgtZone")) + spRetrieve.getTarget().setZone(Constant.Zone.Graveyard); + return spRetrieve; + } + + private static Card retrieveDetermineDefined(String defined, Player player){ + CardList grave = AllZoneUtil.getCardsInZone(Constant.Zone.Graveyard, player); + + if (defined.equals("Top")){ + // i think the "top" of the graveyard, is the last to be added to the graveyard list? + if (grave.size() == 0) + return null; + return grave.get(grave.size()-1); + } + + return null; + } + + private static boolean retrieveCanPlayAI(SpellAbility sa, AbilityFactory af){ + // Retrieve either this card, or target Cards in Graveyard + Ability_Cost abCost = af.getAbCost(); + Card source = af.getHostCard(); + + if (abCost != null){ + // AI currently disabled for these costs + if (abCost.getSacCost()){ + // Sac is ok in general, but should add some decision making based off SacType and Retrieve Type + } + if (abCost.getLifeCost()){ + if (AllZone.ComputerPlayer.getLife() < 5) + return false; + } + if (abCost.getDiscardCost()) return false; + + if (abCost.getSubCounter()) return false; + + } + + if (!ComputerUtil.canPayCost(sa)) + return false; + + Random r = new Random(); + // prevent run-away activations - first time will always return true + boolean chance = r.nextFloat() <= Math.pow(.6667, source.getAbilityUsed()); + + Target tgt = af.getAbTgt(); + if(tgt != null) { + // AI Targeting + CardList list = AllZoneUtil.getPlayerGraveyard(AllZone.ComputerPlayer); + list = list.getValidCards(tgt.getValidTgts(), AllZone.ComputerPlayer); + + if (list.size() == 0) + return false; + + list.shuffle(); + sa.setTargetCard(list.get(0)); + // todo: the AI actually needs a "smart" way to choose before we add any Retrieve cards that tgt. + // reuse some code from spReturn here + } + else{ + Card retrieval; + if (af.getMapParams().containsKey("Defined")){ + retrieval = retrieveDetermineDefined(af.getMapParams().get("Defined"), sa.getActivatingPlayer()); + if (retrieval == null) + return false; + } + else{ + retrieval = sa.getSourceCard(); + } + } + + // todo: add more decision making for Retrieve + + return ((r.nextFloat() < .8) && chance); + } + + private static void doRetrieve(AbilityFactory af, final SpellAbility sa, Card tgt){ + // retrieve currently can't target things due to a lack of an input method + HashMap params = af.getMapParams(); + + Player player = sa.getActivatingPlayer(); + CardList grave = AllZoneUtil.getPlayerGraveyard(player); + grave = filterListByType(grave, params, "RetrieveType"); + + String DrawBack = params.get("SubAbility"); + String destination = params.get("Destination"); + Card card = af.getHostCard(); + + if(grave.size() == 0 || destination == null) + return; + + grave.remove(tgt); + AllZone.getZone(tgt).remove(tgt); + + if (destination.equals("Hand")) + AllZone.getZone(Constant.Zone.Hand, player).add(tgt); //move to hand + else if (destination.equals("Library")){ + int libraryPosition = 0; // this needs to be zero indexed. Top = 0, Third = 2, -1 = Bottom + if (params.containsKey("LibraryPosition")) + libraryPosition = Integer.parseInt(params.get("LibraryPosition")); + + if (libraryPosition == -1) + libraryPosition = AllZone.Human_Library.size(); + + AllZone.getZone(Constant.Zone.Library, player).add(tgt, libraryPosition); //move to library + } + else if (destination.equals("Battlefield")){ + AllZone.getZone(Constant.Zone.Play, player).add(tgt); //move to battlefield + if (params.containsKey("Tapped")) + tgt.tap(); + } + + if (af.hasSubAbility()) + CardFactoryUtil.doDrawBack(DrawBack, 0, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa); + }//if } diff --git a/src/forge/CardFactoryUtil.java b/src/forge/CardFactoryUtil.java index 2d6eb5727af..4c98354ebfa 100644 --- a/src/forge/CardFactoryUtil.java +++ b/src/forge/CardFactoryUtil.java @@ -1125,16 +1125,13 @@ public class CardFactoryUtil { @Override public void resolve() { PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, sourceCard.getController()); - PlayerZone removed = AllZone.getZone(Constant.Zone.Removed_From_Play, sourceCard.getController()); SpellAbility[] sa = sourceCard.getSpellAbility(); - - AllZone.Stack.add(sa[0]); - grave.remove(sourceCard); - removed.add(sourceCard); + SpellAbility flash = sa[0]; + flash.setFlashBackAbility(true); + AllZone.Stack.add(flash); - //AllZone.GameAction.getPlayerLife(sourceCard.getController()).subtractLife(loss,sourceCard); sourceCard.getController().loseLife(loss, sourceCard); } @@ -1162,7 +1159,6 @@ public class CardFactoryUtil { String lifecost = ""; if(loss != 0) lifecost = ", pay " + lifeloss + " life"; - flashback.setFlashBackAbility(true); flashback.setManaCost(manaCost); StringBuilder sbDesc = new StringBuilder(); @@ -3597,19 +3593,33 @@ public class CardFactoryUtil { return cl; } - public static CardList getFlashbackUnearthCards(Player player) { - final CardList crucible = AllZoneUtil.getPlayerCardsInPlay(player, "Crucible of Worlds"); - + public static CardList getGraveyardActivationCards(final Player player) { PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, player); CardList cl = new CardList(grave.getCards()); cl = cl.filter(new CardListFilter() { public boolean addCard(Card c) { - return c.hasFlashback() || c.hasUnearth() || (c.isLand() && crucible.size() > 0); + return activateFromGrave(c, player); } }); return cl; } + public static boolean activateFromGrave(Card c, Player player){ + if (c.hasFlashback() || c.hasUnearth()) + return true; + + final CardList crucible = AllZoneUtil.getPlayerCardsInPlay(player, "Crucible of Worlds"); + if (c.isLand() && crucible.size() > 0) + return true; + + for(SpellAbility sa : c.getSpellAbility()){ + if (sa.getRestrictions().getActivateZone().equals(Constant.Zone.Graveyard)) + return true; + } + + return false; + } + public static int countOccurrences(String arg1, String arg2) { int count = 0; diff --git a/src/forge/CardFactory_Creatures.java b/src/forge/CardFactory_Creatures.java index 31fc2ca070c..c3de72c564b 100644 --- a/src/forge/CardFactory_Creatures.java +++ b/src/forge/CardFactory_Creatures.java @@ -11081,99 +11081,7 @@ public class CardFactory_Creatures { card.addComesIntoPlayCommand(fetchBasicLand); }//*************** END ************ END ************************** - - - //*************** START *********** START ************************** - else if(cardName.equals("Eternal Dragon")) { - final Ability ability = new Ability(card, "3 W W") { - - private static final long serialVersionUID = -5633265048009L; - @Override - public void resolve() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - - grave.remove(card); - hand.add(card); - } - - @Override - public boolean canPlay() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - - return AllZone.GameAction.isCardInZone(card, grave) && AllZone.Phase.isPlayerTurn(card.getController()) && hand.size() > 0; - } - };//Ability - - card.addSpellAbility(ability); - ability.setFlashBackAbility(true); - card.setUnearth(true); - ability.setDescription("3 W W: Return Eternal Dragon from your graveyard to your hand. Activate this ability only during your upkeep."); - - StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" returns from the graveyard to hand"); - ability.setStackDescription(sb.toString()); - }//*************** END ************ END ************************** - - - //*************** START *********** START ************************** - else if(cardName.equals("Undead Gladiator")) { - final Ability ability = new Ability(card, "1 B") { - - private static final long serialVersionUID = -56339412048009L; - - @Override - public void resolve() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - - grave.remove(card); - hand.add(card); - } - - @Override - public boolean canPlay() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - - return AllZone.GameAction.isCardInZone(card, grave) && AllZone.Phase.isPlayerTurn(card.getController()) && hand.size() > 0; - } - };//Ability - - Input target = new Input() { - - private static final long serialVersionUID = 42466124531655L; - - @Override - public void showMessage() { - AllZone.Display.showMessage("Select a card to discard"); - ButtonUtil.enableOnlyCancel(); - } - - @Override - public void selectCard(Card c, PlayerZone zone) { - PlayerZone Player_Hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - if(AllZone.GameAction.isCardInZone(c, Player_Hand)) { - c.getController().discard(c,ability); - AllZone.Stack.add(ability); - stopSetNext(new ComputerAI_StackNotEmpty()); - } - }//selectCard() - };//Input - - card.addSpellAbility(ability); - ability.setFlashBackAbility(true); - card.setUnearth(true); - ability.setDescription("1 B, Discard a card: Return Undead Gladiator from your graveyard to your hand. Activate this ability only during your upkeep."); - - StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" returns from the graveyard to hand"); - ability.setStackDescription(sb.toString()); - ability.setAfterPayMana(target); - }//*************** END ************ END ************************** - //*************** START *********** START ************************** if(cardName.equals("Doomed Necromancer")) { diff --git a/src/forge/CardFactory_Sorceries.java b/src/forge/CardFactory_Sorceries.java index 67e0d2db3a0..07183242e4f 100644 --- a/src/forge/CardFactory_Sorceries.java +++ b/src/forge/CardFactory_Sorceries.java @@ -4044,45 +4044,6 @@ public class CardFactory_Sorceries { card.addSpellAbility(spell); }//*************** END ************ END ************************** - //*************** START *********** START ************************** - else if(cardName.equals("Hammer of Bogardan")) { - final Ability ability2 = new Ability(card, "2 R R R") { - - private static final long serialVersionUID = -5633123448009L; - - @Override - public void resolve() { - // PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - // grave.remove(card); - card.addReplaceMoveToGraveyardCommand(new Command() { - private static final long serialVersionUID = -25594893330418L; - - public void execute() { - PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController()); - AllZone.GameAction.moveTo(hand, card); - } - }); - } - - - @Override - public boolean canPlay() { - PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController()); - - return AllZone.GameAction.isCardInZone(card, grave) && AllZone.Phase.isPlayerTurn(card.getController()); - } - - }; - card.addSpellAbility(ability2); - ability2.setFlashBackAbility(true); - card.setUnearth(true); - ability2.setDescription("2 R R R: Return Hammer of Bogardan from your graveyard to your hand. Activate this ability only during your upkeep."); - - StringBuilder sb = new StringBuilder(); - sb.append(card.getName()).append(" returns from the graveyard to hand"); - ability2.setStackDescription(sb.toString()); - }//*************** END ************ END ************************** - //*************** START *********** START ************************** else if(cardName.equals("Innocent Blood")) { diff --git a/src/forge/ComputerUtil.java b/src/forge/ComputerUtil.java index 6aba0740218..fd39413c53a 100644 --- a/src/forge/ComputerUtil.java +++ b/src/forge/ComputerUtil.java @@ -136,7 +136,7 @@ public class ComputerUtil CardList all = new CardList(); all.addAll(AllZone.Computer_Play.getCards()); all.addAll(AllZone.Computer_Hand.getCards()); - all.addAll(CardFactoryUtil.getFlashbackUnearthCards(AllZone.ComputerPlayer).toArray()); + all.addAll(CardFactoryUtil.getGraveyardActivationCards(AllZone.ComputerPlayer).toArray()); CardList humanPlayable = new CardList(); humanPlayable.addAll(AllZone.Human_Play.getCards()); diff --git a/src/forge/GuiDisplay3.java b/src/forge/GuiDisplay3.java index 0b9781e206a..b6ce3c346c7 100644 --- a/src/forge/GuiDisplay3.java +++ b/src/forge/GuiDisplay3.java @@ -149,7 +149,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo @Override protected Card[] getCards() { - return CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).toArray(); + return CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).toArray(); } @Override @@ -481,7 +481,7 @@ public class GuiDisplay3 extends JFrame implements CardContainer, Display, NewCo playerHandValue.setText("" + AllZone.Human_Hand.getCards().length); playerGraveValue.setText("" + AllZone.Human_Graveyard.getCards().length); playerLibraryValue.setText("" + AllZone.Human_Library.getCards().length); - playerFBValue.setText("" + CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).size()); + playerFBValue.setText("" + CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).size()); playerRemovedValue.setText("" + AllZone.Human_Removed.getCards().length); } diff --git a/src/forge/GuiDisplay4.java b/src/forge/GuiDisplay4.java index 7faf439f642..1295343f9c4 100644 --- a/src/forge/GuiDisplay4.java +++ b/src/forge/GuiDisplay4.java @@ -154,7 +154,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo @Override protected Card[] getCards() { - return CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).toArray(); + return CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).toArray(); } @Override @@ -463,7 +463,7 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo playerHandValue.setText("" + AllZone.Human_Hand.getCards().length); playerGraveValue.setText("" + AllZone.Human_Graveyard.getCards().length); playerLibraryValue.setText("" + AllZone.Human_Library.getCards().length); - playerFBValue.setText("" + CardFactoryUtil.getFlashbackUnearthCards(AllZone.HumanPlayer).size()); + playerFBValue.setText("" + CardFactoryUtil.getGraveyardActivationCards(AllZone.HumanPlayer).size()); playerRemovedValue.setText("" + AllZone.Human_Removed.getCards().length); } diff --git a/src/forge/MagicStack.java b/src/forge/MagicStack.java index b5b31019883..463114c2566 100644 --- a/src/forge/MagicStack.java +++ b/src/forge/MagicStack.java @@ -436,11 +436,16 @@ public class MagicStack extends MyObservable { } // Handle cards that need to be moved differently - if (sa.isFlashBackAbility()) - c.replaceMoveToGraveyard(); + if (sa.isFlashBackAbility()){ + AllZone.GameAction.exile(c); + sa.setFlashBackAbility(false); + } - else if (fizzle) + else if (fizzle && sa.isSpell()) AllZone.GameAction.moveToGraveyard(c); + + else if (sa.isAbility()) + {} // don't send to graveyard if the spell is using an ability else if ((c.isInstant() || c.isSorcery()) && (!c.getName().startsWith("Beacon of")) && (!c.getName().startsWith("Pulse of the")))