mirror of
https://github.com/correl/mage.git
synced 2024-12-27 03:00:13 +00:00
[NEO] fixed Mechtitan Core error when exiling only tokens
This commit is contained in:
parent
4dfd0867ed
commit
ac56e8dd24
1 changed files with 18 additions and 17 deletions
|
@ -32,10 +32,11 @@ public class FixedTargets extends TargetPointerImpl {
|
||||||
|
|
||||||
public FixedTargets(Cards cards, Game game) {
|
public FixedTargets(Cards cards, Game game) {
|
||||||
super();
|
super();
|
||||||
|
if (cards != null) {
|
||||||
for (UUID targetId : cards) {
|
for (UUID targetId : cards) {
|
||||||
MageObjectReference mor = new MageObjectReference(targetId, game);
|
MageObjectReference mor = new MageObjectReference(targetId, game);
|
||||||
targets.add(mor);
|
targets.add(mor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
@ -92,24 +93,24 @@ public class FixedTargets extends TargetPointerImpl {
|
||||||
@Override
|
@Override
|
||||||
public List<UUID> getTargets(Game game, Ability source) {
|
public List<UUID> getTargets(Game game, Ability source) {
|
||||||
// check target not changed zone
|
// check target not changed zone
|
||||||
List<UUID> list = new ArrayList<>();
|
return targets
|
||||||
for (MageObjectReference mor : targets) {
|
.stream()
|
||||||
if (mor.getSourceId() != null && game.getState().getZoneChangeCounter(mor.getSourceId()) == mor.getZoneChangeCounter()) {
|
.filter(mor -> mor.zoneCounterIsCurrent(game))
|
||||||
list.add(mor.getSourceId());
|
.map(MageObjectReference::getSourceId)
|
||||||
}
|
.filter(Objects::nonNull)
|
||||||
}
|
.collect(Collectors.toList());
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public UUID getFirst(Game game, Ability source) {
|
public UUID getFirst(Game game, Ability source) {
|
||||||
// check target not changed zone
|
// check target not changed zone
|
||||||
for (MageObjectReference mor : targets) {
|
return targets
|
||||||
if (game.getState().getZoneChangeCounter(mor.getSourceId()) == mor.getZoneChangeCounter()) {
|
.stream()
|
||||||
return mor.getSourceId();
|
.filter(mor -> mor.zoneCounterIsCurrent(game))
|
||||||
}
|
.map(MageObjectReference::getSourceId)
|
||||||
}
|
.filter(Objects::nonNull)
|
||||||
return null;
|
.findFirst()
|
||||||
|
.orElse(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue