diff --git a/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java b/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java index 452ca0f985c..ce09b921d4d 100644 --- a/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java +++ b/Mage.Sets/src/mage/cards/e/ExtraordinaryJourney.java @@ -103,6 +103,7 @@ class ExtraordinaryJourneyEffect extends OneShotEffect { if(!effect.apply(game, source)) { return false; } + game.getState().applyEffects(game); Set cards = permanents .stream() @@ -118,7 +119,6 @@ class ExtraordinaryJourneyEffect extends OneShotEffect { .filter(Objects::nonNull) .collect(Collectors.toSet()); - // For each of those cards, its owner may play it for as long as it remains exiled. for (Player owner : owners) { String exileZoneName = "Exile — Can be played by " + owner.getName(); UUID exileZoneId = CardUtil.getExileZoneId( @@ -127,7 +127,6 @@ class ExtraordinaryJourneyEffect extends OneShotEffect { ); ExileZone zone = game.getState().getExile().createZone(exileZoneId, exileZoneName); - for(Card card : cards) { if (card.getOwnerId().equals(owner.getId())) { game.getExile().moveToAnotherZone(card, game, zone); diff --git a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java index fedbec442fb..348ae3a4fa8 100644 --- a/Mage.Sets/src/mage/cards/s/ScoutsWarning.java +++ b/Mage.Sets/src/mage/cards/s/ScoutsWarning.java @@ -49,7 +49,6 @@ public final class ScoutsWarning extends CardImpl { class ScoutsWarningAsThoughEffect extends AsThoughEffectImpl { - private ScoutsWarningWatcher watcher; private int zoneChangeCounter; public ScoutsWarningAsThoughEffect() { @@ -59,13 +58,12 @@ class ScoutsWarningAsThoughEffect extends AsThoughEffectImpl { private ScoutsWarningAsThoughEffect(final ScoutsWarningAsThoughEffect effect) { super(effect); - this.watcher = effect.watcher; this.zoneChangeCounter = effect.zoneChangeCounter; } @Override public void init(Ability source, Game game) { - watcher = game.getState().getWatcher(ScoutsWarningWatcher.class, source.getControllerId()); + ScoutsWarningWatcher watcher = game.getState().getWatcher(ScoutsWarningWatcher.class, source.getControllerId()); Card card = game.getCard(source.getSourceId()); if (watcher != null && card != null) { zoneChangeCounter = card.getZoneChangeCounter(game); @@ -85,11 +83,12 @@ class ScoutsWarningAsThoughEffect extends AsThoughEffectImpl { @Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - if (watcher.isScoutsWarningSpellActive(source.getSourceId(), zoneChangeCounter)) { + ScoutsWarningWatcher watcher = game.getState().getWatcher(ScoutsWarningWatcher.class, source.getControllerId()); + if (watcher != null && watcher.isScoutsWarningSpellActive(source.getSourceId(), zoneChangeCounter)) { Card card = game.getCard(sourceId); - if (card != null && card.isCreature(game) && source.isControlledBy(affectedControllerId)) { - return true; - } + return card != null + && card.isCreature(game) + && source.isControlledBy(affectedControllerId); } return false; } diff --git a/Mage/src/main/java/mage/abilities/condition/common/AttachedToMatchesFilterCondition.java b/Mage/src/main/java/mage/abilities/condition/common/AttachedToMatchesFilterCondition.java index 1a3f07a3e2a..e0bda40e77c 100644 --- a/Mage/src/main/java/mage/abilities/condition/common/AttachedToMatchesFilterCondition.java +++ b/Mage/src/main/java/mage/abilities/condition/common/AttachedToMatchesFilterCondition.java @@ -32,6 +32,9 @@ public class AttachedToMatchesFilterCondition implements Condition { if (attachedTo == null) { attachedTo = (Permanent) game.getLastKnownInformation(permanent.getAttachedTo(), Zone.BATTLEFIELD); } + if (attachedTo == null) { + return false; + } if (filter.match(attachedTo, attachedTo.getControllerId(), source, game)) { return true; }