diff --git a/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java b/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java index 6ee01d3726d..32f5a7346a2 100644 --- a/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java +++ b/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java @@ -48,6 +48,7 @@ import mage.target.common.TargetCreaturePermanent; import mage.watchers.WatcherImpl; import java.util.UUID; +import mage.game.permanent.Permanent; /** * @@ -121,6 +122,14 @@ class DungeonGeistsEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { + // Source must be on the battlefield (it's neccessary to check here because if as response to the enter + // the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL + // event will happen before this effect is applied ever) + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) { + this.used = true; + return false; + } if (event.getType() == GameEvent.EventType.LOST_CONTROL) { if (event.getTargetId().equals(source.getSourceId())) { this.used = true; diff --git a/Mage.Sets/src/mage/sets/magic2014/TidebinderMage.java b/Mage.Sets/src/mage/sets/magic2014/TidebinderMage.java index 2cd000bac6b..c2ca6f15147 100644 --- a/Mage.Sets/src/mage/sets/magic2014/TidebinderMage.java +++ b/Mage.Sets/src/mage/sets/magic2014/TidebinderMage.java @@ -50,6 +50,7 @@ import mage.filter.predicate.permanent.ControllerPredicate; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; import mage.target.Target; import mage.target.common.TargetCreaturePermanent; import mage.watchers.WatcherImpl; @@ -126,6 +127,14 @@ class TidebinderMageEffect extends ReplacementEffectImpl { @Override public boolean applies(GameEvent event, Ability source, Game game) { + // Source must be on the battlefield (it's neccessary to check here because if as response to the enter + // the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL + // event will happen before this effect is applied ever) + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) { + this.used = true; + return false; + } if (event.getType() == GameEvent.EventType.LOST_CONTROL) { if (event.getTargetId().equals(source.getSourceId())) { this.used = true; diff --git a/Mage.Sets/src/mage/sets/theros/ShipbreakerKraken.java b/Mage.Sets/src/mage/sets/theros/ShipbreakerKraken.java index 70f40e309f2..6f7547f5d30 100644 --- a/Mage.Sets/src/mage/sets/theros/ShipbreakerKraken.java +++ b/Mage.Sets/src/mage/sets/theros/ShipbreakerKraken.java @@ -45,6 +45,7 @@ import mage.constants.Zone; import mage.game.Game; import mage.game.events.GameEvent; import mage.game.events.ZoneChangeEvent; +import mage.game.permanent.Permanent; import mage.target.common.TargetCreaturePermanent; import mage.watchers.WatcherImpl; @@ -111,6 +112,14 @@ class ShipbreakerKrakenReplacementEffect extends ReplacementEffectImpl