mirror of
https://github.com/correl/mage.git
synced 2025-04-12 17:00:08 -09:00
* Liliana, Heretical Healer - Fixed that the Zombie token was not created if Liliana was exiled by her effect.
This commit is contained in:
parent
1ee75e3e94
commit
d38910b81b
3 changed files with 40 additions and 11 deletions
Mage.Sets/src/mage/sets/magicorigins
Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords
Mage/src/mage/abilities/effects/common
|
@ -30,6 +30,7 @@ package mage.sets.magicorigins;
|
|||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
|
@ -42,6 +43,7 @@ import mage.filter.predicate.Predicates;
|
|||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.filter.predicate.permanent.TokenPredicate;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -74,7 +76,8 @@ public class LilianaHereticalHealer extends CardImpl {
|
|||
this.addAbility(LifelinkAbility.getInstance());
|
||||
|
||||
// Whenever another nontoken creature you control dies, exile Liliana Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new ExileAndReturnTransformedSourceEffect(ExileAndReturnTransformedSourceEffect.Gender.FEMAL), false, filter));
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new ExileAndReturnTransformedSourceEffect(ExileAndReturnTransformedSourceEffect.Gender.FEMAL,
|
||||
new CreateTokenEffect(new ZombieToken(expansionSetCode))), false, filter));
|
||||
}
|
||||
|
||||
public LilianaHereticalHealer(final LilianaHereticalHealer card) {
|
||||
|
|
|
@ -87,6 +87,9 @@ public class TransformTest extends CardTestPlayerBase {
|
|||
assertPermanentCount(playerA, "Liliana, Heretical Healer", 0);
|
||||
assertPermanentCount(playerA, "Liliana, Defiant Necromancer", 1);
|
||||
assertCounterCount("Liliana, Defiant Necromancer", CounterType.LOYALTY, 3);
|
||||
|
||||
assertPermanentCount(playerA, "Zombie", 1);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,8 @@ package mage.abilities.effects.common;
|
|||
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.Card;
|
||||
|
@ -19,26 +21,40 @@ import mage.players.Player;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class ExileAndReturnTransformedSourceEffect extends OneShotEffect {
|
||||
|
||||
public static enum Gender { MALE, FEMAL };
|
||||
|
||||
|
||||
public static enum Gender {
|
||||
|
||||
MALE, FEMAL
|
||||
};
|
||||
|
||||
protected Effect additionalEffect;
|
||||
|
||||
public ExileAndReturnTransformedSourceEffect(Gender gender) {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "exile {this}, then return " + (gender.equals(Gender.MALE) ? "him":"her")
|
||||
+ " to the battlefield transformed under" + (gender.equals(Gender.MALE) ? "his":"her")+ " owner's control";
|
||||
this(gender, null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param gender
|
||||
* @param additionalEffect that effect is applies as source is exiled
|
||||
*/
|
||||
public ExileAndReturnTransformedSourceEffect(Gender gender, Effect additionalEffect) {
|
||||
super(Outcome.Benefit);
|
||||
this.additionalEffect = additionalEffect;
|
||||
this.staticText = "exile {this}, then return " + (gender.equals(Gender.MALE) ? "him" : "her")
|
||||
+ " to the battlefield transformed under" + (gender.equals(Gender.MALE) ? "his" : "her") + " owner's control";
|
||||
}
|
||||
|
||||
public ExileAndReturnTransformedSourceEffect(final ExileAndReturnTransformedSourceEffect effect) {
|
||||
super(effect);
|
||||
this.additionalEffect = effect.additionalEffect;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ExileAndReturnTransformedSourceEffect copy() {
|
||||
return new ExileAndReturnTransformedSourceEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
|
||||
|
@ -48,6 +64,13 @@ public class ExileAndReturnTransformedSourceEffect extends OneShotEffect {
|
|||
if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) {
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
|
||||
if (additionalEffect != null) {
|
||||
if (additionalEffect instanceof ContinuousEffect) {
|
||||
game.addEffect((ContinuousEffect) additionalEffect, source);
|
||||
} else {
|
||||
additionalEffect.apply(game, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
Loading…
Add table
Reference in a new issue