From e94a395b1dbaa79bea6a54fc3425c0265d485a86 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Sat, 28 Mar 2015 16:33:54 +0100 Subject: [PATCH] * Obscuring AEther - Fixed that the turn face down ability did not work. --- .../sets/dragonsoftarkir/ObscuringAEther.java | 3 ++- .../BecomesFaceDownCreatureEffect.java | 25 +++++++++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/ObscuringAEther.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/ObscuringAEther.java index d4f858d69a..ec575d5322 100644 --- a/Mage.Sets/src/mage/sets/dragonsoftarkir/ObscuringAEther.java +++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/ObscuringAEther.java @@ -36,6 +36,7 @@ import mage.abilities.effects.common.continuous.BecomesFaceDownCreatureEffect; import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect; import mage.cards.CardImpl; import mage.constants.CardType; +import mage.constants.Duration; import mage.constants.Rarity; import mage.constants.Zone; import mage.filter.common.FilterCreatureCard; @@ -61,7 +62,7 @@ public class ObscuringAEther extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 1))); // {1}{G}: Turn Obscuring AEther face down. - Effect effect = new BecomesFaceDownCreatureEffect(null, BecomesFaceDownCreatureEffect.FaceDownType.MANIFESTED); + Effect effect = new BecomesFaceDownCreatureEffect(Duration.Custom, BecomesFaceDownCreatureEffect.FaceDownType.MANUAL); effect.setText("Turn Obscuring AEther face down. (It becomes a 2/2 creature.)"); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{G}"))); diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java index e81d02aaf5..14bb52a456 100644 --- a/Mage/src/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java +++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesFaceDownCreatureEffect.java @@ -61,9 +61,10 @@ import mage.game.permanent.Permanent; public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implements SourceEffect { public enum FaceDownType { - MORPHED, + MANIFESTED, + MANUAL, MEGAMORPHED, - MANIFESTED + MORPHED } protected int zoneChangeCounter; @@ -72,6 +73,9 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen protected boolean foundPermanent; protected FaceDownType faceDownType; + public BecomesFaceDownCreatureEffect(Duration duration, FaceDownType faceDownType){ + this(null, null, duration, faceDownType); + } public BecomesFaceDownCreatureEffect(Costs turnFaceUpCosts, FaceDownType faceDownType){ this(turnFaceUpCosts, null, faceDownType); @@ -123,6 +127,22 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen return costs; } + @Override + public void init(Ability source, Game game) { + super.init(source, game); + if (faceDownType.equals(FaceDownType.MANUAL)) { + Permanent permanent; + if (objectReference != null) { + permanent = objectReference.getPermanent(game); + } else { + permanent = game.getPermanent(source.getSourceId()); + } + if (permanent != null) { + permanent.setFaceDown(true, game); + } + } + } + @Override public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { Permanent permanent; @@ -137,6 +157,7 @@ public class BecomesFaceDownCreatureEffect extends ContinuousEffectImpl implemen foundPermanent = true; switch(faceDownType) { case MANIFESTED: + case MANUAL: // sets manifested image permanent.setManifested(true); break; case MORPHED: