- Changes to Lim-Dul the Necromancer

This commit is contained in:
public.folder 2015-09-14 11:58:46 -05:00
parent 6b50a02e3c
commit 42d30f5311

View file

@ -34,19 +34,16 @@ import mage.abilities.common.DiesCreatureTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.RegenerateTargetEffect;
import mage.abilities.effects.common.continuous.AddCardSubTypeTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import static mage.constants.Layer.TypeChangingEffects_4;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.SubLayer;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
@ -63,15 +60,15 @@ import mage.target.targetpointer.FixedTarget;
* @author jeffwadsworth
*/
public class LimDulTheNecromancer extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
private static final FilterPermanent filter2 = new FilterPermanent("Zombie");
static {
filter.add(new ControllerPredicate(TargetController.OPPONENT));
filter2.add(new SubtypePredicate("Zombie"));
}
public LimDulTheNecromancer(UUID ownerId) {
super(ownerId, 114, "Lim-Dul the Necromancer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{B}{B}");
this.expansionSetCode = "TSP";
@ -88,13 +85,13 @@ public class LimDulTheNecromancer extends CardImpl {
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateTargetEffect(), new ManaCostsImpl("{1}{B}"));
ability2.addTarget(new TargetPermanent(filter2));
this.addAbility(ability2);
}
public LimDulTheNecromancer(final LimDulTheNecromancer card) {
super(card);
}
@Override
public LimDulTheNecromancer copy() {
return new LimDulTheNecromancer(this);
@ -102,29 +99,30 @@ public class LimDulTheNecromancer extends CardImpl {
}
class LimDulTheNecromancerEffect extends OneShotEffect {
public LimDulTheNecromancerEffect() {
super(Outcome.PutCreatureInPlay);
staticText = " return that card to the battlefield under your control. If it's a creature, it's a Zombie in addition to its other creature types";
staticText = "return that card to the battlefield under your control. If it's a creature, it's a Zombie in addition to its other creature types";
}
public LimDulTheNecromancerEffect(final LimDulTheNecromancerEffect effect) {
super(effect);
}
@Override
public LimDulTheNecromancerEffect copy() {
return new LimDulTheNecromancerEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(targetPointer.getFirst(game, source));
if (card != null) {
Zone currentZone = game.getState().getZone(card.getId());
if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())) {
if (card.putOntoBattlefield(game, currentZone, source.getSourceId(), source.getControllerId())
&& card.getCardType().contains(CardType.CREATURE)) {
Permanent creature = game.getPermanent(card.getId());
ContinuousEffect effect = new LimDulTheNecromancerContiniousEffect();
ContinuousEffect effect = new AddCardSubTypeTargetEffect("Zombie", Duration.WhileOnBattlefield);
effect.setTargetPointer(new FixedTarget(creature.getId()));
game.addEffect(effect, source);
return true;
@ -132,52 +130,4 @@ class LimDulTheNecromancerEffect extends OneShotEffect {
}
return false;
}
}
class LimDulTheNecromancerContiniousEffect extends ContinuousEffectImpl {
public LimDulTheNecromancerContiniousEffect() {
super(Duration.Custom, Outcome.Neutral);
staticText = "If it's a creature, it's a Zombie in addition to its other creature types";
}
public LimDulTheNecromancerContiniousEffect(final LimDulTheNecromancerContiniousEffect effect) {
super(effect);
}
@Override
public LimDulTheNecromancerContiniousEffect copy() {
return new LimDulTheNecromancerContiniousEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null
&& permanent.getCardType().contains(CardType.CREATURE)) {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
permanent.getSubtype().add("Zombie");
}
break;
}
return true;
} else {
this.used = true;
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.TypeChangingEffects_4;
}
}