forked from External/mage
* Fixed some target pointer handling.
This commit is contained in:
parent
88dd301f82
commit
c02c5a175b
14 changed files with 140 additions and 108 deletions
|
|
@ -1,11 +1,10 @@
|
|||
package mage.target.targetpointer;
|
||||
|
||||
import java.util.*;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class SecondTargetPointer implements TargetPointer {
|
||||
|
||||
private Map<UUID, Integer> zoneChangeCounter = new HashMap<>();
|
||||
|
|
@ -59,7 +58,7 @@ public class SecondTargetPointer implements TargetPointer {
|
|||
if (zoneChangeCounter.containsKey(targetId)) {
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null && zoneChangeCounter.containsKey(targetId)
|
||||
&& card.getZoneChangeCounter(game) != zoneChangeCounter.get(targetId)) {
|
||||
&& card.getZoneChangeCounter(game) != zoneChangeCounter.get(targetId)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -72,4 +71,15 @@ public class SecondTargetPointer implements TargetPointer {
|
|||
public TargetPointer copy() {
|
||||
return new SecondTargetPointer(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FixedTarget getFixedTarget(Game game, Ability source) {
|
||||
this.init(game, source);
|
||||
UUID firstId = getFirst(game, source);
|
||||
if (firstId != null) {
|
||||
return new FixedTarget(firstId, game.getState().getZoneChangeCounter(firstId));
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue