diff --git a/Mage.Sets/src/mage/cards/f/FiremawKavu.java b/Mage.Sets/src/mage/cards/f/FiremawKavu.java index abae4ff254..76f90b6612 100644 --- a/Mage.Sets/src/mage/cards/f/FiremawKavu.java +++ b/Mage.Sets/src/mage/cards/f/FiremawKavu.java @@ -56,7 +56,7 @@ public class FiremawKavu extends CardImpl { this.addAbility(new EchoAbility("{5}{R}")); // When Firemaw Kavu enters the battlefield, it deals 2 damage to target creature. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2)); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/f/FoundryChampion.java b/Mage.Sets/src/mage/cards/f/FoundryChampion.java index 48487db89d..cf5f12c981 100644 --- a/Mage.Sets/src/mage/cards/f/FoundryChampion.java +++ b/Mage.Sets/src/mage/cards/f/FoundryChampion.java @@ -62,7 +62,7 @@ public class FoundryChampion extends CardImpl { this.toughness = new MageInt(4); //When Foundry Champion enters the battlefield, it deals damage to target creature or player equal to the number of creatures you control. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()))); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(new PermanentsOnBattlefieldCount(new FilterControlledCreaturePermanent()), "it")); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/g/GangOfDevils.java b/Mage.Sets/src/mage/cards/g/GangOfDevils.java index 0323f03e6f..f7046cd938 100644 --- a/Mage.Sets/src/mage/cards/g/GangOfDevils.java +++ b/Mage.Sets/src/mage/cards/g/GangOfDevils.java @@ -53,7 +53,7 @@ public class GangOfDevils extends CardImpl { this.toughness = new MageInt(3); // When Gang of Devils dies, it deals 3 damage divided as you choose among one, two, or three target creatures and/or players. - Ability ability = new DiesTriggeredAbility(new DamageMultiEffect(3)); + Ability ability = new DiesTriggeredAbility(new DamageMultiEffect(3, "it")); ability.addTarget(new TargetCreatureOrPlayerAmount(3)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GhituSlinger.java b/Mage.Sets/src/mage/cards/g/GhituSlinger.java index dbcc7361d3..677d71ed48 100644 --- a/Mage.Sets/src/mage/cards/g/GhituSlinger.java +++ b/Mage.Sets/src/mage/cards/g/GhituSlinger.java @@ -56,7 +56,7 @@ public class GhituSlinger extends CardImpl { // Echo {2}{R} this.addAbility(new EchoAbility("{2}{R}")); // When Ghitu Slinger enters the battlefield, it deals 2 damage to target creature or player. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), false); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it"), false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GibberingFiend.java b/Mage.Sets/src/mage/cards/g/GibberingFiend.java index d6e3400efa..e875f2d426 100644 --- a/Mage.Sets/src/mage/cards/g/GibberingFiend.java +++ b/Mage.Sets/src/mage/cards/g/GibberingFiend.java @@ -55,7 +55,7 @@ public class GibberingFiend extends CardImpl { this.toughness = new MageInt(1); // When Gibbering Fiend enters the battlefield, it deals 1 damage to each opponent. - this.addAbility(new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(1, TargetController.OPPONENT), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(1, TargetController.OPPONENT, "it"), false)); // Delirium — At the beginning of each opponent's upkeep, if there are four or more card types among cards in your graveyard, // Gibbering Fiend deals 1 damage to that player. diff --git a/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java b/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java index ca4c307cab..25eb321443 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java +++ b/Mage.Sets/src/mage/cards/g/GoblinBoomKeg.java @@ -53,9 +53,7 @@ public class GoblinBoomKeg extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceEffect(), TargetController.YOU, false)); // When Goblin Boom Keg is put into a graveyard from the battlefield, it deals 3 damage to target creature or player. - Effect effect = new DamageTargetEffect(3); - effect.setText("it deals 3 damage to target creature or player"); - Ability ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(effect, false); + Ability ability = new PutIntoGraveFromBattlefieldSourceTriggeredAbility(new DamageTargetEffect(3, "it"), false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinCommando.java b/Mage.Sets/src/mage/cards/g/GoblinCommando.java index 7dba905b8a..d5c2f5ca99 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinCommando.java +++ b/Mage.Sets/src/mage/cards/g/GoblinCommando.java @@ -52,7 +52,7 @@ public class GoblinCommando extends CardImpl { this.toughness = new MageInt(2); // When Goblin Commando enters the battlefield, it deals 2 damage to target creature. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2)); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinMedics.java b/Mage.Sets/src/mage/cards/g/GoblinMedics.java index a3a1cb6b13..43c8e4ef10 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinMedics.java +++ b/Mage.Sets/src/mage/cards/g/GoblinMedics.java @@ -53,7 +53,7 @@ public class GoblinMedics extends CardImpl { this.toughness = new MageInt(1); // Whenever Goblin Medics becomes tapped, it deals 1 damage to target creature or player. - Ability ability = new BecomesTappedSourceTriggeredAbility(new DamageTargetEffect(1)); + Ability ability = new BecomesTappedSourceTriggeredAbility(new DamageTargetEffect(1, "it")); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinShrine.java b/Mage.Sets/src/mage/cards/g/GoblinShrine.java index bba9f70d00..b50e60b10a 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinShrine.java +++ b/Mage.Sets/src/mage/cards/g/GoblinShrine.java @@ -82,7 +82,7 @@ public class GoblinShrine extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect)); // When Goblin Shrine leaves the battlefield, it deals 1 damage to each Goblin creature. - this.addAbility(new LeavesBattlefieldTriggeredAbility(new DamageAllEffect(1, filterGoblin), false)); + this.addAbility(new LeavesBattlefieldTriggeredAbility(new DamageAllEffect(1, "it", filterGoblin), false)); } diff --git a/Mage.Sets/src/mage/cards/g/GoblinSwineRider.java b/Mage.Sets/src/mage/cards/g/GoblinSwineRider.java index 28c954a59a..ce4a79c876 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinSwineRider.java +++ b/Mage.Sets/src/mage/cards/g/GoblinSwineRider.java @@ -50,7 +50,7 @@ public class GoblinSwineRider extends CardImpl { this.toughness = new MageInt(1); // Whenever Goblin Swine-Rider becomes blocked, it deals 2 damage to each attacking creature and each blocking creature. - this.addAbility(new BecomesBlockedTriggeredAbility(new DamageAllEffect(2, new FilterAttackingOrBlockingCreature("attacking creature and each blocking creature")), false)); + this.addAbility(new BecomesBlockedTriggeredAbility(new DamageAllEffect(2, "it", new FilterAttackingOrBlockingCreature("attacking creature and each blocking creature")), false)); } public GoblinSwineRider(final GoblinSwineRider card) { diff --git a/Mage.Sets/src/mage/cards/i/ImplementOfCombustion.java b/Mage.Sets/src/mage/cards/i/ImplementOfCombustion.java index c37e3d849f..879f7b8266 100644 --- a/Mage.Sets/src/mage/cards/i/ImplementOfCombustion.java +++ b/Mage.Sets/src/mage/cards/i/ImplementOfCombustion.java @@ -51,7 +51,7 @@ public class ImplementOfCombustion extends CardImpl { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); // {R}, Sacrifice Implement of Combustion: It deals 1 damage to target player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{R}")); + Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1, "It"), new ManaCostsImpl("{R}")); ability.addCost(new SacrificeSourceCost()); ability.addTarget(new TargetPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/i/InfernoTitan.java b/Mage.Sets/src/mage/cards/i/InfernoTitan.java index 9bc6f6b876..335f7120a0 100644 --- a/Mage.Sets/src/mage/cards/i/InfernoTitan.java +++ b/Mage.Sets/src/mage/cards/i/InfernoTitan.java @@ -60,7 +60,7 @@ public class InfernoTitan extends CardImpl { this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}"))); // Whenever Inferno Titan enters the battlefield or attacks, it deals 3 damage divided as you choose among one, two, or three target creatures and/or players. - Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DamageMultiEffect(3)); + Ability ability = new EntersBattlefieldOrAttacksSourceTriggeredAbility(new DamageMultiEffect(3, "it")); ability.addTarget(new TargetCreatureOrPlayerAmount(3)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KeldonChampion.java b/Mage.Sets/src/mage/cards/k/KeldonChampion.java index e91da00a2a..caf5f284fc 100644 --- a/Mage.Sets/src/mage/cards/k/KeldonChampion.java +++ b/Mage.Sets/src/mage/cards/k/KeldonChampion.java @@ -58,7 +58,7 @@ public class KeldonChampion extends CardImpl { // Echo {2}{R}{R} this.addAbility(new EchoAbility("{2}{R}{R}")); // When Keldon Champion enters the battlefield, it deals 3 damage to target player. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3), false); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3, "it"), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KeldonMarauders.java b/Mage.Sets/src/mage/cards/k/KeldonMarauders.java index a36293ed4c..24b59faa44 100644 --- a/Mage.Sets/src/mage/cards/k/KeldonMarauders.java +++ b/Mage.Sets/src/mage/cards/k/KeldonMarauders.java @@ -65,7 +65,7 @@ public class KeldonMarauders extends CardImpl { this.addAbility(new VanishingSacrificeAbility()); // When Keldon Marauders enters the battlefield or leaves the battlefield, it deals 1 damage to target player. - ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new DamageTargetEffect(1), false); + ability = new EntersBattlefieldOrLeavesSourceTriggeredAbility(new DamageTargetEffect(1, "it"), false); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/k/KessigMalcontents.java b/Mage.Sets/src/mage/cards/k/KessigMalcontents.java index b740242d69..38fde758bc 100644 --- a/Mage.Sets/src/mage/cards/k/KessigMalcontents.java +++ b/Mage.Sets/src/mage/cards/k/KessigMalcontents.java @@ -61,7 +61,7 @@ public class KessigMalcontents extends CardImpl { this.toughness = new MageInt(1); // When Kessig Malcontents enters the battlefield, it deals damage to target player equal to the number of Humans you control. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter))); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(new PermanentsOnBattlefieldCount(filter), "it")); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/l/LavaHounds.java b/Mage.Sets/src/mage/cards/l/LavaHounds.java index f5ee035b66..23f20e2b58 100644 --- a/Mage.Sets/src/mage/cards/l/LavaHounds.java +++ b/Mage.Sets/src/mage/cards/l/LavaHounds.java @@ -53,7 +53,7 @@ public class LavaHounds extends CardImpl { // Haste this.addAbility(HasteAbility.getInstance()); // When Lava Hounds enters the battlefield, it deals 4 damage to you. - this.addAbility(new EntersBattlefieldTriggeredAbility(new DamageControllerEffect(4))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new DamageControllerEffect(4, "it"))); } public LavaHounds(final LavaHounds card) { diff --git a/Mage.Sets/src/mage/cards/l/LightningDiadem.java b/Mage.Sets/src/mage/cards/l/LightningDiadem.java index 6c7f417243..0f20e8d40a 100644 --- a/Mage.Sets/src/mage/cards/l/LightningDiadem.java +++ b/Mage.Sets/src/mage/cards/l/LightningDiadem.java @@ -65,7 +65,7 @@ public class LightningDiadem extends CardImpl { this.addAbility(ability); // When Lightning Diadem enters the battlefield, it deals 2 damage to target creature or player. - ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2)); + ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it")); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/Meteorite.java b/Mage.Sets/src/mage/cards/m/Meteorite.java index 1edc8c7031..227ea2cb55 100644 --- a/Mage.Sets/src/mage/cards/m/Meteorite.java +++ b/Mage.Sets/src/mage/cards/m/Meteorite.java @@ -47,7 +47,7 @@ public class Meteorite extends CardImpl { super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}"); // When Meteorite enters the battlefield, it deals 2 damage to target creature or player. - Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), false); + Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2, "it"), false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/m/MudbuttonTorchrunner.java b/Mage.Sets/src/mage/cards/m/MudbuttonTorchrunner.java index fee4bc3f5f..6b1e5d852c 100644 --- a/Mage.Sets/src/mage/cards/m/MudbuttonTorchrunner.java +++ b/Mage.Sets/src/mage/cards/m/MudbuttonTorchrunner.java @@ -52,7 +52,7 @@ public class MudbuttonTorchrunner extends CardImpl { this.power = new MageInt(1); this.toughness = new MageInt(1); // When Mudbutton Torchrunner dies, it deals 3 damage to target creature or player. - Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(3), false); + Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(3, "it"), false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java b/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java index 4a82940d13..618ac9b1c0 100644 --- a/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java +++ b/Mage.Sets/src/mage/cards/o/OrdealOfPurphoros.java @@ -73,7 +73,7 @@ public class OrdealOfPurphoros extends CardImpl { this.addAbility(ability); // When you sacrifice Ordeal of Purphoros, it deals 3 damage to target creature or player. ability = new SacrificeSourceTriggeredAbility( - new DamageTargetEffect(3),false); + new DamageTargetEffect(3, "it"),false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PardicArsonist.java b/Mage.Sets/src/mage/cards/p/PardicArsonist.java index ddd8f0f9e8..e3b268f78d 100644 --- a/Mage.Sets/src/mage/cards/p/PardicArsonist.java +++ b/Mage.Sets/src/mage/cards/p/PardicArsonist.java @@ -58,7 +58,7 @@ public class PardicArsonist extends CardImpl { this.toughness = new MageInt(3); // Threshold - As long as seven or more cards are in your graveyard, Pardic Arsonist has "When Pardic Arsonist enters the battlefield, it deals 3 damage to target creature or player." - Ability gainedAbility = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3)); + Ability gainedAbility = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(3, "it")); gainedAbility.addTarget(new TargetCreatureOrPlayer()); Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinuousEffect( diff --git a/Mage.Sets/src/mage/cards/p/PerilousMyr.java b/Mage.Sets/src/mage/cards/p/PerilousMyr.java index 78f65d5134..196975e2e9 100644 --- a/Mage.Sets/src/mage/cards/p/PerilousMyr.java +++ b/Mage.Sets/src/mage/cards/p/PerilousMyr.java @@ -51,7 +51,7 @@ public class PerilousMyr extends CardImpl { this.toughness = new MageInt(1); // When Perilous Myr dies, it deals 2 damage to target creature or player. - Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(2), false); + Ability ability = new DiesTriggeredAbility(new DamageTargetEffect(2, "it"), false); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/p/PitchburnDevils.java b/Mage.Sets/src/mage/cards/p/PitchburnDevils.java index 468641efb1..a29fcaf59e 100644 --- a/Mage.Sets/src/mage/cards/p/PitchburnDevils.java +++ b/Mage.Sets/src/mage/cards/p/PitchburnDevils.java @@ -51,7 +51,7 @@ public class PitchburnDevils extends CardImpl { this.toughness = new MageInt(3); // When Pitchburn Devils dies, it deals 3 damage to target creature or player. - DiesTriggeredAbility ability = new DiesTriggeredAbility(new DamageTargetEffect(3)); + DiesTriggeredAbility ability = new DiesTriggeredAbility(new DamageTargetEffect(3, "it")); ability.addTarget(new TargetCreatureOrPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/r/RagingSwordtooth.java b/Mage.Sets/src/mage/cards/r/RagingSwordtooth.java index cf4f97889d..b723e23c49 100644 --- a/Mage.Sets/src/mage/cards/r/RagingSwordtooth.java +++ b/Mage.Sets/src/mage/cards/r/RagingSwordtooth.java @@ -62,7 +62,7 @@ public class RagingSwordtooth extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // When Raging Swordtooth enters the battlefield, it deals 1 damage to each other creature. - addAbility(new EntersBattlefieldTriggeredAbility(new DamageAllEffect(1, filter))); + addAbility(new EntersBattlefieldTriggeredAbility(new DamageAllEffect(1, "it", filter))); } public RagingSwordtooth(final RagingSwordtooth card) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DamageAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DamageAllEffect.java index a456d90f15..92e3099d35 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DamageAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DamageAllEffect.java @@ -53,13 +53,16 @@ public class DamageAllEffect extends OneShotEffect { public DamageAllEffect(int amount, String whoDealDamageName, FilterPermanent filter) { this(new StaticValue(amount), filter); + this.sourceName = whoDealDamageName; + setText(); // TODO: replace to @Override public String getText() } public DamageAllEffect(DynamicValue amount, FilterPermanent filter) { super(Outcome.Damage); this.amount = amount; this.filter = filter; + setText(); } @@ -84,7 +87,7 @@ public class DamageAllEffect extends OneShotEffect { return true; } - private void setText() { + public void setText() { StringBuilder sb = new StringBuilder(); sb.append(this.sourceName).append(" deals ").append(amount.toString()).append(" damage to each ").append(filter.getMessage()); String message = amount.getMessage(); diff --git a/Mage/src/main/java/mage/abilities/effects/common/DamageEverythingEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DamageEverythingEffect.java index 364726e363..3e353a9c54 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DamageEverythingEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DamageEverythingEffect.java @@ -50,11 +50,19 @@ public class DamageEverythingEffect extends OneShotEffect { private DynamicValue amount; private FilterPermanent filter; private UUID damageSource; + private String sourceName = "{source}"; public DamageEverythingEffect(int amount) { this(new StaticValue(amount), new FilterCreaturePermanent()); } + public DamageEverythingEffect(int amount, String whoDealDamageName) { + this(new StaticValue(amount), new FilterCreaturePermanent()); + + this.sourceName = whoDealDamageName; + setText(); // TODO: replace to @Override public String getText() + } + public DamageEverythingEffect(DynamicValue amount) { this(amount, new FilterCreaturePermanent()); } @@ -62,6 +70,7 @@ 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); } @@ -71,7 +80,11 @@ public class DamageEverythingEffect extends OneShotEffect { this.amount = amount; this.filter = filter; this.damageSource = damageSource; - staticText = "{source} deals " + amount.toString() + " damage to each " + filter.getMessage() + " and each player"; + setText(); + } + + private void setText() { + staticText = this.sourceName + " deals " + this.amount.toString() + " damage to each " + this.filter.getMessage() + " and each player"; } public DamageEverythingEffect(final DamageEverythingEffect effect) { @@ -79,6 +92,7 @@ public class DamageEverythingEffect extends OneShotEffect { this.amount = effect.amount; this.filter = effect.filter; this.damageSource = effect.damageSource; + this.sourceName = effect.sourceName; } @Override diff --git a/Mage/src/main/java/mage/abilities/effects/common/DamagePlayersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DamagePlayersEffect.java index 4ec652807b..c5e0e34fe5 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DamagePlayersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DamagePlayersEffect.java @@ -44,6 +44,7 @@ import mage.players.Player; public class DamagePlayersEffect extends OneShotEffect { private DynamicValue amount; private TargetController controller; + private String sourceName = "{source}"; public DamagePlayersEffect(int amount) { this(Outcome.Damage, new StaticValue(amount)); @@ -53,6 +54,13 @@ public class DamagePlayersEffect extends OneShotEffect { this(Outcome.Damage, new StaticValue(amount), controller); } + public DamagePlayersEffect(int amount, TargetController controller, String whoDealDamageName) { + this(Outcome.Damage, new StaticValue(amount), controller); + + this.sourceName = whoDealDamageName; + setText(); // TODO: replace to @Override public String getText() + } + public DamagePlayersEffect(Outcome outcome, DynamicValue amount) { this(outcome, amount, TargetController.ANY); } @@ -69,6 +77,7 @@ public class DamagePlayersEffect extends OneShotEffect { super(effect); this.amount = effect.amount; this.controller = effect.controller; + this.sourceName = effect.sourceName; } @Override @@ -103,7 +112,7 @@ public class DamagePlayersEffect extends OneShotEffect { private void setText() { - StringBuilder sb = new StringBuilder("{source} deals ").append(amount.toString()); + StringBuilder sb = new StringBuilder().append(this.sourceName).append(" deals ").append(amount.toString()); switch (controller) { case ANY: sb.append(" damage to each player");