mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Allow morph lands to be cast face down at instant speed (#7169)
This commit is contained in:
parent
1862b16d04
commit
923cf1e3ac
2 changed files with 23 additions and 2 deletions
|
@ -5,8 +5,10 @@ package mage.abilities.effects.common.continuous;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.abilities.keyword.MorphAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.filter.FilterCard;
|
||||
|
@ -53,7 +55,25 @@ public class CastAsThoughItHadFlashAllEffect extends AsThoughEffectImpl {
|
|||
public boolean applies(UUID affectedSpellId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (anyPlayer || source.isControlledBy(affectedControllerId)) {
|
||||
Card card = game.getCard(affectedSpellId);
|
||||
return card != null && filter.match(card, game);
|
||||
if (card != null) {
|
||||
//Allow lands with morph to be played at instant speed
|
||||
if (card.isLand()) {
|
||||
boolean morphAbility = false;
|
||||
for (Ability checkAbility : card.getAbilities()) {
|
||||
if (checkAbility instanceof MorphAbility) {
|
||||
morphAbility = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (morphAbility) {
|
||||
Card cardCopy = card.copy();
|
||||
cardCopy.getCardType().clear();
|
||||
cardCopy.addCardType(CardType.CREATURE);
|
||||
return filter.match(cardCopy, game);
|
||||
}
|
||||
}
|
||||
return filter.match(card, game);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -3387,7 +3387,8 @@ public abstract class PlayerImpl implements Player, Serializable {
|
|||
// Even mana cost can't be checked here without lookahead
|
||||
// So make it available all the time
|
||||
boolean canUse;
|
||||
if (ability instanceof MorphAbility && object instanceof Card && game.canPlaySorcery(getId())) {
|
||||
if (ability instanceof MorphAbility && object instanceof Card && (game.canPlaySorcery(getId()) ||
|
||||
(null != game.getContinuousEffects().asThough(object.getId(), AsThoughEffectType.CAST_AS_INSTANT, playAbility, this.getId(), game)))) {
|
||||
canUse = canPlayCardByAlternateCost((Card) object, availableMana, playAbility, game);
|
||||
} else {
|
||||
canUse = canPlay(playAbility, availableMana, object, game); // canPlay already checks alternative source costs and all conditions
|
||||
|
|
Loading…
Reference in a new issue