diff --git a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java
index 8067b9d56e4..cc9ce07983e 100644
--- a/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java
+++ b/Mage.Client/src/main/java/org/mage/card/arcane/CardPanel.java
@@ -65,6 +65,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
public final ScaledImagePanel imagePanel;
public ImagePanel overlayPanel;
public JPanel buttonPanel;
+ public JPanel iconPanel;
private GlowText titleText;
private GlowText ptText;
@@ -94,6 +95,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
private boolean transformed;
private boolean animationInProgress = false;
private JButton dayNightButton;
+ private JButton tokenButton;
private boolean displayTitleAnyway;
@@ -142,6 +144,23 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
}
});
+ // token icon
+ iconPanel = new JPanel();
+ iconPanel.setLayout(null);
+ iconPanel.setOpaque(false);
+ add(iconPanel);
+
+ tokenButton = new JButton("");
+ tokenButton.setLocation(2, 2);
+ tokenButton.setSize(25, 25);
+
+ iconPanel.setVisible(this.gameCard.isToken());
+
+ BufferedImage tokenIconImage = ImageManagerImpl.getInstance().getTokenIconImage();
+ tokenButton.setIcon(new ImageIcon(tokenIconImage));
+
+ iconPanel.add(tokenButton);
+
setBackground(Color.black);
setOpaque(false);
@@ -411,6 +430,9 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
buttonPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize);
buttonPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2);
+ iconPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize);
+ iconPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2);
+
int fontHeight = Math.round(cardHeight * (27f / 680));
boolean showText = (!isAnimationPanel && fontHeight < 12);
titleText.setVisible(showText);
diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java
index bc47999e41c..16269a07503 100644
--- a/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java
+++ b/Mage.Client/src/main/java/org/mage/plugins/card/info/CardInfoPaneImpl.java
@@ -154,12 +154,15 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
} else if (CardUtil.isPlaneswalker(card)) {
pt = card.getLoyalty().toString();
}
- if (pt.length() > 0) {
- buffer.append("
| ");
- buffer.append("");
- buffer.append(pt);
- buffer.append("");
- buffer.append(" |
");
+
+ if (pt.length() > 0 || card.isToken()) {
+ buffer.append("| ");
+ buffer.append(pt).append(" | ");
+ if (card.isToken()) {
+ buffer.append("Token | ");
+ }
+
+ buffer.append("
");
}
StringBuilder rule = new StringBuilder("
");
diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java
index 390e2dd121a..fd8a65891ee 100644
--- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java
+++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/ImageManager.java
@@ -11,6 +11,8 @@ public interface ImageManager {
Image getSicknessImage();
Image getDayImage();
Image getNightImage();
+
+ Image getTokenIconImage();
Image getDlgAcceptButtonImage();
Image getDlgActiveAcceptButtonImage();
diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java
index c99196e2ac3..a161c643c4d 100644
--- a/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java
+++ b/Mage.Client/src/main/java/org/mage/plugins/card/utils/impl/ImageManagerImpl.java
@@ -97,6 +97,15 @@ public class ImageManagerImpl implements ImageManager {
return imageNight;
}
+ @Override
+ public BufferedImage getTokenIconImage() {
+ if (imageTokenIcon == null) {
+ Image image = getImageFromResourceTransparent("/card/token.png", Color.WHITE, new Rectangle(20, 20));
+ imageTokenIcon = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
+ }
+ return imageTokenIcon;
+ }
+
@Override
public Image getDlgCancelButtonImage() {
if (imageDlgCancelButton == null) {
@@ -216,6 +225,8 @@ public class ImageManagerImpl implements ImageManager {
private static BufferedImage imageDay;
private static BufferedImage imageNight;
+ private static BufferedImage imageTokenIcon;
+
private static BufferedImage imageDlgAcceptButton;
private static BufferedImage imageDlgActiveAcceptButton;
private static BufferedImage imageDlgCancelButton;
diff --git a/Mage.Client/src/main/resources/card/token.png b/Mage.Client/src/main/resources/card/token.png
new file mode 100644
index 00000000000..e63f67cb091
Binary files /dev/null and b/Mage.Client/src/main/resources/card/token.png differ
diff --git a/Mage.Common/src/mage/view/CardView.java b/Mage.Common/src/mage/view/CardView.java
index 1c27582361f..30da7ad0d49 100644
--- a/Mage.Common/src/mage/view/CardView.java
+++ b/Mage.Common/src/mage/view/CardView.java
@@ -82,6 +82,7 @@ public class CardView extends SimpleCardView {
protected boolean transformed;
protected boolean isSplitCard;
+ protected boolean isToken;
protected String leftSplitName;
protected ManaCosts leftSplitCosts;
protected List leftSplitRules;
@@ -152,12 +153,23 @@ public class CardView extends SimpleCardView {
if (card instanceof PermanentToken) {
+ this.isToken = true;
this.rarity = Rarity.COMMON;
- this.expansionSetCode = ((PermanentToken) card).getExpansionSetCode();
+ if (((PermanentToken) card).getToken().getOriginalCardNumber() > 0) {
+ // a token copied from permanent
+ this.expansionSetCode = ((PermanentToken) card).getToken().getOriginalExpansionSetCode();
+ this.cardNumber = ((PermanentToken) card).getToken().getOriginalCardNumber();
+ } else {
+ // a created token
+ this.expansionSetCode = ((PermanentToken) card).getExpansionSetCode();
+ }
+ //
+ // set code und card number for token copies to get the image
this.rules = ((PermanentToken) card).getRules();
this.type = ((PermanentToken)card).getToken().getTokenType();
} else {
this.rarity = card.getRarity();
+ this.isToken = false;
}
if (card.getCounters() != null && !card.getCounters().isEmpty()) {
counters = new ArrayList();
@@ -453,6 +465,10 @@ public class CardView extends SimpleCardView {
return this.secondCardFace;
}
+ public boolean isToken() {
+ return this.isToken;
+ }
+
public void setTransformed(boolean transformed) {
this.transformed = transformed;
}
diff --git a/Mage.Common/src/mage/view/GameView.java b/Mage.Common/src/mage/view/GameView.java
index 09d2734ea6b..3913b9f9548 100644
--- a/Mage.Common/src/mage/view/GameView.java
+++ b/Mage.Common/src/mage/view/GameView.java
@@ -28,11 +28,16 @@
package mage.view;
-import mage.constants.PhaseStep;
-import mage.constants.TurnPhase;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
import mage.MageObject;
import mage.abilities.costs.Cost;
import mage.cards.Card;
+import mage.constants.PhaseStep;
+import mage.constants.TurnPhase;
import mage.constants.Zone;
import mage.game.ExileZone;
import mage.game.Game;
@@ -46,11 +51,6 @@ import mage.game.stack.StackAbility;
import mage.game.stack.StackObject;
import mage.players.Player;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
/**
*
@@ -131,14 +131,16 @@ public class GameView implements Serializable {
this.phase = state.getTurn().getPhaseType();
this.step = state.getTurn().getStepType();
this.turn = state.getTurnNum();
- if (state.getActivePlayerId() != null)
+ if (state.getActivePlayerId() != null) {
this.activePlayerName = state.getPlayer(state.getActivePlayerId()).getName();
- else
+ } else {
this.activePlayerName = "";
- if (state.getPriorityPlayerId() != null)
+ }
+ if (state.getPriorityPlayerId() != null) {
this.priorityPlayerName = state.getPlayer(state.getPriorityPlayerId()).getName();
- else
+ } else {
this.priorityPlayerName = "";
+ }
for (CombatGroup combatGroup: state.getCombat().getGroups()) {
combat.add(new CombatGroupView(combatGroup, game));
}
diff --git a/Mage.Common/src/mage/view/PermanentView.java b/Mage.Common/src/mage/view/PermanentView.java
index a88791d000a..09e00e4e419 100644
--- a/Mage.Common/src/mage/view/PermanentView.java
+++ b/Mage.Common/src/mage/view/PermanentView.java
@@ -50,7 +50,6 @@ public class PermanentView extends CardView {
private boolean summoningSickness;
private int damage;
private List attachments;
- private List counters;
private CardView original;
public PermanentView(Permanent permanent, Card card) {
@@ -66,13 +65,7 @@ public class PermanentView extends CardView {
attachments = new ArrayList();
attachments.addAll(permanent.getAttachments());
}
- if (permanent.getCounters().size() > 0) {
- counters = new ArrayList();
- for (Counter counter: permanent.getCounters().values()) {
- counters.add(new CounterView(counter));
- }
- }
- if (permanent instanceof PermanentToken) {
+ if (isToken()) {
original = new CardView(((PermanentToken)permanent).getToken());
original.expansionSetCode = permanent.getExpansionSetCode();
}
@@ -110,10 +103,6 @@ public class PermanentView extends CardView {
return attachments;
}
- public List getCounters() {
- return counters;
- }
-
public CardView getOriginal() {
return original;
}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java b/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java
index 670e174ecfd..ea962b98eff 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/AdventOfTheWurm.java
@@ -75,6 +75,8 @@ public class AdventOfTheWurm extends CardImpl {
subtype.add("Wurm");
power = new MageInt(5);
toughness = new MageInt(5);
+ expansionSetCode = "RTR";
+
addAbility(TrampleAbility.getInstance());
}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java b/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java
index ac86f0194d2..a8efff42caf 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/GrislySpectacle.java
@@ -100,11 +100,11 @@ class GrislySpectacleEffect extends OneShotEffect {
Player controller = game.getPlayer(creature.getControllerId());
if (controller != null) {
int power = creature.getPower().getValue();
- if (creature.destroy(source.getSourceId(), game, false)) {
- Effect effect = new PutLibraryIntoGraveTargetEffect(power);
- effect.setTargetPointer(new FixedTarget(controller.getId()));
- return effect.apply(game, source);
- }
+ creature.destroy(source.getSourceId(), game, false);
+ // the mill effect works also if creature is indestructible or regenerated
+ Effect effect = new PutLibraryIntoGraveTargetEffect(power);
+ effect.setTargetPointer(new FixedTarget(controller.getId()));
+ return effect.apply(game, source);
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java b/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java
index 7c00e84e1b3..c75af84fbf2 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/PredatorsRapport.java
@@ -28,13 +28,13 @@
package mage.sets.gatecrash;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
diff --git a/Mage.Sets/src/mage/sets/modernmasters/HammerheimDeadeye.java b/Mage.Sets/src/mage/sets/modernmasters/HammerheimDeadeye.java
new file mode 100644
index 00000000000..0191efbba38
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/modernmasters/HammerheimDeadeye.java
@@ -0,0 +1,54 @@
+/*
+ * 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.sets.modernmasters;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class HammerheimDeadeye extends mage.sets.planarchaos.HammerheimDeadeye {
+
+ public HammerheimDeadeye(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 119;
+ this.expansionSetCode = "MMA";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public HammerheimDeadeye(final HammerheimDeadeye card) {
+ super(card);
+ }
+
+ @Override
+ public HammerheimDeadeye copy() {
+ return new HammerheimDeadeye(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/modernmasters/Phthisis.java b/Mage.Sets/src/mage/sets/modernmasters/Phthisis.java
new file mode 100644
index 00000000000..98d12ebded6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/modernmasters/Phthisis.java
@@ -0,0 +1,52 @@
+/*
+ * 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.sets.modernmasters;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Phthisis extends mage.sets.timespiral.Phthisis {
+
+ public Phthisis(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 93;
+ this.expansionSetCode = "MMA";
+ }
+
+ public Phthisis(final Phthisis card) {
+ super(card);
+ }
+
+ @Override
+ public Phthisis copy() {
+ return new Phthisis(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/modernmasters/SuddenShock.java b/Mage.Sets/src/mage/sets/modernmasters/SuddenShock.java
new file mode 100644
index 00000000000..98e2c948213
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/modernmasters/SuddenShock.java
@@ -0,0 +1,52 @@
+/*
+ * 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.sets.modernmasters;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SuddenShock extends mage.sets.timespiral.SuddenShock {
+
+ public SuddenShock(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 133;
+ this.expansionSetCode = "MMA";
+ }
+
+ public SuddenShock(final SuddenShock card) {
+ super(card);
+ }
+
+ @Override
+ public SuddenShock copy() {
+ return new SuddenShock(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java b/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java
index 0e5b4650853..6dc266b9ca3 100644
--- a/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java
+++ b/Mage.Sets/src/mage/sets/modernmasters/TakePossession.java
@@ -28,9 +28,19 @@
package mage.sets.modernmasters;
import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.AttachEffect;
+import mage.abilities.effects.common.continious.ControlEnchantedEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.abilities.keyword.SplitSecondAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
+import mage.constants.Outcome;
import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.TargetPermanent;
/**
*
@@ -46,8 +56,18 @@ public class TakePossession extends CardImpl {
this.color.setBlue(true);
// Split second
+ this.addAbility(SplitSecondAbility.getInstance());
// Enchant permanent
+ TargetPermanent auraTarget = new TargetPermanent();
+ this.getSpellAbility().addTarget(auraTarget);
+ this.getSpellAbility().addEffect(new AttachEffect(Outcome.GainControl));
+ Ability ability = new EnchantAbility(auraTarget.getTargetName());
+ this.addAbility(ability);
// You control enchanted permanent.
+ Effect effect = new ControlEnchantedEffect();
+ effect.setText("You control enchanted permanent");
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
+
}
public TakePossession(final TakePossession card) {
diff --git a/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java b/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java
index b06abd575e2..8547c2564cc 100644
--- a/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java
+++ b/Mage.Sets/src/mage/sets/modernmasters/TestOfFaith.java
@@ -116,7 +116,8 @@ class TestOfFaithPreventDamageTargetEffect extends PreventionEffectImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying");
+ static {
+ filter.add(new AbilityPredicate(FlyingAbility.class));
+ }
+
+ public HammerheimDeadeye(UUID ownerId) {
+ super(ownerId, 101, "Hammerheim Deadeye", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
+ this.expansionSetCode = "PLC";
+ this.subtype.add("Giant");
+ this.subtype.add("Warrior");
+
+ this.color.setRed(true);
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(3);
+
+ // Echo {5}{R}
+ this.addAbility(new EchoAbility("{5}{R}"));
+ // When Hammerheim Deadeye enters the battlefield, destroy target creature with flying.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
+ Target target = new TargetCreaturePermanent(filter);
+ target.setRequired(true);
+ ability.addTarget(target);
+ this.addAbility(ability);
+ }
+
+ public HammerheimDeadeye(final HammerheimDeadeye card) {
+ super(card);
+ }
+
+ @Override
+ public HammerheimDeadeye copy() {
+ return new HammerheimDeadeye(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/timespiral/Phthisis.java b/Mage.Sets/src/mage/sets/timespiral/Phthisis.java
new file mode 100644
index 00000000000..deedf7444a9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/timespiral/Phthisis.java
@@ -0,0 +1,105 @@
+/*
+ * 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.sets.timespiral;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.keyword.SuspendAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.players.Player;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Phthisis extends CardImpl {
+
+ public Phthisis(UUID ownerId) {
+ super(ownerId, 122, "Phthisis", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{B}{B}{B}{B}");
+ this.expansionSetCode = "TSP";
+
+ this.color.setBlack(true);
+
+ // Destroy target creature. Its controller loses life equal to its power plus its toughness.
+ this.getSpellAbility().addEffect(new PhthisisEffect());
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent(true));
+
+ // Suspend 5-{1}{B}
+ this.addAbility(new SuspendAbility(5, new ManaCostsImpl("{1}{B}"), this));
+ }
+
+ public Phthisis(final Phthisis card) {
+ super(card);
+ }
+
+ @Override
+ public Phthisis copy() {
+ return new Phthisis(this);
+ }
+}
+
+class PhthisisEffect extends OneShotEffect {
+
+ public PhthisisEffect() {
+ super(Outcome.DestroyPermanent);
+ this.staticText = "Destroy target creature. Its controller loses life equal to its power plus its toughness";
+ }
+
+ public PhthisisEffect(final PhthisisEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public PhthisisEffect copy() {
+ return new PhthisisEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
+ if (creature != null) {
+ Player controller = game.getPlayer(creature.getControllerId());
+ if (controller != null) {
+ int lifeLoss = creature.getPower().getValue() + creature.getToughness().getValue();
+ creature.destroy(source.getSourceId(), game, false);
+ // the life loss happens also if the creature is indestructible or regenerated (legal targets)
+ controller.loseLife(lifeLoss, game);
+ return true;
+ }
+ }
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/timespiral/SuddenShock.java b/Mage.Sets/src/mage/sets/timespiral/SuddenShock.java
new file mode 100644
index 00000000000..899a2c50527
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/timespiral/SuddenShock.java
@@ -0,0 +1,65 @@
+/*
+ * 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.sets.timespiral;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.keyword.SplitSecondAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreatureOrPlayer;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SuddenShock extends CardImpl {
+
+ public SuddenShock(UUID ownerId) {
+ super(ownerId, 179, "Sudden Shock", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{R}");
+ this.expansionSetCode = "TSP";
+
+ this.color.setRed(true);
+
+ // Split second
+ this.addAbility(SplitSecondAbility.getInstance());
+ // Sudden Shock deals 2 damage to target creature or player.
+ this.getSpellAbility().addEffect(new DamageTargetEffect(2, true));
+ this.getSpellAbility().addTarget(new TargetCreatureOrPlayer(true));
+ }
+
+ public SuddenShock(final SuddenShock card) {
+ super(card);
+ }
+
+ @Override
+ public SuddenShock copy() {
+ return new SuddenShock(this);
+ }
+}
diff --git a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java
index 944254c350c..bd5578f504f 100644
--- a/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/DestroyTargetEffect.java
@@ -28,15 +28,14 @@
package mage.abilities.effects.common;
-import mage.constants.Outcome;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.effects.OneShotEffect;
+import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.Target;
-
-import java.util.UUID;
import mage.target.targetpointer.FirstTargetPointer;
/**
@@ -105,12 +104,14 @@ public class DestroyTargetEffect extends OneShotEffect {
StringBuilder sb = new StringBuilder();
if (mode.getTargets().size() == 0) {
sb.append("destroy that creature"); //TODO add possibility to specify text with targetPointer usage
- } else if (mode.getTargets().get(0).getNumberOfTargets() == 1)
+ } else if (mode.getTargets().get(0).getNumberOfTargets() == 1) {
sb.append("Destroy target ").append(mode.getTargets().get(0).getTargetName());
- else
+ } else {
sb.append("Destroy ").append(mode.getTargets().get(0).getNumberOfTargets()).append(" target ").append(mode.getTargets().get(0).getTargetName());
- if (noRegen)
+ }
+ if (noRegen) {
sb.append(". It can't be regenerated");
+ }
return sb.toString();
}
diff --git a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java
index 40307e1aa22..9d0f893fbf6 100644
--- a/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/PutLibraryIntoGraveTargetEffect.java
@@ -86,8 +86,9 @@ public class PutLibraryIntoGraveTargetEffect extends OneShotEffect(This enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.)";
}
diff --git a/Mage/src/mage/game/permanent/token/Token.java b/Mage/src/mage/game/permanent/token/Token.java
index 75355cecb6f..743e1459f6c 100644
--- a/Mage/src/mage/game/permanent/token/Token.java
+++ b/Mage/src/mage/game/permanent/token/Token.java
@@ -49,6 +49,8 @@ public class Token extends MageObjectImpl {
protected String description;
private UUID lastAddedTokenId;
private int tokenType;
+ private int originalCardNumber;
+ private String originalExpansionSetCode;
public enum Type {
FIRST(1),
@@ -146,4 +148,21 @@ public class Token extends MageObjectImpl {
public void setTokenType(int tokenType) {
this.tokenType = tokenType;
}
+
+ public int getOriginalCardNumber() {
+ return originalCardNumber;
+ }
+
+ public void setOriginalCardNumber(int originalCardNumber) {
+ this.originalCardNumber = originalCardNumber;
+ }
+
+ public String getOriginalExpansionSetCode() {
+ return originalExpansionSetCode;
+ }
+
+ public void setOriginalExpansionSetCode(String originalExpansionSetCode) {
+ this.originalExpansionSetCode = originalExpansionSetCode;
+ }
+
}
diff --git a/Mage/src/mage/util/functions/CopyTokenFunction.java b/Mage/src/mage/util/functions/CopyTokenFunction.java
index 4943f498e56..b83582c791e 100644
--- a/Mage/src/mage/util/functions/CopyTokenFunction.java
+++ b/Mage/src/mage/util/functions/CopyTokenFunction.java
@@ -79,7 +79,8 @@ public class CopyTokenFunction implements Function {
for (String type : sourceObj.getSupertype()) {
target.getSupertype().add(type);
}
- //target.setExpansionSetCode(source.getExpansionSetCode());
+ target.setOriginalExpansionSetCode(source.getExpansionSetCode());
+ target.setOriginalCardNumber(source.getCardNumber());
target.getAbilities().clear();
for (Ability ability0 : sourceObj.getAbilities()) {