* Grindstone - Fixed a bug causing target player to lose game by grindstone effect itself.

This commit is contained in:
LevelX2 2015-04-14 15:25:51 +02:00
parent 15389b24d8
commit 7529d6f207
3 changed files with 90 additions and 18 deletions

View file

@ -52,11 +52,6 @@ public class Progenitus extends CardImpl {
this.subtype.add("Hydra");
this.subtype.add("Avatar");
this.color.setRed(true);
this.color.setBlue(true);
this.color.setGreen(true);
this.color.setBlack(true);
this.color.setWhite(true);
this.power = new MageInt(10);
this.toughness = new MageInt(10);

View file

@ -106,17 +106,23 @@ class GrindstoneEffect extends OneShotEffect {
return true;
}
colorShared = false;
Card card1 = targetPlayer.getLibrary().removeFromTop(game);
if (card1 != null) {
targetPlayer.moveCardToGraveyardWithInfo(card1, source.getSourceId(), game, Zone.LIBRARY);
Card card2 = targetPlayer.getLibrary().removeFromTop(game);
if (card2 != null) {
targetPlayer.moveCardToGraveyardWithInfo(card2, source.getSourceId(), game, Zone.LIBRARY);
Card card1 = null;
Card card2 = null;
if (targetPlayer.getLibrary().size() > 0) {
card1 = targetPlayer.getLibrary().removeFromTop(game);
if (targetPlayer.getLibrary().size() > 0) {
card2 = targetPlayer.getLibrary().removeFromTop(game);
if (card1.getColor().hasColor() && card2.getColor().hasColor()) {
colorShared = card1.getColor().shares(card2.getColor());
}
}
}
}
}
}
if (card1 != null) {
targetPlayer.moveCardToGraveyardWithInfo(card1, source.getSourceId(), game, Zone.LIBRARY);
}
if (card2 != null) {
targetPlayer.moveCardToGraveyardWithInfo(card2, source.getSourceId(), game, Zone.LIBRARY);
}
} while (colorShared && targetPlayer.isInGame());
return true;
}