diff --git a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java index a06ddc41677..6828fd9fd2e 100644 --- a/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java +++ b/Mage.Sets/src/mage/cards/v/VesuvanShapeshifter.java @@ -78,7 +78,7 @@ public class VesuvanShapeshifter extends CardImpl { ability.setWorksFaceDown(true); this.addAbility(ability); - // As Vesuvan Shapeshifter etbs, may choose another creature. If you do, until Vesuvan Shapeshifter is turned face down, it becomes a copy of that creature + // As Vesuvan Shapeshifter etbs, you may choose another creature. If you do, until Vesuvan Shapeshifter is turned face down, it becomes a copy of that creature Effect effect = new CopyPermanentEffect(new FilterCreaturePermanent(), new VesuvanShapeShifterFaceUpApplier()); effect.setText(effectText); ability = new EntersBattlefieldAbility(effect, true); @@ -108,6 +108,7 @@ class VesuvanShapeShifterFaceUpApplier extends ApplyToPermanent { Effect effect = new VesuvanShapeshifterFaceDownEffect(); Ability ability = new BeginningOfUpkeepTriggeredAbility(effect, TargetController.YOU, true); permanent.getAbilities().add(ability); + // Why is this needed? permanent.addAbility(new MorphAbility(permanent, new ManaCostsImpl("{1}{U}")), permanent.getId(), game); return true; } @@ -153,6 +154,7 @@ class VesuvanShapeshifterEffect extends OneShotEffect { if (copyFromCreature != null) { game.copyPermanent(Duration.Custom, copyFromCreature, copyToCreature.getId(), source, new VesuvanShapeShifterFaceUpApplier()); source.getTargets().clear(); + game.applyEffects(); // needed to get effects ready if copy happens in replacment and the copied abilities react of the same event (e.g. turn face up) return true; } } diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java index e08c3b524ed..f7ef27362c5 100644 --- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java +++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/MorphTest.java @@ -764,9 +764,9 @@ public class MorphTest extends CardTestPlayerBase { castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Vesuvan Shapeshifter"); setChoice(playerB, "Yes"); - setChoice(playerB, "Brine Elemental"); activateAbility(2, PhaseStep.POSTCOMBAT_MAIN, playerB, "{1}{U}: Turn this face-down permanent"); + setChoice(playerB, "Brine Elemental"); setStopAt(2, PhaseStep.END_TURN); diff --git a/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java b/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java index 71d1e228175..59b117b3f24 100644 --- a/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/AsTurnedFaceUpEffect.java @@ -25,7 +25,6 @@ * authors and should not be interpreted as representing official policies, either expressed * or implied, of BetaSteward_at_googlemail.com. */ - package mage.abilities.effects; import mage.MageObject; @@ -40,24 +39,23 @@ import mage.players.Player; * * @author LevelX2 */ - public class AsTurnedFaceUpEffect extends ReplacementEffectImpl { protected Effects baseEffects = new Effects(); - protected boolean optional; - + protected boolean optional; + public AsTurnedFaceUpEffect(Effect baseEffect, boolean optional) { super(Duration.WhileOnBattlefield, baseEffect.getOutcome(), true); this.baseEffects.add(baseEffect); - this.optional = optional; + this.optional = optional; } - + public AsTurnedFaceUpEffect(final AsTurnedFaceUpEffect effect) { super(effect); this.baseEffects = effect.baseEffects.copy(); this.optional = effect.optional; } - + public void addEffect(Effect effect) { baseEffects.add(effect); } @@ -71,7 +69,7 @@ public class AsTurnedFaceUpEffect extends ReplacementEffectImpl { public boolean applies(GameEvent event, Ability source, Game game) { return event.getTargetId().equals(source.getSourceId()); } - + @Override public boolean apply(Game game, Ability source) { return false; @@ -85,16 +83,15 @@ public class AsTurnedFaceUpEffect extends ReplacementEffectImpl { if (controller == null || object == null) { return false; } - if (!controller.chooseUse(outcome, new StringBuilder("Use effect of ").append(object.getLogName()).append('?').toString(), source, game)) { + if (!controller.chooseUse(outcome, "Use effect of " + object.getIdName() + "?", source, game)) { return false; } } - for (Effect effect: baseEffects) { + for (Effect effect : baseEffects) { if (source.activate(game, false)) { if (effect instanceof ContinuousEffect) { game.addEffect((ContinuousEffect) effect, source); - } - else { + } else { effect.apply(game, source); } } @@ -109,11 +106,10 @@ public class AsTurnedFaceUpEffect extends ReplacementEffectImpl { } return "As {this} is turned face up, " + baseEffects.getText(mode); } - + @Override public AsTurnedFaceUpEffect copy() { return new AsTurnedFaceUpEffect(this); } - - + }