From 41b6a41fdafcd35adceeaa1442801ddd2c22ffad Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Wed, 31 Dec 2014 14:26:57 +0100 Subject: [PATCH] * Fixed a bug of PlayTheTopCardEffect that alloed all players to play the card. (Concerns Oracle of Mul-Daya, Garruk's Horde, Future Sight, Courser of Kruphix, Melek Izzet Paragon, Magus of the Future). --- .../src/mage/sets/magic2011/MightyLeap.java | 18 ++++++++++++------ .../continious/PlayTheTopCardEffect.java | 12 +++++++----- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java b/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java index 70aa7cf4c0..5993a58019 100644 --- a/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java +++ b/Mage.Sets/src/mage/sets/magic2011/MightyLeap.java @@ -29,13 +29,14 @@ package mage.sets.magic2011; import java.util.UUID; -import mage.constants.CardType; -import mage.constants.Duration; -import mage.constants.Rarity; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continious.BoostTargetEffect; import mage.abilities.effects.common.continious.GainAbilityTargetEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.Rarity; import mage.target.common.TargetCreaturePermanent; /** @@ -47,10 +48,15 @@ public class MightyLeap extends CardImpl { public MightyLeap(UUID ownerId) { super(ownerId, 22, "Mighty Leap", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}"); this.expansionSetCode = "M11"; - this.color.setWhite(true); + + // Target creature gets +2/+2 and gains flying until end of turn. + Effect effect = new BoostTargetEffect(2, 2, Duration.EndOfTurn); + effect.setText("Target creature gets +2/+2"); + this.getSpellAbility().addEffect(effect); + effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn); + effect.setText("and gains flying until end of turn"); + this.getSpellAbility().addEffect(effect); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); } public MightyLeap(final MightyLeap card) { diff --git a/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java b/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java index 771ff48be8..819c2ac561 100644 --- a/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java +++ b/Mage/src/mage/abilities/effects/common/continious/PlayTheTopCardEffect.java @@ -73,11 +73,13 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl { } @Override - public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { - Card card = game.getCard(sourceId); - if (card != null && filter.match(card, game)) { - Player player = game.getPlayer(card.getOwnerId()); - if (player != null && card.equals(player.getLibrary().getFromTop(game))) { + public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) { + Card cardOnTop = game.getCard(objectId); + if (cardOnTop != null && + affectedControllerId.equals(source.getControllerId()) && + filter.match(cardOnTop, game)) { + Player player = game.getPlayer(cardOnTop.getOwnerId()); + if (player != null && cardOnTop.equals(player.getLibrary().getFromTop(game))) { return true; } }