- Add changes to allow for a one of the two piles to be facedown

- Add Fortune's Favor
This commit is contained in:
Sol
2016-07-26 14:32:42 +00:00
parent 9496bf38fd
commit d41c0bc3e0
9 changed files with 49 additions and 31 deletions

View File

@@ -0,0 +1,10 @@
Name:Fortune's Favor
ManaCost:3 U
Types:Instant
A:SP$ PeekAndReveal | Cost$ 3 U | Defined$ You | PeekAmount$ 4 | NoPeek$ True | NoReveal$ True | RememberPeeked$ True | SubAbility$ Separate | SpellDescription$ Target opponent looks at the top four cards of your library and separates them into a face-down pile and a face-up pile. Put one pile into your hand and the other into your graveyard.
SVar:Separate:DB$ TwoPiles | Defined$ You | Separator$ TargetedPlayer | Chooser$ You | ValidTgts$ Opponent | DefinedCards$ Remembered | ChosenPile$ DBHand | UnchosenPile$ DBGrave | Zone$ Library | FaceDown$ One | StackDescription$ None
SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand | SubAbility$ DBCleanup
SVar:DBGrave:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Graveyard | SubAbility$ DBCleanup
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
SVar:Picture:http://www.wizards.com/global/images/magic/general/fortunes_favor.jpg
Oracle:Target opponent looks at the top four cards of your library and separates them into a face-down pile and a face-up pile. Put one pile into your hand and the other into your graveyard.

View File

@@ -1289,25 +1289,33 @@ public class PlayerControllerHuman
}
@Override
public boolean chooseCardsPile(final SpellAbility sa, final CardCollectionView pile1, final CardCollectionView pile2, final boolean faceUp) {
if (!faceUp) {
final String p1Str = String.format("Pile 1 (%s cards)", pile1.size());
final String p2Str = String.format("Pile 2 (%s cards)", pile2.size());
public boolean chooseCardsPile(final SpellAbility sa, final CardCollectionView pile1, final CardCollectionView pile2, final String faceUp) {
final String p1Str = String.format("-- Pile 1 (%s cards) --", pile1.size());
final String p2Str = String.format("-- Pile 2 (%s cards) --", pile2.size());
/*
if (faceUp.equals("True")) {
final List<String> possibleValues = ImmutableList.of(p1Str , p2Str);
return getGui().confirm(CardView.get(sa.getHostCard()), "Choose a Pile", possibleValues);
}
tempShowCards(pile1);
tempShowCards(pile2);
*/
final List<CardView> cards = Lists.newArrayListWithCapacity(pile1.size() + pile2.size() + 2);
final CardView pileView1 = new CardView(Integer.MIN_VALUE, null, "--- Pile 1 ---");
cards.add(pileView1);
cards.addAll(CardView.getCollection(pile1));
final CardView pileView1 = new CardView(Integer.MIN_VALUE, null, p1Str);
final CardView pileView2 = new CardView(Integer.MIN_VALUE + 1, null, "--- Pile 2 ---");
cards.add(pileView1);
if (faceUp.equals("False")) {
tempShowCards(pile1);
cards.addAll(CardView.getCollection(pile1));
}
final CardView pileView2 = new CardView(Integer.MIN_VALUE + 1, null, p2Str);
cards.add(pileView2);
cards.addAll(CardView.getCollection(pile2));
if (!faceUp.equals("True")) {
tempShowCards(pile2);
cards.addAll(CardView.getCollection(pile2));
}
// make sure Pile 1 or Pile 2 is clicked on
boolean result;