mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed bug of TargetCardInYourGraveyard that counted also cards in other graveyards (fixes Archaeomancer bug).
This commit is contained in:
parent
fdac98cdeb
commit
fafde2ef31
1 changed files with 12 additions and 4 deletions
|
@ -66,19 +66,22 @@ public class TargetCardInYourGraveyard extends TargetCard<TargetCardInYourGravey
|
|||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
Card card = game.getCard(id);
|
||||
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD)
|
||||
if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id))
|
||||
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
||||
if (game.getPlayer(source.getControllerId()).getGraveyard().contains(id)) {
|
||||
return filter.match(card, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTarget(UUID id, UUID playerId, Ability ability, Game game) {
|
||||
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)) {
|
||||
return filter.match(card, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -91,10 +94,15 @@ public class TargetCardInYourGraveyard extends TargetCard<TargetCardInYourGravey
|
|||
*/
|
||||
@Override
|
||||
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 false;
|
||||
}
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
return canChoose(sourceControllerId, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TargetCardInYourGraveyard copy() {
|
||||
|
|
Loading…
Reference in a new issue