mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
* Scry effect - Added message to the game log, how many cards were put on bottom of the library.
This commit is contained in:
parent
b4a1e79f85
commit
478bd3979b
1 changed files with 41 additions and 33 deletions
|
@ -66,6 +66,7 @@ public class ScryEffect extends OneShotEffect<ScryEffect> {
|
||||||
@Override
|
@Override
|
||||||
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());
|
||||||
|
if (player != null) {
|
||||||
Cards cards = new CardsImpl(Zone.PICK);
|
Cards cards = new CardsImpl(Zone.PICK);
|
||||||
int count = Math.min(scryNumber, player.getLibrary().size());
|
int count = Math.min(scryNumber, player.getLibrary().size());
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
|
@ -87,6 +88,7 @@ public class ScryEffect extends OneShotEffect<ScryEffect> {
|
||||||
target1.clearChosen();
|
target1.clearChosen();
|
||||||
}
|
}
|
||||||
// move cards to the top of the library
|
// move cards to the top of the library
|
||||||
|
int onTop = cards.size();
|
||||||
if (cards.size() > 1) {
|
if (cards.size() > 1) {
|
||||||
TargetCard target2 = new TargetCard(Zone.PICK, filter2);
|
TargetCard target2 = new TargetCard(Zone.PICK, filter2);
|
||||||
target2.setRequired(true);
|
target2.setRequired(true);
|
||||||
|
@ -104,8 +106,14 @@ public class ScryEffect extends OneShotEffect<ScryEffect> {
|
||||||
Card card = cards.get(cards.iterator().next(), game);
|
Card card = cards.get(cards.iterator().next(), game);
|
||||||
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
|
card.moveToZone(Zone.LIBRARY, source.getId(), game, true);
|
||||||
}
|
}
|
||||||
|
game.informPlayers(new StringBuilder(player.getName()).append(" puts ")
|
||||||
|
.append(onTop).append(onTop == 1 ?" card":"cards")
|
||||||
|
.append(" on the bottom of his or her library (scry ")
|
||||||
|
.append(scryNumber).append(")").toString());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ScryEffect copy() {
|
public ScryEffect copy() {
|
||||||
|
|
Loading…
Reference in a new issue