diff --git a/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java b/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java index fd3badac38..b1b4daae98 100644 --- a/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java +++ b/Mage.Sets/src/mage/sets/fatereforged/Arcbond.java @@ -30,6 +30,7 @@ package mage.sets.fatereforged; import java.util.UUID; import mage.abilities.Ability; import mage.abilities.DelayedTriggeredAbility; +import mage.abilities.dynamicvalue.common.StaticValue; import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect; @@ -86,7 +87,7 @@ class ArcbondDelayedTriggeredAbility extends DelayedTriggeredAbility { public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.getFirstTarget())) { for (Effect effect : this.getEffects()) { - effect.setValue("damage", event.getAmount()); + effect.setValue("damage", event.getAmount()); } return true; } @@ -126,7 +127,7 @@ class ArcbondEffect extends OneShotEffect { if (damage > 0) { FilterPermanent filter = new FilterCreaturePermanent("each other creature"); filter.add(Predicates.not(new PermanentIdPredicate(source.getTargets().getFirstTarget()))); - return new DamageEverythingEffect(damage, filter).apply(game, source); + return new DamageEverythingEffect(new StaticValue(damage), filter, source.getTargets().getFirstTarget()).apply(game, source); } return false; } diff --git a/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java b/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java index e45f227091..cb5fab6149 100644 --- a/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java +++ b/Mage/src/mage/abilities/effects/common/DamageEverythingEffect.java @@ -49,6 +49,7 @@ public class DamageEverythingEffect extends OneShotEffect { private DynamicValue amount; private FilterPermanent filter; + private UUID damageSource; public DamageEverythingEffect(int amount) { this(new StaticValue(amount), new FilterCreaturePermanent()); @@ -57,11 +58,15 @@ public class DamageEverythingEffect extends OneShotEffect { public DamageEverythingEffect(int amount, FilterPermanent filter) { this(new StaticValue(amount), filter); } - public DamageEverythingEffect(DynamicValue amount, FilterPermanent filter) { + this(amount, filter, null); + } + + public DamageEverythingEffect(DynamicValue amount, FilterPermanent filter, UUID damageSource) { super(Outcome.Damage); this.amount = amount; this.filter = filter; + this.damageSource = damageSource; staticText = "{source} deals " + amount.toString() + " damage to each " + filter.getMessage() + " and each player"; } @@ -69,6 +74,7 @@ public class DamageEverythingEffect extends OneShotEffect { super(effect); this.amount = effect.amount; this.filter = effect.filter; + this.damageSource = effect.damageSource; } @Override @@ -81,12 +87,12 @@ public class DamageEverythingEffect extends OneShotEffect { int damage = amount.calculate(game, source, this); List permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game); for (Permanent permanent: permanents) { - permanent.damage(damage, source.getSourceId(), game, false, true); + permanent.damage(damage, damageSource == null ? source.getSourceId(): damageSource, game, false, true); } for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) { Player player = game.getPlayer(playerId); if (player != null) { - player.damage(damage, source.getSourceId(), game, false, true); + player.damage(damage, damageSource == null ? source.getSourceId(): damageSource, game, false, true); } } return true;