Added lookAtCards for hand and library for Shimian Specter

This commit is contained in:
North 2012-08-15 16:19:33 +03:00
parent f86c9e01f9
commit 20c1a2e36b

View file

@ -99,52 +99,51 @@ class ShimianSpecterEffect extends OneShotEffect<ShimianSpecterEffect> {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source)); Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (damagedPlayer != null) { Player you = game.getPlayer(source.getControllerId());
if (damagedPlayer != null && you != null) {
damagedPlayer.revealCards("Shimian Specter", damagedPlayer.getHand(), game); damagedPlayer.revealCards("Shimian Specter", damagedPlayer.getHand(), game);
Player you = game.getPlayer(source.getControllerId());
if (you != null) {
TargetCard target = new TargetCard(Constants.Zone.PICK, filter);
target.setRequired(true);
target.setNotTarget(true);
if (you.choose(Constants.Outcome.Benefit, damagedPlayer.getHand(), target, game)) {
Card chosenCard = damagedPlayer.getHand().get(target.getFirstTarget(), game);
if (chosenCard != null) {
if (damagedPlayer != null) {
//cards in Library
Cards cardsInLibrary = new CardsImpl(Constants.Zone.LIBRARY);
cardsInLibrary.addAll(damagedPlayer.getLibrary().getCards(game));
// cards in Graveyard TargetCard target = new TargetCard(Constants.Zone.PICK, filter);
Cards cardsInGraveyard = new CardsImpl(Constants.Zone.GRAVEYARD); target.setRequired(true);
cardsInGraveyard.addAll(damagedPlayer.getGraveyard()); target.setNotTarget(true);
if (you.choose(Constants.Outcome.Benefit, damagedPlayer.getHand(), target, game)) {
// cards in Hand Card chosenCard = damagedPlayer.getHand().get(target.getFirstTarget(), game);
Cards cardsInHand = new CardsImpl(Constants.Zone.HAND); if (chosenCard != null && damagedPlayer != null) {
cardsInHand.addAll(damagedPlayer.getHand());
//cards in Library
// exile same named cards from zones Cards cardsInLibrary = new CardsImpl(Constants.Zone.LIBRARY);
for (Card checkCard : cardsInLibrary.getCards(game)) { cardsInLibrary.addAll(damagedPlayer.getLibrary().getCards(game));
if (checkCard.getName().equals(chosenCard.getName())) { you.lookAtCards(damagedPlayer.getName() + ": cards in library", cardsInLibrary, game);
checkCard.moveToExile(id, "Library", id, game);
} // cards in Graveyard
} Cards cardsInGraveyard = new CardsImpl(Constants.Zone.GRAVEYARD);
for (Card checkCard : cardsInGraveyard.getCards(game)) { cardsInGraveyard.addAll(damagedPlayer.getGraveyard());
if (checkCard.getName().equals(chosenCard.getName())) {
checkCard.moveToExile(id, "Graveyard", id, game); // cards in Hand
} Cards cardsInHand = new CardsImpl(Constants.Zone.HAND);
} cardsInHand.addAll(damagedPlayer.getHand());
for (Card checkCard : cardsInHand.getCards(game)) { you.lookAtCards(damagedPlayer.getName() + ": cards in hand", cardsInHand, game);
if (checkCard.getName().equals(chosenCard.getName())) {
checkCard.moveToExile(id, "Hand", id, game); // exile same named cards from zones
} for (Card checkCard : cardsInLibrary.getCards(game)) {
} if (checkCard.getName().equals(chosenCard.getName())) {
checkCard.moveToExile(id, "Library", id, game);
damagedPlayer.shuffleLibrary(game);
return true;
} }
} }
for (Card checkCard : cardsInGraveyard.getCards(game)) {
if (checkCard.getName().equals(chosenCard.getName())) {
checkCard.moveToExile(id, "Graveyard", id, game);
}
}
for (Card checkCard : cardsInHand.getCards(game)) {
if (checkCard.getName().equals(chosenCard.getName())) {
checkCard.moveToExile(id, "Hand", id, game);
}
}
damagedPlayer.shuffleLibrary(game);
return true;
} }
} }
} }