From fee15744a18e49d9af0d8e69e5f86073c21d4803 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 15 Jan 2014 19:35:01 +0100 Subject: [PATCH] * Tidebinder Mage, Dungeon Geists and Shipbreaker Kraken - Fixed that the not untap effect lasted forever if the creature with the ability was destroyed or exiled while the ability was on the stack. --- Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java | 9 +++++++++ Mage.Sets/src/mage/sets/magic2014/TidebinderMage.java | 9 +++++++++ Mage.Sets/src/mage/sets/theros/ShipbreakerKraken.java | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java b/Mage.Sets/src/mage/sets/darkascension/DungeonGeists.java index 6ee01d3726..32f5a7346a 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 2cd000bac6..c2ca6f1514 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 70f40e309f..6f7547f5d3 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