diff --git a/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java b/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java index 385de243c2..b9f0b5e9ec 100644 --- a/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java +++ b/Mage.Sets/src/mage/sets/apocalypse/FungalShambler.java @@ -58,7 +58,7 @@ public class FungalShambler extends CardImpl { // Whenever Fungal Shambler deals damage to an opponent, you draw a card and that opponent discards a card. Effect effect = new DrawCardSourceControllerEffect(1); effect.setText("you draw a card"); - Ability ability = new DealsDamageToOpponentTriggeredAbility(effect, false); + Ability ability = new DealsDamageToOpponentTriggeredAbility(effect, false, false, true); effect = new DiscardTargetEffect(1); effect.setText("and that opponent discards a card"); ability.addEffect(effect); diff --git a/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java b/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java index fea88abc3d..2f56264ff0 100644 --- a/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java +++ b/Mage.Sets/src/mage/sets/commander/HydraOmnivore.java @@ -55,7 +55,7 @@ public class HydraOmnivore extends CardImpl { this.toughness = new MageInt(8); // Whenever Hydra Omnivore deals combat damage to an opponent, it deals that much damage to each other opponent. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new HydraOmnivoreEffect(), false, true)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new HydraOmnivoreEffect(), false, true, true)); } public HydraOmnivore(final HydraOmnivore card) { diff --git a/Mage.Sets/src/mage/sets/legends/NicolBolas.java b/Mage.Sets/src/mage/sets/legends/NicolBolas.java index 8bf534631e..b53d646381 100644 --- a/Mage.Sets/src/mage/sets/legends/NicolBolas.java +++ b/Mage.Sets/src/mage/sets/legends/NicolBolas.java @@ -62,7 +62,7 @@ public class NicolBolas extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}{B}{R}")), TargetController.YOU, false)); // Whenever Nicol Bolas deals damage to an opponent, that player discards his or her hand. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardHandTargetEffect("that player"), false)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardHandTargetEffect("that player"), false, false, true)); } public NicolBolas(final NicolBolas card) { diff --git a/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java b/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java index e120011e38..7dcc9eda4e 100644 --- a/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java +++ b/Mage.Sets/src/mage/sets/magic2010/HypnoticSpecter.java @@ -54,7 +54,7 @@ public class HypnoticSpecter extends CardImpl { this.addAbility(FlyingAbility.getInstance()); // Whenever Hypnotic Specter deals damage to an opponent, that player discards a card at random. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1, true))); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1, true), false, false, true)); } public HypnoticSpecter(final HypnoticSpecter card) { diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java index 5b20e8e973..4d3b709a32 100644 --- a/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/WeiNightRaiders.java @@ -53,7 +53,7 @@ public class WeiNightRaiders extends CardImpl { // Horsemanship this.addAbility(HorsemanshipAbility.getInstance()); // Whenever Wei Night Raiders deals damage to an opponent, that player discards a card. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false, false, true)); } public WeiNightRaiders(final WeiNightRaiders card) { diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java index 7d3cd94740..da66b3b4b9 100644 --- a/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java +++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/ZhangLiaoHeroOfHefei.java @@ -51,7 +51,7 @@ public class ZhangLiaoHeroOfHefei extends CardImpl { this.toughness = new MageInt(3); // Whenever Zhang Liao, Hero of Hefei deals damage to an opponent, that opponent discards a card. - this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false)); + this.addAbility(new DealsDamageToOpponentTriggeredAbility(new DiscardTargetEffect(1), false, false, true)); } public ZhangLiaoHeroOfHefei(final ZhangLiaoHeroOfHefei card) { diff --git a/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java b/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java index 811b091401..3f9f5d30f0 100644 --- a/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/DealsDamageToOpponentTriggeredAbility.java @@ -40,24 +40,30 @@ import mage.target.targetpointer.FixedTarget; */ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl { - boolean onlyCombat; + private final boolean onlyCombat, setTargetPointer; public DealsDamageToOpponentTriggeredAbility(Effect effect) { - this(effect, false, false); + this(effect, false, false, false); } public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional) { - this(effect, optional, false); + this(effect, optional, false, false); } public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional, boolean onlyCombat) { + this(effect, optional, onlyCombat, false); + } + + public DealsDamageToOpponentTriggeredAbility(Effect effect, boolean optional, boolean onlyCombat, boolean setTargetPointer) { super(Zone.BATTLEFIELD, effect, optional); this.onlyCombat = onlyCombat; + this.setTargetPointer = setTargetPointer; } public DealsDamageToOpponentTriggeredAbility(final DealsDamageToOpponentTriggeredAbility ability) { super(ability); this.onlyCombat = ability.onlyCombat; + this.setTargetPointer = ability.setTargetPointer; } @Override @@ -80,9 +86,11 @@ public class DealsDamageToOpponentTriggeredAbility extends TriggeredAbilityImpl return false; } } - for (Effect effect : getEffects()) { - effect.setTargetPointer(new FixedTarget(event.getTargetId())); - effect.setValue("damage", event.getAmount()); + if(setTargetPointer) { + for (Effect effect : getEffects()) { + effect.setTargetPointer(new FixedTarget(event.getTargetId())); + effect.setValue("damage", event.getAmount()); + } } return true; }