diff --git a/res/cardsfolder/m/mass_polymorph.txt b/res/cardsfolder/m/mass_polymorph.txt index e6e8dd791a1..7f370343d34 100644 --- a/res/cardsfolder/m/mass_polymorph.txt +++ b/res/cardsfolder/m/mass_polymorph.txt @@ -2,7 +2,7 @@ Name:Mass Polymorph ManaCost:5 U Types:Sorcery A:SP$ ChangeZoneAll | Cost$ 5 U | ChangeType$ Creature.YouCtrl | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBMassReveal | SpellDescription$ Exile all creatures you control, then reveal cards from the top of your library until you reveal that many creature cards. Put all creature cards revealed this way onto the battlefield, then shuffle the rest of the revealed cards into your library. -SVar:DBMassReveal:DB$ DigUntil | Amount$ MassX | References$ MassX | Valid$ Creature.YouOwn | ValidDescription$ creature | RevealedDestination$ Library | RevealedLibraryPosition$ 0 | FoundDestination$ Battlefield | SubAbility$ DBMassCleanup +SVar:DBMassReveal:DB$ DigUntil | Amount$ MassX | References$ MassX | Valid$ Creature.YouOwn | ValidDescription$ creature | RevealedDestination$ Library | RevealedLibraryPosition$ 0 | FoundDestination$ Battlefield | SubAbility$ DBMassCleanup | Shuffle$ True SVar:DBMassCleanup:DB$ Cleanup | ClearRemembered$ True | SubAbility$ DBMassShuffle SVar:DBMassShuffle:DB$ Shuffle SVar:MassX:Remembered$Amount diff --git a/res/cardsfolder/s/spellshift.txt b/res/cardsfolder/s/spellshift.txt index 9cda14255c2..c86030cb4d9 100644 --- a/res/cardsfolder/s/spellshift.txt +++ b/res/cardsfolder/s/spellshift.txt @@ -2,7 +2,7 @@ Name:Spellshift ManaCost:3 U Types:Instant A:SP$ Counter | Cost$ 3 U | TargetType$ Spell | ValidTgts$ Instant,Sorcery | TgtPrompt$ Select target Instant or Sorcery Spell | SubAbility$ DBDig | SpellDescription$ Counter target instant or sorcery spell. Its controller reveals cards from the top of his or her library until he or she reveals an instant or sorcery card. That player may cast that card without paying its mana cost. Then he or she shuffles his or her library. -SVar:DBDig:DB$ DigUntil | Defined$ TargetedController | Valid$ Instant,Sorcery | ValidDescription$ Sorcery or Instant | FoundDestination$ Library | RevealedDestination$ Library | RememberFound$ True | SubAbility$ DBPlay +SVar:DBDig:DB$ DigUntil | Defined$ TargetedController | Valid$ Instant,Sorcery | ValidDescription$ Sorcery or Instant | FoundDestination$ Library | RevealedDestination$ Library | RememberFound$ True | SubAbility$ DBPlay | Shuffle$ True SVar:DBPlay:DB$ Play | Defined$ Remembered | Controller$ TargetedController | WithoutManaCost$ True | Optional$ True | SubAbility$ DBShuffle SVar:DBShuffle:DB$ Shuffle | Defined$ TargetedController | SubAbility$ DBCleanup SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True diff --git a/src/main/java/forge/card/ability/effects/DigUntilEffect.java b/src/main/java/forge/card/ability/effects/DigUntilEffect.java index 0015c9176c3..dcc900fd535 100644 --- a/src/main/java/forge/card/ability/effects/DigUntilEffect.java +++ b/src/main/java/forge/card/ability/effects/DigUntilEffect.java @@ -104,7 +104,7 @@ public class DigUntilEffect extends SpellAbilityEffect { for (final Player p : getTargetPlayers(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) { - final List found = new ArrayList(); + List found = new ArrayList(); List revealed = new ArrayList(); final PlayerZone library = p.getZone(digSite); @@ -130,12 +130,13 @@ public class DigUntilEffect extends SpellAbilityEffect { } final GameState game = p.getGame(); - if (revealedDest == ZoneType.Battlefield && revealed.size() >= 2) { - revealed = p.getController().orderMoveToZoneList(revealed, revealedDest); - // should possibly use host.getController().getController()... above instead of p.getController? - } - if (foundDest != null) { + // Allow ordering of found cards + if ((foundDest.isKnown()) && found.size() >= 2) { + found = p.getController().orderMoveToZoneList(found, foundDest); + // should possibly use host.getController().getController()... for these instead of p.getController? + } + final Iterator itr = found.iterator(); while (itr.hasNext()) { final Card c = itr.next(); @@ -166,9 +167,13 @@ public class DigUntilEffect extends SpellAbilityEffect { Collections.shuffle(revealed, random); } - if (revealedDest == ZoneType.Library && !sa.hasParam("Shuffle") && revealed.size() >= 2) { + // Allow ordering the rest of the revealed cards + if ((revealedDest.isKnown()) && revealed.size() >= 2) { + revealed = p.getController().orderMoveToZoneList(revealed, revealedDest); + } + if (revealedDest == ZoneType.Library && !sa.hasParam("Shuffle") + && !sa.hasParam("RevealRandomOrder") && revealed.size() >= 2) { revealed = p.getController().orderMoveToZoneList(revealed, revealedDest); - // should possibly use host.getController().getController()... above instead of p.getController? } final Iterator itr = revealed.iterator(); diff --git a/src/main/java/forge/game/player/PlayerController.java b/src/main/java/forge/game/player/PlayerController.java index ab8acde1366..4edfc2b294c 100644 --- a/src/main/java/forge/game/player/PlayerController.java +++ b/src/main/java/forge/game/player/PlayerController.java @@ -126,7 +126,7 @@ public abstract class PlayerController { public abstract void reveal(String string, Collection cards, ZoneType zone, Player owner); public abstract ImmutablePair, List> arrangeForScry(List topN); public abstract boolean willPutCardOnTop(Card c); - public abstract List orderMoveToZoneList(List revealed, ZoneType destinationZone); + public abstract List orderMoveToZoneList(List cards, ZoneType destinationZone); /** p = target player, validCards - possible discards, min cards to discard */ public abstract List chooseCardsToDiscardFrom(Player playerDiscard, SpellAbility sa, List validCards, int min, int max); diff --git a/src/main/java/forge/game/player/PlayerControllerAi.java b/src/main/java/forge/game/player/PlayerControllerAi.java index 3ddc0bc77a1..82d7d1b05b9 100644 --- a/src/main/java/forge/game/player/PlayerControllerAi.java +++ b/src/main/java/forge/game/player/PlayerControllerAi.java @@ -211,9 +211,9 @@ public class PlayerControllerAi extends PlayerController { } @Override - public List orderMoveToZoneList(List revealed, ZoneType destinationZone) { + public List orderMoveToZoneList(List cards, ZoneType destinationZone) { //TODO Add logic for AI ordering here - return revealed; + return cards; } @Override diff --git a/src/main/java/forge/game/player/PlayerControllerHuman.java b/src/main/java/forge/game/player/PlayerControllerHuman.java index 6a391facb58..84bfc0c99be 100644 --- a/src/main/java/forge/game/player/PlayerControllerHuman.java +++ b/src/main/java/forge/game/player/PlayerControllerHuman.java @@ -334,13 +334,15 @@ public class PlayerControllerHuman extends PlayerController { } @Override - public List orderMoveToZoneList(List revealed, ZoneType destinationZone) { + public List orderMoveToZoneList(List cards, ZoneType destinationZone) { if (destinationZone == ZoneType.Library) { - return GuiChoose.order("Choose order of cards to put into the library", "Closest to top", 0, revealed, null, null); + return GuiChoose.order("Choose order of cards to put into the library", "Closest to top", 0, cards, null, null); } else if (destinationZone == ZoneType.Battlefield) { - return GuiChoose.order("Choose order of cards to put onto the battlefield", "Put first", 0, revealed, null, null); + return GuiChoose.order("Choose order of cards to put onto the battlefield", "Put first", 0, cards, null, null); + } else if (destinationZone == ZoneType.Graveyard) { + return GuiChoose.order("Choose order of cards to put into the graveyard", "Closest to top", 0, cards, null, null); } - return revealed; + return cards; } @Override