diff --git a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.form b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.form
index fdc0887453..5b74e76cbf 100644
--- a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.form
+++ b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.form
@@ -341,7 +341,7 @@
-
+
diff --git a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java
index f513ed79e8..120c35e2c0 100644
--- a/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java
+++ b/Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java
@@ -270,8 +270,8 @@ public class ConnectDialog extends MageDialog {
});
btnFind3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/flags/us.png"))); // NOI18N
- btnFind3.setText("U");
- btnFind3.setToolTipText("Connect to xmage.us (USA)");
+ btnFind3.setText("W");
+ btnFind3.setToolTipText("Connect to vaporservermtg.com (USA)");
btnFind3.setActionCommand("connectXmageus");
btnFind3.setAlignmentY(0.0F);
btnFind3.setMargin(new java.awt.Insets(2, 2, 2, 2));
diff --git a/Mage.Sets/src/mage/cards/e/EnergyTap.java b/Mage.Sets/src/mage/cards/e/EnergyTap.java
index 0fd2502cc2..ef1aaadbf8 100644
--- a/Mage.Sets/src/mage/cards/e/EnergyTap.java
+++ b/Mage.Sets/src/mage/cards/e/EnergyTap.java
@@ -1,4 +1,3 @@
-
package mage.cards.e;
import java.util.UUID;
@@ -23,7 +22,7 @@ import mage.target.common.TargetControlledCreaturePermanent;
*/
public final class EnergyTap extends CardImpl {
- private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you crontrol");
+ private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creature you control");
static {
filter.add(Predicates.not(new TappedPredicate()));
diff --git a/Mage.Sets/src/mage/cards/f/FreneticSliver.java b/Mage.Sets/src/mage/cards/f/FreneticSliver.java
index ad29911cdd..6655f21dbd 100644
--- a/Mage.Sets/src/mage/cards/f/FreneticSliver.java
+++ b/Mage.Sets/src/mage/cards/f/FreneticSliver.java
@@ -1,13 +1,11 @@
-
package mage.cards.f;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.condition.common.SourceOnBattlefieldCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.decorator.ConditionalActivatedAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileReturnBattlefieldOwnerNextEndStepSourceEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
@@ -26,19 +24,26 @@ import mage.players.Player;
public final class FreneticSliver extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent(SubType.SLIVER, "All Slivers");
+ private static final String rule = "All Slivers have \"{0}: If this permanent is on the battlefield, "
+ + "flip a coin. If you win the flip, exile this permanent and return it to the battlefield "
+ + "under its owner's control at the beginning of the next end step. If you lose the flip, sacrifice it.\"";
public FreneticSliver(UUID ownerId, CardSetInfo setInfo) {
- super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{U}{R}");
+ super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}");
this.subtype.add(SubType.SLIVER);
this.power = new MageInt(2);
this.toughness = new MageInt(2);
// All Slivers have "{0}: If this permanent is on the battlefield, flip a coin. If you win the flip, exile this permanent and return it to the battlefield under its owner's control at the beginning of the next end step. If you lose the flip, sacrifice it."
- Ability ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD,
- new FreneticSliverEffect(), new ManaCostsImpl("{0}"), SourceOnBattlefieldCondition.instance, "{0}: If this permanent is on the battlefield, flip a coin. If you win the flip, exile this permanent and return it to the battlefield under its owner's control at the beginning of the next end step. If you lose the flip, sacrifice it.");
-
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
- new GainAbilityAllEffect(ability, Duration.WhileOnBattlefield, filter, "All Slivers have \"{0}: If this permanent is on the battlefield, flip a coin. If you win the flip, exile this permanent and return it to the battlefield under its owner's control at the beginning of the next end step. If you lose the flip, sacrifice it.\"")));
+ new GainAbilityAllEffect(
+ new SimpleActivatedAbility(
+ Zone.BATTLEFIELD,
+ new FreneticSliverEffect(),
+ new ManaCostsImpl("{0}")
+ ), Duration.WhileOnBattlefield, filter, rule
+ )
+ ));
}
public FreneticSliver(final FreneticSliver card) {
@@ -55,7 +60,9 @@ class FreneticSliverEffect extends OneShotEffect {
public FreneticSliverEffect() {
super(Outcome.Neutral);
- staticText = "Flip a coin. If you win the flip, exile this permanent and return it to the battlefield under its owner's control at the beginning of the next end step. If you lose the flip, sacrifice it";
+ staticText = "if this permanent is on the battlefield, flip a coin. If you win the flip, "
+ + "exile this permanent and return it to the battlefield under its owner's control "
+ + "at the beginning of the next end step. If you lose the flip, sacrifice it";
}
public FreneticSliverEffect(final FreneticSliverEffect effect) {
@@ -65,18 +72,15 @@ class FreneticSliverEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
- if (player != null) {
- if (player.flipCoin(game)) {
- return new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true).apply(game, source);
- } else {
- Permanent perm = game.getPermanent(source.getSourceId());
- if (perm != null) {
- perm.sacrifice(source.getSourceId(), game);
- }
- return true;
- }
+ Permanent perm = game.getPermanent(source.getSourceId());
+ if (player == null || perm == null) {
+ return false;
+ }
+ if (player.flipCoin(game)) {
+ return new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true).apply(game, source);
+ } else {
+ return perm.sacrifice(source.getSourceId(), game);
}
- return false;
}
@Override
diff --git a/Mage.Sets/src/mage/cards/r/RecurringNightmare.java b/Mage.Sets/src/mage/cards/r/RecurringNightmare.java
index f7cbaa78ac..2c6b3a90b7 100644
--- a/Mage.Sets/src/mage/cards/r/RecurringNightmare.java
+++ b/Mage.Sets/src/mage/cards/r/RecurringNightmare.java
@@ -1,6 +1,6 @@
-
package mage.cards.r;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
@@ -10,28 +10,26 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
-import mage.filter.common.FilterControlledCreaturePermanent;
-import mage.filter.common.FilterCreatureCard;
+import mage.filter.StaticFilters;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetControlledPermanent;
-import java.util.UUID;
-
/**
*
* @author jeffwadsworth
*/
public final class RecurringNightmare extends CardImpl {
- private static final FilterCreatureCard filter = new FilterCreatureCard("creature card");
- private static final FilterControlledCreaturePermanent filter2 = new FilterControlledCreaturePermanent("creature");
-
public RecurringNightmare(UUID ownerId, CardSetInfo setInfo) {
- super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{B}");
+ super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
// Sacrifice a creature, Return Recurring Nightmare to its owner's hand: Return target creature card from your graveyard to the battlefield. Activate this ability only any time you could cast a sorcery.
- Ability ability = new ActivateAsSorceryActivatedAbility(Zone.BATTLEFIELD, new ReturnFromGraveyardToBattlefieldTargetEffect(), new SacrificeTargetCost(new TargetControlledPermanent(filter2)));
- ability.addTarget(new TargetCardInYourGraveyard(filter));
+ Ability ability = new ActivateAsSorceryActivatedAbility(
+ Zone.BATTLEFIELD,
+ new ReturnFromGraveyardToBattlefieldTargetEffect(),
+ new SacrificeTargetCost(new TargetControlledPermanent(StaticFilters.FILTER_CONTROLLED_CREATURE))
+ );
+ ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE));
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/cards/s/SpikeRogue.java b/Mage.Sets/src/mage/cards/s/SpikeRogue.java
index 18e9739ca7..e612ab71d4 100644
--- a/Mage.Sets/src/mage/cards/s/SpikeRogue.java
+++ b/Mage.Sets/src/mage/cards/s/SpikeRogue.java
@@ -1,4 +1,3 @@
-
package mage.cards.s;
import java.util.UUID;
@@ -17,7 +16,7 @@ import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.counters.CounterType;
-import mage.filter.common.FilterControlledCreaturePermanent;
+import mage.filter.StaticFilters;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@@ -44,7 +43,7 @@ public final class SpikeRogue extends CardImpl {
// {2}, Remove a +1/+1 counter from a creature you control: Put a +1/+1 counter on Spike Rogue.
Ability ability2 = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance(1)), new GenericManaCost(2));
- ability2.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent(), true), CounterType.P1P1));
+ ability2.addCost(new RemoveCounterCost(new TargetControlledCreaturePermanent(1, 1, StaticFilters.FILTER_CONTROLLED_CREATURE, true), CounterType.P1P1));
this.addAbility(ability2);
}
diff --git a/Mage/src/main/java/mage/filter/FilterCard.java b/Mage/src/main/java/mage/filter/FilterCard.java
index 7a873eab6f..d3da298bff 100644
--- a/Mage/src/main/java/mage/filter/FilterCard.java
+++ b/Mage/src/main/java/mage/filter/FilterCard.java
@@ -66,7 +66,7 @@ public class FilterCard extends FilterObject {
return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(card, sourceId, playerId), game);
}
- public void add(ObjectPlayerPredicate predicate) {
+ public final void add(ObjectPlayerPredicate predicate) {
if (isLockedFilter()) {
throw new UnsupportedOperationException("You may not modify a locked filter");
}
diff --git a/Mage/src/main/java/mage/filter/FilterImpl.java b/Mage/src/main/java/mage/filter/FilterImpl.java
index 7ab6e9964f..1463611553 100644
--- a/Mage/src/main/java/mage/filter/FilterImpl.java
+++ b/Mage/src/main/java/mage/filter/FilterImpl.java
@@ -55,7 +55,7 @@ public abstract class FilterImpl implements Filter {
}
@Override
- public void setMessage(String message) {
+ public final void setMessage(String message) {
if (isLockedFilter()) {
throw new UnsupportedOperationException("You may not modify a locked filter");
}
diff --git a/Mage/src/main/java/mage/filter/FilterPermanent.java b/Mage/src/main/java/mage/filter/FilterPermanent.java
index 963334c187..e5cf7537ab 100644
--- a/Mage/src/main/java/mage/filter/FilterPermanent.java
+++ b/Mage/src/main/java/mage/filter/FilterPermanent.java
@@ -61,7 +61,7 @@ public class FilterPermanent extends FilterObject implements FilterIn
return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(permanent, sourceId, playerId), game);
}
- public void add(ObjectPlayerPredicate predicate) {
+ public final void add(ObjectPlayerPredicate predicate) {
if (isLockedFilter()) {
throw new UnsupportedOperationException("You may not modify a locked filter");
}
diff --git a/Mage/src/main/java/mage/filter/FilterStackObject.java b/Mage/src/main/java/mage/filter/FilterStackObject.java
index f7627c2f75..8a448dc909 100644
--- a/Mage/src/main/java/mage/filter/FilterStackObject.java
+++ b/Mage/src/main/java/mage/filter/FilterStackObject.java
@@ -20,7 +20,7 @@ public class FilterStackObject extends FilterObject {
protected List>> extraPredicates = new ArrayList<>();
public FilterStackObject() {
- super("spell or ability");
+ this("spell or ability");
}
public FilterStackObject(String name) {
@@ -40,7 +40,7 @@ public class FilterStackObject extends FilterObject {
return Predicates.and(extraPredicates).apply(new ObjectSourcePlayer(stackObject, sourceId, playerId), game);
}
- public void add(ObjectPlayerPredicate predicate) {
+ public final void add(ObjectPlayerPredicate predicate) {
if (isLockedFilter()) {
throw new UnsupportedOperationException("You may not modify a locked filter");
}
diff --git a/Mage/src/main/java/mage/target/TargetPermanent.java b/Mage/src/main/java/mage/target/TargetPermanent.java
index 310badaf7d..9114df0019 100644
--- a/Mage/src/main/java/mage/target/TargetPermanent.java
+++ b/Mage/src/main/java/mage/target/TargetPermanent.java
@@ -1,4 +1,3 @@
-
package mage.target;
import java.util.HashSet;
@@ -8,6 +7,7 @@ import mage.MageObject;
import mage.abilities.Ability;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
+import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -20,11 +20,11 @@ public class TargetPermanent extends TargetObject {
protected FilterPermanent filter;
public TargetPermanent() {
- this(1, 1, new FilterPermanent(), false);
+ this(StaticFilters.FILTER_PERMANENT);
}
public TargetPermanent(FilterPermanent filter) {
- this(1, 1, filter, false);
+ this(1, filter);
}
public TargetPermanent(int numTargets, FilterPermanent filter) {
diff --git a/Mage/src/main/java/mage/target/common/TargetControlledCreaturePermanent.java b/Mage/src/main/java/mage/target/common/TargetControlledCreaturePermanent.java
index 595880577b..935d811d0a 100644
--- a/Mage/src/main/java/mage/target/common/TargetControlledCreaturePermanent.java
+++ b/Mage/src/main/java/mage/target/common/TargetControlledCreaturePermanent.java
@@ -1,6 +1,6 @@
-
package mage.target.common;
+import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledCreaturePermanent;
/**
@@ -10,19 +10,19 @@ import mage.filter.common.FilterControlledCreaturePermanent;
public class TargetControlledCreaturePermanent extends TargetControlledPermanent {
public TargetControlledCreaturePermanent() {
- this(1, 1, new FilterControlledCreaturePermanent(), false);
+ this(1);
}
public TargetControlledCreaturePermanent(int numTargets) {
- this(numTargets, numTargets, new FilterControlledCreaturePermanent(), false);
+ this(numTargets, numTargets);
}
public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets) {
- this(minNumTargets, maxNumTargets, new FilterControlledCreaturePermanent(), false);
+ this(minNumTargets, maxNumTargets, StaticFilters.FILTER_CONTROLLED_CREATURE, false);
}
public TargetControlledCreaturePermanent(FilterControlledCreaturePermanent filter) {
- super(1, 1, filter, false);
+ this(1, 1, filter, false);
}
public TargetControlledCreaturePermanent(int minNumTargets, int maxNumTargets, FilterControlledCreaturePermanent filter, boolean notTarget) {
diff --git a/Mage/src/main/java/mage/target/common/TargetControlledPermanent.java b/Mage/src/main/java/mage/target/common/TargetControlledPermanent.java
index ce3eb7a039..cbc3e687ab 100644
--- a/Mage/src/main/java/mage/target/common/TargetControlledPermanent.java
+++ b/Mage/src/main/java/mage/target/common/TargetControlledPermanent.java
@@ -1,7 +1,6 @@
-
-
package mage.target.common;
+import mage.filter.StaticFilters;
import mage.filter.common.FilterControlledPermanent;
import mage.target.TargetPermanent;
@@ -12,11 +11,11 @@ import mage.target.TargetPermanent;
public class TargetControlledPermanent extends TargetPermanent {
public TargetControlledPermanent() {
- this(1, 1, new FilterControlledPermanent(), false);
+ this(1, 1, StaticFilters.FILTER_CONTROLLED_PERMANENT, false);
}
public TargetControlledPermanent(int numTargets) {
- this(numTargets, numTargets, new FilterControlledPermanent(), false);
+ this(numTargets, numTargets, StaticFilters.FILTER_CONTROLLED_PERMANENT, false);
}
public TargetControlledPermanent(FilterControlledPermanent filter) {