From f7af2389190043f7da4d91af6145774eceaafb8c Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Fri, 13 Sep 2013 14:11:07 +0200 Subject: [PATCH] Some changes to SacrificeOpponent effect. --- .../mage/sets/magic2010/YawningFissure.java | 4 ++-- .../mage/sets/worldwake/ButcherOfMalakir.java | 3 +-- .../effects/common/SacrificeEffect.java | 6 ++++-- .../common/SacrificeOpponentsEffect.java | 19 ++++++++++++------- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java index 55c83abffb..546be30e66 100644 --- a/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java +++ b/Mage.Sets/src/mage/sets/magic2010/YawningFissure.java @@ -32,7 +32,7 @@ import mage.abilities.effects.common.SacrificeOpponentsEffect; import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; -import mage.filter.common.FilterControlledLandPermanent; +import mage.filter.common.FilterLandPermanent; /** * @@ -47,7 +47,7 @@ public class YawningFissure extends CardImpl { this.color.setRed(true); // Each opponent sacrifices a land. - this.getSpellAbility().addEffect(new SacrificeOpponentsEffect(new FilterControlledLandPermanent())); + this.getSpellAbility().addEffect(new SacrificeOpponentsEffect(new FilterLandPermanent())); } public YawningFissure(final YawningFissure card) { diff --git a/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java b/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java index a788336e7c..f82ef79738 100644 --- a/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java +++ b/Mage.Sets/src/mage/sets/worldwake/ButcherOfMalakir.java @@ -36,7 +36,6 @@ import mage.cards.CardImpl; import mage.constants.CardType; import mage.constants.Rarity; import mage.constants.TargetController; -import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.permanent.ControllerPredicate; @@ -65,7 +64,7 @@ public class ButcherOfMalakir extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever Butcher of Malakir or another creature you control dies, each opponent sacrifices a creature. - this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new SacrificeOpponentsEffect(new FilterControlledCreaturePermanent()), false, filter)); + this.addAbility(new DiesThisOrAnotherCreatureTriggeredAbility(new SacrificeOpponentsEffect(new FilterCreaturePermanent()), false, filter)); } public ButcherOfMalakir(final ButcherOfMalakir card) { diff --git a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java index dbfebde250..20e0b6d052 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeEffect.java @@ -122,8 +122,10 @@ public class SacrificeEffect extends OneShotEffect{ private void setText() { StringBuilder sb = new StringBuilder(); - sb.append(preText); - if (preText.endsWith("player") || preText.endsWith("opponent")) { + if (preText != null) { + sb.append(preText); + } + if (preText != null && (preText.endsWith("player") || preText.endsWith("opponent"))) { sb.append(" sacrifices "); } else { sb.append(" sacrifice "); diff --git a/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java b/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java index d70e794685..cc95758f81 100644 --- a/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java +++ b/Mage/src/mage/abilities/effects/common/SacrificeOpponentsEffect.java @@ -36,7 +36,7 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.OneShotEffect; import mage.constants.Outcome; -import mage.filter.common.FilterControlledPermanent; +import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; @@ -52,16 +52,16 @@ import mage.util.CardUtil; public class SacrificeOpponentsEffect extends OneShotEffect { protected DynamicValue amount; - protected FilterControlledPermanent filter; + protected FilterPermanent filter; - public SacrificeOpponentsEffect(FilterControlledPermanent filter) { + public SacrificeOpponentsEffect(FilterPermanent filter) { this(1, filter); } - public SacrificeOpponentsEffect(int amount, FilterControlledPermanent filter) { + public SacrificeOpponentsEffect(int amount, FilterPermanent filter) { this(new StaticValue(amount), filter); } - public SacrificeOpponentsEffect(DynamicValue amount, FilterControlledPermanent filter) { + public SacrificeOpponentsEffect(DynamicValue amount, FilterPermanent filter) { super(Outcome.Sacrifice); this.amount = amount; this.filter = filter; @@ -108,10 +108,15 @@ public class SacrificeOpponentsEffect extends OneShotEffect