mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* Encrust - Fixed that the deny use of abilities did not work.
This commit is contained in:
parent
020daf94f5
commit
8b03a5b940
2 changed files with 17 additions and 12 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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,12 +78,17 @@ public class HideawayPlayEffect extends OneShotEffect {
|
|||
game.informPlayer(controller, "You're not able to play the land now due to regular restrictions.");
|
||||
}
|
||||
} else {
|
||||
// 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").
|
||||
if (controller.chooseUse(Outcome.Benefit, new StringBuilder("Cast ").append(card.getName()).append(" without paying it's mana cost?").toString(), game)) {
|
||||
card.setFaceDown(false);
|
||||
return controller.cast(card.getSpellAbility(), game, true);
|
||||
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").
|
||||
if (controller.chooseUse(Outcome.Benefit, new StringBuilder("Cast ").append(card.getName()).append(" without paying it's mana cost?").toString(), game)) {
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue