Primordial Mist - Fixed selection of face down targets (fixes #7045).

This commit is contained in:
LevelX2 2020-09-08 13:14:15 +02:00
parent ce4073d810
commit 8e465acb11
4 changed files with 61 additions and 22 deletions

View file

@ -1,10 +1,8 @@
package mage.filter.predicate.other;
import mage.abilities.keyword.MorphAbility;
import mage.cards.Card;
import mage.filter.predicate.Predicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
* @author North
@ -14,15 +12,7 @@ public enum FaceDownPredicate implements Predicate<Card> {
@Override
public boolean apply(Card input, Game game) {
if (game.inCheckPlayableState()) {
// Check for cost reduction of possible face down spell to cast
if (input != null && !(input instanceof Permanent)) {
return input.getAbilities().containsClass(MorphAbility.class);
}
return false;
} else {
return input.isFaceDown(game);
}
return input.isFaceDown(game);
}
@Override

View file

@ -3100,15 +3100,6 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
// ALTERNATIVE COST from source card (AlternativeCostSourceAbility)
for (Ability objectAbility : sourceObject.getAbilities()) {
if (objectAbility instanceof AlternativeCostSourceAbility) {
if (objectAbility.getCosts().canPay(copy, copy.getSourceId(), playerId, game)) {
return true;
}
}
}
// ALTERNATIVE COST FROM dynamic effects
if (getCastSourceIdWithAlternateMana().contains(copy.getSourceId())) {
ManaCosts alternateCosts = getCastSourceIdManaCosts().get(copy.getSourceId());
@ -3128,7 +3119,9 @@ public abstract class PlayerImpl implements Player, Serializable {
}
// ALTERNATIVE COST from source card (any AlternativeSourceCosts)
return canPlayCardByAlternateCost(game.getCard(ability.getSourceId()), availableMana, copy, game);
if (AbilityType.SPELL.equals(ability.getAbilityType())) {
return canPlayCardByAlternateCost(game.getCard(ability.getSourceId()), availableMana, copy, game);
}
}
return false;
}