mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 06:22:01 -08:00
* 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:
parent
f955316225
commit
80d045f6cc
2 changed files with 14 additions and 12 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue