From 6a5e1ae98f73d772afc78377c98f94d99fa0b1c4 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sun, 7 Apr 2013 16:05:13 +0200 Subject: [PATCH] Fixed wrong select text of Restoration Angel.. --- .../sets/avacynrestored/RestorationAngel.java | 31 ++++++++----------- 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java b/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java index 85e680eda70..6636f7c24a0 100644 --- a/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java +++ b/Mage.Sets/src/mage/sets/avacynrestored/RestorationAngel.java @@ -27,25 +27,25 @@ */ package mage.sets.avacynrestored; +import java.util.UUID; +import mage.Constants; import mage.Constants.CardType; import mage.Constants.Rarity; +import mage.Constants.Zone; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.OneShotEffect; import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlyingAbility; +import mage.cards.Card; import mage.cards.CardImpl; import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SubtypePredicate; -import mage.target.common.TargetControlledCreaturePermanent; - -import java.util.UUID; -import mage.Constants; -import mage.abilities.effects.OneShotEffect; -import mage.cards.Card; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.target.common.TargetControlledCreaturePermanent; /** * @@ -54,7 +54,7 @@ import mage.game.permanent.Permanent; */ public class RestorationAngel extends CardImpl { - private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("non-Angel creature you control, then "); + private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("non-Angel creature you control"); static { filter.add(Predicates.not(new SubtypePredicate("Angel"))); @@ -107,22 +107,17 @@ class RestorationAngelEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { boolean exiled = false; + Permanent sourcePermanent = game.getPermanent(source.getSourceId()); + if (sourcePermanent == null) { + sourcePermanent = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD); + } Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source)); if (permanent != null) { - permanent.moveToExile(source.getSourceId(), "Restoration Angel", source.getSourceId(), game); - exiled = true; - } else { - Card card = game.getCard(targetPointer.getFirst(game, source)); - if (card != null) { - card.moveToExile(source.getSourceId(), "Restoration Angel", source.getSourceId(), game); - exiled = true; - } - } - if (exiled) { + permanent.moveToExile(source.getSourceId(), sourcePermanent.getName(), source.getSourceId(), game); Card card = game.getCard(targetPointer.getFirst(game, source)); if (card != null) { Constants.Zone currentZone = game.getState().getZone(card.getId()); - return card.putOntoBattlefield(game, currentZone, source.getId(), source.getControllerId()); + return card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId()); } } return exiled;