diff --git a/res/cardsfolder/d/death_or_glory.txt b/res/cardsfolder/d/death_or_glory.txt index dd3c0540278..a3e02616025 100644 --- a/res/cardsfolder/d/death_or_glory.txt +++ b/res/cardsfolder/d/death_or_glory.txt @@ -5,7 +5,6 @@ Text:no text A:SP$ TwoPiles | Cost$ 4 W | Defined$ You | Separator$ You | Chooser$ Opponent | ChosenPile$ DBReturn | UnchosenPile$ DBExile | ValidCards$ Creature | Zone$ Graveyard | SpellDescription$ Separate all creature cards in your graveyard into two piles. Exile the pile of an opponent's choice and return the other to the battlefield. SVar:DBReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Battlefield SVar:DBExile:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Exile -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/death_or_glory.jpg SetInfo:INV|Rare|http://magiccards.info/scans/en/in/13.jpg diff --git a/res/cardsfolder/d/do_or_die.txt b/res/cardsfolder/d/do_or_die.txt index 1ef0d76f890..7a5824c278c 100644 --- a/res/cardsfolder/d/do_or_die.txt +++ b/res/cardsfolder/d/do_or_die.txt @@ -4,7 +4,6 @@ Types:Sorcery Text:no text A:SP$ TwoPiles | Cost$ 1 B | ValidTgts$ Player | TgtPrompt$ Select target player | Separator$ You | ChosenPile$ DBDestroy | ValidCards$ Creature | Zone$ Battlefield | SpellDescription$ Separate all creatures target player controls into two piles. Destroy all creatures in the pile of that player's choice. They can't be regenerated. SVar:DBDestroy:DB$ Destroy | Defined$ Remembered | NoRegen$ True -SVar:RemAIDeck:True SVar:Rarity:Rare SVar:Picture:http://www.wizards.com/global/images/magic/general/do_or_die.jpg SetInfo:INV|Rare|http://magiccards.info/scans/en/in/102.jpg diff --git a/res/cardsfolder/l/liliana_of_the_veil.txt b/res/cardsfolder/l/liliana_of_the_veil.txt index 15cee04ccec..f70bec8706f 100644 --- a/res/cardsfolder/l/liliana_of_the_veil.txt +++ b/res/cardsfolder/l/liliana_of_the_veil.txt @@ -5,7 +5,7 @@ Text:no text Loyalty:3 A:AB$ Discard | Cost$ AddCounter<1/LOYALTY> | NumCards$ 1 | Mode$ TgtChoose | Defined$ Each | Planeswalker$ True | SpellDescription$ Each player discards a card. A:AB$ Sacrifice | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Player | SacValid$ Creature | SacMessage$ Creature | Planeswalker$ True | SpellDescription$ Target player sacrifices a creature. -A:AB$ TwoPiles | Cost$ SubCounter<6/LOYALTY> | ValidTgts$ Player | TgtPrompt$ Select target player | Separator$ You | ChosenPile$ DBSacAll | ValidCards$ Permanent | Planeswalker$ True | Ultimate$ True | SpellDescription$ Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice. +A:AB$ TwoPiles | Cost$ SubCounter<6/LOYALTY> | ValidTgts$ Player | TgtPrompt$ Select target player | Separator$ You | ChosenPile$ DBSacAll | ValidCards$ Permanent | Zone$ Battlefield | Planeswalker$ True | Ultimate$ True | SpellDescription$ Separate all permanents target player controls into two piles. That player sacrifices all permanents in the pile of his or her choice. SVar:DBSacAll:DB$ SacrificeAll | ValidCards$ Permanent | Defined$ Remembered | SubAbility$ Cleanup SVar:Cleanup:DB$ Cleanup | ClearRemembered$ True SVar:RemAIDeck:True diff --git a/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java b/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java index 36db8d1517e..dae0dbc582f 100644 --- a/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java +++ b/src/main/java/forge/card/abilityfactory/AbilityFactoryClash.java @@ -26,9 +26,7 @@ import javax.swing.JOptionPane; import forge.AllZone; import forge.Card; import forge.CardList; -import forge.CardUtil; import forge.Constant; -import forge.Constant.Zone; import forge.GameActionUtil; import forge.Player; import forge.card.cardfactory.CardFactoryUtil; @@ -607,7 +605,42 @@ public final class AbilityFactoryClash { } private static boolean twoPilesCanPlayAI(final AbilityFactory af, final SpellAbility sa) { - return AbilityFactoryClash.twoPilesTriggerAI(af, sa, false); + final HashMap params = af.getMapParams(); + final Card card = af.getHostCard(); + Constant.Zone zone = null; + + if (params.containsKey("Zone")) { + zone = Constant.Zone.smartValueOf(params.get("Zone")); + } + + String valid = ""; + if (params.containsKey("ValidCards")) { + valid = params.get("ValidCards"); + } + + ArrayList tgtPlayers; + + final Target tgt = sa.getTarget(); + if (tgt != null) { + tgt.resetTargets(); + if (tgt.canTgtPlayer()) { + tgt.addTarget(AllZone.getHumanPlayer()); + } + tgtPlayers = tgt.getTargetPlayers(); + } else { + tgtPlayers = AbilityFactory.getDefinedPlayers(sa.getSourceCard(), params.get("Defined"), sa); + } + + final Player p = tgtPlayers.get(0); + CardList pool = new CardList(); + if (params.containsKey("DefinedCards")) { + pool = new CardList(AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("DefinedCards"), sa)); + } else { + pool = p.getCardsIn(zone); + } + pool = pool.getValidCards(valid, card.getController(), card); + int size = pool.size(); + return size > 2; } private static boolean twoPilesTriggerAI(final AbilityFactory af, final SpellAbility sa, final boolean mandatory) {