diff --git a/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java b/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java index 15313ce5fd..c505455aa1 100644 --- a/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java +++ b/Mage.Sets/src/mage/cards/a/AcrobaticManeuver.java @@ -22,10 +22,10 @@ public final class AcrobaticManeuver extends CardImpl { // Exile target creature you control, then return that card to the battlefield under its owner's control. this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent()); this.getSpellAbility().addEffect(new ExileTargetForSourceEffect()); - this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false)); + this.getSpellAbility().addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false).concatBy(",")); // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("
")); } private AcrobaticManeuver(final AcrobaticManeuver card) { diff --git a/Mage.Sets/src/mage/cards/a/AetherfluxReservoir.java b/Mage.Sets/src/mage/cards/a/AetherfluxReservoir.java index 4dc5ac6b8f..99f02213fd 100644 --- a/Mage.Sets/src/mage/cards/a/AetherfluxReservoir.java +++ b/Mage.Sets/src/mage/cards/a/AetherfluxReservoir.java @@ -1,7 +1,5 @@ - package mage.cards.a; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; @@ -10,31 +8,30 @@ import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.effects.Effect; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.GainLifeEffect; -import mage.abilities.hint.ValueHint; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; import mage.game.Game; import mage.target.common.TargetAnyTarget; import mage.watchers.common.CastSpellLastTurnWatcher; +import java.util.UUID; + /** - * * @author emerald000 */ public final class AetherfluxReservoir extends CardImpl { public AetherfluxReservoir(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{4}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{4}"); // Whenever you cast a spell, you gain 1 life for each spell you've cast this turn. - Ability abilityGainLife = new SpellCastControllerTriggeredAbility(new GainLifeEffect(new AetherfluxReservoirDynamicValue()), false); - abilityGainLife.addHint(new ValueHint("You've cast spells this turn", new AetherfluxReservoirDynamicValue())); - this.addAbility(abilityGainLife); + this.addAbility(new SpellCastControllerTriggeredAbility(new GainLifeEffect( + AetherfluxReservoirDynamicValue.instance, "you gain 1 life for each spell you've cast this turn" + ), false)); // Pay 50 life: Aetherflux Reservoir deals 50 damage to any target. - Ability abilityPayLife = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(50), new PayLifeCost(50)); + Ability abilityPayLife = new SimpleActivatedAbility(new DamageTargetEffect(50), new PayLifeCost(50)); abilityPayLife.addTarget(new TargetAnyTarget()); this.addAbility(abilityPayLife); } @@ -49,20 +46,20 @@ public final class AetherfluxReservoir extends CardImpl { } } -class AetherfluxReservoirDynamicValue implements DynamicValue { +enum AetherfluxReservoirDynamicValue implements DynamicValue { + instance; @Override public int calculate(Game game, Ability sourceAbility, Effect effect) { - CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class); - if(watcher != null) { - return watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId()); - } - return 0; + return game + .getState() + .getWatcher(CastSpellLastTurnWatcher.class) + .getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId()); } @Override public AetherfluxReservoirDynamicValue copy() { - return new AetherfluxReservoirDynamicValue(); + return this; } @Override @@ -74,5 +71,4 @@ class AetherfluxReservoirDynamicValue implements DynamicValue { public String getMessage() { return "spell you've cast this turn"; } - } \ No newline at end of file diff --git a/Mage.Sets/src/mage/cards/b/BuiltToLast.java b/Mage.Sets/src/mage/cards/b/BuiltToLast.java index 470831846d..40ed0f96d7 100644 --- a/Mage.Sets/src/mage/cards/b/BuiltToLast.java +++ b/Mage.Sets/src/mage/cards/b/BuiltToLast.java @@ -28,7 +28,7 @@ public final class BuiltToLast extends CardImpl { this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new LockedInCondition(new TargetHasCardTypeCondition(CardType.ARTIFACT)), - "If its an artifact creature, it gains indestructible until end of turn")); + "If it's an artifact creature, it gains indestructible until end of turn")); } diff --git a/Mage.Sets/src/mage/cards/b/BuiltToSmash.java b/Mage.Sets/src/mage/cards/b/BuiltToSmash.java index 90664118ba..2ed5b93798 100644 --- a/Mage.Sets/src/mage/cards/b/BuiltToSmash.java +++ b/Mage.Sets/src/mage/cards/b/BuiltToSmash.java @@ -28,7 +28,7 @@ public final class BuiltToSmash extends CardImpl { this.getSpellAbility().addTarget(new TargetAttackingCreature()); this.getSpellAbility().addEffect(new ConditionalContinuousEffect( new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn), new LockedInCondition(new TargetHasCardTypeCondition(CardType.ARTIFACT)), - "If its an artifact creature, it gains trample until end of turn")); + "If it's an artifact creature, it gains trample until end of turn")); } private BuiltToSmash(final BuiltToSmash card) { diff --git a/Mage.Sets/src/mage/cards/c/ContrabandKingpin.java b/Mage.Sets/src/mage/cards/c/ContrabandKingpin.java index b32c69e4b5..696bd8569b 100644 --- a/Mage.Sets/src/mage/cards/c/ContrabandKingpin.java +++ b/Mage.Sets/src/mage/cards/c/ContrabandKingpin.java @@ -1,26 +1,25 @@ package mage.cards.c; -import java.util.UUID; import mage.MageInt; -import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.effects.keyword.ScryEffect; import mage.abilities.keyword.LifelinkAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.Zone; -import mage.filter.common.FilterControlledArtifactPermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author fireshoes */ public final class ContrabandKingpin extends CardImpl { public ContrabandKingpin(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}{B}"); this.subtype.add(SubType.AETHERBORN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(1); @@ -30,7 +29,10 @@ public final class ContrabandKingpin extends CardImpl { this.addAbility(LifelinkAbility.getInstance()); // Whenever an artifact enters the battlefield under your control, scry 1. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new ScryEffect(1, false), new FilterControlledArtifactPermanent(), false, null, true)); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility( + new ScryEffect(1, false), + StaticFilters.FILTER_PERMANENT_ARTIFACT_AN + )); } private ContrabandKingpin(final ContrabandKingpin card) { diff --git a/Mage.Sets/src/mage/cards/d/DurableHandicraft.java b/Mage.Sets/src/mage/cards/d/DurableHandicraft.java index 16b8d2e76b..1ea08e05af 100644 --- a/Mage.Sets/src/mage/cards/d/DurableHandicraft.java +++ b/Mage.Sets/src/mage/cards/d/DurableHandicraft.java @@ -1,14 +1,11 @@ - package mage.cards.d; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.ManaCostsImpl; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.counter.AddCountersAllEffect; import mage.abilities.effects.common.counter.AddCountersTargetEffect; @@ -18,27 +15,33 @@ import mage.constants.CardType; import mage.constants.SetTargetPointer; import mage.constants.Zone; import mage.counters.CounterType; -import mage.filter.common.FilterControlledCreaturePermanent; +import mage.filter.StaticFilters; + +import java.util.UUID; /** - * * @author spjspj */ public final class DurableHandicraft extends CardImpl { public DurableHandicraft(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{G}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}"); // Whenever a creature enters the battlefield under your control, you may pay {1}. If you do, put a +1/+1 counter on that creature. - Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance()); - effect.setText("put a +1/+1 counter on that creature"); - DoIfCostPaid doIfCostPaid = new DoIfCostPaid(effect, new GenericManaCost(1)); - this.addAbility(new EntersBattlefieldControlledTriggeredAbility(Zone.BATTLEFIELD, doIfCostPaid, new FilterControlledCreaturePermanent(), false, SetTargetPointer.PERMANENT, null)); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility( + Zone.BATTLEFIELD, + new DoIfCostPaid( + new AddCountersTargetEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on that creature"), + new GenericManaCost(1) + ), StaticFilters.FILTER_PERMANENT_A_CREATURE, + false, SetTargetPointer.PERMANENT, null + )); // {5}{G}, Sacrifice Durable Handicraft: Put a +1/+1 counter on each creature you control. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, - new AddCountersAllEffect(CounterType.P1P1.createInstance(), new FilterControlledCreaturePermanent()), - new ManaCostsImpl("{5}{G}")); + Ability ability = new SimpleActivatedAbility(new AddCountersAllEffect( + CounterType.P1P1.createInstance(), StaticFilters.FILTER_CONTROLLED_CREATURE + ), new ManaCostsImpl<>("{5}{G}")); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } @@ -52,4 +55,3 @@ public final class DurableHandicraft extends CardImpl { return new DurableHandicraft(this); } } - diff --git a/Mage.Sets/src/mage/cards/d/DynavoltTower.java b/Mage.Sets/src/mage/cards/d/DynavoltTower.java index b0ef2837da..33bec51000 100644 --- a/Mage.Sets/src/mage/cards/d/DynavoltTower.java +++ b/Mage.Sets/src/mage/cards/d/DynavoltTower.java @@ -1,7 +1,5 @@ - package mage.cards.d; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SpellCastControllerTriggeredAbility; @@ -12,24 +10,27 @@ import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.Zone; -import mage.filter.common.FilterInstantOrSorcerySpell; +import mage.filter.StaticFilters; import mage.target.common.TargetAnyTarget; +import java.util.UUID; + /** - * * @author emerald000 */ public final class DynavoltTower extends CardImpl { public DynavoltTower(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}"); // Whenever you cast an instant or sorcery spell, you get {E}{E}. - this.addAbility(new SpellCastControllerTriggeredAbility(new GetEnergyCountersControllerEffect(2), new FilterInstantOrSorcerySpell(), false)); + this.addAbility(new SpellCastControllerTriggeredAbility( + new GetEnergyCountersControllerEffect(2), + StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false + )); // {T}, Pay {E}{E}{E}{E}{E}: Dynavolt Tower deals 3 damage to any target. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(3), new TapSourceCost()); + Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(3), new TapSourceCost()); ability.addCost(new PayEnergyCost(5)); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); diff --git a/Mage.Sets/src/mage/cards/e/ElectrostaticPummeler.java b/Mage.Sets/src/mage/cards/e/ElectrostaticPummeler.java index 751da4b24c..d339d06c9a 100644 --- a/Mage.Sets/src/mage/cards/e/ElectrostaticPummeler.java +++ b/Mage.Sets/src/mage/cards/e/ElectrostaticPummeler.java @@ -1,29 +1,31 @@ package mage.cards.e; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.PayEnergyCost; +import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.SourcePermanentPowerCount; import mage.abilities.effects.common.continuous.BoostSourceEffect; import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect; 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 java.util.UUID; /** - * * @author emerald000 */ public final class ElectrostaticPummeler extends CardImpl { + private static final DynamicValue xValue = new SourcePermanentPowerCount(false); + public ElectrostaticPummeler(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{3}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}"); this.subtype.add(SubType.CONSTRUCT); this.power = new MageInt(1); this.toughness = new MageInt(1); @@ -32,7 +34,9 @@ public final class ElectrostaticPummeler extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(3))); // Pay {E}{E}{E}: Electrostatic Pummeler gets +X/+X until end of turn, where X is its power. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(new SourcePermanentPowerCount(), new SourcePermanentPowerCount(), Duration.EndOfTurn, true), new PayEnergyCost(3))); + this.addAbility(new SimpleActivatedAbility(new BoostSourceEffect( + xValue, xValue, Duration.EndOfTurn, true + ).setText("{this} gets +X/+X until end of turn, where X is its power"), new PayEnergyCost(3))); } private ElectrostaticPummeler(final ElectrostaticPummeler card) { diff --git a/Mage.Sets/src/mage/cards/e/EmpyrealVoyager.java b/Mage.Sets/src/mage/cards/e/EmpyrealVoyager.java index 9505b19c6d..abe6812565 100644 --- a/Mage.Sets/src/mage/cards/e/EmpyrealVoyager.java +++ b/Mage.Sets/src/mage/cards/e/EmpyrealVoyager.java @@ -52,7 +52,7 @@ class EmpyrealVoyagerEffect extends OneShotEffect { public EmpyrealVoyagerEffect() { super(Outcome.Benefit); - this.staticText = "get that many {E} counters"; + this.staticText = "you get that many {E}"; } public EmpyrealVoyagerEffect(final EmpyrealVoyagerEffect effect) { diff --git a/Mage.Sets/src/mage/cards/e/EraOfInnovation.java b/Mage.Sets/src/mage/cards/e/EraOfInnovation.java index fc8cf276e5..4d52e9eac1 100644 --- a/Mage.Sets/src/mage/cards/e/EraOfInnovation.java +++ b/Mage.Sets/src/mage/cards/e/EraOfInnovation.java @@ -1,14 +1,11 @@ - package mage.cards.e; -import java.util.UUID; import mage.abilities.Ability; -import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; +import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.costs.common.PayEnergyCost; import mage.abilities.costs.common.SacrificeSourceCost; import mage.abilities.costs.mana.GenericManaCost; -import mage.abilities.effects.Effect; import mage.abilities.effects.common.DoIfCostPaid; import mage.abilities.effects.common.DrawCardSourceControllerEffect; import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect; @@ -16,17 +13,18 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; -import mage.constants.Zone; +import mage.filter.FilterPermanent; import mage.filter.common.FilterControlledPermanent; import mage.filter.predicate.Predicates; +import java.util.UUID; + /** - * * @author fireshoes */ public final class EraOfInnovation extends CardImpl { - private static final FilterControlledPermanent filter = new FilterControlledPermanent("an artifact or Artificer"); + private static final FilterPermanent filter = new FilterControlledPermanent("an artifact or Artificer"); static { filter.add(Predicates.or(CardType.ARTIFACT.getPredicate(), @@ -34,15 +32,15 @@ public final class EraOfInnovation extends CardImpl { } public EraOfInnovation(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}"); // Whenever an artifact or Artificer enters the battlefield under you control, you may pay {1}. If you do, you get {E}{E}. - Effect effect = new DoIfCostPaid(new GetEnergyCountersControllerEffect(2), new GenericManaCost(1)); - this.addAbility(new EntersBattlefieldAllTriggeredAbility(effect, filter, - "Whenever an artifact or Artificer enters the battlefield under you control, you may pay {1}. If you do, you get {E}{E}.")); + this.addAbility(new EntersBattlefieldControlledTriggeredAbility(new DoIfCostPaid( + new GetEnergyCountersControllerEffect(2), new GenericManaCost(1) + ), filter)); // {E}{E}{E}{E}{E}{E}, Sacrifice Era of Innovation: Draw three cards. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(3), new PayEnergyCost(6)); + Ability ability = new SimpleActivatedAbility(new DrawCardSourceControllerEffect(3), new PayEnergyCost(6)); ability.addCost(new SacrificeSourceCost()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/f/FleetwheelCruiser.java b/Mage.Sets/src/mage/cards/f/FleetwheelCruiser.java index eab6593b27..504a212f33 100644 --- a/Mage.Sets/src/mage/cards/f/FleetwheelCruiser.java +++ b/Mage.Sets/src/mage/cards/f/FleetwheelCruiser.java @@ -1,7 +1,5 @@ - package mage.cards.f; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.common.continuous.AddCardTypeSourceEffect; @@ -14,8 +12,9 @@ import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; +import java.util.UUID; + /** - * * @author emerald000 */ public final class FleetwheelCruiser extends CardImpl { @@ -33,8 +32,9 @@ public final class FleetwheelCruiser extends CardImpl { this.addAbility(HasteAbility.getInstance()); // When Fleetwheel Cruiser enters the battlefield, it becomes an artifact creature until the end of turn. - this.addAbility(new EntersBattlefieldTriggeredAbility( - new AddCardTypeSourceEffect(Duration.EndOfTurn, CardType.ARTIFACT, CardType.CREATURE))); + this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCardTypeSourceEffect( + Duration.EndOfTurn, CardType.ARTIFACT, CardType.CREATURE + ).setText("it becomes an artifact creature until end of turn"))); // Crew 2 this.addAbility(new CrewAbility(2)); diff --git a/Mage.Sets/src/mage/cards/f/FortuitousFind.java b/Mage.Sets/src/mage/cards/f/FortuitousFind.java index 6dd23eab94..eac793b0a7 100644 --- a/Mage.Sets/src/mage/cards/f/FortuitousFind.java +++ b/Mage.Sets/src/mage/cards/f/FortuitousFind.java @@ -1,10 +1,11 @@ package mage.cards.f; import mage.abilities.Mode; -import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; +import mage.filter.FilterCard; import mage.filter.StaticFilters; import mage.filter.common.FilterArtifactCard; import mage.target.common.TargetCardInYourGraveyard; @@ -16,6 +17,8 @@ import java.util.UUID; */ public final class FortuitousFind extends CardImpl { + private static final FilterCard filter = new FilterArtifactCard("artifact card from your graveyard"); + public FortuitousFind(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{2}{B}"); @@ -24,12 +27,12 @@ public final class FortuitousFind extends CardImpl { this.getSpellAbility().getModes().setMaxModes(2); // Return target artifact card from your graveyard to your hand.; - this.getSpellAbility().addEffect(new ReturnToHandTargetEffect()); - this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterArtifactCard("artifact card from your graveyard")).withChooseHint("return to hand")); + this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect()); + this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter).withChooseHint("return to hand")); // or Return target creature card from your graveyard to your hand. Mode mode = new Mode(); - mode.addEffect(new ReturnToHandTargetEffect()); + mode.addEffect(new ReturnFromGraveyardToHandTargetEffect()); mode.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE_YOUR_GRAVEYARD).withChooseHint("return to hand")); this.getSpellAbility().addMode(mode); } diff --git a/Mage.Sets/src/mage/cards/g/GhirapurGuide.java b/Mage.Sets/src/mage/cards/g/GhirapurGuide.java index c6c7a27c84..b3f8418649 100644 --- a/Mage.Sets/src/mage/cards/g/GhirapurGuide.java +++ b/Mage.Sets/src/mage/cards/g/GhirapurGuide.java @@ -1,7 +1,5 @@ - package mage.cards.g; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -10,16 +8,16 @@ import mage.abilities.effects.common.combat.CantBeBlockedByAllTargetEffect; 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.constants.SubType; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.mageobject.PowerPredicate; -import mage.target.common.TargetCreaturePermanent; +import mage.target.common.TargetControlledCreaturePermanent; + +import java.util.UUID; /** - * * @author fireshoes */ public final class GhirapurGuide extends CardImpl { @@ -31,15 +29,17 @@ public final class GhirapurGuide extends CardImpl { } public GhirapurGuide(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.ELF); this.subtype.add(SubType.SCOUT); this.power = new MageInt(3); this.toughness = new MageInt(2); // {2}{G}: Target creature you control can't be blocked by creatures with power 2 or less this turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantBeBlockedByAllTargetEffect(filter, Duration.EndOfTurn), new ManaCostsImpl("{2}{G}")); - ability.addTarget(new TargetCreaturePermanent()); + Ability ability = new SimpleActivatedAbility( + new CantBeBlockedByAllTargetEffect(filter, Duration.EndOfTurn), new ManaCostsImpl<>("{2}{G}") + ); + ability.addTarget(new TargetControlledCreaturePermanent()); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/h/HazardousConditions.java b/Mage.Sets/src/mage/cards/h/HazardousConditions.java index 88395f599d..505857f9c9 100644 --- a/Mage.Sets/src/mage/cards/h/HazardousConditions.java +++ b/Mage.Sets/src/mage/cards/h/HazardousConditions.java @@ -1,4 +1,3 @@ - package mage.cards.h; import mage.abilities.effects.common.continuous.BoostAllEffect; @@ -17,7 +16,7 @@ import java.util.UUID; */ public final class HazardousConditions extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with no counter"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures with no counters on them"); static { filter.add(Predicates.not(CounterAnyPredicate.instance)); diff --git a/Mage.Sets/src/mage/cards/i/InventorsGoggles.java b/Mage.Sets/src/mage/cards/i/InventorsGoggles.java index 0f0b6fb10d..345b171287 100644 --- a/Mage.Sets/src/mage/cards/i/InventorsGoggles.java +++ b/Mage.Sets/src/mage/cards/i/InventorsGoggles.java @@ -1,7 +1,5 @@ - package mage.cards.i; -import java.util.UUID; import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; import mage.abilities.costs.mana.GenericManaCost; @@ -13,27 +11,27 @@ import mage.cards.CardSetInfo; import mage.constants.*; import mage.filter.FilterPermanent; +import java.util.UUID; + /** - * * @author emerald000 */ public final class InventorsGoggles extends CardImpl { + private static final FilterPermanent filter = new FilterPermanent(SubType.ARTIFICER, "an Artificer"); + public InventorsGoggles(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}"); this.subtype.add(SubType.EQUIPMENT); // Equipped creature gets +1/+2. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 2, Duration.WhileOnBattlefield))); + this.addAbility(new SimpleStaticAbility(new BoostEquippedEffect(1, 2, Duration.WhileOnBattlefield))); // Whenever an Artificer enters the battlefield under your control, you may attach Inventor's Goggles to it. this.addAbility(new EntersBattlefieldControlledTriggeredAbility( - Zone.BATTLEFIELD, - new AttachEffect(Outcome.BoostCreature, "attach {this} to it"), - new FilterPermanent(SubType.ARTIFICER, "Artificer"), - true, - SetTargetPointer.PERMANENT, - null)); + Zone.BATTLEFIELD, new AttachEffect(Outcome.BoostCreature, "attach {this} to it"), + filter, true, SetTargetPointer.PERMANENT, null + )); // Equip {2} this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2))); diff --git a/Mage.Sets/src/mage/cards/l/LiberatingCombustion.java b/Mage.Sets/src/mage/cards/l/LiberatingCombustion.java index 939aabfa81..56d2c4efe9 100644 --- a/Mage.Sets/src/mage/cards/l/LiberatingCombustion.java +++ b/Mage.Sets/src/mage/cards/l/LiberatingCombustion.java @@ -1,7 +1,5 @@ - package mage.cards.l; -import java.util.UUID; import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.search.SearchLibraryGraveyardPutInHandEffect; import mage.cards.CardImpl; @@ -11,8 +9,9 @@ import mage.filter.FilterCard; import mage.filter.predicate.mageobject.NamePredicate; import mage.target.common.TargetCreaturePermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class LiberatingCombustion extends CardImpl { @@ -29,9 +28,9 @@ public final class LiberatingCombustion extends CardImpl { // Liberating Combustion deals 6 damage to target creature. this.getSpellAbility().addEffect(new DamageTargetEffect(6)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); - + // You may search your library and/or graveyard for a card named Chandra, Pyrogenius, reveal it, and put it into your hand. If you search your library this way, shuffle it. - this.getSpellAbility().addEffect(new SearchLibraryGraveyardPutInHandEffect(filter)); + this.getSpellAbility().addEffect(new SearchLibraryGraveyardPutInHandEffect(filter, false, true)); } private LiberatingCombustion(final LiberatingCombustion card) { diff --git a/Mage.Sets/src/mage/cards/m/Malfunction.java b/Mage.Sets/src/mage/cards/m/Malfunction.java index 76e452d221..0c124b02ed 100644 --- a/Mage.Sets/src/mage/cards/m/Malfunction.java +++ b/Mage.Sets/src/mage/cards/m/Malfunction.java @@ -1,7 +1,5 @@ - package mage.cards.m; -import java.util.UUID; import mage.abilities.Ability; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.SimpleStaticAbility; @@ -12,15 +10,16 @@ import mage.abilities.keyword.EnchantAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; -import mage.constants.SubType; import mage.constants.Outcome; +import mage.constants.SubType; import mage.constants.Zone; import mage.filter.FilterPermanent; import mage.filter.predicate.Predicates; import mage.target.TargetPermanent; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class Malfunction extends CardImpl { @@ -34,7 +33,7 @@ public final class Malfunction extends CardImpl { } public Malfunction(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}"); + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}"); this.subtype.add(SubType.AURA); // Enchant artifact or creature. @@ -45,7 +44,7 @@ public final class Malfunction extends CardImpl { this.addAbility(ability); // When Malfunction enters the battlefield, tap enchanted permanent. - this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect())); + this.addAbility(new EntersBattlefieldTriggeredAbility(new TapEnchantedEffect().setText("tap enchanted permanent"))); // Enchanted permanent doesn't untap during its controller's untap step. this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new DontUntapInControllersUntapStepEnchantedEffect("permanent"))); diff --git a/Mage.Sets/src/mage/cards/m/MasterTrinketeer.java b/Mage.Sets/src/mage/cards/m/MasterTrinketeer.java index 62dbdf42c7..ca21dfa78a 100644 --- a/Mage.Sets/src/mage/cards/m/MasterTrinketeer.java +++ b/Mage.Sets/src/mage/cards/m/MasterTrinketeer.java @@ -1,7 +1,5 @@ - package mage.cards.m; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleStaticAbility; @@ -13,36 +11,42 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Duration; import mage.constants.SubType; -import mage.constants.Zone; import mage.filter.common.FilterCreaturePermanent; import mage.filter.predicate.Predicates; import mage.game.permanent.token.ServoToken; +import java.util.UUID; + /** - * * @author fireshoes */ public final class MasterTrinketeer extends CardImpl { - private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Servo and Thopter creatures"); + private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Servos and Thopters"); static { - filter.add(Predicates.or(SubType.SERVO.getPredicate(), - SubType.THOPTER.getPredicate())); + filter.add(Predicates.or( + SubType.SERVO.getPredicate(), + SubType.THOPTER.getPredicate() + )); } public MasterTrinketeer(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.DWARF); this.subtype.add(SubType.ARTIFICER); this.power = new MageInt(3); this.toughness = new MageInt(2); // Servo and Thopter creatures you control get +1/+1. - this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, false))); + this.addAbility(new SimpleStaticAbility(new BoostControlledEffect( + 1, 1, Duration.WhileOnBattlefield, filter, false + ))); // {3}{W}: Create a 1/1 colorless Servo artifact creature token. - this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new ServoToken(), 1), new ManaCostsImpl("{3}{W}"))); + this.addAbility(new SimpleActivatedAbility( + new CreateTokenEffect(new ServoToken(), 1), new ManaCostsImpl<>("{3}{W}") + )); } private MasterTrinketeer(final MasterTrinketeer card) { diff --git a/Mage.Sets/src/mage/cards/m/MidnightOil.java b/Mage.Sets/src/mage/cards/m/MidnightOil.java index 97280100ae..5e064df5f9 100644 --- a/Mage.Sets/src/mage/cards/m/MidnightOil.java +++ b/Mage.Sets/src/mage/cards/m/MidnightOil.java @@ -38,7 +38,8 @@ public final class MidnightOil extends CardImpl { // At the beginning of your draw step, draw an additional card and remove two hour counters from Midnight Oil. Ability ability = new BeginningOfDrawTriggeredAbility( - new DrawCardSourceControllerEffect(1), + new DrawCardSourceControllerEffect(1) + .setText("draw an additional card"), TargetController.YOU, false ); ability.addEffect(new RemoveCounterSourceEffect( diff --git a/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java b/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java index fb9927141e..f7bb433f72 100644 --- a/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java +++ b/Mage.Sets/src/mage/cards/n/NissaNaturesArtisan.java @@ -1,34 +1,24 @@ package mage.cards.n; -import java.util.LinkedHashSet; -import java.util.Set; -import java.util.UUID; import mage.MageObject; import mage.abilities.Ability; import mage.abilities.LoyaltyAbility; -import mage.abilities.effects.Effect; import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.continuous.BoostControlledEffect; import mage.abilities.effects.common.continuous.GainAbilityControlledEffect; import mage.abilities.keyword.TrampleAbility; -import mage.cards.Card; -import mage.cards.CardImpl; -import mage.cards.CardSetInfo; -import mage.cards.Cards; -import mage.cards.CardsImpl; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.Outcome; -import mage.constants.SuperType; -import mage.constants.Zone; +import mage.cards.*; +import mage.constants.*; import mage.filter.common.FilterLandCard; import mage.game.Game; import mage.players.Player; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.UUID; + /** - * * @author fireshoes */ public final class NissaNaturesArtisan extends CardImpl { @@ -48,13 +38,12 @@ public final class NissaNaturesArtisan extends CardImpl { this.addAbility(new LoyaltyAbility(new NissaNaturesArtisanEffect(), -4)); // -12: Creatures you control get +5/+5 and gain trample until end of turn. - Effect effect = new BoostControlledEffect(5, 5, Duration.EndOfTurn); - effect.setText("Creature you control get +5/+5"); - LoyaltyAbility ability = new LoyaltyAbility(effect, -12); - Effect effect2 = new GainAbilityControlledEffect( - TrampleAbility.getInstance(), Duration.EndOfTurn); - effect2.setText("and gain trample until end of turn"); - ability.addEffect(effect2); + LoyaltyAbility ability = new LoyaltyAbility(new BoostControlledEffect( + 5, 5, Duration.EndOfTurn + ).setText("creatures you control get +5/+5"), -12); + ability.addEffect(new GainAbilityControlledEffect( + TrampleAbility.getInstance(), Duration.EndOfTurn + ).setText("and gain trample until end of turn")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/n/NissaVitalForce.java b/Mage.Sets/src/mage/cards/n/NissaVitalForce.java index a6f68fbb60..6ad1c2dece 100644 --- a/Mage.Sets/src/mage/cards/n/NissaVitalForce.java +++ b/Mage.Sets/src/mage/cards/n/NissaVitalForce.java @@ -1,21 +1,17 @@ package mage.cards.n; -import java.util.UUID; import mage.MageInt; import mage.abilities.LoyaltyAbility; import mage.abilities.effects.common.GetEmblemEffect; -import mage.abilities.effects.common.ReturnToHandTargetEffect; +import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect; import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect; import mage.abilities.keyword.HasteAbility; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.Duration; -import mage.constants.SuperType; -import mage.constants.TargetController; +import mage.constants.*; +import mage.filter.FilterCard; import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterPermanentCard; import mage.game.command.emblems.NissaVitalForceEmblem; @@ -23,13 +19,15 @@ import mage.game.permanent.token.TokenImpl; import mage.target.common.TargetCardInYourGraveyard; import mage.target.common.TargetLandPermanent; +import java.util.UUID; + /** - * * @author fireshoes */ public final class NissaVitalForce extends CardImpl { private static final FilterLandPermanent filter = new FilterLandPermanent("land you control"); + private static final FilterCard filter2 = new FilterPermanentCard("permanent card from your graveyard"); static { filter.add(TargetController.YOU.getControllerPredicate()); @@ -44,13 +42,15 @@ public final class NissaVitalForce extends CardImpl { // +1: Untap target land you control. Until your next turn, it becomes a 5/5 Elemental creature with haste. It's still a land. LoyaltyAbility ability = new LoyaltyAbility(new UntapTargetEffect(), 1); - ability.addEffect(new BecomesCreatureTargetEffect(new NissaVitalForceToken(), false, true, Duration.UntilYourNextTurn)); + ability.addEffect(new BecomesCreatureTargetEffect( + new NissaVitalForceToken(), false, true, Duration.UntilYourNextTurn + ).setText("Until your next turn, it becomes a 5/5 Elemental creature with haste. It's still a land")); ability.addTarget(new TargetLandPermanent(filter)); this.addAbility(ability); // -3: Return target permanent card from your graveyard to your hand. - ability = new LoyaltyAbility(new ReturnToHandTargetEffect(), -3); - ability.addTarget(new TargetCardInYourGraveyard(new FilterPermanentCard("permanent card from your graveyard"))); + ability = new LoyaltyAbility(new ReturnFromGraveyardToHandTargetEffect(), -3); + ability.addTarget(new TargetCardInYourGraveyard(filter2)); this.addAbility(ability); // -6: You get an emblem with "Whenever a land enters the battlefield under your control, you may draw a card." @@ -78,6 +78,7 @@ class NissaVitalForceToken extends TokenImpl { this.toughness = new MageInt(5); this.addAbility(HasteAbility.getInstance()); } + public NissaVitalForceToken(final NissaVitalForceToken token) { super(token); } diff --git a/Mage.Sets/src/mage/cards/o/OvalchaseDaredevil.java b/Mage.Sets/src/mage/cards/o/OvalchaseDaredevil.java index 0d8275d609..f6b336afc4 100644 --- a/Mage.Sets/src/mage/cards/o/OvalchaseDaredevil.java +++ b/Mage.Sets/src/mage/cards/o/OvalchaseDaredevil.java @@ -1,22 +1,17 @@ - package mage.cards.o; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldAllTriggeredAbility; -import mage.abilities.effects.common.ReturnToHandSourceEffect; +import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect; import mage.cards.CardImpl; import mage.cards.CardSetInfo; -import mage.constants.CardType; -import mage.constants.SubType; -import mage.constants.SetTargetPointer; -import mage.constants.TargetController; -import mage.constants.Zone; +import mage.constants.*; import mage.filter.FilterPermanent; import mage.filter.common.FilterArtifactPermanent; +import java.util.UUID; + /** - * * @author fireshoes */ public final class OvalchaseDaredevil extends CardImpl { @@ -35,7 +30,10 @@ public final class OvalchaseDaredevil extends CardImpl { this.toughness = new MageInt(2); // Whenever an artifact enters the battlefield under your control, you may return Ovalchase Daredevil from your graveyard to your hand. - this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.GRAVEYARD, new ReturnToHandSourceEffect(), filter, true, SetTargetPointer.NONE, null, true)); + this.addAbility(new EntersBattlefieldAllTriggeredAbility( + Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), filter, + true, SetTargetPointer.NONE, null, true + )); } private OvalchaseDaredevil(final OvalchaseDaredevil card) { diff --git a/Mage.Sets/src/mage/cards/p/PadeemConsulOfInnovation.java b/Mage.Sets/src/mage/cards/p/PadeemConsulOfInnovation.java index 61bdbaf9c5..5811908ffe 100644 --- a/Mage.Sets/src/mage/cards/p/PadeemConsulOfInnovation.java +++ b/Mage.Sets/src/mage/cards/p/PadeemConsulOfInnovation.java @@ -35,7 +35,7 @@ public final class PadeemConsulOfInnovation extends CardImpl { // Artifacts you control have hexproof. this.addAbility(new SimpleStaticAbility(new GainAbilityControlledEffect( HexproofAbility.getInstance(), Duration.WhileOnBattlefield, - StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACTS, false + StaticFilters.FILTER_PERMANENT_ARTIFACTS, false ))); // At the beginning of your upkeep, if you control the artifact with the highest converted mana cost or tied for the highest converted mana cost, draw a card. diff --git a/Mage.Sets/src/mage/cards/r/RenegadeTactics.java b/Mage.Sets/src/mage/cards/r/RenegadeTactics.java index e8fbb8dd6d..c9d30484b0 100644 --- a/Mage.Sets/src/mage/cards/r/RenegadeTactics.java +++ b/Mage.Sets/src/mage/cards/r/RenegadeTactics.java @@ -23,7 +23,7 @@ public final class RenegadeTactics extends CardImpl { this.getSpellAbility().addEffect(new CantBlockTargetEffect(Duration.EndOfTurn)); this.getSpellAbility().addTarget(new TargetCreaturePermanent()); // Draw a card. - this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1)); + this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1).concatBy("
")); } private RenegadeTactics(final RenegadeTactics card) { diff --git a/Mage.Sets/src/mage/cards/s/SaheelisArtistry.java b/Mage.Sets/src/mage/cards/s/SaheelisArtistry.java index 1edb601e2e..96137b07c5 100644 --- a/Mage.Sets/src/mage/cards/s/SaheelisArtistry.java +++ b/Mage.Sets/src/mage/cards/s/SaheelisArtistry.java @@ -30,7 +30,7 @@ public final class SaheelisArtistry extends CardImpl { Mode mode1 = new Mode(); effect = new CreateTokenCopyTargetEffect(); effect.setBecomesArtifact(true); - effect.setText("Create a token that's a copy of target creature, except that it's an artifact in addition to its other types"); + effect.setText("Create a token that's a copy of target creature, except it's an artifact in addition to its other types"); mode1.addEffect(effect); mode1.addTarget(new TargetCreaturePermanent().withChooseHint("create copy of that, artifact type")); this.getSpellAbility().addMode(mode1); diff --git a/Mage.Sets/src/mage/cards/s/ScrapheapScrounger.java b/Mage.Sets/src/mage/cards/s/ScrapheapScrounger.java index ab283fbae6..158189b471 100644 --- a/Mage.Sets/src/mage/cards/s/ScrapheapScrounger.java +++ b/Mage.Sets/src/mage/cards/s/ScrapheapScrounger.java @@ -1,7 +1,5 @@ - package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.CantBlockAbility; @@ -19,8 +17,9 @@ import mage.filter.common.FilterCreatureCard; import mage.filter.predicate.mageobject.AnotherCardPredicate; import mage.target.common.TargetCardInYourGraveyard; +import java.util.UUID; + /** - * * @author emerald000 */ public final class ScrapheapScrounger extends CardImpl { @@ -41,7 +40,7 @@ public final class ScrapheapScrounger extends CardImpl { this.addAbility(new CantBlockAbility()); // {1}{B}, Exile another creature card from your graveyard: Return Scrapheap Scrounger from your graveyard to the battlefield. - Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(false), new ManaCostsImpl<>("{1}{B}")); + Ability ability = new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToBattlefieldEffect(false, false), new ManaCostsImpl<>("{1}{B}")); ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(filter))); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/s/SelfAssembler.java b/Mage.Sets/src/mage/cards/s/SelfAssembler.java index f6b6170408..a2f0ab7751 100644 --- a/Mage.Sets/src/mage/cards/s/SelfAssembler.java +++ b/Mage.Sets/src/mage/cards/s/SelfAssembler.java @@ -1,7 +1,5 @@ - package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.effects.Effect; @@ -11,22 +9,24 @@ import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.SubType; import mage.filter.FilterCard; +import mage.filter.common.FilterCreatureCard; import mage.target.common.TargetCardInLibrary; +import java.util.UUID; + /** - * * @author fireshoes */ public final class SelfAssembler extends CardImpl { - private static final FilterCard filter = new FilterCard("an Assembly-Worker card"); + private static final FilterCard filter = new FilterCreatureCard("an Assembly-Worker creature card"); static { filter.add(SubType.ASSEMBLY_WORKER.getPredicate()); } public SelfAssembler(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT,CardType.CREATURE},"{5}"); + super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}"); this.subtype.add(SubType.ASSEMBLY_WORKER); this.power = new MageInt(4); this.toughness = new MageInt(4); @@ -34,7 +34,7 @@ public final class SelfAssembler extends CardImpl { // When Self-Assembler enters the battlefield, you may search your library for an Assembly-Worker creature card, reveal it, put it into your hand, // then shuffle your library. Effect effect = new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true, true); - effect.setText("you may search your library for an Assembly-Worker card, reveal it, put it into your hand, then shuffle"); + effect.setText("you may search your library for an Assembly-Worker creature card, reveal it, put it into your hand, then shuffle"); this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true)); } diff --git a/Mage.Sets/src/mage/cards/s/SyndicateTrafficker.java b/Mage.Sets/src/mage/cards/s/SyndicateTrafficker.java index 635823a020..d83a217ea9 100644 --- a/Mage.Sets/src/mage/cards/s/SyndicateTrafficker.java +++ b/Mage.Sets/src/mage/cards/s/SyndicateTrafficker.java @@ -1,7 +1,5 @@ - package mage.cards.s; -import java.util.UUID; import mage.MageInt; import mage.abilities.Ability; import mage.abilities.common.SimpleActivatedAbility; @@ -13,30 +11,34 @@ import mage.abilities.keyword.IndestructibleAbility; 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.counters.CounterType; -import mage.filter.common.FilterControlledArtifactPermanent; +import mage.filter.StaticFilters; import mage.target.common.TargetControlledPermanent; +import java.util.UUID; + /** - * * @author fireshoes */ public final class SyndicateTrafficker extends CardImpl { public SyndicateTrafficker(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.AETHERBORN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(3); this.toughness = new MageInt(1); // {1}, Sacrifice an artifact: Put a +1/+1 counter on Syndicate Trafficker. It gains indestructible until end of turn. - Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new GenericManaCost(1)); - ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(new FilterControlledArtifactPermanent("an artifact")))); - ability.addEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn)); + Ability ability = new SimpleActivatedAbility( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new GenericManaCost(1) + ); + ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_PERMANENT_ARTIFACT_AN))); + ability.addEffect(new GainAbilitySourceEffect( + IndestructibleAbility.getInstance(), Duration.EndOfTurn + ).setText("It gains indestructible until end of turn")); this.addAbility(ability); } diff --git a/Mage.Sets/src/mage/cards/t/ThrivingGrubs.java b/Mage.Sets/src/mage/cards/t/ThrivingGrubs.java index 4c8bc6f404..d77d4dcc4a 100644 --- a/Mage.Sets/src/mage/cards/t/ThrivingGrubs.java +++ b/Mage.Sets/src/mage/cards/t/ThrivingGrubs.java @@ -1,7 +1,6 @@ package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -15,24 +14,30 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class ThrivingGrubs extends CardImpl { public ThrivingGrubs(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{R}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.subtype.add(SubType.GREMLIN); this.power = new MageInt(2); this.toughness = new MageInt(1); // When Thriving Grubs enters the battlefield, you get {E}{E}. - this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2), false)); + this.addAbility(new EntersBattlefieldTriggeredAbility( + new GetEnergyCountersControllerEffect(2), false + )); // Whenever Thriving Grubs attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it. - this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2)), false, - "Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it.")); + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on it"), + new PayEnergyCost(2) + ), false)); } private ThrivingGrubs(final ThrivingGrubs card) { diff --git a/Mage.Sets/src/mage/cards/t/ThrivingIbex.java b/Mage.Sets/src/mage/cards/t/ThrivingIbex.java index 253f91b040..e8c11693f8 100644 --- a/Mage.Sets/src/mage/cards/t/ThrivingIbex.java +++ b/Mage.Sets/src/mage/cards/t/ThrivingIbex.java @@ -1,7 +1,5 @@ - package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -15,14 +13,15 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; +import java.util.UUID; + /** - * * @author fireshoes */ public final class ThrivingIbex extends CardImpl { public ThrivingIbex(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}"); this.subtype.add(SubType.GOAT); this.power = new MageInt(2); this.toughness = new MageInt(4); @@ -31,8 +30,11 @@ public final class ThrivingIbex extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2))); // Whenever Thriving Ibex attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it. - this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2)), false, - "Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it.")); + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on it"), + new PayEnergyCost(2) + ), false)); } private ThrivingIbex(final ThrivingIbex card) { diff --git a/Mage.Sets/src/mage/cards/t/ThrivingRats.java b/Mage.Sets/src/mage/cards/t/ThrivingRats.java index eb93516f88..ad91484a1c 100644 --- a/Mage.Sets/src/mage/cards/t/ThrivingRats.java +++ b/Mage.Sets/src/mage/cards/t/ThrivingRats.java @@ -1,7 +1,5 @@ - package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -15,14 +13,15 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; +import java.util.UUID; + /** - * * @author fireshoes */ public final class ThrivingRats extends CardImpl { public ThrivingRats(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{B}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B}"); this.subtype.add(SubType.RAT); this.power = new MageInt(1); this.toughness = new MageInt(2); @@ -31,8 +30,11 @@ public final class ThrivingRats extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2))); // Whenever Thriving Rats attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it. - this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2)), false, - "Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it.")); + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on it"), + new PayEnergyCost(2) + ), false)); } private ThrivingRats(final ThrivingRats card) { diff --git a/Mage.Sets/src/mage/cards/t/ThrivingRhino.java b/Mage.Sets/src/mage/cards/t/ThrivingRhino.java index 07497f26d9..bde7b650ed 100644 --- a/Mage.Sets/src/mage/cards/t/ThrivingRhino.java +++ b/Mage.Sets/src/mage/cards/t/ThrivingRhino.java @@ -1,7 +1,5 @@ - package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -15,14 +13,15 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; +import java.util.UUID; + /** - * * @author LevelX2 */ public final class ThrivingRhino extends CardImpl { public ThrivingRhino(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.RHINO); this.power = new MageInt(2); this.toughness = new MageInt(3); @@ -31,8 +30,11 @@ public final class ThrivingRhino extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2))); // Whenever Thriving Rhino attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it. - this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2)), false)); - + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on it"), + new PayEnergyCost(2) + ), false)); } private ThrivingRhino(final ThrivingRhino card) { diff --git a/Mage.Sets/src/mage/cards/t/ThrivingTurtle.java b/Mage.Sets/src/mage/cards/t/ThrivingTurtle.java index d523b37475..654d8ce82c 100644 --- a/Mage.Sets/src/mage/cards/t/ThrivingTurtle.java +++ b/Mage.Sets/src/mage/cards/t/ThrivingTurtle.java @@ -1,7 +1,5 @@ - package mage.cards.t; -import java.util.UUID; import mage.MageInt; import mage.abilities.common.AttacksTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility; @@ -15,14 +13,15 @@ import mage.constants.CardType; import mage.constants.SubType; import mage.counters.CounterType; +import java.util.UUID; + /** - * * @author fireshoes */ public final class ThrivingTurtle extends CardImpl { public ThrivingTurtle(UUID ownerId, CardSetInfo setInfo) { - super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{U}"); + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{U}"); this.subtype.add(SubType.TURTLE); this.power = new MageInt(0); this.toughness = new MageInt(3); @@ -31,7 +30,11 @@ public final class ThrivingTurtle extends CardImpl { this.addAbility(new EntersBattlefieldTriggeredAbility(new GetEnergyCountersControllerEffect(2))); // Whenever Thriving Turtle attacks, you may pay {E}{E}. If you do, put a +1/+1 counter on it. - this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), new PayEnergyCost(2)), false)); + this.addAbility(new AttacksTriggeredAbility(new DoIfCostPaid( + new AddCountersSourceEffect(CounterType.P1P1.createInstance()) + .setText("put a +1/+1 counter on it"), + new PayEnergyCost(2) + ), false)); } private ThrivingTurtle(final ThrivingTurtle card) { diff --git a/Mage.Sets/src/mage/cards/w/WispweaverAngel.java b/Mage.Sets/src/mage/cards/w/WispweaverAngel.java index cf28a17d89..6ae0e572d8 100644 --- a/Mage.Sets/src/mage/cards/w/WispweaverAngel.java +++ b/Mage.Sets/src/mage/cards/w/WispweaverAngel.java @@ -38,7 +38,7 @@ public final class WispweaverAngel extends CardImpl { // When Wispweaver Angel enters the battlefield, you may exile another target creature you control, then return that card to the battlefield under its owner's control. Ability ability = new EntersBattlefieldTriggeredAbility(new ExileTargetForSourceEffect(), true); - ability.addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false)); + ability.addEffect(new ReturnToBattlefieldUnderOwnerControlTargetEffect(false, false).concatBy(",")); ability.addTarget(new TargetControlledCreaturePermanent(1, 1, filter, false)); 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 ed4942ce71..cb473e8bf9 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 = "AER"; // check all abilities and output cards with wrong abilities texts; + private static final String FULL_ABILITIES_CHECK_SET_CODE = "KLD"; // 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/CrewsVehicleSourceTriggeredAbility.java b/Mage/src/main/java/mage/abilities/effects/common/CrewsVehicleSourceTriggeredAbility.java index 214cb25fa1..35b2f0842d 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/CrewsVehicleSourceTriggeredAbility.java +++ b/Mage/src/main/java/mage/abilities/effects/common/CrewsVehicleSourceTriggeredAbility.java @@ -43,6 +43,6 @@ public class CrewsVehicleSourceTriggeredAbility extends TriggeredAbilityImpl { @Override public String getTriggerPhrase() { - return "When {this} crews a Vehicle, " ; + return "Whenever {this} crews a Vehicle, " ; } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToPlayersEffect.java b/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToPlayersEffect.java index 9817e4e375..56fe441c80 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToPlayersEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/PreventAllDamageToPlayersEffect.java @@ -51,7 +51,7 @@ public class PreventAllDamageToPlayersEffect extends PreventionEffectImpl { } sb.append("damage that would be dealt to players"); if (duration == Duration.EndOfTurn) { - sb.append(" this turn"); + sb.append(" this turn"); } return sb.toString(); } diff --git a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByAllTargetEffect.java b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByAllTargetEffect.java index 1448aacf27..af0518dc93 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByAllTargetEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/combat/CantBeBlockedByAllTargetEffect.java @@ -1,6 +1,7 @@ package mage.abilities.effects.common.combat; import mage.abilities.Ability; +import mage.abilities.Mode; import mage.abilities.effects.RestrictionEffect; import mage.constants.Duration; import mage.filter.common.FilterCreaturePermanent; @@ -19,11 +20,6 @@ public class CantBeBlockedByAllTargetEffect extends RestrictionEffect { public CantBeBlockedByAllTargetEffect(FilterCreaturePermanent filterBlockedBy, Duration duration) { super(duration); this.filterBlockedBy = filterBlockedBy; - staticText = "target creature" - + " can't be blocked " - + (duration == EndOfTurn ? "this turn " : "") - + (filterBlockedBy.getMessage().startsWith("except by") ? "" : "by ") - + filterBlockedBy.getMessage(); } public CantBeBlockedByAllTargetEffect(final CantBeBlockedByAllTargetEffect effect) { @@ -45,4 +41,17 @@ public class CantBeBlockedByAllTargetEffect extends RestrictionEffect { public CantBeBlockedByAllTargetEffect copy() { return new CantBeBlockedByAllTargetEffect(this); } + + @Override + public String getText(Mode mode) { + if (staticText != null && !staticText.isEmpty()) { + return staticText; + } + return "target " + + mode.getTargets().get(0).getTargetName() + + " can't be blocked " + + (duration == EndOfTurn ? "this turn " : "") + + (filterBlockedBy.getMessage().startsWith("except by") ? "" : "by ") + + filterBlockedBy.getMessage(); + } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java index 0384c4b252..384787e6a2 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/continuous/AddCardTypeSourceEffect.java @@ -80,7 +80,7 @@ public class AddCardTypeSourceEffect extends ContinuousEffectImpl { } sb.append(cardType.toString().toLowerCase(Locale.ENGLISH)).append(" "); } - sb.append(" in addition to its other types ").append(this.getDuration().toString()); + sb.append("in addition to its other types ").append(this.getDuration().toString()); return sb.toString(); } } diff --git a/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java index 4050cf49d9..6b604c58d3 100644 --- a/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java +++ b/Mage/src/main/java/mage/abilities/effects/common/counter/RemoveCounterSourceEffect.java @@ -8,6 +8,7 @@ import mage.counters.Counter; import mage.counters.CounterType; import mage.game.Game; import mage.game.permanent.Permanent; +import mage.util.CardUtil; /** * @author Loki @@ -66,7 +67,7 @@ public class RemoveCounterSourceEffect extends OneShotEffect { private void setText() { if (counter.getCount() > 1) { StringBuilder sb = new StringBuilder(); - sb.append("remove ").append(Integer.toString(counter.getCount())).append(' ').append(counter.getName()).append(" counters from {this}"); + sb.append("remove ").append(CardUtil.numberToText(counter.getCount())).append(' ').append(counter.getName()).append(" counters from {this}"); staticText = sb.toString(); } else { staticText = "remove " + CounterType.findArticle(counter.getName()) + " " + counter.getName() + " counter from {this}";