* Worldgorger Dragon - Fixed that the exiled permanents did not return after Worldgorger Dragon left the battlefield.

This commit is contained in:
LevelX2 2015-04-09 14:51:17 +02:00
parent 3266c3b1fc
commit 80f06a22c6

View file

@ -44,7 +44,6 @@ import mage.constants.Rarity;
import mage.constants.TargetController; import mage.constants.TargetController;
import mage.constants.Zone; import mage.constants.Zone;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.ControllerPredicate; import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.ExileZone; import mage.game.ExileZone;
import mage.game.Game; import mage.game.Game;
@ -109,13 +108,13 @@ class WorldgorgerDragonEntersEffect extends OneShotEffect {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId()); MageObject sourceObject = source.getSourceObject(game);
if (controller != null) { if (controller != null) {
UUID exileId = CardUtil.getCardExileZoneId(game, source); UUID exileId = CardUtil.getObjectExileZoneId(game, sourceObject);
if (exileId != null) { if (exileId != null) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) { for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (!permanent.getId().equals(source.getSourceId())) { // Another if (!permanent.getId().equals(source.getSourceId())) { // Another
controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName(), source.getSourceId(), game, Zone.BATTLEFIELD); controller.moveCardToExileWithInfo(permanent, exileId, sourceObject.getLogName(), source.getSourceId(), game, Zone.BATTLEFIELD, true);
} }
} }
return true; return true;
@ -145,8 +144,7 @@ class WorldgorgerDragonLeavesEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
if (controller != null) { if (controller != null) {
UUID exileId = source.getSourceId(); ExileZone exile = game.getExile().getExileZone(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter() -1));
ExileZone exile = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
if (exile != null) { if (exile != null) {
exile = exile.copy(); exile = exile.copy();
for (UUID cardId : exile) { for (UUID cardId : exile) {