From edaaac53d9998c5eaa960e59d5abb508374417bd Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sun, 6 Mar 2022 15:29:47 -0500 Subject: [PATCH] [ALA] various text fixes --- Mage.Sets/src/mage/cards/a/AjaniVengeant.java | 2 +- .../src/mage/cards/a/ArchdemonOfUnx.java | 2 +- Mage.Sets/src/mage/cards/c/CarrionThrash.java | 5 +- .../src/mage/cards/c/CruelUltimatum.java | 28 ++++---- Mage.Sets/src/mage/cards/g/GoblinAssault.java | 2 +- Mage.Sets/src/mage/cards/g/GrixisCharm.java | 2 +- .../src/mage/cards/g/GustriderExuberant.java | 24 +++---- .../src/mage/cards/h/HinderingLight.java | 2 +- .../src/mage/cards/h/HissingIguanar.java | 2 +- Mage.Sets/src/mage/cards/i/ImmortalCoil.java | 2 +- .../src/mage/cards/k/KederektLeviathan.java | 2 +- Mage.Sets/src/mage/cards/m/Manaplasm.java | 65 +++++++------------ Mage.Sets/src/mage/cards/m/MemoryErosion.java | 59 ++--------------- .../src/mage/cards/m/MinionReflector.java | 29 ++++----- .../src/mage/cards/q/QasaliAmbusher.java | 41 ++++++------ Mage.Sets/src/mage/cards/q/QuietusSpike.java | 2 +- .../src/mage/cards/r/RockcasterPlatoon.java | 15 ++--- Mage.Sets/src/mage/cards/s/SangriteSurge.java | 16 +++-- Mage.Sets/src/mage/cards/s/SarkhanVol.java | 18 +++-- Mage.Sets/src/mage/cards/s/SavageHunger.java | 30 ++++----- .../src/mage/cards/t/TortoiseFormation.java | 2 +- .../src/mage/cards/v/ViciousShadows.java | 11 ++-- .../src/mage/cards/v/ViolentUltimatum.java | 16 ++--- Mage.Sets/src/mage/cards/w/WelkinGuide.java | 17 +++-- .../src/mage/cards/w/WhereAncientsTread.java | 4 +- .../java/mage/verify/VerifyCardDataTest.java | 2 +- .../effects/common/CreateTokenEffect.java | 7 +- .../DestroyAllControlledTargetEffect.java | 12 ++-- .../common/MayTapOrUntapTargetEffect.java | 3 +- .../effects/common/MillCardsTargetEffect.java | 5 +- .../ReturnToHandFromBattlefieldAllEffect.java | 2 +- .../game/permanent/token/ThopterToken.java | 2 +- Mage/src/main/java/mage/util/CardUtil.java | 2 +- 33 files changed, 185 insertions(+), 248 deletions(-) diff --git a/Mage.Sets/src/mage/cards/a/AjaniVengeant.java b/Mage.Sets/src/mage/cards/a/AjaniVengeant.java index 2832571797..84d4f64875 100644 --- a/Mage.Sets/src/mage/cards/a/AjaniVengeant.java +++ b/Mage.Sets/src/mage/cards/a/AjaniVengeant.java @@ -45,7 +45,7 @@ public final class AjaniVengeant extends CardImpl { // −2: Ajani Vengeant deals 3 damage to any target and you gain 3 life. Effects effects1 = new Effects(); effects1.add(new DamageTargetEffect(3)); - effects1.add(new GainLifeEffect(3)); + effects1.add(new GainLifeEffect(3).concatBy("and")); LoyaltyAbility ability2 = new LoyaltyAbility(effects1, -2); ability2.addTarget(new TargetAnyTarget()); this.addAbility(ability2); diff --git a/Mage.Sets/src/mage/cards/a/ArchdemonOfUnx.java b/Mage.Sets/src/mage/cards/a/ArchdemonOfUnx.java index 1738f21e67..5c6d7df33f 100644 --- a/Mage.Sets/src/mage/cards/a/ArchdemonOfUnx.java +++ b/Mage.Sets/src/mage/cards/a/ArchdemonOfUnx.java @@ -43,7 +43,7 @@ public final class ArchdemonOfUnx extends CardImpl { this.addAbility(TrampleAbility.getInstance()); // At the beginning of your upkeep, sacrifice a non-Zombie creature, then create a 2/2 black Zombie creature token. Ability ability = new BeginningOfUpkeepTriggeredAbility(new SacrificeControllerEffect(filter, 1, ""), TargetController.YOU, false); - ability.addEffect(new CreateTokenEffect(new ZombieToken())); + ability.addEffect(new CreateTokenEffect(new ZombieToken()).concatBy(", then")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CarrionThrash.java b/Mage.Sets/src/mage/cards/c/CarrionThrash.java index 2b48d62e81..9b671db3ad 100644 --- a/Mage.Sets/src/mage/cards/c/CarrionThrash.java +++ b/Mage.Sets/src/mage/cards/c/CarrionThrash.java @@ -6,6 +6,7 @@ import mage.MageInt; import mage.abilities.common.DiesSourceTriggeredAbility; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.effects.common.DoIfCostPaid; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.abilities.effects.common.ReturnToHandTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; @@ -21,7 +22,7 @@ import mage.target.common.TargetCardInYourGraveyard; */ public final class CarrionThrash extends CardImpl { - private static final FilterCreatureCard filter = new FilterCreatureCard("another creature card from your graveyard"); + private static final FilterCreatureCard filter = new FilterCreatureCard("another target creature card from your graveyard"); static { filter.add(new AnotherCardPredicate()); @@ -36,7 +37,7 @@ public final class CarrionThrash extends CardImpl { this.toughness = new MageInt(4); // When Carrion Thrash dies, you may pay {2}. If you do, return another target creature card from your graveyard to your hand. - DiesSourceTriggeredAbility ability = new DiesSourceTriggeredAbility(new DoIfCostPaid(new ReturnToHandTargetEffect(), new GenericManaCost(2)), false); + DiesSourceTriggeredAbility ability = new DiesSourceTriggeredAbility(new DoIfCostPaid(new ReturnFromGraveyardToHandTargetEffect(), new GenericManaCost(2)), false); ability.addTarget(new TargetCardInYourGraveyard(filter)); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/c/CruelUltimatum.java b/Mage.Sets/src/mage/cards/c/CruelUltimatum.java index 56c45460de..a1eae80d39 100644 --- a/Mage.Sets/src/mage/cards/c/CruelUltimatum.java +++ b/Mage.Sets/src/mage/cards/c/CruelUltimatum.java @@ -2,8 +2,6 @@ package mage.cards.c; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; -import mage.abilities.effects.common.DrawCardSourceControllerEffect; -import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.SacrificeEffect; import mage.abilities.effects.common.discard.DiscardTargetEffect; @@ -32,13 +30,13 @@ public final class CruelUltimatum extends CardImpl { // Target opponent sacrifices a creature, discards three cards, then loses 5 life. // You return a creature card from your graveyard to your hand, draw three cards, then gain 5 life. this.getSpellAbility().addTarget(new TargetOpponent()); - this.getSpellAbility().addEffect(new SacrificeEffect(StaticFilters.FILTER_PERMANENT_CREATURE, 1, "Target opponent")); - this.getSpellAbility().addEffect(new DiscardTargetEffect(3)); - this.getSpellAbility().addEffect(new LoseLifeTargetEffect(5)); - + this.getSpellAbility().addEffect(new SacrificeEffect( + StaticFilters.FILTER_PERMANENT_CREATURE, + 1, "Target opponent" + )); + this.getSpellAbility().addEffect(new DiscardTargetEffect(3).setText(", discards three cards")); + this.getSpellAbility().addEffect(new LoseLifeTargetEffect(5).setText(", then loses 5 life")); this.getSpellAbility().addEffect(new CruelUltimatumEffect()); - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(3)); - this.getSpellAbility().addEffect(new GainLifeEffect(5)); } private CruelUltimatum(final CruelUltimatum card) { @@ -55,7 +53,8 @@ class CruelUltimatumEffect extends OneShotEffect { public CruelUltimatumEffect() { super(Outcome.ReturnToHand); - this.staticText = "Return a creature card from your graveyard to your hand"; + this.staticText = "You return a creature card from your graveyard " + + "to your hand, draw three cards, then gain 5 life"; } public CruelUltimatumEffect(final CruelUltimatumEffect effect) { @@ -74,14 +73,13 @@ class CruelUltimatumEffect extends OneShotEffect { return false; } TargetCardInYourGraveyard target = new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD); - if (target.canChoose(source.getSourceId(), source.getControllerId(), game) && controller.choose(Outcome.ReturnToHand, target, source.getSourceId(), game)) { - Card card = game.getCard(target.getFirstTarget()); - if (card == null) { - return false; - } - + controller.choose(Outcome.ReturnToHand, target, source.getSourceId(), game); + Card card = game.getCard(target.getFirstTarget()); + if (card != null) { return controller.moveCards(card, Zone.HAND, source, game); } + controller.drawCards(1, source, game); + controller.gainLife(1, game, source); return true; } } diff --git a/Mage.Sets/src/mage/cards/g/GoblinAssault.java b/Mage.Sets/src/mage/cards/g/GoblinAssault.java index 545b853915..ce26761c09 100644 --- a/Mage.Sets/src/mage/cards/g/GoblinAssault.java +++ b/Mage.Sets/src/mage/cards/g/GoblinAssault.java @@ -29,7 +29,7 @@ public final class GoblinAssault extends CardImpl { this.addAbility(new BeginningOfUpkeepTriggeredAbility(new CreateTokenEffect(new GoblinToken(true)), TargetController.YOU, false)); // Goblin creatures attack each turn if able. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE_GOBLINS, Duration.WhileOnBattlefield)), new AttackedThisTurnWatcher()); + this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AttacksIfAbleAllEffect(StaticFilters.FILTER_PERMANENT_CREATURE_GOBLINS, Duration.WhileOnBattlefield, true)), new AttackedThisTurnWatcher()); } private GoblinAssault(final GoblinAssault card) { diff --git a/Mage.Sets/src/mage/cards/g/GrixisCharm.java b/Mage.Sets/src/mage/cards/g/GrixisCharm.java index d6091f54fb..ff8d3a7855 100644 --- a/Mage.Sets/src/mage/cards/g/GrixisCharm.java +++ b/Mage.Sets/src/mage/cards/g/GrixisCharm.java @@ -33,7 +33,7 @@ public final class GrixisCharm extends CardImpl { this.getSpellAbility().addMode(mode); // or creatures you control get +2/+0 until end of turn. mode = new Mode(); - mode.addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURE, false)); + mode.addEffect(new BoostControlledEffect(2, 0, Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES, false)); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/g/GustriderExuberant.java b/Mage.Sets/src/mage/cards/g/GustriderExuberant.java index 405b4f53b4..3374284409 100644 --- a/Mage.Sets/src/mage/cards/g/GustriderExuberant.java +++ b/Mage.Sets/src/mage/cards/g/GustriderExuberant.java @@ -1,36 +1,36 @@ - package mage.cards.g; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; -import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; +import mage.abilities.effects.common.continuous.GainAbilityAllEffect; import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.ComparisonType; import mage.constants.Duration; -import mage.constants.Zone; -import mage.filter.common.FilterCreaturePermanent; +import mage.constants.SubType; +import mage.filter.FilterPermanent; +import mage.filter.common.FilterControlledCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; +import java.util.UUID; + /** - * * @author North */ public final class GustriderExuberant extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 5 or greater"); + private static final FilterPermanent filter + = new FilterControlledCreaturePermanent("creatures you control with power 5 or greater"); static { filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 4)); } public GustriderExuberant(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.WIZARD); @@ -38,9 +38,9 @@ public final class GustriderExuberant extends CardImpl { this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, - new GainAbilityControlledEffect(FlyingAbility.getInstance(), Duration.EndOfTurn, filter), - new SacrificeSourceCost())); + this.addAbility(new SimpleActivatedAbility(new GainAbilityAllEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn, filter + ), new SacrificeSourceCost())); } private GustriderExuberant(final GustriderExuberant card) { diff --git a/Mage.Sets/src/mage/cards/h/HinderingLight.java b/Mage.Sets/src/mage/cards/h/HinderingLight.java index f0589a0787..072b5ae81d 100644 --- a/Mage.Sets/src/mage/cards/h/HinderingLight.java +++ b/Mage.Sets/src/mage/cards/h/HinderingLight.java @@ -36,7 +36,7 @@ public final class HinderingLight extends CardImpl { this.getSpellAbility().addEffect(new CounterTargetEffect()); this.getSpellAbility().addTarget(new TargetSpell(filter)); // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("
")); } private HinderingLight(final HinderingLight card) { diff --git a/Mage.Sets/src/mage/cards/h/HissingIguanar.java b/Mage.Sets/src/mage/cards/h/HissingIguanar.java index f4bb0963e3..7d4abd7a88 100644 --- a/Mage.Sets/src/mage/cards/h/HissingIguanar.java +++ b/Mage.Sets/src/mage/cards/h/HissingIguanar.java @@ -25,7 +25,7 @@ public final class HissingIguanar extends CardImpl { this.toughness = new MageInt(1); // Whenever another creature dies, you may have Hissing Iguanar deal 1 damage to target player. - DiesCreatureTriggeredAbility ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(1), true, true); + DiesCreatureTriggeredAbility ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(1).setText("you may have {this} deal 1 damage to target player or planeswalker"), true, true); ability.addTarget(new TargetPlayerOrPlaneswalker()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/i/ImmortalCoil.java b/Mage.Sets/src/mage/cards/i/ImmortalCoil.java index d8e9fb6086..1e2338d203 100644 --- a/Mage.Sets/src/mage/cards/i/ImmortalCoil.java +++ b/Mage.Sets/src/mage/cards/i/ImmortalCoil.java @@ -79,7 +79,7 @@ class ImmortalCoilAbility extends StateTriggeredAbility { @Override public String getRule() { - return "When there are no cards in your graveyard, you lose the game"; + return "When there are no cards in your graveyard, you lose the game."; } } diff --git a/Mage.Sets/src/mage/cards/k/KederektLeviathan.java b/Mage.Sets/src/mage/cards/k/KederektLeviathan.java index a762841d9c..e9912a5ebf 100644 --- a/Mage.Sets/src/mage/cards/k/KederektLeviathan.java +++ b/Mage.Sets/src/mage/cards/k/KederektLeviathan.java @@ -20,7 +20,7 @@ import mage.filter.predicate.mageobject.AnotherPredicate; */ public final class KederektLeviathan extends CardImpl { - private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("all other nonland permanents"); + private static final FilterNonlandPermanent filter = new FilterNonlandPermanent("other nonland permanents"); static{ filter.add(AnotherPredicate.instance); } diff --git a/Mage.Sets/src/mage/cards/m/Manaplasm.java b/Mage.Sets/src/mage/cards/m/Manaplasm.java index f83ef347db..18f35efb83 100644 --- a/Mage.Sets/src/mage/cards/m/Manaplasm.java +++ b/Mage.Sets/src/mage/cards/m/Manaplasm.java @@ -1,38 +1,39 @@ - package mage.cards.m; -import java.util.UUID; import mage.MageInt; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.common.InfoEffect; +import mage.abilities.Ability; +import mage.abilities.common.SpellCastControllerTriggeredAbility; +import mage.abilities.dynamicvalue.DynamicValue; +import mage.abilities.effects.Effect; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; -import mage.constants.Zone; +import mage.constants.SubType; import mage.game.Game; -import mage.game.events.GameEvent; import mage.game.stack.Spell; -import mage.target.targetpointer.FixedTarget; + +import java.util.Optional; +import java.util.UUID; /** - * * @author Plopman */ public final class Manaplasm extends CardImpl { public Manaplasm(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}"); this.subtype.add(SubType.OOZE); this.power = new MageInt(1); this.toughness = new MageInt(1); // Whenever you cast a spell, Manaplasm gets +X/+X until end of turn, where X is that spell's converted mana cost. - this.addAbility(new ManaplasmAbility()); - + this.addAbility(new SpellCastControllerTriggeredAbility(new BoostSourceEffect( + ManaplasmValue.instance, ManaplasmValue.instance, + Duration.EndOfTurn, true + ), false)); } private Manaplasm(final Manaplasm card) { @@ -45,44 +46,26 @@ public final class Manaplasm extends CardImpl { } } +enum ManaplasmValue implements DynamicValue { + instance; -class ManaplasmAbility extends TriggeredAbilityImpl { - - public ManaplasmAbility() { - super(Zone.BATTLEFIELD, new InfoEffect("{this} gets +X/+X until end of turn, where X is that spell's mana value"), false); - } - - - - public ManaplasmAbility(final ManaplasmAbility ability) { - super(ability); + @Override + public int calculate(Game game, Ability sourceAbility, Effect effect) { + return Optional.of((Spell) effect.getValue("spellCast")).map(Spell::getManaValue).orElse(0); } @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.SPELL_CAST; + public ManaplasmValue copy() { + return this; } @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && spell.isControlledBy(controllerId)) { - this.getEffects().remove(0); - int x = spell.getManaValue(); - this.addEffect(new BoostSourceEffect(x,x, Duration.EndOfTurn)); - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; + public String getMessage() { + return "that spell's mana value"; } @Override - public String getRule() { - return "Whenever you cast a spell, {this} gets +X/+X until end of turn, where X is that spell's mana value"; - } - - @Override - public ManaplasmAbility copy() { - return new ManaplasmAbility(this); + public String toString() { + return "X"; } } diff --git a/Mage.Sets/src/mage/cards/m/MemoryErosion.java b/Mage.Sets/src/mage/cards/m/MemoryErosion.java index 1d4967685e..5250cac0f0 100644 --- a/Mage.Sets/src/mage/cards/m/MemoryErosion.java +++ b/Mage.Sets/src/mage/cards/m/MemoryErosion.java @@ -1,31 +1,23 @@ - package mage.cards.m; -import java.util.UUID; -import mage.abilities.TriggeredAbilityImpl; -import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect; +import mage.abilities.common.SpellCastOpponentTriggeredAbility; +import mage.abilities.effects.common.MillCardsTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; -import mage.game.Game; -import mage.game.events.GameEvent; -import mage.game.events.GameEvent.EventType; -import mage.game.stack.Spell; -import mage.target.targetpointer.FixedTarget; + +import java.util.UUID; /** - * * @author Plopman */ public final class MemoryErosion extends CardImpl { public MemoryErosion(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}{U}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{U}"); // Whenever an opponent casts a spell, that player puts the top two cards of their library into their graveyard. - this.addAbility(new SpellCastTriggeredAbility()); + this.addAbility(new SpellCastOpponentTriggeredAbility(new MillCardsTargetEffect(2), false)); } private MemoryErosion(final MemoryErosion card) { @@ -37,42 +29,3 @@ public final class MemoryErosion extends CardImpl { return new MemoryErosion(this); } } - - -class SpellCastTriggeredAbility extends TriggeredAbilityImpl { - - public SpellCastTriggeredAbility() { - super(Zone.BATTLEFIELD, new PutLibraryIntoGraveTargetEffect(2), false); - } - - - - public SpellCastTriggeredAbility(final SpellCastTriggeredAbility ability) { - super(ability); - } - - @Override - public boolean checkEventType(GameEvent event, Game game) { - return event.getType() == GameEvent.EventType.SPELL_CAST; - } - - @Override - public boolean checkTrigger(GameEvent event, Game game) { - Spell spell = game.getStack().getSpell(event.getTargetId()); - if (spell != null && game.getOpponents(this.getControllerId()).contains(spell.getControllerId())) { - this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId())); - return true; - } - return false; - } - - @Override - public String getRule() { - return "Whenever an opponent casts a spell, that player mills two cards"; - } - - @Override - public SpellCastTriggeredAbility copy() { - return new SpellCastTriggeredAbility(this); - } -} \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/m/MinionReflector.java b/Mage.Sets/src/mage/cards/m/MinionReflector.java index 8afbacbcc1..6d6e84ab96 100644 --- a/Mage.Sets/src/mage/cards/m/MinionReflector.java +++ b/Mage.Sets/src/mage/cards/m/MinionReflector.java @@ -1,7 +1,5 @@ - package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.BeginningOfEndStepTriggeredAbility; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; @@ -21,32 +19,31 @@ import mage.game.Game; import mage.game.permanent.Permanent; import mage.target.targetpointer.FixedTarget; +import java.util.UUID; + /** - * * @author Plopman */ public final class MinionReflector extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creature"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a nontoken creature"); static { filter.add(TokenPredicate.FALSE); } public MinionReflector(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{5}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{5}"); // Whenever a nontoken creature enters the battlefield under your control, you may pay {2}. If you do, create a token that's a copy of that creature. That token has haste and "At the beginning of the end step, sacrifice this permanent." - Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DoIfCostPaid( - new MinionReflectorEffect(), new ManaCostsImpl("{2}"), - "Pay {2} to create a token that's a copy of that creature that " + - "entered the battlefield?"), - filter, false, SetTargetPointer.PERMANENT, - "Whenever a nontoken creature enters the battlefield under your control, " + - "you may pay 2. If you do, create a token that's a copy of that creature, " + - "except it has haste and \"At the beginning of the end step, sacrifice this " + - "permanent.\""); - this.addAbility(ability); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility( + Zone.BATTLEFIELD, + new DoIfCostPaid( + new MinionReflectorEffect(), new ManaCostsImpl<>("{2}"), "Pay {2} " + + "to create a token that's a copy of that creature that entered the battlefield?" + ), + filter, false, SetTargetPointer.PERMANENT, null + )); } private MinionReflector(final MinionReflector card) { @@ -64,7 +61,7 @@ class MinionReflectorEffect extends OneShotEffect { public MinionReflectorEffect() { super(Outcome.PutCreatureInPlay); - this.staticText = "create a token that's a copy of that creature, except it has haste and \"At the beginning of the end step, sacrifice this permanent."; + this.staticText = "create a token that's a copy of that creature, except it has haste and \"At the beginning of the end step, sacrifice this permanent.\""; } public MinionReflectorEffect(final MinionReflectorEffect effect) { diff --git a/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java b/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java index 8e523c0312..a285efbab1 100644 --- a/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java +++ b/Mage.Sets/src/mage/cards/q/QasaliAmbusher.java @@ -1,6 +1,5 @@ package mage.cards.q; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.condition.CompoundCondition; @@ -13,27 +12,28 @@ import mage.abilities.effects.common.continuous.CastAsThoughItHadFlashSourceEffe import mage.abilities.keyword.ReachAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.*; +import mage.constants.CardType; +import mage.constants.Duration; +import mage.constants.SubType; import mage.filter.common.FilterControlledPermanent; import mage.watchers.common.PlayerAttackedStepWatcher; +import java.util.UUID; + /** - * * @author Plopman */ public final class QasaliAmbusher extends CardImpl { - private static final FilterControlledPermanent filterForest = new FilterControlledPermanent(); - private static final FilterControlledPermanent filterPlains = new FilterControlledPermanent(); + private static final FilterControlledPermanent filterForest = new FilterControlledPermanent(SubType.FOREST); + private static final FilterControlledPermanent filterPlains = new FilterControlledPermanent(SubType.PLAINS); - static { - filterForest.add(SubType.FOREST.getPredicate()); - filterPlains.add(SubType.PLAINS.getPredicate()); - } - - private static final Condition condition = - new CompoundCondition("If a creature is attacking you and you control a Forest and a Plains", - AttackedThisStepCondition.instance, new PermanentsOnTheBattlefieldCondition(filterForest), new PermanentsOnTheBattlefieldCondition(filterPlains)); + private static final Condition condition = new CompoundCondition( + "If a creature is attacking you and you control a Forest and a Plains", + AttackedThisStepCondition.instance, + new PermanentsOnTheBattlefieldCondition(filterForest), + new PermanentsOnTheBattlefieldCondition(filterPlains) + ); public QasaliAmbusher(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); @@ -48,11 +48,14 @@ public final class QasaliAmbusher extends CardImpl { // If a creature is attacking you and you control a Forest and a Plains, // you may cast Qasali Ambusher without paying its mana cost and as though it had flash. - Ability ability = new AlternativeCostSourceAbility(null, condition); - ability.addEffect(new ConditionalAsThoughEffect(new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame), condition) - .setText("you may cast {this} without paying its mana cost and as though it had flash")); - ability.addWatcher(new PlayerAttackedStepWatcher()); - this.addAbility(ability); + Ability ability = new AlternativeCostSourceAbility( + null, condition, "if a creature is attacking you and you control a Forest and a Plains, " + + "you may cast {this} without paying its mana cost and as though it had flash." + ); + ability.addEffect(new ConditionalAsThoughEffect( + new CastAsThoughItHadFlashSourceEffect(Duration.EndOfGame), condition + )); + this.addAbility(ability, new PlayerAttackedStepWatcher()); } private QasaliAmbusher(final QasaliAmbusher card) { @@ -63,4 +66,4 @@ public final class QasaliAmbusher extends CardImpl { public QasaliAmbusher copy() { return new QasaliAmbusher(this); } -} \ No newline at end of file +} diff --git a/Mage.Sets/src/mage/cards/q/QuietusSpike.java b/Mage.Sets/src/mage/cards/q/QuietusSpike.java index e915eaafc7..959763e121 100644 --- a/Mage.Sets/src/mage/cards/q/QuietusSpike.java +++ b/Mage.Sets/src/mage/cards/q/QuietusSpike.java @@ -31,7 +31,7 @@ public final class QuietusSpike extends CardImpl { this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), AttachmentType.EQUIPMENT))); // Whenever equipped creature deals combat damage to a player, that player loses half their life, rounded up. - this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new LoseHalfLifeTargetEffect(), "equipped", false, true)); + this.addAbility(new DealsDamageToAPlayerAttachedTriggeredAbility(new LoseHalfLifeTargetEffect(), "equipped creature", false, true)); // Equip {3} this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); diff --git a/Mage.Sets/src/mage/cards/r/RockcasterPlatoon.java b/Mage.Sets/src/mage/cards/r/RockcasterPlatoon.java index 6743048b2a..69919e1f7e 100644 --- a/Mage.Sets/src/mage/cards/r/RockcasterPlatoon.java +++ b/Mage.Sets/src/mage/cards/r/RockcasterPlatoon.java @@ -1,7 +1,5 @@ - package mage.cards.r; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -13,23 +11,24 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.AbilityPredicate; +import java.util.UUID; + /** - * * @author Plopman */ public final class RockcasterPlatoon extends CardImpl { - + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying"); + static { filter.add(new AbilityPredicate(FlyingAbility.class)); } public RockcasterPlatoon(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{W}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{5}{W}{W}"); this.subtype.add(SubType.RHINO); this.subtype.add(SubType.SOLDIER); @@ -37,8 +36,8 @@ public final class RockcasterPlatoon extends CardImpl { this.toughness = new MageInt(7); // {4}{G}: Rockcaster Platoon deals 2 damage to each creature with flying and each player. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageAllEffect(2, filter), new ManaCostsImpl("{4}{G}")); - ability.addEffect(new DamagePlayersEffect(2)); + Ability ability = new SimpleActivatedAbility(new DamageAllEffect(2, filter), new ManaCostsImpl<>("{4}{G}")); + ability.addEffect(new DamagePlayersEffect(2).setText("and each player")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SangriteSurge.java b/Mage.Sets/src/mage/cards/s/SangriteSurge.java index 0ffe91383c..308918fd88 100644 --- a/Mage.Sets/src/mage/cards/s/SangriteSurge.java +++ b/Mage.Sets/src/mage/cards/s/SangriteSurge.java @@ -1,7 +1,5 @@ - package mage.cards.s; -import java.util.UUID; import mage.abilities.effects.common.continuous.BoostTargetEffect; import mage.abilities.effects.common.continuous.GainAbilityTargetEffect; import mage.abilities.keyword.DoubleStrikeAbility; @@ -11,19 +9,23 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author North */ public final class SangriteSurge extends CardImpl { public SangriteSurge(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{4}{R}{G}"); - + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{4}{R}{G}"); // Target creature gets +3/+3 and gains double strike until end of turn. - this.getSpellAbility().addEffect(new BoostTargetEffect(3, 3, Duration.EndOfTurn)); - this.getSpellAbility().addEffect(new GainAbilityTargetEffect(DoubleStrikeAbility.getInstance(), Duration.EndOfTurn)); + this.getSpellAbility().addEffect(new BoostTargetEffect( + 3, 3, Duration.EndOfTurn + ).setText("target creature gets +3/+3")); + this.getSpellAbility().addEffect(new GainAbilityTargetEffect( + DoubleStrikeAbility.getInstance(), Duration.EndOfTurn + ).setText("and gains double strike until end of turn")); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); } diff --git a/Mage.Sets/src/mage/cards/s/SarkhanVol.java b/Mage.Sets/src/mage/cards/s/SarkhanVol.java index 98dbf17303..cd4a8018aa 100644 --- a/Mage.Sets/src/mage/cards/s/SarkhanVol.java +++ b/Mage.Sets/src/mage/cards/s/SarkhanVol.java @@ -26,8 +26,6 @@ import java.util.UUID; */ public final class SarkhanVol extends CardImpl { - private static DragonToken dragonToken = new DragonToken(); - public SarkhanVol(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.PLANESWALKER}, "{2}{R}{G}"); this.addSuperType(SuperType.LEGENDARY); @@ -36,20 +34,26 @@ public final class SarkhanVol extends CardImpl { this.setStartingLoyalty(4); // +1: Creatures you control get +1/+1 and gain haste until end of turn. - Effects effects1 = new Effects(); - effects1.add(new BoostControlledEffect(1, 1, Duration.EndOfTurn)); - effects1.add(new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.EndOfTurn, StaticFilters.FILTER_PERMANENT_CREATURES)); + Effects effects1 = new Effects(new BoostControlledEffect( + 1, 1, Duration.EndOfTurn + ).setText("creatures you control get +1/+1")); + effects1.add(new GainAbilityControlledEffect( + HasteAbility.getInstance(), Duration.EndOfTurn, + StaticFilters.FILTER_PERMANENT_CREATURES + ).setText("and gain haste until end of turn")); this.addAbility(new LoyaltyAbility(effects1, 1)); // -2: Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn. LoyaltyAbility ability = new LoyaltyAbility(new GainControlTargetEffect(Duration.EndOfTurn), -2); ability.addEffect(new UntapTargetEffect().setText("Untap that creature")); - ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); + ability.addEffect(new GainAbilityTargetEffect( + HasteAbility.getInstance(), Duration.EndOfTurn + ).setText("It gains haste until end of turn")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); // -6: Create five 4/4 red Dragon creature tokens with flying. - this.addAbility(new LoyaltyAbility(new CreateTokenEffect(dragonToken, 5), -6)); + this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new DragonToken(), 5), -6)); } private SarkhanVol(final SarkhanVol card) { diff --git a/Mage.Sets/src/mage/cards/s/SavageHunger.java b/Mage.Sets/src/mage/cards/s/SavageHunger.java index 0f0969e8ac..db5d02bc21 100644 --- a/Mage.Sets/src/mage/cards/s/SavageHunger.java +++ b/Mage.Sets/src/mage/cards/s/SavageHunger.java @@ -1,8 +1,6 @@ - - package mage.cards.s; -import java.util.UUID; +import mage.abilities.Ability; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.effects.common.AttachEffect; @@ -13,23 +11,19 @@ import mage.abilities.keyword.EnchantAbility; import mage.abilities.keyword.TrampleAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.AttachmentType; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.Zone; +import mage.constants.*; import mage.target.TargetPermanent; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author Loki */ public final class SavageHunger extends CardImpl { - public SavageHunger (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}"); + public SavageHunger(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}"); this.subtype.add(SubType.AURA); @@ -38,13 +32,17 @@ public final class SavageHunger extends CardImpl { this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature)); this.addAbility(new EnchantAbility(auraTarget.getTargetName())); - SimpleStaticAbility ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 0, Duration.WhileOnBattlefield)); - ability.addEffect(new GainAbilityAttachedEffect(TrampleAbility.getInstance(), AttachmentType.AURA)); + Ability ability = new SimpleStaticAbility(new BoostEnchantedEffect( + 1, 0, Duration.WhileOnBattlefield + )); + ability.addEffect(new GainAbilityAttachedEffect( + TrampleAbility.getInstance(), AttachmentType.AURA + ).setText("and has trample")); this.addAbility(ability); - this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}"))); + this.addAbility(new CyclingAbility(new ManaCostsImpl<>("{2}"))); } - public SavageHunger (final SavageHunger card) { + public SavageHunger(final SavageHunger card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/t/TortoiseFormation.java b/Mage.Sets/src/mage/cards/t/TortoiseFormation.java index 06be216742..e8a527ac1a 100644 --- a/Mage.Sets/src/mage/cards/t/TortoiseFormation.java +++ b/Mage.Sets/src/mage/cards/t/TortoiseFormation.java @@ -21,7 +21,7 @@ public final class TortoiseFormation extends CardImpl { // Creatures you control gain shroud until end of turn. this.getSpellAbility().addEffect(new GainAbilityControlledEffect( ShroudAbility.getInstance(), Duration.EndOfTurn, - StaticFilters.FILTER_CONTROLLED_CREATURES + StaticFilters.FILTER_PERMANENT_CREATURES )); } diff --git a/Mage.Sets/src/mage/cards/v/ViciousShadows.java b/Mage.Sets/src/mage/cards/v/ViciousShadows.java index defd4a3136..43a58af8b7 100644 --- a/Mage.Sets/src/mage/cards/v/ViciousShadows.java +++ b/Mage.Sets/src/mage/cards/v/ViciousShadows.java @@ -1,7 +1,5 @@ - package mage.cards.v; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.DiesCreatureTriggeredAbility; import mage.abilities.dynamicvalue.common.CardsInTargetHandCount; @@ -11,18 +9,19 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.target.TargetPlayer; +import java.util.UUID; + /** - * * @author Plopman */ public final class ViciousShadows extends CardImpl { public ViciousShadows(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{6}{R}"); - + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{6}{R}"); // Whenever a creature dies, you may have Vicious Shadows deal damage to target player equal to the number of cards in that player's hand. - Ability ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(CardsInTargetHandCount.instance), true); + Ability ability = new DiesCreatureTriggeredAbility(new DamageTargetEffect(CardsInTargetHandCount.instance) + .setText("you may have {this} deal damage to target player equal to the number of cards in that player's hand"), true); ability.addTarget(new TargetPlayer()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/v/ViolentUltimatum.java b/Mage.Sets/src/mage/cards/v/ViolentUltimatum.java index 1f1b2ec894..ffc29e1655 100644 --- a/Mage.Sets/src/mage/cards/v/ViolentUltimatum.java +++ b/Mage.Sets/src/mage/cards/v/ViolentUltimatum.java @@ -1,30 +1,28 @@ - - package mage.cards.v; -import java.util.UUID; import mage.abilities.effects.common.DestroyTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.filter.FilterPermanent; +import mage.filter.StaticFilters; import mage.target.TargetPermanent; +import java.util.UUID; + /** - * * @author Loki */ public final class ViolentUltimatum extends CardImpl { - public ViolentUltimatum (UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}{B}{R}{R}{R}{G}{G}"); + public ViolentUltimatum(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}{R}{R}{R}{G}{G}"); this.getSpellAbility().addEffect(new DestroyTargetEffect()); - this.getSpellAbility().addTarget(new TargetPermanent(3, 3, new FilterPermanent(), false)); + this.getSpellAbility().addTarget(new TargetPermanent(3, StaticFilters.FILTER_PERMANENTS)); } - public ViolentUltimatum (final ViolentUltimatum card) { + public ViolentUltimatum(final ViolentUltimatum card) { super(card); } diff --git a/Mage.Sets/src/mage/cards/w/WelkinGuide.java b/Mage.Sets/src/mage/cards/w/WelkinGuide.java index 2ea9afc774..7ea0f42200 100644 --- a/Mage.Sets/src/mage/cards/w/WelkinGuide.java +++ b/Mage.Sets/src/mage/cards/w/WelkinGuide.java @@ -1,7 +1,5 @@ - package mage.cards.w; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -11,18 +9,19 @@ import mage.abilities.keyword.FlyingAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Duration; +import mage.constants.SubType; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author North */ public final class WelkinGuide extends CardImpl { public WelkinGuide(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{W}"); this.subtype.add(SubType.BIRD); this.subtype.add(SubType.CLERIC); @@ -30,8 +29,12 @@ public final class WelkinGuide extends CardImpl { this.toughness = new MageInt(2); this.addAbility(FlyingAbility.getInstance()); - Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect(2, 2, Duration.EndOfTurn), false); - ability.addEffect(new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn)); + Ability ability = new EntersBattlefieldTriggeredAbility(new BoostTargetEffect( + 2, 2, Duration.EndOfTurn + ).setText("target creature gets +2/+2"), false); + ability.addEffect(new GainAbilityTargetEffect( + FlyingAbility.getInstance(), Duration.EndOfTurn + ).setText("and gains flying until end of turn")); ability.addTarget(new TargetCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/w/WhereAncientsTread.java b/Mage.Sets/src/mage/cards/w/WhereAncientsTread.java index 46d2662de3..67b806600d 100644 --- a/Mage.Sets/src/mage/cards/w/WhereAncientsTread.java +++ b/Mage.Sets/src/mage/cards/w/WhereAncientsTread.java @@ -20,7 +20,7 @@ import mage.target.common.TargetAnyTarget; */ public final class WhereAncientsTread extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 5 or greater"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature with power 5 or greater"); static { filter.add(new PowerPredicate(ComparisonType.MORE_THAN, 4)); } @@ -30,7 +30,7 @@ import mage.target.common.TargetAnyTarget; // Whenever a creature with power 5 or greater enters the battlefield under your control, you may have Where Ancients Tread deal 5 damage to any target. - Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(5), filter, true); + Ability ability = new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, new DamageTargetEffect(5).setText("you may have {this} deal 5 damage to any target"), filter, true); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); } diff --git a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java index cb80ec1e71..f88ce6ab12 100644 --- a/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java +++ b/Mage.Verify/src/test/java/mage/verify/VerifyCardDataTest.java @@ -62,7 +62,7 @@ public class VerifyCardDataTest { private static final Logger logger = Logger.getLogger(VerifyCardDataTest.class); - private static final String FULL_ABILITIES_CHECK_SET_CODE = "KHC"; // check all abilities and output cards with wrong abilities texts; + private static final String FULL_ABILITIES_CHECK_SET_CODE = "ALA"; // check all abilities and output cards with wrong abilities texts; private static final boolean AUTO_FIX_SAMPLE_DECKS = false; // debug only: auto-fix sample decks by test_checkSampleDecks test run private static final boolean ONLY_TEXT = false; // use when checking text locally, suppresses unnecessary checks and output messages diff --git a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java index 5eab8fc988..0f6d338f20 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CreateTokenEffect.java @@ -118,11 +118,12 @@ public class CreateTokenEffect extends OneShotEffect { } StringBuilder sb = new StringBuilder("create "); if (amount.toString().equals("1")) { - sb.append("a "); if (tapped && !attacking) { - sb.append("tapped "); + sb.append("a tapped "); + sb.append(token.getDescription()); + } else { + sb.append(CardUtil.addArticle(token.getDescription())); } - sb.append(token.getDescription()); } else { sb.append(CardUtil.numberToText(amount.toString())).append(' '); if (tapped && !attacking) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java index 291813d913..98cc806c65 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/DestroyAllControlledTargetEffect.java @@ -1,26 +1,23 @@ - - package mage.abilities.effects.common; -import mage.constants.Outcome; import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; +import mage.constants.Outcome; import mage.filter.FilterPermanent; import mage.game.Game; import mage.game.permanent.Permanent; /** - * * @author BetaSteward_at_googlemail.com */ public class DestroyAllControlledTargetEffect extends OneShotEffect { - private FilterPermanent filter; + private final FilterPermanent filter; public DestroyAllControlledTargetEffect(FilterPermanent filter) { super(Outcome.DestroyPermanent); this.filter = filter; - staticText = "Destroy all " + filter.getMessage() + " controlled by target player"; + staticText = "Destroy all " + filter.getMessage() + " target player controls"; } public DestroyAllControlledTargetEffect(final DestroyAllControlledTargetEffect effect) { @@ -35,10 +32,9 @@ public class DestroyAllControlledTargetEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { + for (Permanent permanent : game.getBattlefield().getAllActivePermanents(filter, source.getFirstTarget(), game)) { permanent.destroy(source, game, false); } return true; } - } diff --git a/Mage/src/main/java/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java index d5407da7b0..4ff98626cd 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/MayTapOrUntapTargetEffect.java @@ -51,7 +51,8 @@ public class MayTapOrUntapTargetEffect extends OneShotEffect { if (mode.getTargets().isEmpty()) { return "you may tap or untap it"; } else { - return "you may tap or untap target " + mode.getTargets().get(0).getTargetName(); + String targetName = mode.getTargets().get(0).getTargetName(); + return "you may tap or untap " + (targetName.contains("target") ? "" : "target ") + targetName; } } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/MillCardsTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/MillCardsTargetEffect.java index bc3d768524..34daa5d11b 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/MillCardsTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/MillCardsTargetEffect.java @@ -51,11 +51,12 @@ public class MillCardsTargetEffect extends OneShotEffect { if (staticText != null && !staticText.isEmpty()) { return staticText; } - StringBuilder sb = new StringBuilder("target "); + StringBuilder sb = new StringBuilder(); if (!mode.getTargets().isEmpty()) { + sb.append("target "); sb.append(mode.getTargets().get(0).getTargetName()); } else { - sb.append("player"); + sb.append("that player"); } sb.append(" mills "); if (numberCards.toString().equals("1")) { diff --git a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandFromBattlefieldAllEffect.java b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandFromBattlefieldAllEffect.java index 679b857829..67c7477194 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandFromBattlefieldAllEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/ReturnToHandFromBattlefieldAllEffect.java @@ -24,7 +24,7 @@ public class ReturnToHandFromBattlefieldAllEffect extends OneShotEffect { public ReturnToHandFromBattlefieldAllEffect(FilterPermanent filter) { super(Outcome.ReturnToHand); this.filter = filter; - staticText = "Return all " + filter.getMessage() + " to their owners' hands"; + staticText = "return all " + filter.getMessage() + " to their owners' hands"; } public ReturnToHandFromBattlefieldAllEffect(final ReturnToHandFromBattlefieldAllEffect effect) { diff --git a/Mage/src/main/java/mage/game/permanent/token/ThopterToken.java b/Mage/src/main/java/mage/game/permanent/token/ThopterToken.java index f422785dc9..8d0a8d501c 100644 --- a/Mage/src/main/java/mage/game/permanent/token/ThopterToken.java +++ b/Mage/src/main/java/mage/game/permanent/token/ThopterToken.java @@ -13,7 +13,7 @@ import mage.abilities.keyword.FlyingAbility; public final class ThopterToken extends TokenImpl { public ThopterToken() { - super("Thopter", "1/1 blue Thopter artifact creature tokens with flying"); + super("Thopter", "1/1 blue Thopter artifact creature token with flying"); cardType.add(CardType.CREATURE); cardType.add(CardType.ARTIFACT); color.setBlue(true); diff --git a/Mage/src/main/java/mage/util/CardUtil.java b/Mage/src/main/java/mage/util/CardUtil.java index 7d39d184c2..4ef5a53407 100644 --- a/Mage/src/main/java/mage/util/CardUtil.java +++ b/Mage/src/main/java/mage/util/CardUtil.java @@ -948,7 +948,7 @@ public final class CardUtil { } } - private static final String vowels = "aeiouAEIOU"; + private static final String vowels = "aeiouAEIOU8"; public static String addArticle(String text) { if (text.startsWith("a ")