mirror of
https://github.com/correl/mage.git
synced 2024-11-27 03:00:11 +00:00
Added lookAtCards for hand and library for Shimian Specter
This commit is contained in:
parent
f86c9e01f9
commit
20c1a2e36b
1 changed files with 41 additions and 42 deletions
|
@ -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
|
TargetCard target = new TargetCard(Constants.Zone.PICK, filter);
|
||||||
Cards cardsInLibrary = new CardsImpl(Constants.Zone.LIBRARY);
|
target.setRequired(true);
|
||||||
cardsInLibrary.addAll(damagedPlayer.getLibrary().getCards(game));
|
target.setNotTarget(true);
|
||||||
|
if (you.choose(Constants.Outcome.Benefit, damagedPlayer.getHand(), target, game)) {
|
||||||
|
Card chosenCard = damagedPlayer.getHand().get(target.getFirstTarget(), game);
|
||||||
|
if (chosenCard != null && damagedPlayer != null) {
|
||||||
|
|
||||||
// cards in Graveyard
|
//cards in Library
|
||||||
Cards cardsInGraveyard = new CardsImpl(Constants.Zone.GRAVEYARD);
|
Cards cardsInLibrary = new CardsImpl(Constants.Zone.LIBRARY);
|
||||||
cardsInGraveyard.addAll(damagedPlayer.getGraveyard());
|
cardsInLibrary.addAll(damagedPlayer.getLibrary().getCards(game));
|
||||||
|
you.lookAtCards(damagedPlayer.getName() + ": cards in library", cardsInLibrary, game);
|
||||||
|
|
||||||
// cards in Hand
|
// cards in Graveyard
|
||||||
Cards cardsInHand = new CardsImpl(Constants.Zone.HAND);
|
Cards cardsInGraveyard = new CardsImpl(Constants.Zone.GRAVEYARD);
|
||||||
cardsInHand.addAll(damagedPlayer.getHand());
|
cardsInGraveyard.addAll(damagedPlayer.getGraveyard());
|
||||||
|
|
||||||
// exile same named cards from zones
|
// cards in Hand
|
||||||
for (Card checkCard : cardsInLibrary.getCards(game)) {
|
Cards cardsInHand = new CardsImpl(Constants.Zone.HAND);
|
||||||
if (checkCard.getName().equals(chosenCard.getName())) {
|
cardsInHand.addAll(damagedPlayer.getHand());
|
||||||
checkCard.moveToExile(id, "Library", id, game);
|
you.lookAtCards(damagedPlayer.getName() + ": cards in hand", cardsInHand, game);
|
||||||
}
|
|
||||||
}
|
|
||||||
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);
|
// exile same named cards from zones
|
||||||
|
for (Card checkCard : cardsInLibrary.getCards(game)) {
|
||||||
return true;
|
if (checkCard.getName().equals(chosenCard.getName())) {
|
||||||
|
checkCard.moveToExile(id, "Library", id, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue