mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 04:42:07 -08: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
|
|
@ -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
Add a link
Reference in a new issue