* Elsha of the Infinite - fixed that it gives flash ability to cards in the hand instead library's top card (closes #7605);

This commit is contained in:
Oleg Agafonov 2021-02-21 07:43:14 +04:00
parent b968637e20
commit d343511d73
6 changed files with 90 additions and 8 deletions

View file

@ -1,8 +1,5 @@
package mage.abilities.effects.common.continuous;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.AsThoughEffectImpl;
import mage.abilities.keyword.MorphAbility;
@ -14,8 +11,9 @@ import mage.constants.Outcome;
import mage.filter.FilterCard;
import mage.game.Game;
import java.util.UUID;
/**
*
* @author LevelX2
*/
@ -69,10 +67,10 @@ public class CastAsThoughItHadFlashAllEffect extends AsThoughEffectImpl {
Card cardCopy = card.copy();
cardCopy.getCardType().clear();
cardCopy.addCardType(CardType.CREATURE);
return filter.match(cardCopy, game);
return filter.match(cardCopy, source.getSourceId(), affectedControllerId, game);
}
}
return filter.match(card, game);
return filter.match(card, source.getSourceId(), affectedControllerId, game);
}
}
return false;

View file

@ -98,6 +98,6 @@ public class PlayTheTopCardEffect extends AsThoughEffectImpl {
}
// must be correct card
return filter.match(cardToCheck, source.getSourceId(), source.getControllerId(), game);
return filter.match(cardToCheck, source.getSourceId(), affectedControllerId, game);
}
}

View file

@ -77,6 +77,6 @@ public class PlayLandsFromGraveyardControllerEffect extends AsThoughEffectImpl {
}
// must be correct card
return filter.match(cardToCheck, source.getSourceId(), source.getControllerId(), game);
return filter.match(cardToCheck, source.getSourceId(), affectedControllerId, game);
}
}

View file

@ -0,0 +1,26 @@
package mage.filter.predicate.mageobject;
import mage.cards.Card;
import mage.filter.predicate.ObjectPlayer;
import mage.filter.predicate.ObjectPlayerPredicate;
import mage.game.Game;
import mage.players.Player;
/**
* @author JayDi85
*/
public enum CardOnTopOfLibraryPredicate implements ObjectPlayerPredicate<ObjectPlayer<Card>> {
instance;
@Override
public boolean apply(ObjectPlayer<Card> input, Game game) {
Player player = game.getPlayer(input.getObject().getOwnerId());
if (player == null) {
return false;
}
Card topCard = player.getLibrary().getFromTop(game);
return topCard != null && topCard.getId().equals(input.getObject().getMainCard().getId());
}
}