* Fixed for some cards that allow to play the top card of a players library that it also was possible to play the top card of other players libraries if the card was revealed (MagusOfTheFuture, Future Sight, Melek Izzet Paragon, Courser o fKruphix, Garruk's Horde, Oracle of Mul-Daya).

This commit is contained in:
LevelX2 2015-07-13 15:00:32 +02:00
parent f955316225
commit 80d045f6cc
2 changed files with 14 additions and 12 deletions

View file

@ -27,6 +27,7 @@
*/
package mage.abilities.effects.common.continuous;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.cards.Card;
@ -37,8 +38,6 @@ import mage.filter.FilterCard;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
/**
* @author nantuko
*/
@ -50,7 +49,7 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl {
this(new FilterCard());
staticText = "You may play the top card of your library";
}
public PlayTheTopCardEffect(FilterCard filter) {
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit);
this.filter = filter;
@ -75,9 +74,10 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl {
@Override
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)) {
if (cardOnTop != null
&& affectedControllerId.equals(source.getControllerId())
&& cardOnTop.getOwnerId().equals(source.getControllerId())
&& filter.match(cardOnTop, game)) {
Player player = game.getPlayer(cardOnTop.getOwnerId());
if (player != null && cardOnTop.equals(player.getLibrary().getFromTop(game))) {
return true;
@ -86,4 +86,4 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl {
return false;
}
}
}