remove AIRevealAction.Hide from ShuffleLibraryAction, call it in executeEvent

master
melvinzhang 2015-04-27 19:58:17 +08:00
parent 094967c0da
commit 232065a590
3 changed files with 8 additions and 3 deletions

View File

@ -17,7 +17,6 @@ public class ShuffleLibraryAction extends MagicAction {
public void doAction(final MagicGame game) {
oldLibrary=new MagicCardList(player.getLibrary());
player.getLibrary().shuffle();
game.doAction(AIRevealAction.Hide(player.getLibrary()));
}
@Override

View File

@ -45,6 +45,7 @@ public class MagicSearchOntoBattlefieldEvent extends MagicEvent {
@Override
public void onAddEvent(final MagicGame game) {
// reveal library so that search can choose the actual cards
game.doAction(new AIRevealAction(getPlayer().getLibrary()));
}
@ -54,7 +55,7 @@ public class MagicSearchOntoBattlefieldEvent extends MagicEvent {
public void executeEvent(final MagicGame game, final MagicEvent event) {
// choice could be MagicMayChoice or MagicTargetChoice or MagicFromCardListChoice
if (event.isNo()) {
game.doAction(AIRevealAction.Hide(event.getPlayer().getLibrary()));
// do nothing
} else if (event.getChosen()[0] instanceof MagicCardChoiceResult) {
event.processChosenCards(game, new MagicCardAction() {
public void doAction(final MagicCard card) {
@ -74,6 +75,8 @@ public class MagicSearchOntoBattlefieldEvent extends MagicEvent {
});
game.doAction(new ShuffleLibraryAction(event.getPlayer()));
}
// hide back all the cards in the library
game.doAction(AIRevealAction.Hide(event.getPlayer().getLibrary()));
}
};
}

View File

@ -34,6 +34,7 @@ public class MagicSearchToLocationEvent extends MagicEvent {
@Override
public void onAddEvent(final MagicGame game) {
// reveal library so that search can choose the actual cards
game.doAction(new AIRevealAction(getPlayer().getLibrary()));
}
@ -42,7 +43,7 @@ public class MagicSearchToLocationEvent extends MagicEvent {
public void executeEvent(final MagicGame game, final MagicEvent event) {
// choice could be MagicMayChoice or MagicTargetChoice or MagicFromCardListChoice
if (event.isNo()) {
game.doAction(AIRevealAction.Hide(event.getPlayer().getLibrary()));
// do nothing
} else if (event.getChosen()[0] instanceof MagicCardChoiceResult) {
game.doAction(new ShuffleLibraryAction(event.getPlayer()));
event.processChosenCards(game, new MagicCardAction() {
@ -64,6 +65,8 @@ public class MagicSearchToLocationEvent extends MagicEvent {
}
});
}
// hide back all the cards in the library
game.doAction(AIRevealAction.Hide(event.getPlayer().getLibrary()));
}
};
}