* Fixed Binding Mummy's ability doesn't trigger from Liliana, Death Majesty -3 ability (fixes #3165).

This commit is contained in:
LevelX2 2017-04-19 16:40:00 +02:00
parent 0b827b239c
commit 04c80c27a3
3 changed files with 13 additions and 10 deletions

View file

@ -28,6 +28,7 @@
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
@ -41,8 +42,6 @@ import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import java.util.UUID;
/**
*
* @author Loki
@ -62,7 +61,10 @@ public class DungroveElder extends CardImpl {
this.power = new MageInt(0);
this.toughness = new MageInt(0);
this.addAbility(HexproofAbility.getInstance());
// Hexproof (This creature can't be the target of spells or abilities your opponents control.)
this.addAbility(HexproofAbility.getInstance());
// Dungrove Elder's power and toughness are each equal to the number of Forests you control.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new SetPowerToughnessSourceEffect(new PermanentsOnBattlefieldCount(filterLands), Duration.EndOfGame)));
}

View file

@ -28,10 +28,8 @@
package mage.cards.l;
import java.util.UUID;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.PlanswalkerEntersWithLoyalityCountersAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DestroyAllEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveControllerEffect;
@ -40,8 +38,6 @@ import mage.abilities.effects.common.continuous.BecomesBlackZombieAdditionEffect
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
@ -75,9 +71,11 @@ public class LilianaDeathsMajesty extends CardImpl {
this.addAbility(ability);
// -3: Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types.
ability = new LoyaltyAbility(new ReturnFromGraveyardToBattlefieldTargetEffect(), -3);
ability = new LoyaltyAbility(new BecomesBlackZombieAdditionEffect() // because the effect has to be active for triggered effects that e.g. check if the creature entering is a Zombie, the continuous effect needs to be added before the card moving effect is applied
.setText(""), -3);
ability.addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
ability.addEffect(new BecomesBlackZombieAdditionEffect());
ability.addEffect(new ReturnFromGraveyardToBattlefieldTargetEffect()
.setText("Return target creature card from your graveyard to the battlefield. That creature is a black Zombie in addition to its other colors and types"));
this.addAbility(ability);
// -7: Destroy all non-Zombie creatures.

View file

@ -58,7 +58,10 @@ public class BecomesBlackZombieAdditionEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
Permanent creature = game.getPermanent(source.getTargets().getFirstTarget());
if (creature == null) {
creature = game.getPermanentEntering(source.getTargets().getFirstTarget());
}
if (creature != null) {
switch (layer) {
case TypeChangingEffects_4: