diff --git a/.gitattributes b/.gitattributes index bc139135c6c..cad9897ec1b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -3572,6 +3572,7 @@ res/cardsfolder/f/fate_transfer.txt -text res/cardsfolder/f/fatestitcher.txt svneol=native#text/plain res/cardsfolder/f/fathom_mage.txt -text res/cardsfolder/f/fathom_seer.txt svneol=native#text/plain +res/cardsfolder/f/fathom_trawl.txt -text res/cardsfolder/f/fatigue.txt -text res/cardsfolder/f/fault_line.txt svneol=native#text/plain res/cardsfolder/f/fault_riders.txt svneol=native#text/plain diff --git a/res/cardsfolder/f/fathom_trawl.txt b/res/cardsfolder/f/fathom_trawl.txt new file mode 100644 index 00000000000..421b90d1ef8 --- /dev/null +++ b/res/cardsfolder/f/fathom_trawl.txt @@ -0,0 +1,9 @@ +Name:Fathom Trawl +ManaCost:3 U U +Types:Sorcery +A:SP$ DigUntil | Cost$ 3 U U | Amount$ 3 | Valid$ Card.nonLand+YouOwn | ValidDescription$ nonland | RevealedDestination$ Library | RevealedLibraryPosition$ -1 | FoundDestination$ Hand | SpellDescription$ Reveal cards from the top of your library until you reveal three nonland cards. Put the nonland cards revealed this way into your hand, then put the rest of the revealed cards on the bottom of your library in any order. +SVar:NeedsToPlayVar:AIHand LE4 +SVar:AIHand:Count$InYourHand +SVar:Picture:http://www.wizards.com/global/images/magic/general/fathom_trawl.jpg +Oracle:Reveal cards from the top of your library until you reveal three nonland cards. Put the nonland cards revealed this way into your hand, then put the rest of the revealed cards on the bottom of your library in any order. +SetInfo:LRW Rare \ No newline at end of file diff --git a/src/main/java/forge/card/ability/effects/DigUntilEffect.java b/src/main/java/forge/card/ability/effects/DigUntilEffect.java index 9276620efb0..0015c9176c3 100644 --- a/src/main/java/forge/card/ability/effects/DigUntilEffect.java +++ b/src/main/java/forge/card/ability/effects/DigUntilEffect.java @@ -101,11 +101,11 @@ public class DigUntilEffect extends SpellAbilityEffect { final ZoneType revealedDest = ZoneType.smartValueOf(sa.getParam("RevealedDestination")); final int revealedLibPos = AbilityUtils.calculateAmount(host, sa.getParam("RevealedLibraryPosition"), sa); final ZoneType digSite = sa.hasParam("DigZone") ? ZoneType.smartValueOf(sa.getParam("DigZone")) : ZoneType.Library; - + for (final Player p : getTargetPlayers(sa)) { if ((tgt == null) || p.canBeTargetedBy(sa)) { final List found = new ArrayList(); - final List revealed = new ArrayList(); + List revealed = new ArrayList(); final PlayerZone library = p.getZone(digSite); @@ -130,7 +130,11 @@ public class DigUntilEffect extends SpellAbilityEffect { } final GameState game = p.getGame(); - // TODO Allow Human to choose the order + 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) { final Iterator itr = found.iterator(); while (itr.hasNext()) { @@ -162,7 +166,11 @@ public class DigUntilEffect extends SpellAbilityEffect { Collections.shuffle(revealed, random); } - // TODO Use getOrderChoices before this moveTo call for the Human + if (revealedDest == ZoneType.Library && !sa.hasParam("Shuffle") && 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(); while (itr.hasNext()) { final Card c = itr.next(); diff --git a/src/main/java/forge/game/player/PlayerController.java b/src/main/java/forge/game/player/PlayerController.java index c8752913238..ab8acde1366 100644 --- a/src/main/java/forge/game/player/PlayerController.java +++ b/src/main/java/forge/game/player/PlayerController.java @@ -126,6 +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); /** 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 ded2da02e3e..3ddc0bc77a1 100644 --- a/src/main/java/forge/game/player/PlayerControllerAi.java +++ b/src/main/java/forge/game/player/PlayerControllerAi.java @@ -210,6 +210,12 @@ public class PlayerControllerAi extends PlayerController { return true; // AI does not know what will happen next (another clash or that would become his topdeck) } + @Override + public List orderMoveToZoneList(List revealed, ZoneType destinationZone) { + //TODO Add logic for AI ordering here + return revealed; + } + @Override public List chooseCardsToDiscardFrom(Player p, SpellAbility sa, List validCards, int min, int max) { boolean isTargetFriendly = !p.isOpponentOf(player); diff --git a/src/main/java/forge/game/player/PlayerControllerHuman.java b/src/main/java/forge/game/player/PlayerControllerHuman.java index 050fd392657..6a391facb58 100644 --- a/src/main/java/forge/game/player/PlayerControllerHuman.java +++ b/src/main/java/forge/game/player/PlayerControllerHuman.java @@ -333,6 +333,16 @@ public class PlayerControllerHuman extends PlayerController { return GuiDialog.confirm(c, "Where will you put " + c.getName() + " in your library", new String[]{"Top", "Bottom"} ); } + @Override + public List orderMoveToZoneList(List revealed, 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); + } else if (destinationZone == ZoneType.Battlefield) { + return GuiChoose.order("Choose order of cards to put onto the battlefield", "Put first", 0, revealed, null, null); + } + return revealed; + } + @Override public List chooseCardsToDiscardFrom(Player p, SpellAbility sa, List valid, int min, int max) { if ( p != player ) {