mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* 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).
This commit is contained in:
parent
d0c0a7391d
commit
41b6a41fda
2 changed files with 19 additions and 11 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue