Fixed wrong ability texts with duplicated card name (see #4335)

This commit is contained in:
Oleg Agafonov 2018-01-05 02:21:16 +04:00
parent adae3e22bc
commit bc75f82524
27 changed files with 53 additions and 29 deletions

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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));
// <i>Delirium</i> &mdash; 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.

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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));
}

View file

@ -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) {

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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) {

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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(

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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) {

View file

@ -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();

View file

@ -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

View file

@ -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");