[AFR] improved flavor words, added support in ETB abilities (#7952, #7808);

This commit is contained in:
Oleg Agafonov 2021-06-30 17:47:11 +04:00
parent 93ea276e83
commit bbd3f266f0
34 changed files with 125 additions and 75 deletions

View file

@ -37,8 +37,9 @@ public final class CouncilGuardian extends CardImpl {
// Will of the council - When Council Guardian enters the battlefield, starting with you, each player votes for blue, black, red, or green. Council Guardian gains protection from each color with the most votes or tied for most votes.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new CouncilsGuardianEffect(), false, "<i>Will of the council</i> &mdash; "
));
new CouncilsGuardianEffect(), false)
.withFlavorWord("Will of the council")
);
}
private CouncilGuardian(final CouncilGuardian card) {

View file

@ -37,10 +37,12 @@ public final class CustodiSquire extends CardImpl {
// Flying
this.addAbility(FlyingAbility.getInstance());
// Will of the council - When Custodi Squire enters the battlefield, starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. Return each card with the most votes or tied for most votes to your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new CustodiSquireVoteEffect(), false, true
));
new CustodiSquireVoteEffect(), false)
.withFlavorWord("Will of the council")
);
}
private CustodiSquire(final CustodiSquire card) {
@ -57,8 +59,7 @@ class CustodiSquireVoteEffect extends OneShotEffect {
CustodiSquireVoteEffect() {
super(Outcome.Benefit);
this.staticText = "<i>Will of the council</i> &mdash; When {this} enters the battlefield, " +
"starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. " +
this.staticText = "starting with you, each player votes for an artifact, creature, or enchantment card in your graveyard. " +
"Return each card with the most votes or tied for most votes to your hand";
}

View file

@ -41,8 +41,9 @@ public final class Duplicant extends CardImpl {
this.toughness = new MageInt(4);
// Imprint - When Duplicant enters the battlefield, you may exile target nontoken creature.
Ability ability = new EntersBattlefieldTriggeredAbility(new DuplicantExileTargetEffect(), true, "<i>Imprint</i> &mdash; ");
Ability ability = new EntersBattlefieldTriggeredAbility(new DuplicantExileTargetEffect(), true);
ability.addTarget(new TargetCreaturePermanent(filter));
ability.withFlavorWord("Imprint");
this.addAbility(ability);
// As long as the exiled card is a creature card, Duplicant has that card's power, toughness, and creature types. It's still a Shapeshifter.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DuplicantContinuousEffect()));

View file

@ -1,9 +1,12 @@
package mage.cards.g;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
@ -12,6 +15,7 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
@ -37,6 +41,13 @@ public final class GuildThief extends CardImpl {
this.addAbility(new SimpleActivatedAbility(
new CantBeBlockedSourceEffect(Duration.EndOfTurn), new ManaCostsImpl<>("{3}{U}")
).withFlavorWord("Cunning Action"));
// TODO: EXAMPLE DELETE
// When Fathom Fleet Cutthroat enters the battlefield, destroy target creature an opponent controls that was dealt damage this turn.
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
ability.addTarget(new TargetCreaturePermanent());
ability.withFlavorWord("Tail Spikes");
this.addAbility(ability);
}
private GuildThief(final GuildThief card) {

View file

@ -41,8 +41,11 @@ public final class HeartlashCinder extends CardImpl {
// Chroma - When Heartlash Cinder enters the battlefield, it gets +X/+0 until end of turn, where X is the number of red mana symbols in the mana costs of permanents you control.
ContinuousEffect effect = new BoostSourceEffect(new ChromaHeartlashCinderCount(), StaticValue.get(0), Duration.EndOfTurn, true);
effect.setText("<i>Chroma</i> &mdash; When Heartlash Cinder enters the battlefield, it gets +X/+0 until end of turn, where X is the number of red mana symbols in the mana costs of permanents you control.");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false, true));
effect.setText("it gets +X/+0 until end of turn, where X is the number of red mana symbols in the mana costs of permanents you control");
this.addAbility(new EntersBattlefieldTriggeredAbility(
effect, false)
.withFlavorWord("Chroma")
);
}

View file

@ -35,8 +35,10 @@ public final class IsochronScepter extends CardImpl {
// Imprint - When Isochron Scepter enters the battlefield, you may exile an
// instant card with converted mana cost 2 or less from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new IsochronScepterImprintEffect(),
true, "<i>Imprint &mdash; </i>"));
this.addAbility(new EntersBattlefieldTriggeredAbility(
new IsochronScepterImprintEffect(),true)
.withFlavorWord("Imprint")
);
// {2}, {tap}: You may copy the exiled card. If you do, you may cast the
// copy without paying its mana cost.

View file

@ -43,8 +43,9 @@ public final class IzoniThousandEyed extends CardImpl {
new CardsInControllerGraveyardCount(
StaticFilters.FILTER_CARD_CREATURE
)
), false, "<i>Undergrowth</i> &mdash; "
));
), false)
.withFlavorWord("Undergrowth")
);
// {B}{G}, Sacrifice another creature: You gain 1 life and draw a card.
Ability ability = new SimpleActivatedAbility(

View file

@ -27,9 +27,9 @@ public final class KraulForagers extends CardImpl {
// Undergrowth When Kraul Foragers enters the battlefield, you gain 1 life for each creature card in your graveyard.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new GainLifeEffect(new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE)),
false, "<i>Undergrowth</i> &mdash; "
));
new GainLifeEffect(new CardsInControllerGraveyardCount(StaticFilters.FILTER_CARD_CREATURE)), false)
.withFlavorWord("Undergrowth")
);
}
private KraulForagers(final KraulForagers card) {

View file

@ -50,10 +50,10 @@ public final class KraulHarpooner extends CardImpl {
// Undergrowth When Kraul Harpooner enters the battlefield, choose up to one target creature with flying you don't control. Kraul Harpooner gets +X/+0 until end of turn, where X is the number of creature cards in your graveyard, then you may have Kraul Harpooner fight that creature.
Ability ability = new EntersBattlefieldTriggeredAbility(
new KraulHarpoonerEffect(), false,
"<i>Undergrowth</i> &mdash; "
new KraulHarpoonerEffect(), false
);
ability.addTarget(new TargetPermanent(0, 1, filter, false));
ability.withFlavorWord("Undergrowth");
this.addAbility(ability);
}

View file

@ -34,8 +34,9 @@ public final class LieutenantsOfTheGuard extends CardImpl {
// each player votes for strength or numbers. Put a +1/+1 counter on Lieutenants of the Guard for each
// strength vote and put a 1/1 white Soldier creature token onto the battlefield for each numbers vote.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new LieutenantsOfTheGuardEffect(), false, "<i>Council's dilemma</i> &mdash; "
));
new LieutenantsOfTheGuardEffect(), false)
.withFlavorWord("Council's dilemma")
);
}
private LieutenantsOfTheGuard(final LieutenantsOfTheGuard card) {

View file

@ -31,9 +31,9 @@ public final class LotlethGiant extends CardImpl {
Ability ability = new EntersBattlefieldTriggeredAbility(
new DamageTargetEffect(new CardsInControllerGraveyardCount(
StaticFilters.FILTER_CARD_CREATURE
), "it"), false, "<i>Undergrowth</i> &mdash; "
);
), "it"), false);
ability.addTarget(new TargetOpponent());
ability.withFlavorWord("Undergrowth");
this.addAbility(ability);
}

View file

@ -41,7 +41,10 @@ public final class MagisterOfWorth extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// Will of the council - When Magister of Worth enters the battlefield, starting with you, each player votes for grace or condemnation. If grace gets more votes, each player returns each creature card from their graveyard to the battlefield. If condemnation gets more votes or the vote is tied, destroy all creatures other than Magister of Worth.
this.addAbility(new EntersBattlefieldTriggeredAbility(new MagisterOfWorthEffect(), false, true));
this.addAbility(new EntersBattlefieldTriggeredAbility(
new MagisterOfWorthEffect(), false)
.withFlavorWord("Will of the council")
);
}
private MagisterOfWorth(final MagisterOfWorth card) {
@ -64,8 +67,7 @@ class MagisterOfWorthEffect extends OneShotEffect {
MagisterOfWorthEffect() {
super(Outcome.Benefit);
staticText = "<i>Will of the council</i> &mdash; When {this} enters the battlefield, " +
"starting with you, each player votes for grace or condemnation. " +
staticText = "starting with you, each player votes for grace or condemnation. " +
"If grace gets more votes, each player returns each creature card from their graveyard to the battlefield. " +
"If condemnation gets more votes or the vote is tied, destroy all creatures other than {this}.";
}

View file

@ -35,8 +35,9 @@ public final class MessengerJays extends CardImpl {
// <i>Council's dilemma &mdash; When Messenger Jays enters the battlefield, starting with you, each player votes for feather or quill. Put a +1/+1 counter on Messenger Jays for each feather vote and draw a card for each quill vote. For each card drawn this way, discard a card.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new MessengerJaysEffect(), false, "<i>Council's dilemma</i> &mdash; "
));
new MessengerJaysEffect(), false)
.withFlavorWord("Council's dilemma")
);
}
private MessengerJays(final MessengerJays card) {

View file

@ -34,8 +34,9 @@ public final class MirrorGolem extends CardImpl {
this.toughness = new MageInt(4);
// Imprint - When Mirror Golem enters the battlefield, you may exile target card from a graveyard.
Ability ability = new EntersBattlefieldTriggeredAbility(new MirrorGolemImprintEffect(), true, "Imprint &mdash; ");
Ability ability = new EntersBattlefieldTriggeredAbility(new MirrorGolemImprintEffect(), true);
ability.addTarget(new TargetCardInGraveyard());
ability.withFlavorWord("Imprint");
this.addAbility(ability);
// Mirror Golem has protection from each of the exiled card's card types.

View file

@ -41,8 +41,7 @@ public final class MoodmarkPainter extends CardImpl {
new MenaceAbility(),
Duration.EndOfTurn
).setText("target creature gains menace"),
false, "<i>Undergrowth</i> &mdash; "
);
false);
ability.addEffect(new BoostTargetEffect(
xValue, StaticValue.get(0),
Duration.EndOfTurn, true
@ -50,6 +49,7 @@ public final class MoodmarkPainter extends CardImpl {
+ "where X is the number of creature cards in your graveyard")
);
ability.addTarget(new TargetCreaturePermanent());
ability.withFlavorWord("Undergrowth");
this.addAbility(ability);
}

View file

@ -41,8 +41,9 @@ public final class MournersShield extends CardImpl {
// Imprint - When Mourner's Shield enters the battlefield, you may exile target card from a graveyard.
Ability ability = new EntersBattlefieldTriggeredAbility(new MournersShieldImprintEffect(), true, "Imprint &mdash; ");
Ability ability = new EntersBattlefieldTriggeredAbility(new MournersShieldImprintEffect(), true);
ability.addTarget(new TargetCardInGraveyard());
ability.withFlavorWord("Imprint");
this.addAbility(ability);
// {2}, {tap}: Prevent all damage that would be dealt this turn by a source of your choice that shares a color with the exiled card.

View file

@ -31,8 +31,9 @@ public final class OrchardElemental extends CardImpl {
// <i>Council's dilemma</i> &mdash When Orchard Elemental enters the battlefield, starting with you, each player votes for sprout or harvest. Put two +1/+1 counters on Orchard Elemental for each sprout vote. You gain 3 life for each harvest vote.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new OrchardElementalEffect(), false, "<i>Council's dilemma</i> &mdash; "
));
new OrchardElementalEffect(), false)
.withFlavorWord("Council's dilemma")
);
}
private OrchardElemental(final OrchardElemental card) {

View file

@ -31,9 +31,10 @@ public final class OutrageShaman extends CardImpl {
// Chroma - When Outrage Shaman enters the battlefield, it deals damage to target creature equal to the number of red mana symbols in the mana costs of permanents you control.
Effect effect = new DamageTargetEffect(new ChromaOutrageShamanCount());
effect.setText("<i>Chroma</i> &mdash; When Outrage Shaman enters the battlefield, it deals damage to target creature equal to the number of red mana symbols in the mana costs of permanents you control.");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false, true);
effect.setText("it deals damage to target creature equal to the number of red mana symbols in the mana costs of permanents you control");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
ability.addTarget(new TargetCreaturePermanent());
ability.withFlavorWord("Chroma");
this.addAbility(ability);
}

View file

@ -52,8 +52,7 @@ public final class PropheticTitan extends CardImpl {
class PropheticTitanTriggeredAbility extends EntersBattlefieldTriggeredAbility {
public PropheticTitanTriggeredAbility() {
super(new DamageTargetEffect(4), false, "<i>Delirium</i> &mdash; ");
this.addTarget(new TargetAnyTarget());
super(new DamageTargetEffect(4), false);
this.addMode(new Mode(new LookLibraryAndPickControllerEffect(
StaticValue.get(4), false, StaticValue.get(1),
StaticFilters.FILTER_CARD, Zone.LIBRARY, false, false
@ -62,7 +61,9 @@ class PropheticTitanTriggeredAbility extends EntersBattlefieldTriggeredAbility {
this.getModes().setChooseText(
"choose one. If there are four or more card types among cards in your graveyard, choose both instead."
);
this.addTarget(new TargetAnyTarget());
this.addHint(CardTypesInGraveyardHint.YOU);
this.withFlavorWord("Delirium");
}
private PropheticTitanTriggeredAbility(final PropheticTitanTriggeredAbility ability) {

View file

@ -37,8 +37,9 @@ public final class PrototypePortal extends CardImpl {
// Imprint - When Prototype Portal enters the battlefield, you may exile an artifact card from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new PrototypePortalEffect(), true, "<i>Imprint</i> &mdash; "
));
new PrototypePortalEffect(), true)
.withFlavorWord("Imprint")
);
// {X}, {tap}: Create a token that's a copy of the exiled card. X is the converted mana cost of that card.
Ability ability = new SimpleActivatedAbility(new PrototypePortalCreateTokenEffect(), new ManaCostsImpl("{X}"));

View file

@ -33,8 +33,9 @@ public final class RadiantEpicure extends CardImpl {
// Converge When Radiant Epicure enters the battlefield, each opponent loses X life and you gain X life, where X is the number of colors of mana spent to cast this spell.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new RadiantEpicureEffect(), false, "<i>Converge</i> &mdash; "
));
new RadiantEpicureEffect(), false)
.withFlavorWord("Converge")
);
}
private RadiantEpicure(final RadiantEpicure card) {

View file

@ -41,7 +41,7 @@ public final class RangeTrooper extends CardImpl {
this.toughness = new MageInt(2);
// Trooper creatures you control have "When this creature enters that battlefield, you may exile target creature. Return that creature to the battlefield at the beginning of the next end step."
Ability ability = new EntersBattlefieldTriggeredAbility(new RangeTrooperEffect(), true, false);
Ability ability = new EntersBattlefieldTriggeredAbility(new RangeTrooperEffect(), true);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new GainAbilityControlledEffect(ability, Duration.WhileOnBattlefield, filter, false)));

View file

@ -46,8 +46,12 @@ public final class RonaDiscipleOfGix extends CardImpl {
this.toughness = new MageInt(2);
// When Rona, Disciple of Gix enters the battlefield, you may exile target historic card from your graveyard.
String abilityText = "When {this} enters the battlefield, you may exile target historic card from your graveyard. <i>(Artifacts, legendaries, and Sagas are historic.)</i>";
Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetEffect().setToSourceExileZone(true), true, abilityText);
Ability ability = new EntersBattlefieldTriggeredAbility(
new ExileTargetEffect()
.setToSourceExileZone(true)
.setText("exile target historic card from your graveyard. <i>(Artifacts, legendaries, and Sagas are historic.)</i>"),
true
);
ability.addTarget(new TargetCardInYourGraveyard(new FilterHistoricCard("historic card from your graveyard")));
this.addAbility(ability);

View file

@ -34,10 +34,9 @@ public final class SelvalasEnforcer extends CardImpl {
// Parley - When Selvala's Enforcer enters the battlefield, each player reveals the top card of their library.
// For each nonland card revealed this way, put a +1/+1 counter on Selvala's Enforcer. Then each player draws a card.
Ability ability = new EntersBattlefieldTriggeredAbility(new SelvalasEnforcerEffect(), false, "<i>Parley &mdash; </i>");
Effect effect = new DrawCardAllEffect(1);
effect.setText("Then each player draws a card");
ability.addEffect(effect);
Ability ability = new EntersBattlefieldTriggeredAbility(new SelvalasEnforcerEffect(), false);
ability.addEffect(new DrawCardAllEffect(1).setText("Then each player draws a card"));
ability.withFlavorWord("Parley");
this.addAbility(ability);
}

View file

@ -37,8 +37,9 @@ public final class SoulFoundry extends CardImpl {
// Imprint - When Soul Foundry enters the battlefield, you may exile a creature card from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new SoulFoundryImprintEffect(), true, "<i>Imprint</i> &mdash; "
));
new SoulFoundryImprintEffect(), true)
.withFlavorWord("Imprint")
);
// {X}, {T}: Create a token that's a copy of the exiled card. X is the converted mana cost of that card.
Ability ability = new SimpleActivatedAbility(new SoulFoundryEffect(), new ManaCostsImpl("{X}"));

View file

@ -39,7 +39,9 @@ public final class Spellbinder extends CardImpl {
// Imprint - When Spellbinder enters the battlefield, you may exile
// an instant card from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(
new SpellbinderImprintEffect(), true, "<i>Imprint &mdash; </i>"));
new SpellbinderImprintEffect(), true)
.withFlavorWord("Imprint")
);
// Whenever equipped creature deals combat damage to a player, you may
// copy the exiled card. If you do, you may cast the copy without paying its mana cost.

View file

@ -39,8 +39,9 @@ public final class SpellweaverHelix extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
// Imprint - When Spellweaver Helix enters the battlefield, you may exile two target sorcery cards from a single graveyard.
Ability ability = new EntersBattlefieldTriggeredAbility(new SpellweaverHelixImprintEffect(), true, "Imprint &mdash; ");
Ability ability = new EntersBattlefieldTriggeredAbility(new SpellweaverHelixImprintEffect(), true);
ability.addTarget(new TargetCardInASingleGraveyard(2, 2, filter));
ability.withFlavorWord("Imprint");
this.addAbility(ability);
// Whenever a player casts a card, if it has the same name as one of the cards exiled with Spellweaver Helix, you may copy the other. If you do, you may cast the copy without paying its mana cost.

View file

@ -34,9 +34,11 @@ public final class SpringjackShepherd extends CardImpl {
// Chroma - When Springjack Shepherd enters the battlefield, create a 0/1 white Goat creature token for each white mana symbol in the mana costs of permanents you control.
Effect effect = new CreateTokenEffect(new GoatToken(), new ChromaSpringjackShepherdCount());
effect.setText("<i>Chroma</i> &mdash; When Springjack Shepherd enters the battlefield, create a 0/1 white Goat creature token for each white mana symbol in the mana costs of permanents you control.");
this.addAbility(new EntersBattlefieldTriggeredAbility(effect, false, true));
effect.setText("create a 0/1 white Goat creature token for each white mana symbol in the mana costs of permanents you control.");
this.addAbility(new EntersBattlefieldTriggeredAbility(
effect, false)
.withFlavorWord("Chroma")
);
}
private SpringjackShepherd(final SpringjackShepherd card) {

View file

@ -34,7 +34,11 @@ public final class SummonersEgg extends CardImpl {
this.toughness = new MageInt(4);
// Imprint - When Summoner's Egg enters the battlefield, you may exile a card from your hand face down.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SummonersEggImprintEffect(), true, "<i>Imprint</i> &mdash; "));
this.addAbility(new EntersBattlefieldTriggeredAbility(
new SummonersEggImprintEffect(), true)
.withFlavorWord("Imprint")
);
// When Summoner's Egg dies, turn the exiled card face up. If it's a creature card, put it onto the battlefield under your control.
this.addAbility(new DiesSourceTriggeredAbility(new SummonersEggPutOntoBattlefieldEffect()));
}

View file

@ -38,8 +38,9 @@ public final class ThoughtPrison extends CardImpl {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}");
// Imprint - When Thought Prison enters the battlefield, you may have target player reveal their hand. If you do, choose a nonland card from it and exile that card.
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ThoughtPrisonImprintEffect(), true, "<i>Imprint</i> &mdash; ");
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new ThoughtPrisonImprintEffect(), true);
ability.addTarget(new TargetPlayer());
ability.withFlavorWord("Imprint");
this.addAbility(ability);
// Whenever a player casts a spell that shares a color or converted mana cost with the exiled card, Thought Prison deals 2 damage to that player.

View file

@ -42,7 +42,7 @@ public final class VedalkenPlotter extends CardImpl {
// When Vedalken Plotter enters the battlefield, exchange control of target land you control and target land an opponent controls.
Effect effect = new ExchangeControlTargetEffect(Duration.EndOfGame, rule, false, true);
effect.setText("exchange control of target land you control and target land an opponent controls");
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false, true);
Ability ability = new EntersBattlefieldTriggeredAbility(effect, false);
ability.addTarget(new TargetControlledPermanent(new FilterControlledLandPermanent()));
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);

View file

@ -42,13 +42,13 @@ public final class VigorsporeWurm extends CardImpl {
VigilanceAbility.getInstance(),
Duration.EndOfTurn
).setText("target creature gains vigilance"),
false, "<i>Undergrowth</i> &mdash; "
);
false);
ability.addEffect(new BoostTargetEffect(
xValue, xValue, Duration.EndOfTurn, true
).setText("and gets +X/+X until end of turn, "
+ "where X is the number of creature cards in your graveyard."));
ability.addTarget(new TargetCreaturePermanent());
ability.withFlavorWord("Undergrowth");
this.addAbility(ability);
// Vigorspore Wurm can't be blocked by more than one creature.

View file

@ -1,5 +1,6 @@
package mage.abilities.common;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.constants.Zone;
@ -11,31 +12,26 @@ import mage.game.events.GameEvent;
*/
public class EntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl {
protected String rulePrefix;
protected boolean noRule;
protected boolean ignoreRulesGeneration; // use it with custom rules (if you don't want ETB auto-generated text)
protected String etbFlavorWord = null;
public EntersBattlefieldTriggeredAbility(Effect effect) {
this(effect, false);
}
public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional) {
this(effect, optional, null);
this(effect, optional, false);
}
public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional, boolean noRule) {
this(effect, optional, null);
this.noRule = noRule;
}
public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional, String rulePrefix) {
public EntersBattlefieldTriggeredAbility(Effect effect, boolean optional, boolean ignoreRulesGeneration) {
super(Zone.ALL, effect, optional); // Zone.All because a creature with trigger can be put into play and be sacrificed during the resolution of an effect (discard Obstinate Baloth with Smallpox)
this.rulePrefix = rulePrefix;
this.ignoreRulesGeneration = ignoreRulesGeneration;
}
public EntersBattlefieldTriggeredAbility(final EntersBattlefieldTriggeredAbility ability) {
super(ability);
this.rulePrefix = ability.rulePrefix;
this.noRule = ability.noRule;
this.ignoreRulesGeneration = ability.ignoreRulesGeneration;
this.etbFlavorWord = ability.etbFlavorWord;
}
@Override
@ -52,12 +48,21 @@ public class EntersBattlefieldTriggeredAbility extends TriggeredAbilityImpl {
return false;
}
@Override
public Ability withFlavorWord(String flavorWord) {
// must put flavor word before auto-generated rules, so keep it in etb place
super.withFlavorWord(null);
this.etbFlavorWord = flavorWord;
return this;
}
@Override
public String getRule() {
if (noRule) {
if (ignoreRulesGeneration) {
return super.getRule();
}
return (rulePrefix != null ? rulePrefix : "") + "When {this} enters the battlefield, " + super.getRule();
return (this.etbFlavorWord == null ? "" : "<i>" + this.etbFlavorWord + "</i> &mdash; ")
+ "When {this} enters the battlefield, " + super.getRule();
}
@Override

View file

@ -12,7 +12,7 @@ public class EntersBattlefieldUntappedTriggeredAbility extends EntersBattlefield
public EntersBattlefieldUntappedTriggeredAbility(Effect effect, boolean optional) {
super(effect, optional);
this.noRule = true;
this.ignoreRulesGeneration = true;
}
private EntersBattlefieldUntappedTriggeredAbility(final EntersBattlefieldUntappedTriggeredAbility ability) {