mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00: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
|
@ -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) {
|
||||
|
|
|
@ -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…
Reference in a new issue