This commit is contained in:
jeffwadsworth 2020-06-26 16:51:17 -05:00
parent 8e5b72b8c7
commit d02d8a4dfe
3 changed files with 25 additions and 8 deletions

View file

@ -43,7 +43,8 @@ public class ExileTargetEffect extends OneShotEffect {
}
/**
* Exile cards to normal exile window (but it can exile to source's exile window after toSourceExileZone change)
* Exile cards to normal exile window (but it can exile to source's exile
* window after toSourceExileZone change)
*/
public ExileTargetEffect() {
this(null, "");
@ -91,21 +92,27 @@ public class ExileTargetEffect extends OneShotEffect {
Set<Card> toExile = new LinkedHashSet<>();
if (multitargetHandling
&& targetPointer instanceof FirstTargetPointer
&& (source.getTargets().size() > 1 || (source.getTargets().size() > 0 && source.getTargets().get(0).getTargets().size() > 1))) {
&& (source.getTargets().size() > 1
|| (source.getTargets().size() > 0
&& source.getTargets().get(0).getTargets().size() > 1))) {
for (Target target : source.getTargets()) {
for (UUID targetId : target.getTargets()) {
Permanent permanent = game.getPermanent(targetId);
if (permanent != null
&& permanent.isPhasedIn()) {
Zone currentZone = game.getState().getZone(permanent.getId());
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == Zone.BATTLEFIELD)) {
if (currentZone != Zone.EXILED
&& (onlyFromZone == null
|| onlyFromZone == Zone.BATTLEFIELD)) {
toExile.add(permanent);
}
} else {
Card card = game.getCard(targetId);
if (card != null) {
Zone currentZone = game.getState().getZone(card.getId());
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == currentZone)) {
if (currentZone != Zone.EXILED
&& (onlyFromZone == null
|| onlyFromZone == currentZone)) {
toExile.add(card);
}
} else {
@ -123,14 +130,18 @@ public class ExileTargetEffect extends OneShotEffect {
if (permanent != null
&& permanent.isPhasedIn()) {
Zone currentZone = game.getState().getZone(permanent.getId());
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == Zone.BATTLEFIELD)) {
if (currentZone != Zone.EXILED
&& (onlyFromZone == null
|| onlyFromZone == Zone.BATTLEFIELD)) {
toExile.add(permanent);
}
} else {
Card card = game.getCard(targetId);
if (card != null) {
Zone currentZone = game.getState().getZone(card.getId());
if (currentZone != Zone.EXILED && (onlyFromZone == null || onlyFromZone == currentZone)) {
if (currentZone != Zone.EXILED
&& (onlyFromZone == null
|| onlyFromZone == currentZone)) {
toExile.add(card);
}
} else {