mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
Fixed Scry causing losing the game
This commit is contained in:
parent
cec8d6feef
commit
b4f8de621f
1 changed files with 5 additions and 1 deletions
|
@ -66,7 +66,11 @@ public class ScryEffect extends OneShotEffect<ScryEffect> {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player player = game.getPlayer(source.getControllerId());
|
Player player = game.getPlayer(source.getControllerId());
|
||||||
Cards cards = new CardsImpl(Zone.PICK);
|
Cards cards = new CardsImpl(Zone.PICK);
|
||||||
for (int i = 0; i < scryNumber; i++) {
|
int count = Math.min(scryNumber, player.getLibrary().size());
|
||||||
|
if (count == 0) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < count; i++) {
|
||||||
Card card = player.getLibrary().removeFromTop(game);
|
Card card = player.getLibrary().removeFromTop(game);
|
||||||
cards.add(card);
|
cards.add(card);
|
||||||
game.setZone(card.getId(), Zone.PICK);
|
game.setZone(card.getId(), Zone.PICK);
|
||||||
|
|
Loading…
Reference in a new issue