* Some fixed / changes to multi target destry effects.

This commit is contained in:
LevelX2 2015-09-08 16:48:25 +02:00
parent b4d7009af8
commit 39cfbec82f
6 changed files with 21 additions and 59 deletions

View file

@ -41,6 +41,7 @@ import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetLandPermanent;
@ -62,6 +63,7 @@ public class DwarvenLandslide extends CardImpl {
this.addAbility(new KickerAbility(kickerCosts));
// Destroy target land. If Dwarven Landslide was kicked, destroy another target land.
getSpellAbility().addEffect(new DestroyTargetEffect("Destroy target land. If {this} was kicked, destroy another target land"));
getSpellAbility().addTarget(new TargetLandPermanent());
}
public DwarvenLandslide(final DwarvenLandslide card) {
@ -70,7 +72,9 @@ public class DwarvenLandslide extends CardImpl {
@Override
public void adjustTargets(Ability ability, Game game) {
ability.addTarget(new TargetLandPermanent(KickedCondition.getInstance().apply(game, ability) ? 2 : 1));
if (KickedCondition.getInstance().apply(game, ability)) {
getSpellAbility().addTarget(new TargetLandPermanent(new FilterLandPermanent("land (Kicker)")));
}
}
@Override

View file

@ -50,7 +50,6 @@ public class HullBreach extends CardImpl {
super(ownerId, 193, "Hull Breach", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{R}{G}");
this.expansionSetCode = "C13";
// Choose one - Destroy target artifact;
this.getSpellAbility().addEffect(new DestroyTargetEffect());
Target target = new TargetArtifactPermanent();
@ -63,18 +62,14 @@ public class HullBreach extends CardImpl {
this.getSpellAbility().addMode(mode);
// or destroy target artifact and target enchantment.
mode = new Mode();
mode.getEffects().add(new DestroyTargetEffect());
target = new TargetArtifactPermanent();
mode.getTargets().add(target);
Effect effect = new DestroyTargetEffect();
effect.setTargetPointer(new SecondTargetPointer());
effect.setText("and target enchantment");
effect.setText("destroy target artifact and target enchantment");
mode.getEffects().add(effect);
target = new TargetPermanent(new FilterEnchantmentPermanent());
mode.getTargets().add(target);
mode.getTargets().add(new TargetArtifactPermanent());
mode.getTargets().add(new TargetPermanent(new FilterEnchantmentPermanent()));
this.getSpellAbility().addMode(mode);
}
public HullBreach(final HullBreach card) {

View file

@ -43,7 +43,7 @@ import mage.target.common.TargetLandPermanent;
/**
*
* @author LoneFox
*
*/
public class PlagueSpores extends CardImpl {
@ -58,7 +58,7 @@ public class PlagueSpores extends CardImpl {
this.expansionSetCode = "INV";
// Destroy target nonblack creature and target land. They can't be regenerated.
Effect effect = new DestroyTargetEffect(true);
Effect effect = new DestroyTargetEffect(true, true);
effect.setText("Destroy target nonblack creature and target land. They can't be regenerated.");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filter));

View file

@ -33,10 +33,8 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetLandPermanent;
import mage.target.targetpointer.SecondTargetPointer;
/**
*
@ -48,16 +46,12 @@ public class SpitefulBlow extends CardImpl {
super(ownerId, 83, "Spiteful Blow", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{B}{B}");
this.expansionSetCode = "JOU";
// Destroy target creature and target land.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
Effect effect = new DestroyTargetEffect();
effect.setText("and target land");
effect.setTargetPointer(new SecondTargetPointer());
Effect effect = new DestroyTargetEffect(false, true);
effect.setText("Destroy target creature and target land");
this.getSpellAbility().addEffect(effect);
Target target = new TargetLandPermanent();
this.getSpellAbility().addTarget(target);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addTarget(new TargetLandPermanent());
}
public SpitefulBlow(final SpitefulBlow card) {

View file

@ -55,7 +55,7 @@ public class GoblinGrenadiers extends CardImpl {
this.toughness = new MageInt(2);
// Whenever Goblin Grenadiers attacks and isn't blocked, you may sacrifice it. If you do, destroy target creature and target land.
Effect effect = new DoIfCostPaid(new DestroyTargetEffect(), new SacrificeSourceCost(), "Sacrifice {this} to destroy target creature and target land?");
Effect effect = new DoIfCostPaid(new DestroyTargetEffect(false, true), new SacrificeSourceCost(), "Sacrifice {this} to destroy target creature and target land?");
effect.setText("you may sacrifice it. If you do, destroy target creature and target land");
Ability ability = new AttacksAndIsNotBlockedTriggeredAbility(effect);
ability.addTarget(new TargetCreaturePermanent());

View file

@ -29,15 +29,12 @@ package mage.sets.zendikar;
import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
/**
@ -45,14 +42,16 @@ import mage.target.TargetPermanent;
* @author jeffwadsworth
*/
public class RelicCrush extends CardImpl {
public RelicCrush(UUID ownerId) {
super(ownerId, 179, "Relic Crush", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{4}{G}");
this.expansionSetCode = "ZEN";
// Destroy target artifact or enchantment and up to one other target artifact or enchantment.
FilterPermanent filter = new FilterArtifactOrEnchantmentPermanent();
this.getSpellAbility().addEffect(new RelicCrushEffect());
Effect effect = new DestroyTargetEffect(false, true);
effect.setText("Destroy target artifact or enchantment and up to one other target artifact or enchantment");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetPermanent(filter));
this.getSpellAbility().addTarget(new TargetPermanent(0, 1, filter, false));
}
@ -66,33 +65,3 @@ public class RelicCrush extends CardImpl {
return new RelicCrush(this);
}
}
class RelicCrushEffect extends OneShotEffect {
public RelicCrushEffect() {
super(Outcome.DestroyPermanent);
this.staticText = "Destroy target artifact or enchantment and up to one other target artifact or enchantment";
}
public RelicCrushEffect(final RelicCrushEffect effect) {
super(effect);
}
@Override
public RelicCrushEffect copy() {
return new RelicCrushEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent firstTarget = game.getPermanent(source.getFirstTarget());
Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget());
if (firstTarget != null) {
firstTarget.destroy(id, game, false);
}
if (secondTarget != null) {
return secondTarget.destroy(id, game, false);
}
return true;
}
}