mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
a special case for Human scrying with a single card available and no need to arrange
This commit is contained in:
@@ -71,12 +71,15 @@ public class ScryEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ImmutablePair<List<Card>, List<Card>> lists = p.getController().arrangeForScry(topN);
|
ImmutablePair<List<Card>, List<Card>> lists = p.getController().arrangeForScry(topN);
|
||||||
|
List<Card> toTop = lists.getLeft();
|
||||||
|
List<Card> toBottom = lists.getRight();
|
||||||
|
|
||||||
for(Card c : lists.getRight()) {
|
if ( null != toBottom) {
|
||||||
|
for(Card c : toBottom) {
|
||||||
p.getGame().getAction().moveToBottomOfLibrary(c);
|
p.getGame().getAction().moveToBottomOfLibrary(c);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<Card> toTop = lists.getLeft();
|
|
||||||
if ( null != toTop ) {
|
if ( null != toTop ) {
|
||||||
Collections.reverse(toTop); // the last card in list will become topmost in library, have to revert thus.
|
Collections.reverse(toTop); // the last card in list will become topmost in library, have to revert thus.
|
||||||
for(Card c : toTop) {
|
for(Card c : toTop) {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package forge.game.player;
|
package forge.game.player;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -292,15 +293,30 @@ public class PlayerControllerHuman extends PlayerController {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ImmutablePair<List<Card>, List<Card>> arrangeForScry(List<Card> topN) {
|
public ImmutablePair<List<Card>, List<Card>> arrangeForScry(List<Card> topN) {
|
||||||
List<Card> toBottom = GuiChoose.order("Select cards to be put on the bottom of your library", "Cards to put on the bottom", -1, topN, null, null);
|
List<Card> toBottom = null;
|
||||||
|
List<Card> toTop = null;
|
||||||
|
|
||||||
|
if (topN.size() == 1) {
|
||||||
|
if (willPutCardOnTop(topN.get(0)))
|
||||||
|
toTop = topN;
|
||||||
|
else
|
||||||
|
toBottom = topN;
|
||||||
|
} else {
|
||||||
|
toBottom = GuiChoose.order("Select cards to be put on the bottom of your library", "Cards to put on the bottom", -1, topN, null, null);
|
||||||
topN.removeAll(toBottom);
|
topN.removeAll(toBottom);
|
||||||
List<Card> toTop = topN.isEmpty() ? null : GuiChoose.order("Arrange cards to be put on top of your library", "Cards arranged", 0, topN, null, null);
|
if ( topN.isEmpty() )
|
||||||
|
toTop = null;
|
||||||
|
else if ( topN.size() == 1 )
|
||||||
|
toTop = topN;
|
||||||
|
else
|
||||||
|
toTop = GuiChoose.order("Arrange cards to be put on top of your library", "Cards arranged", 0, topN, null, null);
|
||||||
|
}
|
||||||
return ImmutablePair.of(toTop, toBottom);
|
return ImmutablePair.of(toTop, toBottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean willPutCardOnTop(Card c) {
|
public boolean willPutCardOnTop(Card c) {
|
||||||
return GuiDialog.confirm(c, "Where you put " + c.getName() + " in your library", new String[]{"Top", "Bottom"} );
|
return GuiDialog.confirm(c, "Where will you put " + c.getName() + " in your library", new String[]{"Top", "Bottom"} );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user