Fixed some cards that did not correctly retrieve target object if it was not destroyed (fixes #1486) .

This commit is contained in:
LevelX2 2016-01-22 12:56:58 +01:00
parent fb7d05e82a
commit ecedc360e9
12 changed files with 135 additions and 74 deletions

View file

@ -56,7 +56,6 @@ public class Polymorph extends CardImpl {
super(ownerId, 67, "Polymorph", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}");
this.expansionSetCode = "M10";
// Destroy target creature. It can't be regenerated.
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
@ -93,11 +92,7 @@ class PolymorphEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
}
Permanent permanent = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (permanent != null) {
Player player = game.getPlayer(permanent.getControllerId());
if (player != null) {