- Added Fathom Trawl

- Enabled ordering of cards going to library or battlefield from DigUntil effects.
This commit is contained in:
moomarc
2013-05-24 09:50:52 +00:00
parent 2370324591
commit 4197acc6fd
6 changed files with 39 additions and 4 deletions

1
.gitattributes vendored
View File

@@ -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

View File

@@ -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

View File

@@ -105,7 +105,7 @@ public class DigUntilEffect extends SpellAbilityEffect {
for (final Player p : getTargetPlayers(sa)) {
if ((tgt == null) || p.canBeTargetedBy(sa)) {
final List<Card> found = new ArrayList<Card>();
final List<Card> revealed = new ArrayList<Card>();
List<Card> revealed = new ArrayList<Card>();
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<Card> 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<Card> itr = revealed.iterator();
while (itr.hasNext()) {
final Card c = itr.next();

View File

@@ -126,6 +126,7 @@ public abstract class PlayerController {
public abstract void reveal(String string, Collection<Card> cards, ZoneType zone, Player owner);
public abstract ImmutablePair<List<Card>, List<Card>> arrangeForScry(List<Card> topN);
public abstract boolean willPutCardOnTop(Card c);
public abstract List<Card> orderMoveToZoneList(List<Card> revealed, ZoneType destinationZone);
/** p = target player, validCards - possible discards, min cards to discard */
public abstract List<Card> chooseCardsToDiscardFrom(Player playerDiscard, SpellAbility sa, List<Card> validCards, int min, int max);

View File

@@ -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<Card> orderMoveToZoneList(List<Card> revealed, ZoneType destinationZone) {
//TODO Add logic for AI ordering here
return revealed;
}
@Override
public List<Card> chooseCardsToDiscardFrom(Player p, SpellAbility sa, List<Card> validCards, int min, int max) {
boolean isTargetFriendly = !p.isOpponentOf(player);

View File

@@ -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<Card> orderMoveToZoneList(List<Card> 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<Card> chooseCardsToDiscardFrom(Player p, SpellAbility sa, List<Card> valid, int min, int max) {
if ( p != player ) {