mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
* Amplify abilities - fixed that it allows reveal itself when put onto battlefield from hand (#6776);
This commit is contained in:
parent
4168e2714a
commit
49f4e54aaa
2 changed files with 33 additions and 13 deletions
|
|
@ -8,6 +8,7 @@ package mage.abilities.effects.common;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.Duration;
|
||||
|
|
@ -16,6 +17,7 @@ import mage.constants.SubType;
|
|||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreatureCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.CardIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.EntersTheBattlefieldEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
|
|
@ -108,6 +110,14 @@ public class AmplifyEffect extends ReplacementEffectImpl {
|
|||
} else if (filterSubtypes.size() == 1) {
|
||||
filter.add(filterSubtypes.get(0));
|
||||
}
|
||||
|
||||
// You can’t reveal this card or any other cards that are entering the battlefield at the same time as this card.
|
||||
filter.add(Predicates.not(new CardIdPredicate(source.getSourceId())));
|
||||
for (Permanent enteringPermanent : game.getPermanentsEntering().values()) {
|
||||
Card card = game.getCard(enteringPermanent.getId());
|
||||
filter.add(Predicates.not(new CardIdPredicate(enteringPermanent.getId())));
|
||||
}
|
||||
|
||||
if (controller.getHand().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) {
|
||||
if (controller.chooseUse(outcome, "Reveal cards to Amplify?", source, game)) {
|
||||
TargetCardInHand target = new TargetCardInHand(0, Integer.MAX_VALUE, filter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue