* Encrust - Fixed that the deny use of abilities did not work.

This commit is contained in:
LevelX2 2014-08-06 20:03:59 +02:00
parent 020daf94f5
commit 8b03a5b940
2 changed files with 17 additions and 12 deletions

View file

@ -28,23 +28,21 @@
package mage.sets.magic2013;
import java.util.UUID;
import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.CantActivateAbilitiesAttachedEffect;
import mage.abilities.effects.common.SkipEnchantedUntapEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
/**
@ -79,6 +77,7 @@ public class Encrust extends CardImpl {
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipEnchantedUntapEffect());
Effect effect = new CantActivateAbilitiesAttachedEffect();
effect.setText("and its activated abilities can't be activated");
ability.addEffect(effect);
this.addAbility(ability);
}

View file

@ -36,6 +36,7 @@ import mage.game.ExileZone;
import mage.game.Game;
import mage.players.Player;
import mage.util.CardUtil;
import org.apache.log4j.Logger;
/**
* @author LevelX2
@ -77,6 +78,7 @@ public class HideawayPlayEffect extends OneShotEffect {
game.informPlayer(controller, "You're not able to play the land now due to regular restrictions.");
}
} else {
if (card.getSpellAbility() != null) {
// The land's last ability allows you to play the removed card as part of the resolution of that ability.
// Timing restrictions based on the card's type are ignored (for instance, if it's a creature or sorcery).
// Other play restrictions are not (such as "Play [this card] only during combat").
@ -84,6 +86,10 @@ public class HideawayPlayEffect extends OneShotEffect {
card.setFaceDown(false);
return controller.cast(card.getSpellAbility(), game, true);
}
} else {
Logger.getLogger(HideawayPlayEffect.class).error("Non land card had no spell ability: " + card.getName());
return false;
}
}
return true;
}