Fixed bug of TargetCardInYourGraveyard that counted also cards in other graveyards (fixes Archaeomancer bug).

This commit is contained in:
LevelX2 2013-06-08 02:15:25 +02:00
parent fdac98cdeb
commit fafde2ef31

View file

@ -66,19 +66,22 @@ public class TargetCardInYourGraveyard extends TargetCard<TargetCardInYourGravey
@Override @Override
public boolean canTarget(UUID id, Ability source, Game game) { public boolean canTarget(UUID id, Ability source, Game game) {
Card card = game.getCard(id); Card card = game.getCard(id);
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id)) if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id)) {
return filter.match(card, game); return filter.match(card, game);
}
}
return false; return false;
} }
@Override @Override
public boolean canTarget(UUID id, UUID playerId, Ability ability, Game game) { public boolean canTarget(UUID id, UUID playerId, Ability ability, Game game) {
Card card = game.getCard(id); Card card = game.getCard(id);
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
if (game.getPlayer(playerId).getGraveyard().contains(id)) { if (game.getPlayer(playerId).getGraveyard().contains(id)) {
return filter.match(card, game); return filter.match(card, game);
} }
}
return false; return false;
} }
@ -91,10 +94,15 @@ public class TargetCardInYourGraveyard extends TargetCard<TargetCardInYourGravey
*/ */
@Override @Override
public boolean canChoose(UUID sourceControllerId, Game game) { public boolean canChoose(UUID sourceControllerId, Game game) {
if (game.getPlayer(sourceControllerId).getGraveyard().count(filter, game) >= this.minNumberOfTargets) if (game.getPlayer(sourceControllerId).getGraveyard().count(filter, game) >= this.minNumberOfTargets) {
return true; return true;
}
return false; return false;
} }
@Override
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
return canChoose(sourceControllerId, game);
}
@Override @Override
public TargetCardInYourGraveyard copy() { public TargetCardInYourGraveyard copy() {