Merge origin/master

Conflicts:
	Mage.Client/src/main/java/mage/client/dialog/ConnectDialog.java
This commit is contained in:
LevelX2 2018-06-10 01:13:30 +02:00
commit 52270a11c8
13 changed files with 55 additions and 56 deletions

View file

@ -341,7 +341,7 @@
<Image iconType="3" name="/flags/us.png"/>
</Property>
<Property name="text" type="java.lang.String" value="W"/>
<Property name="toolTipText" type="java.lang.String" value="Connect to xmage.us (USA)"/>
<Property name="toolTipText" type="java.lang.String" value="Connect to vaporservermtg.com (USA)"/>
<Property name="actionCommand" type="java.lang.String" value="connectXmageus"/>
<Property name="alignmentY" type="float" value="0.0"/>
<Property name="margin" type="java.awt.Insets" editor="org.netbeans.beaninfo.editors.InsetsEditor">

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -66,7 +66,7 @@ public class FilterCard extends FilterObject<Card> {
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");
}

View file

@ -55,7 +55,7 @@ public abstract class FilterImpl<E> implements Filter<E> {
}
@Override
public void setMessage(String message) {
public final void setMessage(String message) {
if (isLockedFilter()) {
throw new UnsupportedOperationException("You may not modify a locked filter");
}

View file

@ -61,7 +61,7 @@ public class FilterPermanent extends FilterObject<Permanent> 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");
}

View file

@ -20,7 +20,7 @@ public class FilterStackObject extends FilterObject<StackObject> {
protected List<ObjectPlayerPredicate<ObjectPlayer<Permanent>>> 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<StackObject> {
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");
}

View file

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

View file

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

View file

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