* Psychic Strike - Fixed that second effect will be applied also if targeted spell can't be countered.

This commit is contained in:
LevelX2 2013-09-10 16:06:46 +02:00
parent 70e7fb0cdd
commit b4a1e79f85

View file

@ -88,21 +88,23 @@ class PsychicStrikeEffect extends OneShotEffect<PsychicStrikeEffect> {
@Override
public boolean apply(Game game, Ability source) {
boolean countered = false;
StackObject stackObject = game.getStack().getStackObject(targetPointer.getFirst(game, source));
if (stackObject != null && game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
if (game.getStack().counter(source.getFirstTarget(), source.getSourceId(), game)) {
countered = true;
}
if (stackObject != null) {
Player controller = game.getPlayer(stackObject.getControllerId());
if (controller == null) {
return false;
}
int cardsCount = Math.min(2, controller.getLibrary().size());
for (int i = 0; i < cardsCount; i++) {
Card card = controller.getLibrary().removeFromTop(game);
if (card != null) {
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
if (controller != null) {
int cardsCount = Math.min(2, controller.getLibrary().size());
for (int i = 0; i < cardsCount; i++) {
Card card = controller.getLibrary().removeFromTop(game);
if (card != null) {
card.moveToZone(Zone.GRAVEYARD, source.getId(), game, false);
}
}
}
return true;
}
return false;
return countered;
}
}