diff --git a/.hgignore b/.hgignore
index ab36f2c613e..980fa5368dd 100644
--- a/.hgignore
+++ b/.hgignore
@@ -25,6 +25,7 @@ Mage.Sets/target
Mage.Tests/target
Mage/target
+releases
syntax: regexp
.class
.jar
@@ -37,4 +38,4 @@ glob:Mage.Client/cheat.dck
glob:Mage.Client/test.dck
glob:Mage.Server.Console/target/
-Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target
\ No newline at end of file
+Mage.Server.Plugins/Mage.Draft.8PlayerBooster/target
diff --git a/Mage.Client/src/main/java/mage/client/MagePane.form b/Mage.Client/src/main/java/mage/client/MagePane.form
index 725f5d510d5..42bad78a9d4 100644
--- a/Mage.Client/src/main/java/mage/client/MagePane.form
+++ b/Mage.Client/src/main/java/mage/client/MagePane.form
@@ -1,4 +1,4 @@
-
+
diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPane.java b/Mage.Client/src/main/java/mage/client/table/TablesPane.java
index 5ba76524799..43ef146bce8 100644
--- a/Mage.Client/src/main/java/mage/client/table/TablesPane.java
+++ b/Mage.Client/src/main/java/mage/client/table/TablesPane.java
@@ -38,6 +38,8 @@ import java.util.Map;
import java.util.UUID;
import javax.swing.JComponent;
+import javax.swing.event.InternalFrameEvent;
+import javax.swing.event.InternalFrameListener;
import mage.client.MageFrame;
import mage.client.MagePane;
diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form
index 0ecd9f5af06..bcdad1179a2 100644
--- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.form
+++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.form
@@ -96,7 +96,7 @@
-
+
diff --git a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java
index 0c6b94c0a6c..d9916e2e37f 100644
--- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java
+++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java
@@ -473,7 +473,8 @@ class UpdateTablesTask extends SwingWorker> {
@Override
protected Void doInBackground() throws Exception {
while (!isCancelled()) {
- this.publish(session.getTables(roomId));
+ if (MageFrame.getDesktop().getSelectedFrame() instanceof TablesPane)
+ this.publish(session.getTables(roomId));
Thread.sleep(1000);
}
return null;
diff --git a/Mage.Server/src/main/java/mage/server/SessionManager.java b/Mage.Server/src/main/java/mage/server/SessionManager.java
index 4ab3cb4ac95..76b661910a4 100644
--- a/Mage.Server/src/main/java/mage/server/SessionManager.java
+++ b/Mage.Server/src/main/java/mage/server/SessionManager.java
@@ -97,7 +97,7 @@ public class SessionManager {
}
public void checkSessions() {
- logger.info("Checking sessions");
+ logger.trace("Checking sessions");
for (Session session: sessions.values()) {
if (!session.stillAlive()) {
logger.info("Client for user " + session.getUsername() + ":" + session.getId() + " timed out - releasing resources");
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlunttheAssault.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlunttheAssault.java
index ca3c3ec1b3d..21f8c6727a5 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/BlunttheAssault.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/BlunttheAssault.java
@@ -33,11 +33,11 @@ import java.util.UUID;
import mage.Constants;
import mage.Constants.CardType;
import mage.Constants.Rarity;
-import mage.Constants.Zone;
-import mage.abilities.dynamicvalue.common.CreaturesOnBattlefieldCount;
+import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.PreventAllCombatDamageEffect;
import mage.cards.CardImpl;
+import mage.filter.FilterPermanent;
/**
*
@@ -45,13 +45,17 @@ import mage.cards.CardImpl;
*/
public class BlunttheAssault extends CardImpl {
+ private static final FilterPermanent filter = new FilterPermanent("creature on the battlefield");
+
+ static {
+ filter.getCardType().add(Constants.CardType.CREATURE);
+ }
+
public BlunttheAssault (UUID ownerId) {
super(ownerId, 113, "Blunt the Assault", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{G}");
this.expansionSetCode = "SOM";
this.color.setGreen(true);
- GainLifeEffect effect = new GainLifeEffect(new CreaturesOnBattlefieldCount());
- effect.setStaticText("You gain 1 life for each creature on the battlefield");
- this.getSpellAbility().addEffect(effect);
+ this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter)));
this.getSpellAbility().addEffect(new PreventAllCombatDamageEffect(Constants.Duration.EndOfTurn));
}
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java
index 2e44118126c..12cd85a7bc7 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DarksteelJuggernaut.java
@@ -37,15 +37,22 @@ import mage.MageInt;
import mage.abilities.common.AttacksEachTurnStaticAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.continious.SetPowerToughnessSourceEffect;
-import mage.abilities.dynamicvalue.common.ControlledArtifactsOnBattlefieldCount;
+import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
+import mage.filter.FilterPermanent;
/**
*
* @author Loki
*/
public class DarksteelJuggernaut extends CardImpl {
+ private static final FilterPermanent filter = new FilterPermanent("artifacts you control");
+
+ static {
+ filter.getCardType().add(Constants.CardType.ARTIFACT);
+ filter.setTargetController(Constants.TargetController.YOU);
+ }
public DarksteelJuggernaut (UUID ownerId) {
super(ownerId, 150, "Darksteel Juggernaut", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}");
@@ -53,7 +60,9 @@ public class DarksteelJuggernaut extends CardImpl {
this.subtype.add("Juggernaut");
this.power = new MageInt(0);
this.toughness = new MageInt(0);
- SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(new ControlledArtifactsOnBattlefieldCount(), new ControlledArtifactsOnBattlefieldCount(), Constants.Duration.EndOfGame);
+
+ PermanentsOnBattlefieldCount value = new PermanentsOnBattlefieldCount(filter);
+ SetPowerToughnessSourceEffect effect = new SetPowerToughnessSourceEffect(value, value, Constants.Duration.EndOfGame);
effect.setStaticText("Darksteel Juggernaut's power and toughness are each equal to the number of artifacts you control");
this.addAbility(new SimpleStaticAbility(Constants.Zone.ALL, effect));
this.addAbility(IndestructibleAbility.getInstance());
diff --git a/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java b/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java
index 081f153db49..765bb9bf749 100644
--- a/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java
+++ b/Mage.Sets/src/mage/sets/zendikar/LandbindRitual.java
@@ -42,7 +42,7 @@ import mage.filter.common.FilterLandPermanent;
*/
public class LandbindRitual extends CardImpl {
- private static final FilterLandPermanent filter = new FilterLandPermanent("Plains");
+ private static final FilterLandPermanent filter = new FilterLandPermanent("Plains you control");
static {
filter.getSubtype().add("Plains");
@@ -55,7 +55,7 @@ public class LandbindRitual extends CardImpl {
this.color.setWhite(true);
- this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter)));
+ this.getSpellAbility().addEffect(new GainLifeEffect(new PermanentsOnBattlefieldCount(filter, 2)));
}
public LandbindRitual(final LandbindRitual card) {
diff --git a/Mage.Sets/src/mage/sets/zendikar/MindSludge.java b/Mage.Sets/src/mage/sets/zendikar/MindSludge.java
index 2d243373aca..ea97505675f 100644
--- a/Mage.Sets/src/mage/sets/zendikar/MindSludge.java
+++ b/Mage.Sets/src/mage/sets/zendikar/MindSludge.java
@@ -43,7 +43,7 @@ import mage.target.TargetPlayer;
*/
public class MindSludge extends CardImpl {
- private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp");
+ private static final FilterLandPermanent filter = new FilterLandPermanent("Swamp you control");
static {
filter.getSubtype().add("Swamp");
diff --git a/Mage/src/mage/abilities/dynamicvalue/DynamicValue.java b/Mage/src/mage/abilities/dynamicvalue/DynamicValue.java
index a97e85b30f8..ef6713d20dd 100644
--- a/Mage/src/mage/abilities/dynamicvalue/DynamicValue.java
+++ b/Mage/src/mage/abilities/dynamicvalue/DynamicValue.java
@@ -8,4 +8,5 @@ import java.io.Serializable;
public interface DynamicValue extends Serializable {
int calculate(Game game, Ability sourceAbility);
DynamicValue clone();
+ String getMessage();
}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/ArtifactsOnBattlefieldCount.java b/Mage/src/mage/abilities/dynamicvalue/common/ArtifactsOnBattlefieldCount.java
deleted file mode 100644
index 1eeb2c96c13..00000000000
--- a/Mage/src/mage/abilities/dynamicvalue/common/ArtifactsOnBattlefieldCount.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package mage.abilities.dynamicvalue.common;
-
-import mage.Constants;
-import mage.abilities.Ability;
-import mage.abilities.dynamicvalue.DynamicValue;
-import mage.filter.Filter;
-import mage.filter.FilterPermanent;
-import mage.game.Game;
-
-class ArtifactsOnBattlefieldCount implements DynamicValue {
- private static final FilterPermanent filter = new FilterPermanent();
-
- static {
- filter.getCardType().add(Constants.CardType.ARTIFACT);
- filter.setScopeCardType(Filter.ComparisonScope.Any);
- }
-
- @Override
- public int calculate(Game game, Ability sourceAbility) {
- return game.getBattlefield().countAll(filter);
- }
-
- @Override
- public DynamicValue clone() {
- return new ArtifactsOnBattlefieldCount();
- }
-}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControlledPlayerHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControlledPlayerHandCount.java
index 4f8322843cd..e7b6383856c 100644
--- a/Mage/src/mage/abilities/dynamicvalue/common/CardsInControlledPlayerHandCount.java
+++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInControlledPlayerHandCount.java
@@ -19,4 +19,9 @@ public class CardsInControlledPlayerHandCount implements DynamicValue {
public DynamicValue clone() {
return new CardsInControlledPlayerHandCount();
}
+
+ @Override
+ public String getMessage() {
+ return "";
+ }
}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/ControlledArtifactsOnBattlefieldCount.java b/Mage/src/mage/abilities/dynamicvalue/common/ControlledArtifactsOnBattlefieldCount.java
deleted file mode 100644
index 1c06a208c59..00000000000
--- a/Mage/src/mage/abilities/dynamicvalue/common/ControlledArtifactsOnBattlefieldCount.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package mage.abilities.dynamicvalue.common;
-
-import mage.Constants;
-import mage.abilities.Ability;
-import mage.abilities.dynamicvalue.DynamicValue;
-import mage.filter.Filter;
-import mage.filter.FilterPermanent;
-import mage.game.Game;
-
-public class ControlledArtifactsOnBattlefieldCount implements DynamicValue {
- private static final FilterPermanent filter = new FilterPermanent();
-
- static {
- filter.getCardType().add(Constants.CardType.ARTIFACT);
- filter.setScopeCardType(Filter.ComparisonScope.Any);
- }
-
- @Override
- public int calculate(Game game, Ability sourceAbility) {
- return game.getBattlefield().countAll(filter, sourceAbility.getControllerId());
- }
-
- @Override
- public DynamicValue clone() {
- return new ControlledArtifactsOnBattlefieldCount();
- }
-
- @Override
- public String toString() {
- return "X";
- }
-}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java
index efa22f71fbd..6d0a817d6de 100644
--- a/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java
+++ b/Mage/src/mage/abilities/dynamicvalue/common/CountersCount.java
@@ -35,4 +35,9 @@ public class CountersCount implements DynamicValue {
public String toString() {
return "X";
}
+
+ @Override
+ public String getMessage() {
+ return "";
+ }
}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CreaturesOnBattlefieldCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CreaturesOnBattlefieldCount.java
deleted file mode 100644
index e84769b8cde..00000000000
--- a/Mage/src/mage/abilities/dynamicvalue/common/CreaturesOnBattlefieldCount.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package mage.abilities.dynamicvalue.common;
-
-import mage.Constants;
-import mage.abilities.Ability;
-import mage.abilities.dynamicvalue.DynamicValue;
-import mage.filter.Filter;
-import mage.filter.FilterPermanent;
-import mage.game.Game;
-
-public class CreaturesOnBattlefieldCount implements DynamicValue {
- private static final FilterPermanent filter = new FilterPermanent();
-
- static {
- filter.getCardType().add(Constants.CardType.CREATURE);
- filter.setScopeCardType(Filter.ComparisonScope.Any);
- }
-
- @Override
- public int calculate(Game game, Ability sourceAbility) {
- return game.getBattlefield().countAll(filter);
- }
-
- @Override
- public DynamicValue clone() {
- return new CreaturesOnBattlefieldCount();
- }
-}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/ManacostVariableValue.java b/Mage/src/mage/abilities/dynamicvalue/common/ManacostVariableValue.java
index 8b43648ef8c..96c728473ab 100644
--- a/Mage/src/mage/abilities/dynamicvalue/common/ManacostVariableValue.java
+++ b/Mage/src/mage/abilities/dynamicvalue/common/ManacostVariableValue.java
@@ -19,4 +19,9 @@ public class ManacostVariableValue implements DynamicValue {
public String toString() {
return "X";
}
+
+ @Override
+ public String getMessage() {
+ return "";
+ }
}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java b/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java
index 39e20e06b1e..dc2a3b64b45 100644
--- a/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java
+++ b/Mage/src/mage/abilities/dynamicvalue/common/PermanentsOnBattlefieldCount.java
@@ -12,13 +12,19 @@ import mage.game.Game;
public class PermanentsOnBattlefieldCount implements DynamicValue {
private FilterPermanent filter;
+ private Integer amount;
public PermanentsOnBattlefieldCount() {
filter = new FilterPermanent();
}
public PermanentsOnBattlefieldCount(FilterPermanent filter) {
+ this(filter, 1);
+ }
+
+ public PermanentsOnBattlefieldCount(FilterPermanent filter, Integer amount) {
this.filter = filter;
+ this.amount = amount;
}
public PermanentsOnBattlefieldCount(final PermanentsOnBattlefieldCount dynamicValue) {
@@ -37,6 +43,11 @@ public class PermanentsOnBattlefieldCount implements DynamicValue {
@Override
public String toString() {
- return "X";
+ return amount.toString();
+ }
+
+ @Override
+ public String getMessage() {
+ return " for each " + filter.getMessage();
}
}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/StaticValue.java b/Mage/src/mage/abilities/dynamicvalue/common/StaticValue.java
index bad46a62c3d..e6384dcce9c 100644
--- a/Mage/src/mage/abilities/dynamicvalue/common/StaticValue.java
+++ b/Mage/src/mage/abilities/dynamicvalue/common/StaticValue.java
@@ -30,4 +30,9 @@ public class StaticValue implements DynamicValue {
public String toString() {
return Integer.toString(value);
}
+
+ @Override
+ public String getMessage() {
+ return "";
+ }
}
diff --git a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java
index b832bda75e9..b18aee1fc33 100644
--- a/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java
+++ b/Mage/src/mage/abilities/effects/common/CreateTokenEffect.java
@@ -90,6 +90,7 @@ public class CreateTokenEffect extends OneShotEffect {
sb.append("put ").append(amount);
}
sb.append(" ").append(token.getDescription()).append(" onto the battlefield");
+ sb.append(amount.getMessage());
return sb.toString();
}
diff --git a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java
index 394334e5da6..1c8c3f2a01e 100644
--- a/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/DamageTargetEffect.java
@@ -103,6 +103,7 @@ public class DamageTargetEffect extends OneShotEffect {
StringBuilder sb = new StringBuilder();
sb.append("{source} deals ").append(amount).append(" damage to target ");
sb.append(source.getTargets().get(0).getTargetName());
+ sb.append(amount.getMessage());
if (!preventable)
sb.append(". The damage can't be prevented");
return sb.toString();
diff --git a/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java b/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java
index 87580dcd7b4..e5b639449f7 100644
--- a/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/DiscardTargetEffect.java
@@ -1,31 +1,30 @@
/*
-* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
-*
-* Redistribution and use in source and binary forms, with or without modification, are
-* permitted provided that the following conditions are met:
-*
-* 1. Redistributions of source code must retain the above copyright notice, this list of
-* conditions and the following disclaimer.
-*
-* 2. Redistributions in binary form must reproduce the above copyright notice, this list
-* of conditions and the following disclaimer in the documentation and/or other materials
-* provided with the distribution.
-*
-* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
-* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
-* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*
-* The views and conclusions contained in the software and documentation are those of the
-* authors and should not be interpreted as representing official policies, either expressed
-* or implied, of BetaSteward_at_googlemail.com.
-*/
-
+ * Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice, this list of
+ * conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright notice, this list
+ * of conditions and the following disclaimer in the documentation and/or other materials
+ * provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of BetaSteward_at_googlemail.com.
+ */
package mage.abilities.effects.common;
import mage.Constants.Outcome;
@@ -42,45 +41,49 @@ import mage.players.Player;
*/
public class DiscardTargetEffect extends OneShotEffect {
- protected DynamicValue amount;
+ protected DynamicValue amount;
- public DiscardTargetEffect(DynamicValue amount) {
- super(Outcome.Discard);
- this.amount = amount;
- }
+ public DiscardTargetEffect(DynamicValue amount) {
+ super(Outcome.Discard);
+ this.amount = amount;
+ }
public DiscardTargetEffect(int amount) {
this(new StaticValue(amount));
}
-
- public DiscardTargetEffect(final DiscardTargetEffect effect) {
- super(effect);
- this.amount = effect.amount.clone();
- }
- @Override
- public DiscardTargetEffect copy() {
- return new DiscardTargetEffect(this);
- }
+ public DiscardTargetEffect(final DiscardTargetEffect effect) {
+ super(effect);
+ this.amount = effect.amount.clone();
+ }
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getFirstTarget());
- if (player != null) {
- player.discard(amount.calculate(game, source), source, game);
- return true;
- }
- return false;
- }
+ @Override
+ public DiscardTargetEffect copy() {
+ return new DiscardTargetEffect(this);
+ }
- @Override
- public String getText(Ability source) {
- int staticAmount = 0;
- try{
- staticAmount = Integer.parseInt(amount.toString());
- } catch (Exception e) {
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player player = game.getPlayer(source.getFirstTarget());
+ if (player != null) {
+ player.discard(amount.calculate(game, source), source, game);
+ return true;
}
- return "Target player discards " + amount.toString() + " card" + (staticAmount == 1 ? "" : "s");
- }
+ return false;
+ }
+ @Override
+ public String getText(Ability source) {
+ StringBuilder sb = new StringBuilder("Target player discards ");
+ sb.append(amount).append(" card");
+ try {
+ if (Integer.parseInt(amount.toString()) > 1) {
+ sb.append("s");
+ }
+ } catch (Exception e) {
+ sb.append("s");
+ }
+ sb.append(amount.getMessage());
+ return sb.toString();
+ }
}
diff --git a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java
index 6e45cb4f9ea..f147e786853 100644
--- a/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/DrawCardTargetEffect.java
@@ -77,10 +77,14 @@ public class DrawCardTargetEffect extends OneShotEffect {
public String getText(Ability source) {
StringBuilder sb = new StringBuilder();
sb.append("Target player draws ").append(amount).append(" card");
- if (amount instanceof StaticValue && amount.calculate(null, null) == 1) {
- } else {
+ try {
+ if (Integer.parseInt(amount.toString()) > 1) {
+ sb.append("s");
+ }
+ } catch (Exception e) {
sb.append("s");
}
+ sb.append(amount.getMessage());
return sb.toString();
}
diff --git a/Mage/src/mage/abilities/effects/common/GainLifeEffect.java b/Mage/src/mage/abilities/effects/common/GainLifeEffect.java
index 5c02454070f..5450f30d493 100644
--- a/Mage/src/mage/abilities/effects/common/GainLifeEffect.java
+++ b/Mage/src/mage/abilities/effects/common/GainLifeEffect.java
@@ -74,7 +74,7 @@ public class GainLifeEffect extends OneShotEffect {
@Override
public String getDynamicText(Ability source) {
- return "you gain " + life.toString() + " life";
+ return "you gain " + life.toString() + " life" + life.getMessage();
}
}
diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java
index e3709309dd0..7ea1dbc29f3 100644
--- a/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continious/BoostEquippedEffect.java
@@ -93,9 +93,10 @@ public class BoostEquippedEffect extends ContinuousEffectImpl {
@Override
public String getDynamicText(Ability source) {
- return "{this} gets " + power.toString() + "/" + toughness.toString() + " " + duration.toString();
+ StringBuilder sb = new StringBuilder();
+ sb.append("{this} gets ").append(power).append("/").append(toughness);
+ if (duration != Duration.WhileOnBattlefield)
+ sb.append(" ").append(duration.toString());
+ sb.append(power.getMessage());
+ return sb.toString();
}
}
diff --git a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java
index 966d5493829..7aed6c0b6f9 100644
--- a/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continious/BoostTargetEffect.java
@@ -82,9 +82,11 @@ public class BoostTargetEffect extends ContinuousEffectImpl {
@Override
public String getText(Ability source) {
StringBuilder sb = new StringBuilder();
- sb.append("target ").append(source.getTargets().get(0).getTargetName()).append(" gets ");
- sb.append(power.toString()).append("/").append(toughness.toString());
- sb.append(" ").append(duration.toString());
+ sb.append("Target ").append(source.getTargets().get(0).getTargetName()).append(" gets ");
+ sb.append(power).append("/").append(toughness);
+ if (duration != Duration.WhileOnBattlefield)
+ sb.append(" ").append(duration.toString());
+ sb.append(power.getMessage());
return sb.toString();
}
}
diff --git a/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java b/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java
index 869279ecb90..3c1209be554 100644
--- a/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continious/SetPowerToughnessSourceEffect.java
@@ -84,7 +84,10 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImplMage.Plugins
Mage.Server.Plugins
Mage.Server.Console
- Mage.Tests
-
+