mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Done some rework to Wu Spy.
This commit is contained in:
parent
9e29fdafcd
commit
bb229156f5
1 changed files with 13 additions and 18 deletions
|
@ -83,7 +83,7 @@ class WuSpyEffect extends OneShotEffect {
|
||||||
|
|
||||||
WuSpyEffect() {
|
WuSpyEffect() {
|
||||||
super(Outcome.Exile);
|
super(Outcome.Exile);
|
||||||
this.staticText = "Look at the top two cards of target player's library. Put one of them into his or her graveyard";
|
this.staticText = "look at the top two cards of target player's library. Put one of them into his or her graveyard";
|
||||||
}
|
}
|
||||||
|
|
||||||
WuSpyEffect(final WuSpyEffect effect) {
|
WuSpyEffect(final WuSpyEffect effect) {
|
||||||
|
@ -101,19 +101,14 @@ class WuSpyEffect extends OneShotEffect {
|
||||||
Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
Player opponent = game.getPlayer(this.getTargetPointer().getFirst(game, source));
|
||||||
if (controller != null && opponent != null) {
|
if (controller != null && opponent != null) {
|
||||||
Cards cards = new CardsImpl();
|
Cards cards = new CardsImpl();
|
||||||
int numLooked = Math.min(2, opponent.getLibrary().size());
|
cards.addAll(opponent.getLibrary().getTopCards(game, 2));
|
||||||
if (numLooked > 0) {
|
if (!cards.isEmpty()) {
|
||||||
for (int i = 0; i < numLooked; i++) {
|
TargetCard target = new TargetCardInLibrary(new FilterCard("card to put into graveyard"));
|
||||||
cards.add(opponent.getLibrary().removeFromTop(game));
|
controller.choose(Outcome.Benefit, cards, target, game);
|
||||||
}
|
|
||||||
TargetCard target = new TargetCardInLibrary(new FilterCard("card to discard"));
|
|
||||||
controller.choose(Outcome.Discard, cards, target, game);
|
|
||||||
Card card = cards.get(target.getFirstTarget(), game);
|
Card card = cards.get(target.getFirstTarget(), game);
|
||||||
cards.remove(card);
|
if (card != null) {
|
||||||
opponent.moveCardToGraveyardWithInfo(card, source.getSourceId(), game, Zone.LIBRARY);
|
cards.remove(card);
|
||||||
if (cards.size() == 1) {
|
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||||
card = cards.get(cards.iterator().next(), game);
|
|
||||||
opponent.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.LIBRARY, true, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in a new issue