mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +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;
|
package mage.sets.magic2013;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import mage.constants.*;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.ReplacementEffectImpl;
|
|
||||||
import mage.abilities.effects.common.AttachEffect;
|
import mage.abilities.effects.common.AttachEffect;
|
||||||
import mage.abilities.effects.common.CantActivateAbilitiesAttachedEffect;
|
import mage.abilities.effects.common.CantActivateAbilitiesAttachedEffect;
|
||||||
import mage.abilities.effects.common.SkipEnchantedUntapEffect;
|
import mage.abilities.effects.common.SkipEnchantedUntapEffect;
|
||||||
import mage.abilities.keyword.EnchantAbility;
|
import mage.abilities.keyword.EnchantAbility;
|
||||||
import mage.cards.CardImpl;
|
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.FilterPermanent;
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.mageobject.CardTypePredicate;
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.game.events.GameEvent;
|
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
import mage.target.TargetPermanent;
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -79,6 +77,7 @@ public class Encrust extends CardImpl {
|
||||||
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipEnchantedUntapEffect());
|
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipEnchantedUntapEffect());
|
||||||
Effect effect = new CantActivateAbilitiesAttachedEffect();
|
Effect effect = new CantActivateAbilitiesAttachedEffect();
|
||||||
effect.setText("and its activated abilities can't be activated");
|
effect.setText("and its activated abilities can't be activated");
|
||||||
|
ability.addEffect(effect);
|
||||||
this.addAbility(ability);
|
this.addAbility(ability);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.players.Player;
|
import mage.players.Player;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author LevelX2
|
* @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.");
|
game.informPlayer(controller, "You're not able to play the land now due to regular restrictions.");
|
||||||
}
|
}
|
||||||
} else {
|
} 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.
|
// 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).
|
// 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").
|
// 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);
|
card.setFaceDown(false);
|
||||||
return controller.cast(card.getSpellAbility(), game, true);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue