diff --git a/Mage.Client/pom.xml b/Mage.Client/pom.xml
index 53c8d3985d1..b75e77454a0 100644
--- a/Mage.Client/pom.xml
+++ b/Mage.Client/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
org.mage
diff --git a/Mage.Client/release/readme.txt b/Mage.Client/release/readme.txt
index eeba07fd9ed..cde5e139c8c 100644
--- a/Mage.Client/release/readme.txt
+++ b/Mage.Client/release/readme.txt
@@ -11,7 +11,7 @@ You can download this from: http://java.com/
Installing and running XMage
You will need to download both the client and the server applications. These can be
-obtained from HTTP://XMage.info.
+obtained from HTTP://XMage.de.
Extact the client and the server to separate folders.
To play a game you can either connect to a server or start your own server. To
diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java
index 42a5d7e262f..3dba3dcf775 100644
--- a/Mage.Client/src/main/java/mage/client/MageFrame.java
+++ b/Mage.Client/src/main/java/mage/client/MageFrame.java
@@ -835,14 +835,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
}
public void setUserPrefsToConnection(Connection connection) {
- int avatarId = PreferencesDialog.getSelectedAvatar();
- connection.setAvatarId(avatarId);
- boolean showAbilityPickerForced = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_ABILITY_PICKER_FORCED, "true").equals("true");
- connection.setShowAbilityPickerForced(showAbilityPickerForced);
- connection.setAllowRequestShowHandCards(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"));
- connection.setConfirmEmptyManaPool(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"));
- connection.setUserSkipPrioritySteps(PreferencesDialog.getUserSkipPrioritySteps());
- connection.setFlagName(MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png"));
+ connection.setUserData(PreferencesDialog.getUserData());
}
/**
diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form
index 7bc34fdbb7b..f423543b402 100644
--- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form
+++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.form
@@ -96,7 +96,7 @@
-
+
diff --git a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java
index 0e3e2f88cbd..5bdbed28ef5 100644
--- a/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java
+++ b/Mage.Client/src/main/java/mage/client/chat/ChatPanel.java
@@ -37,25 +37,20 @@ import java.awt.Color;
import java.awt.event.KeyEvent;
import java.util.ArrayList;
import java.util.Collection;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import java.util.UUID;
import javax.swing.Icon;
-import javax.swing.ImageIcon;
import javax.swing.JTextField;
import javax.swing.table.AbstractTableModel;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableColumnModel;
import mage.client.MageFrame;
-import mage.client.dialog.PreferencesDialog;
-import static mage.client.dialog.PreferencesDialog.KEY_TABLES_COLUMNS_ORDER;
-import static mage.client.dialog.PreferencesDialog.KEY_TABLES_COLUMNS_WIDTH;
import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_ORDER;
import static mage.client.dialog.PreferencesDialog.KEY_USERS_COLUMNS_WIDTH;
import mage.client.util.MageTableRowSorter;
import mage.client.util.gui.TableUtil;
import mage.client.util.audio.AudioManager;
+import mage.client.util.gui.countryBox.CountryCellRenderer;
import mage.remote.MageRemoteException;
import mage.view.ChatMessage;
//import mage.remote.Session;
@@ -63,7 +58,6 @@ import mage.view.ChatMessage.MessageColor;
import mage.view.ChatMessage.MessageType;
import mage.view.RoomUsersView;
import mage.view.UsersView;
-import org.apache.log4j.Logger;
import org.mage.card.arcane.ManaSymbols;
import org.mage.network.Client;
@@ -72,13 +66,11 @@ import org.mage.network.Client;
* @author BetaSteward_at_googlemail.com, nantuko
*/
public class ChatPanel extends javax.swing.JPanel {
-
- private static final Logger logger = Logger.getLogger(ChatPanel.class);
-
+
private UUID chatId;
private Client client;
private final List players = new ArrayList<>();
- private final TableModel tableModel;
+ private final UserTableModel userTableModel;
/**
* Chat message color for opponents.
*/
@@ -156,14 +148,15 @@ public class ChatPanel extends javax.swing.JPanel {
* @param addPlayersTab
*/
public ChatPanel(boolean addPlayersTab) {
- tableModel = new TableModel();
+ userTableModel = new UserTableModel();
initComponents();
setBackground(new Color(0, 0, 0, ALPHA));
jTablePlayers.setBackground(new Color(0, 0, 0, ALPHA));
jTablePlayers.setForeground(Color.white);
- jTablePlayers.setRowSorter(new MageTableRowSorter(tableModel));
-
+ jTablePlayers.setRowSorter(new MageTableRowSorter(userTableModel));
+
TableUtil.setColumnWidthAndOrder(jTablePlayers, defaultColumnsWidth, KEY_USERS_COLUMNS_WIDTH, KEY_USERS_COLUMNS_ORDER);
+ jTablePlayers.setDefaultRenderer(Icon.class, new CountryCellRenderer());
if (jScrollPaneTxt != null) {
jScrollPaneTxt.setBackground(new Color(0, 0, 0, ALPHA));
@@ -387,13 +380,10 @@ public class ChatPanel extends javax.swing.JPanel {
return this.jSplitPane1.getDividerLocation();
}
- class TableModel extends AbstractTableModel {
+ class UserTableModel extends AbstractTableModel {
-
-
private final String[] columnNames = new String[]{" ","Players", "Info", "Games", "Connection"};
private UsersView[] players = new UsersView[0];
- private Map flagIconCache = new HashMap<>();
public void loadData(RoomUsersView roomUserInfo) throws MageRemoteException {
// RoomUsersView roomUserInfo = roomUserInfoList.iterator().next();
@@ -401,8 +391,8 @@ public class ChatPanel extends javax.swing.JPanel {
JTableHeader th = jTablePlayers.getTableHeader();
TableColumnModel tcm = th.getColumnModel();
- tcm.getColumn(1).setHeaderValue("Players (" + this.players.length + ")");
- tcm.getColumn(3).setHeaderValue(
+ tcm.getColumn(jTablePlayers.convertColumnIndexToView(1)).setHeaderValue("Players (" + this.players.length + ")");
+ tcm.getColumn(jTablePlayers.convertColumnIndexToView(3)).setHeaderValue(
"Games " + roomUserInfo.getNumberActiveGames() +
(roomUserInfo.getNumberActiveGames() != roomUserInfo.getNumberGameThreads() ? " (T:" + roomUserInfo.getNumberGameThreads():" (") +
" limit: " + roomUserInfo.getNumberMaxGames() + ")");
@@ -424,7 +414,7 @@ public class ChatPanel extends javax.swing.JPanel {
public Object getValueAt(int arg0, int arg1) {
switch (arg1) {
case 0:
- return getCountryFlagIcon(players[arg0].getFlagName());
+ return players[arg0].getFlagName();
case 1:
return players[arg0].getUserName();
case 2:
@@ -463,18 +453,7 @@ public class ChatPanel extends javax.swing.JPanel {
return false;
}
- private ImageIcon getCountryFlagIcon(String countryCode) {
- ImageIcon flagIcon = flagIconCache.get(countryCode);
- if (flagIcon == null) {
- flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode +".png"));
- if (flagIcon.getImage() == null) {
- logger.warn("Country flag resource not found: " + countryCode);
- } else {
- flagIconCache.put(countryCode, flagIcon);
- }
- }
- return flagIcon;
- }
+
}
@@ -516,7 +495,7 @@ public class ChatPanel extends javax.swing.JPanel {
jScrollPanePlayers.setBorder(null);
- jTablePlayers.setModel(this.tableModel);
+ jTablePlayers.setModel(this.userTableModel);
jTablePlayers.setToolTipText("Connected players");
jTablePlayers.setAutoscrolls(false);
jTablePlayers.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
@@ -584,7 +563,7 @@ public class ChatPanel extends javax.swing.JPanel {
public void setRoomUserInfo(RoomUsersView view) {
try {
- tableModel.loadData(view);
+ userTableModel.loadData(view);
} catch (Exception ex) {
this.players.clear();
}
diff --git a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java
index 69563a64746..fee877ac688 100644
--- a/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java
+++ b/Mage.Client/src/main/java/mage/client/deckeditor/collection/viewer/CollectionViewerPane.java
@@ -44,7 +44,7 @@ public class CollectionViewerPane extends MagePane {
public CollectionViewerPane() {
boolean initialized = false;
- this.setTitle("Collection Viewier");
+ this.setTitle("Collection Viewer");
if (Plugins.getInstance().isThemePluginLoaded()) {
Map uiComponents = new HashMap();
JComponent container = Plugins.getInstance().updateTablePanel(uiComponents);
diff --git a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form
index 4d3f578895f..f9036d14f48 100644
--- a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form
+++ b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.form
@@ -52,9 +52,9 @@
-
+
-
+
@@ -82,17 +82,17 @@
-
+
-
+
-
+
diff --git a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java
index 613b928b90b..45a60b45087 100644
--- a/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java
+++ b/Mage.Client/src/main/java/mage/client/dialog/AboutDialog.java
@@ -88,11 +88,11 @@ public class AboutDialog extends MageDialog {
lblVersion.setText("0.0.0");
- jLabel2.setText("Courtesy: BetaSteward@googlemail.com. Site: http://XMage.info/");
+ jLabel2.setText("Courtesy: BetaSteward@googlemail.com. Site: http://XMage.de/");
- jLabel3.setText("Devs: BetaSteward, Noxx, Eugen.Rivniy, North, LevelX2, Jeff, Plopman, dustinconrad, emerald000. ");
+ jLabel3.setText("Devs: BetaSteward, Noxx, Eugen.Rivniy, North, LevelX2, Jeff, Plopman, dustinconrad, emerald000.,");
- jLabel4.setText("Thanks: maurer.it, Rafbill, Alvin, cbt33, Quercitron.");
+ jLabel4.setText("fireshoes, lunaskyrise, mnapoleon, jgod, LoneFox.");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
@@ -122,9 +122,9 @@ public class AboutDialog extends MageDialog {
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel4)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 71, Short.MAX_VALUE)
.addComponent(btnOk)
.addContainerGap())
);
diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form
index 06253718466..af752462a6b 100644
--- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form
+++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.form
@@ -82,10 +82,10 @@
-
+
-
+
@@ -159,7 +159,7 @@
-
+
@@ -173,7 +173,7 @@
-
+
@@ -201,23 +201,17 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -235,6 +229,9 @@
+
+
+
@@ -307,6 +304,17 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java
index 6e676093738..fb3677e43ba 100644
--- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java
+++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java
@@ -66,6 +66,7 @@ import mage.client.util.gui.BufferedImageBuilder;
import mage.players.net.UserSkipPrioritySteps;
import mage.remote.Connection;
import mage.remote.Connection.ProxyType;
+import mage.view.UserDataView;
import org.apache.log4j.Logger;
/**
@@ -86,6 +87,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
public static final String KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS = "gameAllowRequestShowHandCards";
public static final String KEY_GAME_SHOW_STORM_COUNTER = "gameShowStormCounter";
public static final String KEY_GAME_CONFIRM_EMPTY_MANA_POOL = "gameConfirmEmptyManaPool";
+ public static final String KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER = "gameAskMoveToGraveORder";
public static final String KEY_GAME_LOG_AUTO_SAVE = "gameLogAutoSave";
@@ -346,6 +348,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
cbAllowRequestToShowHandCards = new javax.swing.JCheckBox();
cbShowStormCounter = new javax.swing.JCheckBox();
cbConfirmEmptyManaPool = new javax.swing.JCheckBox();
+ cbAskMoveToGraveOrder = new javax.swing.JCheckBox();
main_gamelog = new javax.swing.JPanel();
cbGameLogAutoSave = new javax.swing.JCheckBox();
tabPhases = new javax.swing.JPanel();
@@ -570,6 +573,16 @@ public class PreferencesDialog extends javax.swing.JDialog {
}
});
+ cbAskMoveToGraveOrder.setSelected(true);
+ cbAskMoveToGraveOrder.setText("Ask player for setting order cards go to graveyard");
+ cbAskMoveToGraveOrder.setToolTipText("If activated and multiple cards go to the graveyard at the same time
\nthe player is asked to set the order of the cards.");
+ cbAskMoveToGraveOrder.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
+ cbAskMoveToGraveOrder.addActionListener(new java.awt.event.ActionListener() {
+ public void actionPerformed(java.awt.event.ActionEvent evt) {
+ cbAskMoveToGraveOrderActionPerformed(evt);
+ }
+ });
+
javax.swing.GroupLayout main_gameLayout = new javax.swing.GroupLayout(main_game);
main_game.setLayout(main_gameLayout);
main_gameLayout.setHorizontalGroup(
@@ -577,18 +590,15 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addGroup(main_gameLayout.createSequentialGroup()
.addContainerGap()
.addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(main_gameLayout.createSequentialGroup()
- .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGroup(main_gameLayout.createSequentialGroup()
- .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
- .addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING))
- .addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(0, 0, Short.MAX_VALUE))))
+ .addComponent(cbAllowRequestToShowHandCards, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addGroup(main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
+ .addComponent(showPlayerNamesPermanently, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(nonLandPermanentsInOnePile, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .addComponent(showAbilityPickerForced, javax.swing.GroupLayout.Alignment.LEADING))
+ .addComponent(cbShowStormCounter, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(cbConfirmEmptyManaPool, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(cbAskMoveToGraveOrder, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE))
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
main_gameLayout.setVerticalGroup(
main_gameLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -603,7 +613,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cbShowStormCounter)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cbConfirmEmptyManaPool))
+ .addComponent(cbConfirmEmptyManaPool)
+ .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
+ .addComponent(cbAskMoveToGraveOrder)
+ .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
nonLandPermanentsInOnePile.getAccessibleContext().setAccessibleName("nonLandPermanentsInOnePile");
@@ -651,10 +664,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addContainerGap()
.addComponent(main_card, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
+ .addComponent(main_game, javax.swing.GroupLayout.PREFERRED_SIZE, 189, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(main_gamelog, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap(40, Short.MAX_VALUE))
+ .addContainerGap())
);
main_card.getAccessibleContext().setAccessibleName("Game panel");
@@ -1626,7 +1639,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
- .addComponent(tabsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 595, Short.MAX_VALUE)
+ .addComponent(tabsPanel)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@@ -1655,6 +1668,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
save(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true", "false", UPDATE_CACHE_POLICY);
save(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true", "false", UPDATE_CACHE_POLICY);
save(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true", "false", UPDATE_CACHE_POLICY);
+ save(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true", "false", UPDATE_CACHE_POLICY);
save(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true", "false", UPDATE_CACHE_POLICY);
// Phases
@@ -1717,13 +1731,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
}
try {
- MageFrame.getClient().updatePreferencesForServer(
- getSelectedAvatar(),
- dialog.showAbilityPickerForced.isSelected(),
- dialog.cbAllowRequestToShowHandCards.isSelected(),
- dialog.cbConfirmEmptyManaPool.isSelected(),
- getUserSkipPrioritySteps(),
- MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png"));
+ MageFrame.getClient().updatePreferencesForServer(getUserData());
prefs.flush();
} catch (BackingStoreException ex) {
@@ -1978,6 +1986,10 @@ public class PreferencesDialog extends javax.swing.JDialog {
// TODO add your handling code here:
}//GEN-LAST:event_cbConfirmEmptyManaPoolActionPerformed
+ private void cbAskMoveToGraveOrderActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbAskMoveToGraveOrderActionPerformed
+ // TODO add your handling code here:
+ }//GEN-LAST:event_cbAskMoveToGraveOrderActionPerformed
+
private void showProxySettings() {
if (cbProxyType.getSelectedItem() == Connection.ProxyType.SOCKS) {
this.pnlProxy.setVisible(true);
@@ -2055,6 +2067,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
load(prefs, dialog.cbAllowRequestToShowHandCards, KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true");
load(prefs, dialog.cbShowStormCounter, KEY_GAME_SHOW_STORM_COUNTER, "true");
load(prefs, dialog.cbConfirmEmptyManaPool, KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true");
+ load(prefs, dialog.cbAskMoveToGraveOrder, KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true");
load(prefs, dialog.cbGameLogAutoSave, KEY_GAME_LOG_AUTO_SAVE, "true");
@@ -2395,26 +2408,32 @@ public class PreferencesDialog extends javax.swing.JDialog {
public void mousePressed(MouseEvent e) {
if (selectedAvatarId != id) {
setSelectedId(id);
- MageFrame.getClient().updatePreferencesForServer(
- id,
- PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"),
- PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"),
- PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"),
- getUserSkipPrioritySteps(),
- MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world.png")
- );
+ MageFrame.getClient().updatePreferencesForServer(getUserData());
}
}
});
}
}
+ public static UserDataView getUserData(){
+ return new UserDataView(
+ getSelectedAvatar(),
+ PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"),
+ PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"),
+ PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"),
+ getUserSkipPrioritySteps(),
+ MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"),
+ PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true")
+ );
+ }
+
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnBattlefieldBGMBrowse;
private javax.swing.JButton btnBrowseBackgroundImage;
private javax.swing.JButton btnBrowseBattlefieldImage;
private javax.swing.JButton btnBrowseImageLocation;
private javax.swing.JCheckBox cbAllowRequestToShowHandCards;
+ private javax.swing.JCheckBox cbAskMoveToGraveOrder;
private javax.swing.JCheckBox cbCheckForNewImages;
private javax.swing.JCheckBox cbConfirmEmptyManaPool;
private javax.swing.JCheckBox cbEnableBattlefieldBGM;
diff --git a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java
index e7c509d41d0..3e9916beb6a 100644
--- a/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java
+++ b/Mage.Client/src/main/java/mage/client/game/PlayAreaPanel.java
@@ -569,8 +569,12 @@ public class PlayAreaPanel extends javax.swing.JPanel {
}
public void setMenuStates(boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) {
- manaPoolMenuItem1.setSelected(manaPoolAutomatic);
- manaPoolMenuItem2.setSelected(manaPoolAutomaticRestricted);
+ if (manaPoolMenuItem1 != null) {
+ manaPoolMenuItem1.setSelected(manaPoolAutomatic);
+ }
+ if (manaPoolMenuItem2 != null) {
+ manaPoolMenuItem2.setSelected(manaPoolAutomaticRestricted);
+ }
}
private mage.client.game.BattlefieldPanel battlefieldPanel;
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 b21749765d0..8419b85cfba 100644
--- a/Mage.Client/src/main/java/mage/client/table/TablesPanel.java
+++ b/Mage.Client/src/main/java/mage/client/table/TablesPanel.java
@@ -1148,7 +1148,8 @@ public class TablesPanel extends javax.swing.JPanel {
options.setMatchTimeLimit(MatchTimeLimit.NONE);
options.setFreeMulligans(2);
options.setSkillLevel(SkillLevel.CASUAL);
- table = client.createTable(roomId, options);
+ options.setRollbackTurnsAllowed(true);
+ table = client.createTable(roomId, options);
client.joinTable(roomId, table.getTableId(), "Human", "Human", 1, DeckImporterUtil.importDeck("test.dck"),"");
client.joinTable(roomId, table.getTableId(), "Computer", "Computer - mad", 5, DeckImporterUtil.importDeck("test.dck"),"");
diff --git a/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java
new file mode 100644
index 00000000000..2ee392fe9ea
--- /dev/null
+++ b/Mage.Client/src/main/java/mage/client/util/gui/countryBox/CountryCellRenderer.java
@@ -0,0 +1,80 @@
+/*
+ * 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.client.util.gui.countryBox;
+
+import java.awt.Component;
+import java.util.HashMap;
+import java.util.Map;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.swing.JTable;
+import javax.swing.table.DefaultTableCellRenderer;
+import org.apache.log4j.Logger;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class CountryCellRenderer extends DefaultTableCellRenderer {
+
+ private static final Logger logger = Logger.getLogger(CountryCellRenderer.class);
+ private final Map flagIconCache = new HashMap<>();
+
+ private final Map countryMap = new HashMap<>();
+
+ public CountryCellRenderer() {
+ for( int i = 0; i <= CountryComboBox.countryList.length - 1; i++) {
+ countryMap.put(CountryComboBox.countryList[i][1],CountryComboBox.countryList[i][0]);
+ }
+ }
+
+ @Override
+ public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
+ JLabel label = (JLabel)super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
+ if(table.convertColumnIndexToView(0) == column) {
+ label.setToolTipText(countryMap.get((String)value));
+ label.setIcon(getCountryFlagIcon((String)value));
+ label.setText("");
+ }
+ return label;
+ }
+
+ private ImageIcon getCountryFlagIcon(String countryCode) {
+ ImageIcon flagIcon = flagIconCache.get(countryCode);
+ if (flagIcon == null) {
+ flagIcon = new javax.swing.ImageIcon(getClass().getResource("/flags/" + countryCode + (countryCode.endsWith(".png") ? "" :".png")));
+ if (flagIcon.getImage() == null) {
+ logger.warn("Country flag resource not found: " + countryCode);
+ } else {
+ flagIconCache.put(countryCode, flagIcon);
+ }
+ }
+ return flagIcon;
+ }
+}
diff --git a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java
index 5cd0fe2b2b0..81bc28210b6 100644
--- a/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java
+++ b/Mage.Client/src/main/java/mage/client/util/sets/ConstructedFormats.java
@@ -29,7 +29,7 @@ public class ConstructedFormats {
public static final String MODERN = "- Modern";
private static final Map> underlyingSetCodesPerFormat = new HashMap<>();
- private static final List formats = new ArrayList();
+ private static final List formats = new ArrayList<>();
private ConstructedFormats() {
}
@@ -59,7 +59,7 @@ public class ConstructedFormats {
else {
cutoff = new GregorianCalendar(calendar.get(Calendar.YEAR) - 2, Calendar.SEPTEMBER, 1);
}
- final Map expansionInfo = new HashMap();
+ final Map expansionInfo = new HashMap<>();
for (ExpansionInfo set : ExpansionRepository.instance.getAll()) {
expansionInfo.put(set.getName(), set);
formats.add(set.getName());
diff --git a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java
index 08cb77829f1..33cbb1a7dbe 100644
--- a/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java
+++ b/Mage.Client/src/main/java/org/mage/plugins/card/images/ImageCache.java
@@ -27,11 +27,11 @@ import org.mage.plugins.card.utils.CardImageUtils;
* This class stores ALL card images in a cache with soft values. this means
* that the images may be garbage collected when they are not needed any more, but will
* be kept as long as possible.
- *
+ *
* Key format: "####"
- *
+ *
* where param is:
- *
+ *
*
* - #Normal: request for unrotated image
* - #Tapped: request for rotated image
@@ -56,7 +56,7 @@ public class ImageCache {
@Override
public BufferedImage apply(String key) {
try {
-
+
boolean usesVariousArt = false;
if (key.endsWith("#usesVariousArt")) {
usesVariousArt = true;
@@ -111,7 +111,7 @@ public class ImageCache {
} catch(Exception ex) {
exists = false;
}
- }
+ }
if (exists) {
log.debug("loading thumbnail for " + key + ", path="+thumbnailPath);
return loadImage(thumbnailFile);
@@ -150,7 +150,7 @@ public class ImageCache {
return null;
}
TFile file = getTFile(path);
- return loadImage(file);
+ return loadImage(file);
}
public static BufferedImage getManifestImage() {
@@ -159,7 +159,7 @@ public class ImageCache {
String path = CardImageUtils.generateTokenImagePath(info);
if (path == null) {
return null;
- }
+ }
TFile file = getTFile(path);
return loadImage(file);
}
@@ -219,7 +219,7 @@ public class ImageCache {
private static BufferedImage getImage(String key) {
try {
BufferedImage image = imageCache.get(key);
- return image;
+ return image;
} catch (NullPointerException ex) {
// unfortunately NullOutputException, thrown when apply() returns
// null, is not public
@@ -261,7 +261,7 @@ public class ImageCache {
/**
* Load image from file
- *
+ *
* @param file
* file to load image from
* @return {@link BufferedImage}
@@ -298,6 +298,7 @@ public class ImageCache {
}
} catch (IOException e) {
log.error(e,e);
+ imageFile.delete();
}
return image;
}
@@ -382,7 +383,7 @@ public class ImageCache {
return getFullSizeImage(original, scale);
}
-
+
public static TFile getTFile(String path) {
try {
TFile file = new TFile(path);
@@ -390,6 +391,6 @@ public class ImageCache {
} catch (NullPointerException ex) {
log.warn("Imagefile does not exist: " + path);
}
- return null;
+ return null;
}
}
diff --git a/Mage.Client/src/main/resources/image.url.properties b/Mage.Client/src/main/resources/image.url.properties
index 7ba6f59ee2e..21a5556cc22 100644
--- a/Mage.Client/src/main/resources/image.url.properties
+++ b/Mage.Client/src/main/resources/image.url.properties
@@ -64,6 +64,6 @@ ddd=gvl
unh=uh
dde=pvc
# Remove setname as soon as the images can be downloaded
-ignore.urls=TOK,MMB,ORI
+ignore.urls=TOK,MMB
# sets ordered by release time (newest goes first)
token.lookup.order=TPR,MPRP,DD3,DDO,ORI,MMB,PTC,DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC
\ No newline at end of file
diff --git a/Mage.Common/pom.xml b/Mage.Common/pom.xml
index 68a4a1c38aa..5d73c78968e 100644
--- a/Mage.Common/pom.xml
+++ b/Mage.Common/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
mage-common
diff --git a/Mage.Common/src/mage/remote/Connection.java b/Mage.Common/src/mage/remote/Connection.java
index 65e59aad8b1..d1d1f3577b3 100644
--- a/Mage.Common/src/mage/remote/Connection.java
+++ b/Mage.Common/src/mage/remote/Connection.java
@@ -36,6 +36,7 @@ import java.net.NetworkInterface;
import java.net.SocketException;
import java.util.Enumeration;
import mage.players.net.UserSkipPrioritySteps;
+import mage.view.UserDataView;
/**
*
@@ -56,12 +57,14 @@ public class Connection implements Serializable {
private int clientCardDatabaseVersion;
private boolean forceDBComparison;
- private int avatarId;
- private boolean showAbilityPickerForced;
- private boolean allowRequestShowHandCards;
- private boolean confirmEmptyManaPool;
- private String flagName;
- private UserSkipPrioritySteps userSkipPrioritySteps;
+ private UserDataView userData;
+
+// private int avatarId;
+// private boolean showAbilityPickerForced;
+// private boolean allowRequestShowHandCards;
+// private boolean confirmEmptyManaPool;
+// private String flagName;
+// private UserSkipPrioritySteps userSkipPrioritySteps;
// private static final String serialization = "?serializationtype=jboss";
// private static final String transport = "bisocket";
@@ -231,45 +234,12 @@ public class Connection implements Serializable {
return null;
}
- public int getAvatarId() {
- return avatarId;
- }
-
- public void setAvatarId(int avatarId) {
- this.avatarId = avatarId;
- }
-
- public boolean isShowAbilityPickerForced() {
- return showAbilityPickerForced;
- }
-
- public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
- this.showAbilityPickerForced = showAbilityPickerForced;
- }
-
- public boolean allowRequestShowHandCards() {
- return allowRequestShowHandCards;
- }
-
- public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
- this.allowRequestShowHandCards = allowRequestShowHandCards;
- }
-
- public boolean confirmEmptyManaPool() {
- return confirmEmptyManaPool;
- }
-
- public void setConfirmEmptyManaPool(boolean confirmEmptyManaPool) {
- this.confirmEmptyManaPool = confirmEmptyManaPool;
+ public void setUserData(UserDataView userData) {
+ this.userData= userData;
}
-
- public UserSkipPrioritySteps getUserSkipPrioritySteps() {
- return userSkipPrioritySteps;
- }
-
- public void setUserSkipPrioritySteps(UserSkipPrioritySteps userSkipPrioritySteps) {
- this.userSkipPrioritySteps = userSkipPrioritySteps;
+ public UserDataView getUserData() {
+ return userData;
}
public boolean isForceDBComparison() {
@@ -279,13 +249,4 @@ public class Connection implements Serializable {
public void setForceDBComparison(boolean forceDBComparison) {
this.forceDBComparison = forceDBComparison;
}
-
- public String getFlagName() {
- return flagName;
- }
-
- public void setFlagName(String flagName) {
- this.flagName = flagName;
- }
-
}
diff --git a/Mage.Common/src/mage/remote/interfaces/ClientData.java b/Mage.Common/src/mage/remote/interfaces/ClientData.java
index 2a9fe56b384..7b4f248d934 100644
--- a/Mage.Common/src/mage/remote/interfaces/ClientData.java
+++ b/Mage.Common/src/mage/remote/interfaces/ClientData.java
@@ -27,7 +27,7 @@
*/
package mage.remote.interfaces;
-import mage.players.net.UserSkipPrioritySteps;
+import mage.view.UserDataView;
/**
* @author noxx
@@ -36,5 +36,5 @@ public interface ClientData {
String getUserName();
- boolean updatePreferencesForServer(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName);
+ boolean updatePreferencesForServer(UserDataView userData);
}
diff --git a/Mage.Common/src/mage/utils/MageVersion.java b/Mage.Common/src/mage/utils/MageVersion.java
index 2baafa2e561..15109980eb0 100644
--- a/Mage.Common/src/mage/utils/MageVersion.java
+++ b/Mage.Common/src/mage/utils/MageVersion.java
@@ -41,8 +41,8 @@ public class MageVersion implements Serializable, Comparable {
*/
public final static int MAGE_VERSION_MAJOR = 1;
public final static int MAGE_VERSION_MINOR = 4;
- public final static int MAGE_VERSION_PATCH = 0;
- public final static String MAGE_VERSION_MINOR_PATCH = "v2";
+ public final static int MAGE_VERSION_PATCH = 1;
+ public final static String MAGE_VERSION_MINOR_PATCH = "v3";
public final static String MAGE_VERSION_INFO = "";
private final int major;
diff --git a/Mage.Common/src/mage/view/PlayerView.java b/Mage.Common/src/mage/view/PlayerView.java
index 3e9eb437d81..487e84afd26 100644
--- a/Mage.Common/src/mage/view/PlayerView.java
+++ b/Mage.Common/src/mage/view/PlayerView.java
@@ -115,7 +115,7 @@ public class PlayerView implements Serializable {
if (player.getUserData() != null) {
this.userDataView = new UserDataView(player.getUserData());
} else {
- this.userDataView = new UserDataView(0, false, false, true, null,"world.png");
+ this.userDataView = UserDataView.getDefaultUserDataView();
}
for (CommandObject commandObject : game.getState().getCommand()) {
diff --git a/Mage.Common/src/mage/view/UserDataView.java b/Mage.Common/src/mage/view/UserDataView.java
index 9bf65b6f2e7..40171cbe315 100644
--- a/Mage.Common/src/mage/view/UserDataView.java
+++ b/Mage.Common/src/mage/view/UserDataView.java
@@ -18,15 +18,22 @@ public class UserDataView implements Serializable {
protected boolean confirmEmptyManaPool;
protected UserSkipPrioritySteps userSkipPrioritySteps;
String flagName;
+ protected boolean askMoveToGraveOrder;
+ static UserDataView getDefaultUserDataView() {
+ return new UserDataView(0, false, false, true, null,"world.png", false);
+ }
+
public UserDataView(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards,
- boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName) {
+ boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName, boolean askMoveToGraveOrder) {
this.avatarId = avatarId;
this.showAbilityPickerForced = showAbilityPickerForced;
this.allowRequestShowHandCards = allowRequestShowHandCards;
this.userSkipPrioritySteps = userSkipPrioritySteps;
this.confirmEmptyManaPool = confirmEmptyManaPool;
this.flagName = flagName;
+ this.askMoveToGraveOrder = askMoveToGraveOrder;
+
}
public UserDataView(UserData userData) {
@@ -37,6 +44,7 @@ public class UserDataView implements Serializable {
this.userSkipPrioritySteps = userData.getUserSkipPrioritySteps();
this.confirmEmptyManaPool = userData.confirmEmptyManaPool();
this.flagName = userData.getFlagName();
+ this.askMoveToGraveOrder = userData.askMoveToGraveOrder();
}
public int getAvatarId() {
@@ -62,5 +70,9 @@ public class UserDataView implements Serializable {
public String getFlagName() {
return flagName;
}
+
+ public boolean askMoveToGraveOrder() {
+ return askMoveToGraveOrder;
+ }
}
diff --git a/Mage.Network/pom.xml b/Mage.Network/pom.xml
index 56cfba07642..6f3d2c16525 100644
--- a/Mage.Network/pom.xml
+++ b/Mage.Network/pom.xml
@@ -5,7 +5,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
mage-network
diff --git a/Mage.Network/src/main/java/org/mage/network/Client.java b/Mage.Network/src/main/java/org/mage/network/Client.java
index b17b13a33a3..69b62b146ea 100644
--- a/Mage.Network/src/main/java/org/mage/network/Client.java
+++ b/Mage.Network/src/main/java/org/mage/network/Client.java
@@ -30,6 +30,7 @@ import mage.view.DraftPickView;
import mage.view.RoomView;
import mage.view.TableView;
import mage.view.TournamentView;
+import mage.view.UserDataView;
import mage.view.UserView;
import org.apache.log4j.Logger;
import org.mage.network.handlers.ExceptionHandler;
@@ -244,7 +245,7 @@ public class Client {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
- public void updatePreferencesForServer(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName) {
+ public void updatePreferencesForServer(UserDataView view) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
diff --git a/Mage.Plugins/Mage.Counter.Plugin/pom.xml b/Mage.Plugins/Mage.Counter.Plugin/pom.xml
index a17a51e3693..569f1399beb 100644
--- a/Mage.Plugins/Mage.Counter.Plugin/pom.xml
+++ b/Mage.Plugins/Mage.Counter.Plugin/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-plugins
- 1.4.0
+ 1.4.1
mage-counter-plugin
diff --git a/Mage.Plugins/Mage.Theme.Plugin/pom.xml b/Mage.Plugins/Mage.Theme.Plugin/pom.xml
index e03b2cd956f..053171cd390 100644
--- a/Mage.Plugins/Mage.Theme.Plugin/pom.xml
+++ b/Mage.Plugins/Mage.Theme.Plugin/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-plugins
- 1.4.0
+ 1.4.1
mage-theme-plugin
@@ -29,7 +29,7 @@
${project.groupId}
mage-client
- 1.4.0
+ 1.4.1
diff --git a/Mage.Plugins/pom.xml b/Mage.Plugins/pom.xml
index 082e3e65096..cc48ed5c7be 100644
--- a/Mage.Plugins/pom.xml
+++ b/Mage.Plugins/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
mage-plugins
diff --git a/Mage.Server.Console/pom.xml b/Mage.Server.Console/pom.xml
index be3f68f1555..b4cb5b65383 100644
--- a/Mage.Server.Console/pom.xml
+++ b/Mage.Server.Console/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
org.mage
diff --git a/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java b/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java
index c568d9e79b0..0196311d25b 100644
--- a/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java
+++ b/Mage.Server.Console/src/main/java/mage/server/console/ConsolePanel.java
@@ -94,10 +94,10 @@ public class ConsolePanel extends javax.swing.JPanel {
public void start() {
- updateUsersTask = new UpdateUsersTask(ConsoleFrame.getClient(), this);
- updateTablesTask = new UpdateTablesTask(ConsoleFrame.getClient(), ConsoleFrame.getClient().getMainRoomId(), this);
- updateUsersTask.execute();
- updateTablesTask.execute();
+// updateUsersTask = new UpdateUsersTask(ConsoleFrame.getClient(), this);
+// updateTablesTask = new UpdateTablesTask(ConsoleFrame.getClient(), ConsoleFrame.getClient().getMainRoomId(), this);
+// updateUsersTask.execute();
+// updateTablesTask.execute();
}
public void stop() {
diff --git a/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml b/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml
index 17ed6709e3e..eeb227fab7b 100644
--- a/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml
+++ b/Mage.Server.Plugins/Mage.Deck.Constructed/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-deck-constructed
diff --git a/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml b/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml
index aaf2a0c6c0a..5ba54ada61d 100644
--- a/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml
+++ b/Mage.Server.Plugins/Mage.Deck.Limited/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-deck-limited
diff --git a/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml
index 198839d0f23..21d3ecfae31 100644
--- a/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml
+++ b/Mage.Server.Plugins/Mage.Game.CommanderDuel/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-game-commanderduel
diff --git a/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml b/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml
index d83276362cc..f0fa53feb71 100644
--- a/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml
+++ b/Mage.Server.Plugins/Mage.Game.CommanderFreeForAll/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-game-commanderfreeforall
diff --git a/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml b/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml
index d44c53517b5..79201f719e6 100644
--- a/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml
+++ b/Mage.Server.Plugins/Mage.Game.FreeForAll/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-game-freeforall
diff --git a/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml
index 3ed7020bf77..995624a110d 100644
--- a/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml
+++ b/Mage.Server.Plugins/Mage.Game.TinyLeadersDuel/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-game-tinyleadersduel
diff --git a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml
index fe7e465d170..822af7beeff 100644
--- a/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml
+++ b/Mage.Server.Plugins/Mage.Game.TwoPlayerDuel/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-game-twoplayerduel
diff --git a/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml b/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml
index 13e94e25e60..eb5254b9266 100644
--- a/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml
+++ b/Mage.Server.Plugins/Mage.Player.AI.DraftBot/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-player-ai-draftbot
diff --git a/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml b/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml
index 8bbe618537c..d905d12ec1b 100644
--- a/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml
+++ b/Mage.Server.Plugins/Mage.Player.AI.MA/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-player-ai-ma
diff --git a/Mage.Server.Plugins/Mage.Player.AI/pom.xml b/Mage.Server.Plugins/Mage.Player.AI/pom.xml
index d4308dc2e4f..6c90d7e1d56 100644
--- a/Mage.Server.Plugins/Mage.Player.AI/pom.xml
+++ b/Mage.Server.Plugins/Mage.Player.AI/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-player-ai
diff --git a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java
index e10917f2746..dda37ca177f 100644
--- a/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java
+++ b/Mage.Server.Plugins/Mage.Player.AI/src/main/java/mage/player/ai/ComputerPlayer.java
@@ -175,7 +175,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
public ComputerPlayer(String name, RangeOfInfluence range) {
super(name, range);
human = false;
- userData = new UserData(UserGroup.COMPUTER, 64, false, true, false, null, "Computer.png");
+ userData = new UserData(UserGroup.COMPUTER, 64, false, true, false, null, "Computer.png", false);
pickedCards = new ArrayList<>();
}
@@ -208,7 +208,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (log.isDebugEnabled()) {
log.debug("chooseTarget: " + outcome.toString() + ":" + target.toString());
}
- // sometimes a target aelection can be made from a player that does not control the ability
+ // sometimes a target selection can be made from a player that does not control the ability
UUID abilityControllerId = playerId;
if (target.getTargetController() != null && target.getAbilityController() != null) {
abilityControllerId = target.getAbilityController();
@@ -311,8 +311,9 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (card != null) {
cards.add(card);
}
- }
- while(!target.isChosen() && !cards.isEmpty()) {
+ }
+ while((outcome.isGood() ? target.getTargets().size() < target.getMaxNumberOfTargets() : !target.isChosen())
+ && !cards.isEmpty()) {
Card pick = pickTarget(cards, outcome, target, null, game);
if (pick != null) {
target.addTarget(pick.getId(), null, game);
@@ -507,7 +508,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
if (target instanceof TargetDiscard || target instanceof TargetCardInHand) {
if (outcome.isGood()) {
ArrayList cardsInHand = new ArrayList<>(hand.getCards(game));
- while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() < target.getTargets().size()) {
+ while (!target.isChosen() && !cardsInHand.isEmpty() && target.getMaxNumberOfTargets() > target.getTargets().size()) {
Card card = pickBestCard(cardsInHand, null, target, source, game);
if (card != null) {
if (target.canTarget(card.getId(), source, game)) {
diff --git a/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml b/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml
index 86f8bf80990..ef53791b090 100644
--- a/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml
+++ b/Mage.Server.Plugins/Mage.Player.AIMCTS/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-player-ai-mcts
diff --git a/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml b/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml
index 5223670dca0..7f31cb06928 100644
--- a/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml
+++ b/Mage.Server.Plugins/Mage.Player.AIMinimax/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-player-aiminimax
diff --git a/Mage.Server.Plugins/Mage.Player.Human/pom.xml b/Mage.Server.Plugins/Mage.Player.Human/pom.xml
index 9e7c35f9d90..d76184bfd64 100644
--- a/Mage.Server.Plugins/Mage.Player.Human/pom.xml
+++ b/Mage.Server.Plugins/Mage.Player.Human/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-player-human
diff --git a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml
index a54a82d6f56..897b17155a2 100644
--- a/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml
+++ b/Mage.Server.Plugins/Mage.Tournament.BoosterDraft/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-tournament-boosterdraft
diff --git a/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml b/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml
index 272aa4bdf8f..a4c096d5073 100644
--- a/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml
+++ b/Mage.Server.Plugins/Mage.Tournament.Constructed/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-tournament-constructed
diff --git a/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml b/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml
index 1727046d60a..37b534066be 100644
--- a/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml
+++ b/Mage.Server.Plugins/Mage.Tournament.Sealed/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-server-plugins
- 1.4.0
+ 1.4.1
mage-tournament-sealed
diff --git a/Mage.Server.Plugins/pom.xml b/Mage.Server.Plugins/pom.xml
index eb1522dccf4..6aa5662ff10 100644
--- a/Mage.Server.Plugins/pom.xml
+++ b/Mage.Server.Plugins/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
mage-server-plugins
diff --git a/Mage.Server/pom.xml b/Mage.Server/pom.xml
index cfb5b2e6bef..14420a64136 100644
--- a/Mage.Server/pom.xml
+++ b/Mage.Server/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
mage-server
diff --git a/Mage.Server/release/server.msg.txt b/Mage.Server/release/server.msg.txt
index c6bb6c677ec..f9309549e1d 100644
--- a/Mage.Server/release/server.msg.txt
+++ b/Mage.Server/release/server.msg.txt
@@ -1,4 +1,4 @@
-Welcome! You are playing XMage version 1.3.0
+Welcome! You are playing XMage version 1.4.1
Find what was changed since previous versions on project Wiki https://github.com/magefree/mage/wiki
Contact us on the XMAGE board of http://www.slightlymagic.net/forum/viewforum.php?f=70 for bug reports or enhancement requests.
-Download newest version from http://XMage.info.
\ No newline at end of file
+Download newest version from http://XMage.de
\ No newline at end of file
diff --git a/Mage.Server/server.msg.txt b/Mage.Server/server.msg.txt
index 17ea51ac05a..7ef6a5c492c 100644
--- a/Mage.Server/server.msg.txt
+++ b/Mage.Server/server.msg.txt
@@ -2,5 +2,5 @@ HotKeys: Alt+E - Enlarge card image
Wheel zoom in/out - Enlarge card image
F4 - end current turn, response to stack
F9 - skip all opponents' turns, no response to stack
-Welcome! You are playing Mage version 1.4.0
+Welcome! You are playing Mage version 1.4.1
Contact us on www.slightlymagic.net
\ No newline at end of file
diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java
index 8a295a99437..3bdc92315a4 100644
--- a/Mage.Server/src/main/java/mage/server/Session.java
+++ b/Mage.Server/src/main/java/mage/server/Session.java
@@ -140,7 +140,7 @@ public class Session {
}
this.userId = user.getId();
- setUserData(user, connection);
+ setUserData(user, connection.getUserData());
if (reconnect) { // must be connected to receive the message
UUID chatId = GamesRoomManager.getInstance().getRoom(GamesRoomManager.getInstance().getMainRoomId()).getChatId();
@@ -158,32 +158,33 @@ public class Session {
if (user == null) {
user = UserManager.getInstance().findUser("Admin");
}
- user.setUserData(new UserData(UserGroup.ADMIN, 0, false, false, false, null, "world.png"));
+ user.setUserData(new UserData(UserGroup.ADMIN, 0, false, false, false, null, "world.png", false));
if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) {
logger.info("Error connecting Admin!");
}
this.userId = user.getId();
}
- public boolean setUserData(User user, Connection connection) {
+ public boolean setUserData(User user, UserDataView userDataView) {
// User user = UserManager.getInstance().findUser(userName);
if (user != null) {
UserData userData = user.getUserData();
if (userData == null) {
- userData = new UserData(UserGroup.PLAYER, connection.getAvatarId(),
- connection.isShowAbilityPickerForced(), connection.allowRequestShowHandCards(),
- connection.confirmEmptyManaPool(), connection.getUserSkipPrioritySteps(),
- connection.getFlagName());
+ userData = new UserData(UserGroup.PLAYER, userDataView.getAvatarId(),
+ userDataView.isShowAbilityPickerForced(), userDataView.allowRequestShowHandCards(),
+ userDataView.confirmEmptyManaPool(), userDataView.getUserSkipPrioritySteps(),
+ userDataView.getFlagName(), userDataView.askMoveToGraveOrder());
user.setUserData(userData);
} else {
- if (connection.getAvatarId() == 51) { // Update special avatar if first avatar is selected
- updateAvatar(connection.getUsername(), userData);
+ if (userData.getAvatarId() == 51) { // Update special avatar if first avatar is selected
+ updateAvatar(user.getName(), userData);
}
- userData.setAvatarId(connection.getAvatarId());
- userData.setShowAbilityPickerForced(connection.isShowAbilityPickerForced());
- userData.setAllowRequestShowHandCards(connection.allowRequestShowHandCards());
- userData.setUserSkipPrioritySteps(connection.getUserSkipPrioritySteps());
- userData.setConfirmEmptyManaPool(connection.confirmEmptyManaPool());
+ userData.setAvatarId(userDataView.getAvatarId());
+ userData.setShowAbilityPickerForced(userDataView.isShowAbilityPickerForced());
+ userData.setAllowRequestShowHandCards(userDataView.allowRequestShowHandCards());
+ userData.setUserSkipPrioritySteps(userDataView.getUserSkipPrioritySteps());
+ userData.setConfirmEmptyManaPool(userDataView.confirmEmptyManaPool());
+ userData.setAskMoveToGraveOrder(userDataView.askMoveToGraveOrder());
}
return true;
}
diff --git a/Mage.Server/src/main/java/mage/server/game/GameController.java b/Mage.Server/src/main/java/mage/server/game/GameController.java
index ce123e88b5e..4d1feba65b9 100644
--- a/Mage.Server/src/main/java/mage/server/game/GameController.java
+++ b/Mage.Server/src/main/java/mage/server/game/GameController.java
@@ -605,8 +605,8 @@ public class GameController implements GameCallback {
if (grantingPlayer.isHuman()) {
GameSessionPlayer gameSession = gameSessions.get(userIdGranter);
if (gameSession != null) {
- UUID requestingPlayer = getPlayerId(userIdRequester);
- if (requestingPlayer == null || !requestingPlayer.equals(grantingPlayer.getId())) { // don't allow request for your own cards
+ UUID requestingPlayerId = getPlayerId(userIdRequester);
+ if (requestingPlayerId == null || !requestingPlayerId.equals(grantingPlayer.getId())) { // don't allow request for your own cards
if (grantingPlayer.isRequestToShowHandCardsAllowed()) {
gameSession.requestPermissionToSeeHandCards(userIdRequester);
} else {
diff --git a/Mage.Sets/pom.xml b/Mage.Sets/pom.xml
index 6974f845d0f..e5beb76c890 100644
--- a/Mage.Sets/pom.xml
+++ b/Mage.Sets/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
org.mage
diff --git a/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java b/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java
index 89ec238a681..66af16ece13 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/Crystallization.java
@@ -32,8 +32,8 @@ import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
-import mage.abilities.effects.common.combat.CantAttackBlockAttachedEffect;
import mage.abilities.effects.common.ExileTargetEffect;
+import mage.abilities.effects.common.combat.CantAttackBlockAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
@@ -43,6 +43,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@@ -101,17 +102,20 @@ class CrystallizationTriggeredAbility extends TriggeredAbilityImpl {
public CrystallizationTriggeredAbility copy() {
return new CrystallizationTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TARGETED) {
- Permanent enchantment = game.getPermanent(sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- UUID enchanted = enchantment.getAttachedTo();
- if (event.getTargetId().equals(enchanted)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(enchanted));
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ UUID enchanted = enchantment.getAttachedTo();
+ if (event.getTargetId().equals(enchanted)) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(enchanted));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java b/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java
index 6f7d65cb1b2..5ee8ca52d96 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -86,14 +87,15 @@ class DragonAppeasementTriggeredAbility extends TriggeredAbilityImpl {
return new DragonAppeasementTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SACRIFICED_PERMANENT;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT
- && event.getPlayerId().equals(this.getControllerId())
- && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.getControllerId())
+ && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java b/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java
index 819fd8fda9f..7cc940a7bf4 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/EnigmaSphinx.java
@@ -28,10 +28,6 @@
package mage.sets.alarareborn;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -41,8 +37,13 @@ import mage.abilities.keyword.CascadeAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Library;
@@ -101,20 +102,23 @@ class EnigmaSphinxTriggeredAbility extends TriggeredAbilityImpl {
return new EnigmaSphinxTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- Permanent permanent = zEvent.getTarget();
- if (permanent != null &&
- zEvent.getToZone() == Zone.GRAVEYARD &&
- zEvent.getFromZone() == Zone.BATTLEFIELD &&
- permanent.getId().equals(this.getSourceId()) &&
- // 5/1/2009 If you control an Enigma Sphinx that's owned by another player, it's put into that player's
- // graveyard from the battlefield, so Enigma Sphinx's middle ability won't trigger.
- permanent.getOwnerId().equals(permanent.getControllerId())) {
- return true;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ Permanent permanent = zEvent.getTarget();
+ if (permanent != null &&
+ zEvent.getToZone() == Zone.GRAVEYARD &&
+ zEvent.getFromZone() == Zone.BATTLEFIELD &&
+ permanent.getId().equals(this.getSourceId()) &&
+ // 5/1/2009 If you control an Enigma Sphinx that's owned by another player, it's put into that player's
+ // graveyard from the battlefield, so Enigma Sphinx's middle ability won't trigger.
+ permanent.getOwnerId().equals(permanent.getControllerId())) {
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java
index 6bc9d7e20fd..6680bd1cd15 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/FinestHour.java
@@ -29,23 +29,22 @@
package mage.sets.alarareborn;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.TurnPhase;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.ExaltedAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TurnPhase;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
-import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
/**
@@ -95,16 +94,19 @@ class FinestHourAbility extends TriggeredAbilityImpl {
return new FinestHourAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (checkInterveningIfClause(game) && game.getActivePlayerId().equals(this.controllerId)) {
- if (event.getType() == EventType.DECLARED_ATTACKERS) {
- if (game.getCombat().attacksAlone()) {
- for (Effect effect: this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
- }
- return true;
+ if (game.getActivePlayerId().equals(this.controllerId)) {
+ if (game.getCombat().attacksAlone()) {
+ for (Effect effect: this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java
index 46d20e93bba..7d87143fc83 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/GloryscaleViashino.java
@@ -29,16 +29,17 @@
package mage.sets.alarareborn;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -85,15 +86,15 @@ class GloryscaleViashinoAbility extends TriggeredAbilityImpl {
return new GloryscaleViashinoAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java b/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java
index b3227fb7012..5f68c93393f 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/MycoidShepherd.java
@@ -28,17 +28,17 @@
package mage.sets.alarareborn;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
@@ -83,24 +83,27 @@ class MycoidShepherdTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- MageObject lastKnown = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (lastKnown == null) {
- return false;
- }
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- Permanent permanent = zEvent.getTarget();
- if (permanent == null) {
- return false;
- }
- if (super.getSourceId().equals(event.getTargetId())
- || permanent.getPower().getValue() > 4
- && permanent.getControllerId().equals(controllerId)) {
- Zone after = game.getState().getZone(event.getTargetId());
- return after != null && Zone.GRAVEYARD.match(after);
- }
+ MageObject lastKnown = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (lastKnown == null) {
+ return false;
+ }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ Permanent permanent = zEvent.getTarget();
+ if (permanent == null) {
+ return false;
+ }
+ if (super.getSourceId().equals(event.getTargetId())
+ || permanent.getPower().getValue() > 4
+ && permanent.getControllerId().equals(controllerId)) {
+ Zone after = game.getState().getZone(event.getTargetId());
+ return after != null && Zone.GRAVEYARD.match(after);
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java b/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java
index 02289774433..fa3a33e7ef5 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/SigilCaptain.java
@@ -39,6 +39,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -83,21 +84,24 @@ class SigilCaptainTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent == null) {
- return false;
- }
- if (permanent.getControllerId().equals(controllerId)
- && permanent.getPower().getValue() == 1
- && permanent.getToughness().getValue() == 1) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent == null) {
+ return false;
+ }
+ if (permanent.getControllerId().equals(controllerId)
+ && permanent.getPower().getValue() == 1
+ && permanent.getToughness().getValue() == 1) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java b/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java
index 60407470419..f6f70200a1d 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/SovereignsOfLostAlara.java
@@ -28,10 +28,6 @@
package mage.sets.alarareborn;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -39,7 +35,10 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.ExaltedAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.other.AuraCardCanAttachToPermanentId;
@@ -99,14 +98,17 @@ class CreatureControlledAttacksAloneTriggeredAbility extends TriggeredAbilityImp
return new CreatureControlledAttacksAloneTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (game.getActivePlayerId().equals(this.controllerId)) {
- if (event.getType() == EventType.DECLARED_ATTACKERS) {
- if (game.getCombat().attacksAlone()) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
- return true;
- }
+ if (game.getCombat().attacksAlone()) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java b/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java
index 3028eded661..9fe05560f06 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/Thraximundar.java
@@ -44,6 +44,7 @@ import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -139,15 +140,15 @@ class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SACRIFICED_PERMANENT;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT) {
- MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (mageObject != null && mageObject.getCardType().contains(CardType.CREATURE)) {
- return true;
- }
- }
- return false;
+ MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ return mageObject != null && mageObject.getCardType().contains(CardType.CREATURE);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java b/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java
index 5edada9ccb2..388649436cd 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/TraceOfAbundance.java
@@ -28,18 +28,15 @@
package mage.sets.alarareborn;
import java.util.UUID;
-import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AddManaAnyColorAttachedControllerEffect;
import mage.abilities.effects.common.AttachEffect;
-import mage.abilities.effects.common.ManaEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ShroudAbility;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
-import mage.choices.ChoiceColor;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Duration;
@@ -48,8 +45,8 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
-import mage.players.Player;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -109,15 +106,15 @@ class TraceOfAbundanceTriggeredAbility extends TriggeredManaAbility {
return new TraceOfAbundanceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.getSourceId());
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) {
- if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- return true;
- }
- }
- return false;
+ return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java b/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java
index b4bf3105dd5..b89373ee45c 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java
@@ -48,6 +48,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.ZombieToken;
@@ -103,9 +104,14 @@ class UnscytheKillerOfKingsTriggeredAbility extends TriggeredAbilityImpl {
return new UnscytheKillerOfKingsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
+ if (((ZoneChangeEvent) event).isDiesEvent()) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getTarget().getCardType().contains(CardType.CREATURE)) { // target token can't create Zombie
Permanent equipment = game.getPermanent(getSourceId());
diff --git a/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java b/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java
index f69fcb53d0c..ddd5bc56763 100644
--- a/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java
+++ b/Mage.Sets/src/mage/sets/alarareborn/VedalkenGhoul.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -82,9 +83,14 @@ class VedalkenGhoulTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.CREATURE_BLOCKED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.CREATURE_BLOCKED && event.getTargetId().equals(this.getSourceId())) {
+ if (event.getTargetId().equals(this.getSourceId())) {
UUID defendingPlayer = game.getCombat().getDefenderId(this.getSourceId());
if (defendingPlayer != null) {
for (Effect effect : this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/alliances/YavimayaAnts.java b/Mage.Sets/src/mage/sets/alliances/YavimayaAnts.java
new file mode 100644
index 00000000000..db233aee603
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/alliances/YavimayaAnts.java
@@ -0,0 +1,70 @@
+/*
+ * 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.alliances;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.keyword.TrampleAbility;
+import mage.abilities.keyword.HasteAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.keyword.CumulativeUpkeepAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class YavimayaAnts extends CardImpl {
+
+ public YavimayaAnts(UUID ownerId) {
+ super(ownerId, 93, "Yavimaya Ants", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
+ this.expansionSetCode = "ALL";
+ this.subtype.add("Insect");
+ this.power = new MageInt(5);
+ this.toughness = new MageInt(1);
+
+ // Trample
+ this.addAbility(TrampleAbility.getInstance());
+ // Haste
+ this.addAbility(HasteAbility.getInstance());
+ // Cumulative upkeep {G}{G}
+ this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{G}{G}")));
+ }
+
+ public YavimayaAnts(final YavimayaAnts card) {
+ super(card);
+ }
+
+ @Override
+ public YavimayaAnts copy() {
+ return new YavimayaAnts(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java b/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java
new file mode 100644
index 00000000000..3e593593680
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/antiquities/CitanulDruid.java
@@ -0,0 +1,76 @@
+/*
+ * 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.antiquities;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.SpellCastOpponentTriggeredAbility;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.SetTargetPointer;
+import mage.constants.TargetController;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import mage.filter.common.FilterArtifactSpell;
+import mage.filter.predicate.permanent.ControllerPredicate;
+
+/**
+ *
+ * @author anonymous
+ */
+public class CitanulDruid extends CardImpl {
+ private static final FilterArtifactSpell filter = new FilterArtifactSpell();
+
+ static {
+ filter.add(new ControllerPredicate(TargetController.OPPONENT));
+ }
+
+
+ public CitanulDruid(UUID ownerId) {
+ super(ownerId, 61, "Citanul Druid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}");
+ this.expansionSetCode = "ATQ";
+ this.subtype.add("Human");
+ this.subtype.add("Druid");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(1);
+
+ // Whenever an opponent casts an artifact spell, put a +1/+1 counter on Citanul Druid.
+ this.addAbility(new SpellCastOpponentTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, false));
+ }
+
+ public CitanulDruid(final CitanulDruid card) {
+ super(card);
+ }
+
+ @Override
+ public CitanulDruid copy() {
+ return new CitanulDruid(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/antiquities/Onulet.java b/Mage.Sets/src/mage/sets/antiquities/Onulet.java
new file mode 100644
index 00000000000..d27a886f10f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/antiquities/Onulet.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.antiquities;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class Onulet extends mage.sets.mastersedition.Onulet {
+
+ public Onulet(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 24;
+ this.expansionSetCode = "ATQ";
+ this.rarity = Rarity.UNCOMMON;
+ }
+
+ public Onulet(final Onulet card) {
+ super(card);
+ }
+
+ @Override
+ public Onulet copy() {
+ return new Onulet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java b/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.java
new file mode 100644
index 00000000000..e1e494a7351
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/antiquities/StaffOfZegon.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.antiquities;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class StaffOfZegon extends mage.sets.masterseditioniv.StaffOfZegon {
+
+ public StaffOfZegon(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 30;
+ this.expansionSetCode = "ATQ";
+ }
+
+ public StaffOfZegon(final StaffOfZegon card) {
+ super(card);
+ }
+
+ @Override
+ public StaffOfZegon copy() {
+ return new StaffOfZegon(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java
index 303c2e9131c..efc75cfd615 100644
--- a/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java
+++ b/Mage.Sets/src/mage/sets/apocalypse/BogGnarr.java
@@ -29,20 +29,20 @@
package mage.sets.apocalypse;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -87,15 +87,15 @@ class BogGnarrTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && filter.match(spell, game)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && filter.match(spell, game);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java b/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java
index 537e1291d33..4ff643a49d7 100644
--- a/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java
+++ b/Mage.Sets/src/mage/sets/apocalypse/GladeGnarr.java
@@ -27,23 +27,23 @@
*/
package mage.sets.apocalypse;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
-import java.util.UUID;
-
/**
* @author Loki
*/
@@ -85,15 +85,15 @@ class GladeGnarrTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && filter.match(spell, game)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && filter.match(spell, game);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java
new file mode 100644
index 00000000000..840710323ef
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/arabiannights/ErgRaiders.java
@@ -0,0 +1,53 @@
+/*
+ * 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.arabiannights;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders {
+
+ public ErgRaiders(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 3;
+ this.expansionSetCode = "ARN";
+ }
+
+ public ErgRaiders(final ErgRaiders card) {
+ super(card);
+ }
+
+ @Override
+ public ErgRaiders copy() {
+ return new ErgRaiders(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java
new file mode 100644
index 00000000000..767c07fa5c3
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/arabiannights/HasranOgress.java
@@ -0,0 +1,53 @@
+/*
+ * 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.arabiannights;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class HasranOgress extends mage.sets.masterseditioniv.HasranOgress {
+
+ public HasranOgress(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 6;
+ this.expansionSetCode = "ARN";
+ }
+
+ public HasranOgress(final HasranOgress card) {
+ super(card);
+ }
+
+ @Override
+ public HasranOgress copy() {
+ return new HasranOgress(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/archenemy/Fertilid.java b/Mage.Sets/src/mage/sets/archenemy/Fertilid.java
new file mode 100644
index 00000000000..df59cab005e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/archenemy/Fertilid.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.archenemy;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class Fertilid extends mage.sets.commander.Fertilid {
+
+ public Fertilid(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 54;
+ this.expansionSetCode = "ARC";
+ }
+
+ public Fertilid(final Fertilid card) {
+ super(card);
+ }
+
+ @Override
+ public Fertilid copy() {
+ return new Fertilid(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java b/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java
index d181d91f344..a6f0e7964a5 100644
--- a/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java
+++ b/Mage.Sets/src/mage/sets/avacynrestored/DescendantsPath.java
@@ -27,7 +27,6 @@
*/
package mage.sets.avacynrestored;
-import java.util.ArrayList;
import java.util.UUID;
import mage.constants.CardType;
@@ -42,11 +41,10 @@ import mage.cards.CardsImpl;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.filter.common.FilterControlledCreaturePermanent;
-import mage.filter.predicate.Predicate;
-import mage.filter.predicate.Predicates;
-import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
+import mage.game.permanent.Permanent;
import mage.players.Player;
+import mage.util.CardUtil;
/**
*
@@ -59,7 +57,6 @@ public class DescendantsPath extends CardImpl {
super(ownerId, 173, "Descendants' Path", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.expansionSetCode = "AVR";
-
// At the beginning of your upkeep, reveal the top card of your library. If it's a creature card that shares a creature type with a creature you control, you may cast that card without paying its mana cost. Otherwise, put that card on the bottom of your library.
Ability ability = new BeginningOfUpkeepTriggeredAbility(new DescendantsPathEffect(), TargetController.YOU, false);
this.addAbility(ability);
@@ -93,36 +90,39 @@ class DescendantsPathEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- if (player != null) {
- if (player.getLibrary().size() > 0) {
- Card card = player.getLibrary().getFromTop(game);
- player.revealCards("DescendantsPath", new CardsImpl(card), game);
- if (card.getCardType().contains(CardType.CREATURE)) {
+ Player controller = game.getPlayer(source.getControllerId());
+ MageObject sourceObject = source.getSourceObject(game);
+ if (controller != null && sourceObject != null) {
+ if (controller.getLibrary().size() > 0) {
+ Card card = controller.getLibrary().getFromTop(game);
+ if (card == null) {
+ return false;
+ }
+ controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
+ if (card.getCardType().contains(CardType.CREATURE)) {
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
-
- ArrayList> subtypes = new ArrayList<>();
- for (String subtype: card.getSubtype()) {
- subtypes.add(new SubtypePredicate(subtype));
+ boolean found = false;
+ for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
+ if (CardUtil.shareSubtypes(card, permanent)) {
+ found = true;
+ break;
+ }
}
- filter.add(Predicates.or(subtypes));
-
- int count = game.getBattlefield().getAllActivePermanents(filter, player.getId(), game).size();
- if (count > 0) {
- game.informPlayers("DescendantsPath: Found a creature that shares a creature type with the revealed card.");
- if (player.chooseUse(Outcome.Benefit, "Cast the card?", game)) {
- player.cast(card.getSpellAbility(), game, true);
+ if (found) {
+ game.informPlayers(sourceObject.getLogName() + ": Found a creature that shares a creature type with the revealed card.");
+ if (controller.chooseUse(Outcome.Benefit, "Cast the card?", game)) {
+ controller.cast(card.getSpellAbility(), game, true);
} else {
- game.informPlayers("DescendantsPath: " + player.getLogName() + " canceled casting the card.");
- player.getLibrary().putOnBottom(card, game);
+ game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " canceled casting the card.");
+ controller.getLibrary().putOnBottom(card, game);
}
} else {
- game.informPlayers("DescendantsPath: No creature that shares a creature type with the revealed card.");
- player.getLibrary().putOnBottom(card, game);
+ game.informPlayers(sourceObject.getLogName() + ": No creature that shares a creature type with the revealed card.");
+ controller.getLibrary().putOnBottom(card, game);
}
} else {
- game.informPlayers("DescendantsPath: put " + card.getName() + " on the bottom.");
- player.getLibrary().putOnBottom(card, game);
+ game.informPlayers(sourceObject.getLogName() + ": Put " + card.getLogName() + " on the bottom.");
+ controller.getLibrary().putOnBottom(card, game);
}
return true;
diff --git a/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java b/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java
index 14fb15e506a..3dae9353e98 100644
--- a/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java
+++ b/Mage.Sets/src/mage/sets/avacynrestored/ExquisiteBlood.java
@@ -27,16 +27,16 @@
*/
package mage.sets.avacynrestored;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
-
-import java.util.UUID;
+import mage.game.events.GameEvent.EventType;
/**
* @author noxx
@@ -78,9 +78,14 @@ class ExquisiteBloodTriggeredAbility extends TriggeredAbilityImpl {
return new ExquisiteBloodTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LOST_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LOST_LIFE && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
this.getEffects().clear();
this.addEffect(new GainLifeEffect(event.getAmount()));
return true;
diff --git a/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java b/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java
index b4bbb836910..68e82eb0f99 100644
--- a/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java
+++ b/Mage.Sets/src/mage/sets/avacynrestored/HavengulSkaab.java
@@ -27,22 +27,22 @@
*/
package mage.sets.avacynrestored;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetControlledCreaturePermanent;
-import java.util.UUID;
-
/**
*
* @author noxx
@@ -89,9 +89,14 @@ class HavengulSkaabAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
+ if (event.getSourceId().equals(this.getSourceId())) {
TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(1, 1, filter, false);
this.addTarget(target);
return true;
diff --git a/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java b/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java
index 515e0e80d7e..0024d46d9cb 100644
--- a/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java
+++ b/Mage.Sets/src/mage/sets/avacynrestored/LoneRevenant.java
@@ -42,6 +42,7 @@ import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -91,10 +92,14 @@ class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl {
return new LoneRevenantTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent permanent = game.getPermanent(event.getSourceId());
int number = game.getBattlefield().countAll(filter, controllerId, game);
diff --git a/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java b/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java
index 244365d90a4..7923ce030b3 100644
--- a/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java
+++ b/Mage.Sets/src/mage/sets/avacynrestored/SpectralPrison.java
@@ -27,9 +27,8 @@
*/
package mage.sets.avacynrestored;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.abilities.Ability;
+import java.util.UUID;
+import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
@@ -37,18 +36,18 @@ import mage.abilities.effects.common.DestroySourceEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
+import mage.game.stack.Spell;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
-import java.util.UUID;
-import mage.MageObject;
-import mage.game.stack.Spell;
-
/**
*
* @author noxx
@@ -99,16 +98,19 @@ class SpectralPrisonAbility extends TriggeredAbilityImpl {
return new SpectralPrisonAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TARGETED) {
- MageObject eventSourceObject = game.getObject(event.getSourceId());
- if (eventSourceObject != null && eventSourceObject instanceof Spell) {
- Permanent enchantment = game.getPermanent(sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- if (event.getTargetId().equals(enchantment.getAttachedTo())) {
- return true;
- }
+ MageObject eventSourceObject = game.getObject(event.getSourceId());
+ if (eventSourceObject != null && eventSourceObject instanceof Spell) {
+ Permanent enchantment = game.getPermanent(sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ if (event.getTargetId().equals(enchantment.getAttachedTo())) {
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java
index 7c265a37cec..992fc08f1af 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/JettingGlasskite.java
@@ -28,14 +28,14 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -93,9 +93,13 @@ class JettingGlasskiteAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) {
this.getTargets().clear();
TargetStackObject target = new TargetStackObject();
target.add(event.getSourceId(), game);
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java
index 21a31b702d6..921e4ddb136 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KamiOfTheHonoredDead.java
@@ -28,10 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -39,9 +35,13 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.SoulshiftAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -92,11 +92,16 @@ class KamiOfTheHonoredDeadTriggeredAbility extends TriggeredAbilityImpl {
return new KamiOfTheHonoredDeadTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- return true;
+ if (event.getTargetId().equals(this.sourceId)) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java
index 4fb87fe03d0..abdfe0da0fe 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/KiraGreatGlassSpinner.java
@@ -30,10 +30,6 @@ package mage.sets.betrayersofkamigawa;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -41,6 +37,10 @@ import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -102,20 +102,25 @@ class KiraGreatGlassSpinnerAbility extends TriggeredAbilityImpl {
return new KiraGreatGlassSpinnerAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId())) {
+ if (event.getTargetId().equals(this.getSourceId())) {
Integer turn = turnUsed.get(event.getTargetId());
- if (turn == null || turn.intValue() < game.getTurnNum()) {
+ if (turn == null || turn < game.getTurnNum()) {
this.getTargets().clear();
TargetStackObject target = new TargetStackObject();
target.add(event.getSourceId(), game);
this.addTarget(target);
if (turnUsed.containsKey(event.getTargetId())) {
turnUsed.remove(event.getTargetId());
- turnUsed.put(event.getTargetId(),new Integer(game.getTurnNum()));
+ turnUsed.put(event.getTargetId(), game.getTurnNum());
} else {
- turnUsed.put(event.getTargetId(), new Integer(game.getTurnNum()));
+ turnUsed.put(event.getTargetId(), game.getTurnNum());
}
return true;
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java
index 9ba3ec0dcae..98dbfb2c5b4 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MarkOfSakiko.java
@@ -44,8 +44,9 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
-import mage.game.events.DamagedPlayerEvent;
+import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
@@ -101,18 +102,21 @@ class MarkOfSakikoTriggeredAbility extends TriggeredAbilityImpl {
return new MarkOfSakikoTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if (((DamagedPlayerEvent) event).isCombatDamage()) {
- if (event.getSourceId().equals(getSourceId())) {
- this.getEffects().clear();
- Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true);
- effect.setTargetPointer(new FixedTarget(getControllerId()));
- effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end");
- this.addEffect(effect);
- return true;
- }
+ if (((DamagedEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(getSourceId())) {
+ this.getEffects().clear();
+ Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true);
+ effect.setTargetPointer(new FixedTarget(getControllerId()));
+ effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end");
+ this.addEffect(effect);
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java
index 27ae8a62520..c791bf1df22 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/MistbladeShinobi.java
@@ -28,20 +28,21 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.NinjutsuAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
@@ -92,10 +93,14 @@ class MistbladeShinobiTriggeredAbility extends TriggeredAbilityImpl {
return new MistbladeShinobiTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent
- && ((DamagedPlayerEvent) event).isCombatDamage()
+ if (((DamagedPlayerEvent) event).isCombatDamage()
&& event.getSourceId().equals(sourceId)) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null) {
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java
index 12998823283..4ad31655ef8 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/PatronOfTheNezumi.java
@@ -28,9 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
@@ -38,6 +35,9 @@ import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.keyword.OfferingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -87,17 +87,20 @@ class PatronOfTheNezumiTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD
- && zEvent.getToZone() == Zone.GRAVEYARD) {
- Card card = game.getCard(zEvent.getTargetId());
- if (card != null && game.getOpponents(controllerId).contains(card.getOwnerId())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(zEvent.getPlayerId()));
- return true;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD
+ && zEvent.getToZone() == Zone.GRAVEYARD) {
+ Card card = game.getCard(zEvent.getTargetId());
+ if (card != null && game.getOpponents(controllerId).contains(card.getOwnerId())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(zEvent.getPlayerId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java
index 76bacd56dc5..fedf501ce0e 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/RoninWarclub.java
@@ -28,10 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -40,8 +36,13 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
@@ -88,25 +89,28 @@ public class RoninWarclub extends CardImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent.getCardType().contains(CardType.CREATURE)
- && (permanent.getControllerId().equals(this.controllerId))) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
- if (!this.getTargets().isEmpty()) {
- // remove previous target
- if (this.getTargets().get(0).getTargets().size() > 0) {
- this.getTargets().clear();
- this.addTarget(new TargetCreaturePermanent());
- }
- Target target = this.getTargets().get(0);
- if (target instanceof TargetCreaturePermanent) {
- target.add(event.getTargetId(), game);
- }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent.getCardType().contains(CardType.CREATURE)
+ && (permanent.getControllerId().equals(this.controllerId))) {
+
+ if (!this.getTargets().isEmpty()) {
+ // remove previous target
+ if (this.getTargets().get(0).getTargets().size() > 0) {
+ this.getTargets().clear();
+ this.addTarget(new TargetCreaturePermanent());
+ }
+ Target target = this.getTargets().get(0);
+ if (target instanceof TargetCreaturePermanent) {
+ target.add(event.getTargetId(), game);
}
- return true;
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java
index 11375e1b5bb..fe8a3787c2f 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/SakikoMotherOfSummer.java
@@ -33,15 +33,14 @@ import mage.Mana;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
-import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
-import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -91,19 +90,22 @@ class SakikoMotherOfSummerTriggeredAbility extends TriggeredAbilityImpl {
return new SakikoMotherOfSummerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if (((DamagedPlayerEvent) event).isCombatDamage()) {
- Permanent creature = game.getPermanent(event.getSourceId());
- if (creature != null && creature.getControllerId().equals(controllerId)) {
- this.getEffects().clear();
- Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true);
- effect.setTargetPointer(new FixedTarget(creature.getControllerId()));
- effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end");
- this.addEffect(effect);
- return true;
- }
+ if (((DamagedPlayerEvent) event).isCombatDamage()) {
+ Permanent creature = game.getPermanent(event.getSourceId());
+ if (creature != null && creature.getControllerId().equals(controllerId)) {
+ this.getEffects().clear();
+ Effect effect = new AddManaToManaPoolTargetControllerEffect(new Mana(0,event.getAmount(),0,0,0,0,0), "that player", true);
+ effect.setTargetPointer(new FixedTarget(creature.getControllerId()));
+ effect.setText("add that much {G} to your mana pool. Until end of turn, this mana doesn't empty from your mana pool as steps and phases end");
+ this.addEffect(effect);
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java
index 4f22ae29dad..9d43915b660 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShimmeringGlasskite.java
@@ -28,14 +28,14 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -93,9 +93,13 @@ class ShimmeringGlasskiteAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ if (event.getTargetId().equals(this.getSourceId()) && game.getTurnNum() > turnUsed) {
this.getTargets().clear();
TargetStackObject target = new TargetStackObject();
target.add(event.getSourceId(), game);
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java
index 0cec7744018..58f970e9d42 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ShireiShizosCaretaker.java
@@ -92,25 +92,28 @@ class ShireiShizosCaretakerTriggeredAbility extends TriggeredAbilityImpl {
public ShireiShizosCaretakerTriggeredAbility copy() {
return new ShireiShizosCaretakerTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- Permanent LKIpermanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId());
- Card card = game.getCard(zEvent.getTargetId());
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ Permanent LKIpermanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId());
+ Card card = game.getCard(zEvent.getTargetId());
- if (card != null && LKIpermanent != null &&
- card.getOwnerId().equals(this.controllerId) &&
- zEvent.getToZone() == Zone.GRAVEYARD &&
- zEvent.getFromZone() == Zone.BATTLEFIELD &&
- card.getCardType().contains(CardType.CREATURE) &&
- LKIpermanent.getPower().getValue() <= 1) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(zEvent.getTargetId()));
- }
- return true;
+ if (card != null && LKIpermanent != null &&
+ card.getOwnerId().equals(this.controllerId) &&
+ zEvent.getToZone() == Zone.GRAVEYARD &&
+ zEvent.getFromZone() == Zone.BATTLEFIELD &&
+ card.getCardType().contains(CardType.CREATURE) &&
+ LKIpermanent.getPower().getValue() <= 1) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(zEvent.getTargetId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java
index 9cec6dbae47..7031cef6449 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/Skullsnatcher.java
@@ -28,9 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
@@ -38,6 +35,8 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.NinjutsuAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.common.FilterControlledCreaturePermanent;
@@ -46,6 +45,7 @@ import mage.filter.predicate.permanent.UnblockedPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCardInOpponentsGraveyard;
/**
@@ -103,10 +103,14 @@ class SkullsnatcherTriggeredAbility extends TriggeredAbilityImpl {
return new SkullsnatcherTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent
- && ((DamagedPlayerEvent) event).isCombatDamage()
+ if (((DamagedPlayerEvent) event).isCombatDamage()
&& event.getSourceId().equals(sourceId)) {
FilterCard filter = new FilterCard("up to two target cards from that player's graveyard");
diff --git a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java
index 96855f251f4..73ae590b27d 100644
--- a/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java
+++ b/Mage.Sets/src/mage/sets/betrayersofkamigawa/ThroatSlitter.java
@@ -28,9 +28,6 @@
package mage.sets.betrayersofkamigawa;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
@@ -38,6 +35,9 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.NinjutsuAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
@@ -45,6 +45,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.TargetPermanent;
/**
@@ -94,10 +95,14 @@ class ThroatSlitterTriggeredAbility extends TriggeredAbilityImpl {
return new ThroatSlitterTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent
- && ((DamagedPlayerEvent) event).isCombatDamage()
+ if (((DamagedPlayerEvent) event).isCombatDamage()
&& event.getSourceId().equals(sourceId)) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("nonblack creature that player controls");
diff --git a/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java b/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java
index 625795542a5..a249d46d935 100644
--- a/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java
+++ b/Mage.Sets/src/mage/sets/bornofthegods/PerplexingChimera.java
@@ -45,6 +45,7 @@ import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
@@ -130,9 +131,14 @@ class PerplexingChimeraTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
for (Effect effect: this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java b/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java
index 7b5e3326382..c7e59facd09 100644
--- a/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java
+++ b/Mage.Sets/src/mage/sets/bornofthegods/SearingBlood.java
@@ -115,9 +115,14 @@ class SearingBloodDelayedTriggeredAbility extends DelayedTriggeredAbility {
this.target = ability.target;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(target)) {
+ if (event.getTargetId().equals(target)) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
return true;
diff --git a/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java b/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java
index bb39ac5c1ec..3f132ca5074 100644
--- a/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java
+++ b/Mage.Sets/src/mage/sets/bornofthegods/SpitefulReturned.java
@@ -42,6 +42,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -94,26 +95,28 @@ class SpitefulReturnedTriggeredAbility extends TriggeredAbilityImpl {
return new SpitefulReturnedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
- Permanent sourcePermanent = game.getPermanent(this.getSourceId());
- if (sourcePermanent != null) {
- if (sourcePermanent.getCardType().contains(CardType.CREATURE)) {
- if (event.getSourceId() == this.getSourceId()) {
- UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game);
- this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
- return true;
- }
- } else {
- if (sourcePermanent.getAttachedTo() != null && sourcePermanent.getAttachedTo().equals(event.getSourceId())) {
- UUID defender = game.getCombat().getDefendingPlayerId(sourcePermanent.getAttachedTo(), game);
- this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
- return true;
- }
+ Permanent sourcePermanent = game.getPermanent(this.getSourceId());
+ if (sourcePermanent != null) {
+ if (sourcePermanent.getCardType().contains(CardType.CREATURE)) {
+ if (event.getSourceId() == this.getSourceId()) {
+ UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game);
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
+ return true;
+ }
+ } else {
+ if (sourcePermanent.getAttachedTo() != null && sourcePermanent.getAttachedTo().equals(event.getSourceId())) {
+ UUID defender = game.getCombat().getDefendingPlayerId(sourcePermanent.getAttachedTo(), game);
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
+ return true;
}
}
-
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java
index f0edd96bc58..c4afd226be2 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiLavarunner.java
@@ -1,5 +1,6 @@
package mage.sets.championsofkamigawa;
+import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@@ -11,16 +12,19 @@ import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
-import mage.constants.*;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.Token;
-import java.util.UUID;
-
/**
* @author Loki
*/
@@ -68,15 +72,15 @@ class AkkiLavarunnerAbility extends TriggeredAbilityImpl {
return new AkkiLavarunnerAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- if (damageEvent.isCombatDamage() && this.sourceId.equals(event.getSourceId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ return damageEvent.isCombatDamage() && this.sourceId.equals(event.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java
index 43b28458e80..d27a1170aa6 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/AkkiUnderminer.java
@@ -29,19 +29,19 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.SacrificeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -88,16 +88,19 @@ class AkkiUnderminerAbility extends TriggeredAbilityImpl {
return new AkkiUnderminerAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java
index 932d3982658..14e5a67bdf4 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GlimpseOfNature.java
@@ -28,18 +28,18 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.filter.FilterSpell;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
public class GlimpseOfNature extends CardImpl {
@@ -79,9 +79,14 @@ class GlimpseOfNatureTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && filter.match(spell, game)) {
return true;
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java b/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java
index 3215be1d38f..6e08a587c1d 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/GodoBanditWarlord.java
@@ -109,16 +109,21 @@ class GodoBanditWarlordAttacksTriggeredAbility extends TriggeredAbilityImpl {
@Override
public void reset(Game game) {
- game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", this.getSourceId(), game), new Integer(0));
+ game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", this.getSourceId(), game), 0);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) {
+ if (event.getSourceId().equals(this.getSourceId()) ) {
Integer amountAttacks = (Integer) game.getState().getValue(CardUtil.getCardZoneString("amountAttacks", this.getSourceId(), game));
- if (amountAttacks == null || amountAttacks.intValue() < 1) {
+ if (amountAttacks == null || amountAttacks < 1) {
if (amountAttacks == null) {
- amountAttacks = new Integer(1);
+ amountAttacks = 1;
} else {
++amountAttacks;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java
index d3bb27b64e8..a254027b6a5 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/HorobiDeathsWail.java
@@ -97,14 +97,17 @@ class HorobiDeathsWailAbility extends TriggeredAbilityImpl {
return new HorobiDeathsWailAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED) {
- Permanent creature = game.getPermanent(event.getTargetId());
- if (creature != null && creature.getCardType().contains(CardType.CREATURE)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
- return true;
- }
+ Permanent creature = game.getPermanent(event.getTargetId());
+ if (creature != null && creature.getCardType().contains(CardType.CREATURE)) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java b/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java
index 0ec6c8e799e..2745e9eb4f7 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/KusariGama.java
@@ -48,8 +48,8 @@ import mage.constants.Zone;
import mage.filter.common.FilterBlockingCreature;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
-import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -102,16 +102,19 @@ class KusariGamaAbility extends TriggeredAbilityImpl {
return new KusariGamaAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedEvent) {
- Permanent sourcePermanet = game.getPermanent(event.getSourceId());
- Permanent targetPermanet = game.getPermanent(event.getTargetId());
- if (sourcePermanet != null && targetPermanet != null && sourcePermanet.getAttachments().contains(this.getSourceId()) && filter.match(targetPermanet, game)) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- this.getEffects().get(0).setValue("damagedCreatureId", targetPermanet.getId());
- return true;
- }
+ Permanent sourcePermanet = game.getPermanent(event.getSourceId());
+ Permanent targetPermanet = game.getPermanent(event.getTargetId());
+ if (sourcePermanet != null && targetPermanet != null && sourcePermanet.getAttachments().contains(this.getSourceId()) && filter.match(targetPermanet, game)) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ this.getEffects().get(0).setValue("damagedCreatureId", targetPermanet.getId());
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java b/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java
index f3f5312183c..6c5ed8f79d3 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/NaturesWill.java
@@ -44,6 +44,7 @@ import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -92,9 +93,14 @@ class NaturesWillTriggeredAbility extends TriggeredAbilityImpl {
return new NaturesWillTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.COMBAT_DAMAGE_STEP_POST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
+ if (event.getType() == EventType.DAMAGED_PLAYER) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
Permanent p = game.getPermanent(event.getSourceId());
if (damageEvent.isCombatDamage() && p != null && p.getControllerId().equals(this.getControllerId())) {
@@ -102,7 +108,7 @@ class NaturesWillTriggeredAbility extends TriggeredAbilityImpl {
damagedPlayers.add(event.getPlayerId());
}
}
- if (event.getType().equals(GameEvent.EventType.COMBAT_DAMAGE_STEP_POST)) {
+ if (event.getType().equals(EventType.COMBAT_DAMAGE_STEP_POST)) {
if (madeDamge) {
Set damagedPlayersCopy = new HashSet();
damagedPlayersCopy.addAll(damagedPlayers);
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java b/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java
index a95b255300b..551f3c750df 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/RaggedVeins.java
@@ -29,11 +29,6 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
@@ -41,8 +36,13 @@ import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlashAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
@@ -99,16 +99,19 @@ class RaggedVeinsTriggeredAbility extends TriggeredAbilityImpl {
return new RaggedVeinsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- Permanent enchantment = game.getPermanent(sourceId);
- UUID targetId = event.getTargetId();
- if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ UUID targetId = event.getTargetId();
+ if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java
index 3ed8eadffa1..ea8a4e12288 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SeshiroTheAnointed.java
@@ -29,22 +29,22 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -97,14 +97,17 @@ class SeshiroTheAnointedAbility extends TriggeredAbilityImpl {
return new SeshiroTheAnointedAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.hasSubtype("Snake") && p.getControllerId().equals(controllerId)) {
- return true;
- }
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && p != null && p.hasSubtype("Snake") && p.getControllerId().equals(controllerId)) {
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java
index 6a73491ac9a..29c128af844 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/SosukeSonOfSeshiro.java
@@ -28,8 +28,6 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
-
-import mage.constants.*;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -39,11 +37,17 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -100,17 +104,20 @@ class SosukeSonOfSeshiroTriggeredAbility extends TriggeredAbilityImpl {
return new SosukeSonOfSeshiroTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedCreatureEvent) {
- if (((DamagedCreatureEvent) event).isCombatDamage()) {
- Permanent sourceCreature = game.getPermanent(event.getSourceId());
- Permanent targetCreature = game.getPermanent(event.getTargetId());
- if (sourceCreature != null && sourceCreature.getControllerId().equals(this.getControllerId())
- && targetCreature != null && sourceCreature.hasSubtype("Warrior")) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
- return true;
- }
+ if (((DamagedCreatureEvent) event).isCombatDamage()) {
+ Permanent sourceCreature = game.getPermanent(event.getSourceId());
+ Permanent targetCreature = game.getPermanent(event.getTargetId());
+ if (sourceCreature != null && sourceCreature.getControllerId().equals(this.getControllerId())
+ && targetCreature != null && sourceCreature.hasSubtype("Warrior")) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java
index 419f09538d8..a9e7ff37dbf 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TatsumasaTheDragonsFang.java
@@ -49,6 +49,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget;
@@ -137,9 +138,14 @@ class TatsumaTheDragonsFangTriggeredAbility extends DelayedTriggeredAbility {
return new TatsumaTheDragonsFangTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
+ if (((ZoneChangeEvent) event).isDiesEvent()) {
if (fixedTarget.getFirst(game, this).equals(event.getTargetId())) {
return true;
}
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java b/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java
index f729fef98f0..60799576bd0 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/TideOfWar.java
@@ -42,6 +42,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -80,13 +81,16 @@ class BlocksTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_BLOCKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) {
- for (CombatGroup combatGroup: game.getCombat().getGroups()) {
- if (!combatGroup.getBlockers().isEmpty()) {
- return true;
- }
+ for (CombatGroup combatGroup: game.getCombat().getGroups()) {
+ if (!combatGroup.getBlockers().isEmpty()) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java b/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java
index 723286834da..d34bb5e8faa 100644
--- a/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java
+++ b/Mage.Sets/src/mage/sets/championsofkamigawa/ZoZuThePunisher.java
@@ -28,19 +28,19 @@
package mage.sets.championsofkamigawa;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -95,18 +95,21 @@ class ZoZuThePunisherAbility extends TriggeredAbilityImpl {
return new ZoZuThePunisherAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
- Player player = game.getPlayer(permanent.getControllerId());
- if (player != null) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(player.getId()));
- }
- return true;
+ if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
+ Player player = game.getPlayer(permanent.getControllerId());
+ if (player != null) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(player.getId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java b/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java
index 13e284417b6..cf4356084d8 100644
--- a/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java
+++ b/Mage.Sets/src/mage/sets/coldsnap/AdarkarValkyrie.java
@@ -28,11 +28,6 @@
package mage.sets.coldsnap;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -43,10 +38,16 @@ import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEf
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
@@ -141,9 +142,14 @@ class AdarkarValkyrieDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new AdarkarValkyrieDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
+ if (((ZoneChangeEvent) event).isDiesEvent()) {
if (fixedTarget.getFirst(game, this).equals(event.getTargetId())) {
return true;
}
diff --git a/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java b/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java
index 560a5f0f70b..d1d2b43d7bc 100644
--- a/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java
+++ b/Mage.Sets/src/mage/sets/coldsnap/DarienKingOfKjeldor.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.SoldierToken;
import mage.players.Player;
@@ -87,12 +88,17 @@ class DarienKingOfKjeldorTriggeredAbility extends TriggeredAbilityImpl {
return new DarienKingOfKjeldorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- return true;
- }
+ if ((event.getTargetId().equals(this.getControllerId()))) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ return true;
+ }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java b/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java
index 68c678de3a2..d672dfc494a 100644
--- a/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java
+++ b/Mage.Sets/src/mage/sets/coldsnap/FuryOfTheHorde.java
@@ -45,6 +45,7 @@ import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
import mage.target.common.TargetCardInHand;
@@ -180,6 +181,11 @@ class DelayedAddMainPhaseAbility extends DelayedTriggeredAbility {
return new DelayedAddMainPhaseAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.PHASE_CHANGED || event.getType() == EventType.COMBAT_PHASE_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/coldsnap/WhiteShieldCrusader.java b/Mage.Sets/src/mage/sets/coldsnap/WhiteShieldCrusader.java
new file mode 100644
index 00000000000..72f0081f091
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/coldsnap/WhiteShieldCrusader.java
@@ -0,0 +1,86 @@
+/*
+ * 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.coldsnap;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.ObjectColor;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.abilities.keyword.ProtectionAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.ColorPredicate;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class WhiteShieldCrusader extends CardImpl {
+
+ private static final FilterCard filter = new FilterCard("Black");
+
+ static {
+ filter.add(new ColorPredicate(ObjectColor.BLACK));
+ }
+
+ public WhiteShieldCrusader(UUID ownerId) {
+ super(ownerId, 24, "White Shield Crusader", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}");
+ this.expansionSetCode = "CSP";
+ this.subtype.add("Human");
+ this.subtype.add("Knight");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Protection from black
+ this.addAbility(new ProtectionAbility(filter));
+
+ // {W}: White Shield Crusader gains flying until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}")));
+
+ // {W}{W}: White Shield Crusader gets +1/+0 until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{W}{W}")));
+ }
+
+ public WhiteShieldCrusader(final WhiteShieldCrusader card) {
+ super(card);
+ }
+
+ @Override
+ public WhiteShieldCrusader copy() {
+ return new WhiteShieldCrusader(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander/DreambornMuse.java b/Mage.Sets/src/mage/sets/commander/DreambornMuse.java
new file mode 100644
index 00000000000..93fbd3f00b2
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander/DreambornMuse.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.commander;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class DreambornMuse extends mage.sets.legions.DreambornMuse {
+
+ public DreambornMuse(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 44;
+ this.expansionSetCode = "CMD";
+ }
+
+ public DreambornMuse(final DreambornMuse card) {
+ super(card);
+ }
+
+ @Override
+ public DreambornMuse copy() {
+ return new DreambornMuse(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java b/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java
index 2803c0e36ef..1da8c8e947a 100644
--- a/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java
+++ b/Mage.Sets/src/mage/sets/commander/EdricSpymasterOfTrest.java
@@ -87,10 +87,13 @@ class EdricSpymasterOfTrestTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
- if (event.getType().equals(EventType.DAMAGED_PLAYER) &&
- ((DamagedPlayerEvent) event).isCombatDamage() &&
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ if (((DamagedPlayerEvent) event).isCombatDamage() &&
game.getOpponents(this.controllerId).contains(((DamagedPlayerEvent) event).getPlayerId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(game.getPermanent(event.getSourceId()).getControllerId()));
diff --git a/Mage.Sets/src/mage/sets/commander/FalseProphet.java b/Mage.Sets/src/mage/sets/commander/FalseProphet.java
new file mode 100644
index 00000000000..02e9f79fb51
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander/FalseProphet.java
@@ -0,0 +1,53 @@
+/*
+ * 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.commander;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FalseProphet extends mage.sets.urzasdestiny.FalseProphet {
+
+ public FalseProphet(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 13;
+ this.expansionSetCode = "CMD";
+ }
+
+ public FalseProphet(final FalseProphet card) {
+ super(card);
+ }
+
+ @Override
+ public FalseProphet copy() {
+ return new FalseProphet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander/Fertilid.java b/Mage.Sets/src/mage/sets/commander/Fertilid.java
new file mode 100644
index 00000000000..c0b3132f69c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander/Fertilid.java
@@ -0,0 +1,80 @@
+/*
+ * 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.commander;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.RemoveCountersSourceCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.abilities.effects.common.search.SearchLibraryPutInPlayTargetPlayerEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import mage.filter.common.FilterBasicLandCard;
+import mage.target.TargetPlayer;
+import mage.target.common.TargetCardInLibrary;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class Fertilid extends CardImpl {
+
+ public Fertilid(UUID ownerId) {
+ super(ownerId, 154, "Fertilid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
+ this.expansionSetCode = "CMD";
+ this.subtype.add("Elemental");
+ this.power = new MageInt(0);
+ this.toughness = new MageInt(0);
+
+ // Fertilid enters the battlefield with two +1/+1 counters on it.
+ this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), "with two +1/+1 counters on it"));
+
+ // {1}{G}, Remove a +1/+1 counter from Fertilid: Target player searches his or her library for a basic land card and puts it onto the battlefield tapped. Then that player shuffles his or her library.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
+ new SearchLibraryPutInPlayTargetPlayerEffect(new TargetCardInLibrary(new FilterBasicLandCard()), true, true), new ManaCostsImpl("{1}{G}"));
+ ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance(1)));
+ ability.addTarget(new TargetPlayer());
+ this.addAbility(ability);
+ }
+
+ public Fertilid(final Fertilid card) {
+ super(card);
+ }
+
+ @Override
+ public Fertilid copy() {
+ return new Fertilid(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java b/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java
index 1fda32b5b58..562935d4c6a 100644
--- a/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java
+++ b/Mage.Sets/src/mage/sets/commander/KaaliaOfTheVast.java
@@ -30,15 +30,15 @@ package mage.sets.commander;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
@@ -94,9 +94,14 @@ class KaaliaOfTheVastAttacksAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
+ if (event.getSourceId().equals(this.getSourceId())) {
Player opponent = game.getPlayer(event.getTargetId());
if (opponent != null) {
return true;
diff --git a/Mage.Sets/src/mage/sets/commander/SewerNemesis.java b/Mage.Sets/src/mage/sets/commander/SewerNemesis.java
index ee6da4ab795..fa7df34d3fa 100644
--- a/Mage.Sets/src/mage/sets/commander/SewerNemesis.java
+++ b/Mage.Sets/src/mage/sets/commander/SewerNemesis.java
@@ -27,6 +27,7 @@
*/
package mage.sets.commander;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -38,16 +39,19 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PutTopCardOfLibraryIntoGraveTargetEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.cards.CardImpl;
-import mage.constants.*;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
*
* @author LevelX2
@@ -155,15 +159,17 @@ class SewerNemesisTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- // chosen player casts a spell
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- UUID playerId = (UUID) game.getState().getValue(getSourceId() + "_player");
- if (playerId.equals(event.getPlayerId())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(playerId));
- return true;
- }
+ UUID playerId = (UUID) game.getState().getValue(getSourceId() + "_player");
+ if (playerId.equals(event.getPlayerId())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(playerId));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/commander/SoulSnare.java b/Mage.Sets/src/mage/sets/commander/SoulSnare.java
new file mode 100644
index 00000000000..fae8a7edbdf
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/commander/SoulSnare.java
@@ -0,0 +1,119 @@
+/*
+ * 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.commander;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.SacrificeSourceCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.ExileTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.common.FilterAttackingCreature;
+import mage.game.Game;
+import mage.game.combat.CombatGroup;
+import mage.game.permanent.Permanent;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SoulSnare extends CardImpl {
+
+ public SoulSnare(UUID ownerId) {
+ super(ownerId, 32, "Soul Snare", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{W}");
+ this.expansionSetCode = "CMD";
+
+ // {W}, Sacrifice Soul Snare: Exile target creature that's attacking you or a planeswalker you control.
+ Effect effect = new ExileTargetEffect();
+ effect.setText("Exile target creature that's attacking you or a planeswalker you control.");
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{W}"));
+ ability.addCost(new SacrificeSourceCost());
+ ability.addTarget(new TargetCreaturePermanent(new SoulSnareFilter()));
+ this.addAbility(ability);
+ }
+
+ public SoulSnare(final SoulSnare card) {
+ super(card);
+ }
+
+ @Override
+ public SoulSnare copy() {
+ return new SoulSnare(this);
+ }
+}
+
+class SoulSnareFilter extends FilterAttackingCreature {
+
+ public SoulSnareFilter() {
+ super("creature that's attacking you or a planeswalker you control");
+ }
+
+
+ public SoulSnareFilter(final SoulSnareFilter filter) {
+ super(filter);
+ }
+
+ @Override
+ public SoulSnareFilter copy() {
+ return new SoulSnareFilter(this);
+ }
+
+ @Override
+ public boolean match(Permanent permanent, UUID sourceId, UUID playerId, Game game) {
+ if(!super.match(permanent, sourceId, playerId, game)) {
+ return false;
+ }
+
+ for(CombatGroup group : game.getCombat().getGroups()) {
+ for(UUID attacker : group.getAttackers()) {
+ if(attacker.equals(permanent.getId())) {
+ UUID defenderId = group.getDefenderId();
+ if(defenderId.equals(playerId)) {
+ return true;
+ }
+ else {
+ Permanent planeswalker = game.getPermanent(defenderId);
+ if(planeswalker != null && planeswalker.getCardType().contains(CardType.PLANESWALKER)
+ && planeswalker.getControllerId().equals(playerId)) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java b/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java
index de4556bc487..0397ca4cff8 100644
--- a/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java
+++ b/Mage.Sets/src/mage/sets/commander/TheMimeoplasm.java
@@ -36,6 +36,8 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CopyEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.cards.Cards;
+import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
@@ -94,31 +96,33 @@ class TheMimeoplasmEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
+ Player controller = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getSourceId());
- if (player != null && permanent != null) {
+ if (controller != null && permanent != null) {
if (new CardsInAllGraveyardsCount(new FilterCreatureCard()).calculate(game, source, this) >= 2) {
- if (player.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", game)) {
+ if (controller.chooseUse(Outcome.Benefit, "Do you want to exile two creature cards from graveyards?", game)) {
TargetCardInGraveyard targetCopy = new TargetCardInGraveyard(new FilterCreatureCard("creature card to become a copy of"));
- TargetCardInGraveyard targetCounters = new TargetCardInGraveyard(new FilterCreatureCard("creature card for additional +1/+1 counters"));
- if (player.choose(Outcome.Copy, targetCopy, source.getSourceId(), game)) {
+ TargetCardInGraveyard targetCounters = new TargetCardInGraveyard(new FilterCreatureCard("creature card to determine amount of additional +1/+1 counters"));
+ if (controller.choose(Outcome.Copy, targetCopy, source.getSourceId(), game)) {
Card cardToCopy = game.getCard(targetCopy.getFirstTarget());
if (cardToCopy != null) {
- player.moveCardToExileWithInfo(cardToCopy, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
- if (player.choose(Outcome.Copy, targetCounters, source.getSourceId(), game)) {
+ if (controller.choose(Outcome.Copy, targetCounters, source.getSourceId(), game)) {
Card cardForCounters = game.getCard(targetCounters.getFirstTarget());
if (cardForCounters != null) {
- player.moveCardToExileWithInfo(cardForCounters, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
+ Cards cardsToExile = new CardsImpl();
+ cardsToExile.add(cardToCopy);
+ cardsToExile.add(cardForCounters);
+ controller.moveCards(cardsToExile, Zone.GRAVEYARD, Zone.EXILED, source, game);
CopyEffect copyEffect = new CopyEffect(Duration.Custom, cardToCopy, source.getSourceId());
game.addEffect(copyEffect, source);
permanent.addCounters(CounterType.P1P1.createInstance(cardForCounters.getPower().getValue()), game);
- return true;
}
}
}
}
}
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java
index aba960d1bc1..cb4931a6e3c 100644
--- a/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java
+++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfChaos.java
@@ -90,18 +90,21 @@ class CurseOfChaosTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.DECLARED_ATTACKERS)) {
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null
- && enchantment.getAttachedTo() != null
- && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
- for (Effect effect: this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId()));
- }
- return true;
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ if (enchantment != null
+ && enchantment.getAttachedTo() != null
+ && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
+ for (Effect effect: this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java
index 755913c61bf..12aa2df4bae 100644
--- a/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java
+++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfPredation.java
@@ -94,26 +94,29 @@ class CurseOfPredationTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.ATTACKER_DECLARED)) {
- Player defender = game.getPlayer(event.getTargetId());
- if (defender == null) {
- Permanent planeswalker = game.getPermanent(event.getTargetId());
- if (planeswalker != null) {
- defender = game.getPlayer(planeswalker.getControllerId());
- }
+ Player defender = game.getPlayer(event.getTargetId());
+ if (defender == null) {
+ Permanent planeswalker = game.getPermanent(event.getTargetId());
+ if (planeswalker != null) {
+ defender = game.getPlayer(planeswalker.getControllerId());
}
- if (defender != null) {
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null
- && enchantment.getAttachedTo() != null
- && enchantment.getAttachedTo().equals(defender.getId())) {
- for (Effect effect: this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- }
- return true;
+ }
+ if (defender != null) {
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ if (enchantment != null
+ && enchantment.getAttachedTo() != null
+ && enchantment.getAttachedTo().equals(defender.getId())) {
+ for (Effect effect: this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java
index c466a4aba1b..fa2e34e982f 100644
--- a/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java
+++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfShallowGraves.java
@@ -44,7 +44,6 @@ import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.ZombieToken;
-import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget;
@@ -95,18 +94,21 @@ class CurseOfShallowTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.DECLARED_ATTACKERS)) {
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null
- && enchantment.getAttachedTo() != null
- && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
- for (Effect effect: this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId()));
- }
- return true;
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ if (enchantment != null
+ && enchantment.getAttachedTo() != null
+ && game.getCombat().getPlayerDefenders(game).contains(enchantment.getAttachedTo())) {
+ for (Effect effect: this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java b/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java
index 038f0b9a841..8011fafb75c 100644
--- a/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java
+++ b/Mage.Sets/src/mage/sets/commander2013/CurseOfTheForsaken.java
@@ -93,26 +93,29 @@ class CurseOfTheForsakenTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.ATTACKER_DECLARED)) {
- Player defender = game.getPlayer(event.getTargetId());
- if (defender == null) {
- Permanent planeswalker = game.getPermanent(event.getTargetId());
- if (planeswalker != null) {
- defender = game.getPlayer(planeswalker.getControllerId());
- }
+ Player defender = game.getPlayer(event.getTargetId());
+ if (defender == null) {
+ Permanent planeswalker = game.getPermanent(event.getTargetId());
+ if (planeswalker != null) {
+ defender = game.getPlayer(planeswalker.getControllerId());
}
- if (defender != null) {
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null
- && enchantment.getAttachedTo() != null
- && enchantment.getAttachedTo().equals(defender.getId())) {
- for (Effect effect: this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ }
+ if (defender != null) {
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ if (enchantment != null
+ && enchantment.getAttachedTo() != null
+ && enchantment.getAttachedTo().equals(defender.getId())) {
+ for (Effect effect: this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java b/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java
index 5d0cf42452d..125f9f87484 100644
--- a/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java
+++ b/Mage.Sets/src/mage/sets/commander2013/DereviEmpyrialTactician.java
@@ -46,6 +46,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
@@ -97,6 +98,11 @@ class DereviEmpyrialTacticianTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD || event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD
diff --git a/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java b/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java
index 3efebe96d8a..6207f2a8db6 100644
--- a/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java
+++ b/Mage.Sets/src/mage/sets/commander2013/GahijiHonoredOne.java
@@ -89,24 +89,27 @@ class GahijiHonoredOneTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.ATTACKER_DECLARED)) {
- Player defender = game.getPlayer(event.getTargetId());
- if (defender == null) {
- Permanent planeswalker = game.getPermanent(event.getTargetId());
- if (planeswalker != null) {
- defender = game.getPlayer(planeswalker.getControllerId());
- }
+ Player defender = game.getPlayer(event.getTargetId());
+ if (defender == null) {
+ Permanent planeswalker = game.getPermanent(event.getTargetId());
+ if (planeswalker != null) {
+ defender = game.getPlayer(planeswalker.getControllerId());
}
- if (defender != null) {
- Set opponents = game.getOpponents(this.getControllerId());
- if (opponents != null && opponents.contains(defender.getId())) {
- for (Effect effect: this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- }
- return true;
+ }
+ if (defender != null) {
+ Set opponents = game.getOpponents(this.getControllerId());
+ if (opponents != null && opponents.contains(defender.getId())) {
+ for (Effect effect: this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/commander2013/Mirari.java b/Mage.Sets/src/mage/sets/commander2013/Mirari.java
index 5d985d6293f..a0ed6f66ee0 100644
--- a/Mage.Sets/src/mage/sets/commander2013/Mirari.java
+++ b/Mage.Sets/src/mage/sets/commander2013/Mirari.java
@@ -41,6 +41,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.TargetSpell;
@@ -95,9 +96,14 @@ class MirariTriggeredAbility extends TriggeredAbilityImpl {
return new MirariTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (isControlledInstantOrSorcery(spell)) {
this.getTargets().get(0).clearChosen();
diff --git a/Mage.Sets/src/mage/sets/commander2013/NightSoil.java b/Mage.Sets/src/mage/sets/commander2013/NightSoil.java
index b7e0c197361..b83edbc8648 100644
--- a/Mage.Sets/src/mage/sets/commander2013/NightSoil.java
+++ b/Mage.Sets/src/mage/sets/commander2013/NightSoil.java
@@ -33,7 +33,7 @@ import java.util.UUID;
*
* @author LevelX2
*/
-public class NightSoil extends mage.sets.fallenempires.NightSoil {
+public class NightSoil extends mage.sets.fallenempires.NightSoil1 {
public NightSoil(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java b/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java
index 89fedf703ad..4ea19f2722f 100644
--- a/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java
+++ b/Mage.Sets/src/mage/sets/commander2013/PlagueBoiler.java
@@ -126,9 +126,14 @@ class PlagueBoilerTriggeredAbility extends TriggeredAbilityImpl {
return new PlagueBoilerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_ADDED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.COUNTER_ADDED) && event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.PLAGUE.getName())) {
+ if (event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.PLAGUE.getName())) {
Permanent sourcePermanent = game.getPermanent(this.getSourceId());
if (sourcePermanent != null && sourcePermanent.getCounters().getCount(CounterType.PLAGUE) >= 3) {
return true;
diff --git a/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java b/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java
index 6ee57c9c0a4..2afdb2d69b1 100644
--- a/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java
+++ b/Mage.Sets/src/mage/sets/commander2013/Reincarnation.java
@@ -117,9 +117,14 @@ class ReincarnationDelayedTriggeredAbility extends DelayedTriggeredAbility {
this.target = ability.target;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(target)) {
+ if (event.getTargetId().equals(target)) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
return true;
diff --git a/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java b/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java
index 379782a1a7a..acc33c800a6 100644
--- a/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java
+++ b/Mage.Sets/src/mage/sets/commander2013/SunDroplet.java
@@ -48,6 +48,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -93,9 +94,14 @@ class SunDropletTriggeredAbility extends TriggeredAbilityImpl {
return new SunDropletTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) {
+ if (event.getTargetId().equals(this.getControllerId())) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java b/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java
index 4b498f8db46..7dd5c75d80c 100644
--- a/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java
+++ b/Mage.Sets/src/mage/sets/commander2013/WidespreadPanic.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
import mage.target.targetpointer.FixedTarget;
@@ -84,15 +85,17 @@ class WidespreadPanicTriggeredAbility extends TriggeredAbilityImpl {
return new WidespreadPanicTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LIBRARY_SHUFFLED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.LIBRARY_SHUFFLED)) {
- for(Effect effect :this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ for (Effect effect :this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java
index 862aa72691f..3436c1fb33d 100644
--- a/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java
+++ b/Mage.Sets/src/mage/sets/commander2014/DarettiScrapSavant.java
@@ -200,19 +200,22 @@ class DarettiScrapSavantTriggeredAbility extends TriggeredAbilityImpl {
return new DarettiScrapSavantTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getToZone() == Zone.GRAVEYARD &&
- zEvent.getFromZone() == Zone.BATTLEFIELD &&
- zEvent.getTarget().getCardType().contains(CardType.ARTIFACT) &&
- zEvent.getTarget().getOwnerId().equals(this.controllerId)) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(zEvent.getTargetId()));
- }
- return true;
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getToZone() == Zone.GRAVEYARD &&
+ zEvent.getFromZone() == Zone.BATTLEFIELD &&
+ zEvent.getTarget().getCardType().contains(CardType.ARTIFACT) &&
+ zEvent.getTarget().getOwnerId().equals(this.controllerId)) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(zEvent.getTargetId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java b/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java
index af27c34f58d..3279b98d431 100644
--- a/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java
+++ b/Mage.Sets/src/mage/sets/commander2014/DulcetSirens.java
@@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.keyword.MorphAbility;
@@ -61,6 +62,7 @@ public class DulcetSirens extends CardImpl {
// {U}, {T}: Target creature attacks target opponent this turn if able.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DulcetSirensForceAttackEffect(Duration.EndOfTurn), new ManaCostsImpl("{U}"));
+ ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
diff --git a/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java b/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java
index 6613499c77d..ed54e110b30 100644
--- a/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java
+++ b/Mage.Sets/src/mage/sets/commander2014/ZoeticCavern.java
@@ -46,7 +46,7 @@ public class ZoeticCavern extends CardImpl {
this.expansionSetCode = "C14";
// {T}: Add {1} to your mana pool.
- this.addAbility(new ColorlessManaAbility());
+ this.addAbility(new ColorlessManaAbility());
// Morph {2}
this.addAbility(new MorphAbility(this, new ManaCostsImpl("{2}")));
}
diff --git a/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java b/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java
index 648fc5179ae..1bb4dd28be4 100644
--- a/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java
+++ b/Mage.Sets/src/mage/sets/conflux/BloodTyrant.java
@@ -103,10 +103,15 @@ class PlayerLosesTheGameTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
+ public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.LOSES;
}
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ return true;
+ }
+
@Override
public String getRule() {
return "Whenever a player loses the game, put five +1/+1 counters on {this}.";
diff --git a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java
index 484a1864a58..3100b029dc9 100644
--- a/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java
+++ b/Mage.Sets/src/mage/sets/conflux/BloodhallOoze.java
@@ -28,14 +28,15 @@
package mage.sets.conflux;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
+import java.util.UUID;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
@@ -44,8 +45,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
-import java.util.UUID;
-
/**
*
* @author loki
@@ -95,9 +94,14 @@ class BloodhallOozeTriggeredAbility1 extends TriggeredAbilityImpl {
return new BloodhallOozeTriggeredAbility1(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
return true;
}
return false;
@@ -135,9 +139,14 @@ class BloodhallOozeTriggeredAbility2 extends TriggeredAbilityImpl {
return new BloodhallOozeTriggeredAbility2(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
return true;
}
return false;
diff --git a/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java b/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java
index 9dc77e7ee7b..71acd4c156a 100644
--- a/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java
+++ b/Mage.Sets/src/mage/sets/conflux/CorruptedRoots.java
@@ -44,6 +44,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -101,18 +102,21 @@ class CorruptedRootsTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent enchantment = game.getPermanent(this.sourceId);
- if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) {
- Permanent attached = game.getPermanent(enchantment.getAttachedTo());
- if (attached != null) {
- for (Effect effect : getEffects()) {
- effect.setTargetPointer(new FixedTarget(attached.getControllerId()));
- }
- return true;
+ Permanent enchantment = game.getPermanent(this.sourceId);
+ if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) {
+ Permanent attached = game.getPermanent(enchantment.getAttachedTo());
+ if (attached != null) {
+ for (Effect effect : getEffects()) {
+ effect.setTargetPointer(new FixedTarget(attached.getControllerId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java
index 05b2b5d0219..47667373b22 100644
--- a/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java
+++ b/Mage.Sets/src/mage/sets/conflux/FontOfMythos.java
@@ -29,16 +29,15 @@
package mage.sets.conflux;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
-
import mage.target.TargetPlayer;
/**
@@ -79,15 +78,17 @@ class FontOfMythosAbility extends TriggeredAbilityImpl {
return new FontOfMythosAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DRAW_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DRAW_STEP_PRE) {
- this.getTargets().clear();
- this.addTarget(new TargetPlayer());
- getTargets().get(0).add(event.getPlayerId(),game);
- return true;
- }
- return false;
+ this.getTargets().clear();
+ this.addTarget(new TargetPlayer());
+ getTargets().get(0).add(event.getPlayerId(),game);
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/conflux/KederektParasite.java b/Mage.Sets/src/mage/sets/conflux/KederektParasite.java
index cf42f9ab4af..a55fb2f9178 100644
--- a/Mage.Sets/src/mage/sets/conflux/KederektParasite.java
+++ b/Mage.Sets/src/mage/sets/conflux/KederektParasite.java
@@ -28,16 +28,16 @@
package mage.sets.conflux;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -84,9 +84,14 @@ class KederektParasiteTriggeredAbility extends TriggeredAbilityImpl {
return new KederektParasiteTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DREW_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
boolean youControlRedPermanent = false;
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(this.getControllerId())) {
if (permanent.getColor(game).isRed()) {
diff --git a/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java b/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java
index a0138fa9071..a0113ee14b3 100644
--- a/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java
+++ b/Mage.Sets/src/mage/sets/conflux/ParasiticStrix.java
@@ -92,12 +92,14 @@ class ParasiticStrixTriggeredAbility extends TriggeredAbilityImpl {
return new ParasiticStrixTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.ENTERS_THE_BATTLEFIELD) && event.getTargetId().equals(this.getSourceId())) {
- return true;
- }
- return false;
+ return event.getTargetId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java
index 9b7f9cdaf37..881d4bbb18a 100644
--- a/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java
+++ b/Mage.Sets/src/mage/sets/conflux/QuenchableFire.java
@@ -29,22 +29,23 @@
package mage.sets.conflux;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
+import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.SpecialAction;
import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.RemoveDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.RemoveSpecialActionEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
-
import mage.target.TargetPlayer;
/**
@@ -78,7 +79,8 @@ class QuenchableFireEffect extends OneShotEffect {
public QuenchableFireEffect() {
super(Outcome.Damage);
- staticText = "{this} deals an additional 3 damage to that player at the beginning of your next upkeep step unless he or she pays {U} before that step";
+ staticText = "{this} deals an additional 3 damage to that player at the beginning of your next upkeep step unless he or she pays {U} before that step."
+ + "
Use the Special button to pay the {U} with a special action before the beginning of your next upkeep step.";
}
public QuenchableFireEffect(final QuenchableFireEffect effect) {
@@ -92,22 +94,34 @@ class QuenchableFireEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- //create delayed triggered ability
- QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility();
- delayedAbility.setSourceId(source.getSourceId());
- delayedAbility.setControllerId(source.getControllerId());
- delayedAbility.setSourceObject(source.getSourceObject(game), game);
- delayedAbility.getTargets().addAll(source.getTargets());
- game.addDelayedTriggeredAbility(delayedAbility);
+ MageObject sourceObject = source.getSourceObject(game);
+ if (sourceObject != null) {
+
+ //create special action
+ QuenchableFireSpecialAction newAction = new QuenchableFireSpecialAction();
- //create special action
- QuenchableFireSpecialAction newAction = new QuenchableFireSpecialAction(delayedAbility.getId());
- delayedAbility.setSpecialActionId(newAction.getId());
- newAction.setSourceId(source.getSourceId());
- newAction.setControllerId(source.getFirstTarget());
- newAction.getTargets().addAll(source.getTargets());
- game.getState().getSpecialActions().add(newAction);
- return true;
+ //create delayed triggered ability
+ QuenchableFireDelayedTriggeredAbility delayedAbility = new QuenchableFireDelayedTriggeredAbility();
+ delayedAbility.setSourceId(source.getSourceId());
+ delayedAbility.setControllerId(source.getControllerId());
+ delayedAbility.setSourceObject(sourceObject, game);
+ delayedAbility.getTargets().addAll(source.getTargets());
+ delayedAbility.setSpecialActionId(newAction.getId());
+ UUID delayedAbilityId = game.addDelayedTriggeredAbility(delayedAbility);
+
+ // update special action
+ newAction.addCost(new ManaCostsImpl("{U}"));
+ Effect effect = new RemoveDelayedTriggeredAbilityEffect(delayedAbilityId);
+ newAction.addEffect(effect);
+ effect.setText(sourceObject.getIdName() + " - Pay {U} to remove the triggered ability that deals 3 damage to you at the beginning of your next upkeep step");
+ newAction.addEffect(new RemoveSpecialActionEffect(newAction.getId()));
+ newAction.setSourceId(source.getSourceId());
+ newAction.setControllerId(source.getFirstTarget());
+ newAction.getTargets().addAll(source.getTargets());
+ game.getState().getSpecialActions().add(newAction);
+ return true;
+ }
+ return false;
}
}
@@ -133,9 +147,14 @@ class QuenchableFireDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new QuenchableFireDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
for (SpecialAction action: game.getState().getSpecialActions()) {
if (action.getId().equals(specialActionId)) {
game.getState().getSpecialActions().remove(action);
@@ -151,11 +170,8 @@ class QuenchableFireDelayedTriggeredAbility extends DelayedTriggeredAbility {
class QuenchableFireSpecialAction extends SpecialAction {
- public QuenchableFireSpecialAction(UUID effectId) {
+ public QuenchableFireSpecialAction() {
super();
- this.addCost(new ManaCostsImpl("{U}"));
- this.addEffect(new RemoveDelayedTriggeredAbilityEffect(effectId));
- this.addEffect(new RemoveSpecialActionEffect(this.getId()));
}
public QuenchableFireSpecialAction(final QuenchableFireSpecialAction ability) {
@@ -166,5 +182,4 @@ class QuenchableFireSpecialAction extends SpecialAction {
public QuenchableFireSpecialAction copy() {
return new QuenchableFireSpecialAction(this);
}
-
}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java b/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java
index cfaa23940e1..bb67a818b42 100644
--- a/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java
+++ b/Mage.Sets/src/mage/sets/conflux/SludgeStrider.java
@@ -45,6 +45,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -98,6 +99,11 @@ class SludgeStriderTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD || event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
diff --git a/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java b/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java
index 0ad44a2f54a..e9d62fe6ab5 100644
--- a/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java
+++ b/Mage.Sets/src/mage/sets/conspiracy/DackFayden.java
@@ -54,6 +54,7 @@ import mage.counters.CounterType;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
@@ -129,6 +130,11 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
public DackFaydenEmblemTriggeredAbility copy() {
return new DackFaydenEmblemTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
@@ -136,7 +142,7 @@ class DackFaydenEmblemTriggeredAbility extends TriggeredAbilityImpl {
List targettedPermanents = new ArrayList<>(0);
Player player = game.getPlayer(this.getControllerId());
if (player != null) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null) {
SpellAbility spellAbility = spell.getSpellAbility();
diff --git a/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java b/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java
index a4fc613a6b8..40064cb8583 100644
--- a/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java
+++ b/Mage.Sets/src/mage/sets/darkascension/AvacynsCollar.java
@@ -28,11 +28,6 @@
package mage.sets.darkascension;
import java.util.UUID;
-import mage.constants.AttachmentType;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
@@ -42,8 +37,14 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SpiritWhiteToken;
@@ -93,9 +94,14 @@ class AvacynsCollarTriggeredAbility extends TriggeredAbilityImpl {
return new AvacynsCollarTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
+ if (((ZoneChangeEvent) event).isDiesEvent()) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent.getAttachments().contains(this.getSourceId()) && permanent.hasSubtype("Human")) {
return true;
diff --git a/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java b/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java
index 3fcdd765c38..9a5b75ad48d 100644
--- a/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java
+++ b/Mage.Sets/src/mage/sets/darkascension/CurseOfThirst.java
@@ -27,6 +27,7 @@
*/
package mage.sets.darkascension;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.DynamicValue;
@@ -41,13 +42,12 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
*
* @author BetaSteward
@@ -97,16 +97,19 @@ class CurseOfThirstAbility extends TriggeredAbilityImpl {
return new CurseOfThirstAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- Permanent enchantment = game.getPermanent(this.sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- Player player = game.getPlayer(enchantment.getAttachedTo());
- if (player != null && game.getActivePlayerId().equals(player.getId())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
- return true;
- }
+ Permanent enchantment = game.getPermanent(this.sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ Player player = game.getPlayer(enchantment.getAttachedTo());
+ if (player != null && game.getActivePlayerId().equals(player.getId())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java
index 1feaf489553..ccbb3cf69f8 100644
--- a/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java
+++ b/Mage.Sets/src/mage/sets/darkascension/DiregrafCaptain.java
@@ -27,8 +27,7 @@
*/
package mage.sets.darkascension;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -36,18 +35,19 @@ import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetOpponent;
-import java.util.UUID;
-
/**
*
* @author Loki
@@ -103,9 +103,14 @@ class DiregrafCaptainTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) {
+ if (!event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
diff --git a/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java b/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java
index 67978444b93..a3198b7d868 100644
--- a/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java
+++ b/Mage.Sets/src/mage/sets/darkascension/DrogskolReaver.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -87,9 +88,14 @@ class DrogskolReaverAbility extends TriggeredAbilityImpl {
return new DrogskolReaverAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId);
+ return event.getPlayerId().equals(controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java b/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java
index d629ffaaced..41e66775f09 100644
--- a/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java
+++ b/Mage.Sets/src/mage/sets/darkascension/FlayerOfTheHatebound.java
@@ -27,8 +27,7 @@
*/
package mage.sets.darkascension;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -36,17 +35,18 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.UndyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
+import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
-import java.util.UUID;
-import mage.game.events.EntersTheBattlefieldEvent;
-
/**
*
* @author BetaSteward
@@ -89,17 +89,20 @@ class FlayerTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD
- && permanent.getOwnerId().equals(controllerId)
- && permanent.getCardType().contains(CardType.CREATURE)) {
- Effect effect = this.getEffects().get(0);
- effect.setValue("damageSource", event.getTargetId());
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD
+ && permanent.getOwnerId().equals(controllerId)
+ && permanent.getCardType().contains(CardType.CREATURE)) {
+ Effect effect = this.getEffects().get(0);
+ effect.setValue("damageSource", event.getTargetId());
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java
index 33c7c884a2d..61935aede9b 100644
--- a/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java
+++ b/Mage.Sets/src/mage/sets/darkascension/HavengulLich.java
@@ -51,6 +51,7 @@ import mage.filter.FilterCard;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInGraveyard;
@@ -169,9 +170,14 @@ class HavengulLichDelayedTriggeredAbility extends DelayedTriggeredAbility {
this.cardId = ability.cardId;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.SPELL_CAST && event.getSourceId().equals(cardId);
+ return event.getSourceId().equals(cardId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/darkascension/Hellrider.java b/Mage.Sets/src/mage/sets/darkascension/Hellrider.java
index b2915a627bf..54fe016e31b 100644
--- a/Mage.Sets/src/mage/sets/darkascension/Hellrider.java
+++ b/Mage.Sets/src/mage/sets/darkascension/Hellrider.java
@@ -28,16 +28,17 @@
package mage.sets.darkascension;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -85,15 +86,18 @@ class HellriderTriggeredAbility extends TriggeredAbilityImpl {
return new HellriderTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
- Permanent source = game.getPermanent(event.getSourceId());
- if (source != null && source.getControllerId().equals(controllerId)) {
- UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game);
- this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId));
- return true;
- }
+ Permanent source = game.getPermanent(event.getSourceId());
+ if (source != null && source.getControllerId().equals(controllerId)) {
+ UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(event.getSourceId(), game);
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(defendingPlayerId));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java b/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java
index 6f1eac04a6d..4e2890e6403 100644
--- a/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java
+++ b/Mage.Sets/src/mage/sets/darkascension/JarOfEyeballs.java
@@ -28,10 +28,6 @@
package mage.sets.darkascension;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
@@ -45,10 +41,15 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -100,10 +101,14 @@ class JarOfEyeballsTriggeredAbility extends TriggeredAbilityImpl {
return new JarOfEyeballsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE
- && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
+ if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java b/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java
index 7fb564d35ac..e03da865fa6 100644
--- a/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java
+++ b/Mage.Sets/src/mage/sets/darkascension/Shriekgeist.java
@@ -28,18 +28,19 @@
package mage.sets.darkascension;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -86,16 +87,19 @@ class ShriekgeistTriggeredAbility extends TriggeredAbilityImpl {
return new ShriekgeistTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java b/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java
index fb1853dca43..02e4cb5f09d 100644
--- a/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java
+++ b/Mage.Sets/src/mage/sets/darkascension/SoulSeizer.java
@@ -28,10 +28,6 @@
package mage.sets.darkascension;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -39,12 +35,16 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
@@ -99,19 +99,22 @@ class SoulSeizerTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
- Player opponent = game.getPlayer(event.getPlayerId());
- if (opponent != null) {
- FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
- filter.add(new ControllerIdPredicate(opponent.getId()));
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
- this.getTargets().clear();
- this.addTarget(new TargetCreaturePermanent(filter));
- return true;
- }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
+ Player opponent = game.getPlayer(event.getPlayerId());
+ if (opponent != null) {
+ FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
+ filter.add(new ControllerIdPredicate(opponent.getId()));
+
+ this.getTargets().clear();
+ this.addTarget(new TargetCreaturePermanent(filter));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java b/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java
index 08df247c52e..0d273b38a4e 100644
--- a/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java
+++ b/Mage.Sets/src/mage/sets/darkascension/SpitefulShadows.java
@@ -28,18 +28,19 @@
package mage.sets.darkascension;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
@@ -92,16 +93,19 @@ class SpitefulShadowsTriggeredAbility extends TriggeredAbilityImpl {
return new SpitefulShadowsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- Permanent enchantment = game.getPermanent(sourceId);
- UUID targetId = event.getTargetId();
- if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ UUID targetId = event.getTargetId();
+ if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java b/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java
index 2ef04e4c7b7..43246ddf7e7 100644
--- a/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java
+++ b/Mage.Sets/src/mage/sets/darkascension/TovolarsMagehunter.java
@@ -28,10 +28,6 @@
package mage.sets.darkascension;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.TargetController;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
@@ -42,8 +38,13 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -99,9 +100,14 @@ class TovolarsMagehunterTriggeredAbility extends TriggeredAbilityImpl {
return new TovolarsMagehunterTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java b/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java
index 20b2619b740..bf1a2905c5d 100644
--- a/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java
+++ b/Mage.Sets/src/mage/sets/darkascension/WerewolfRansacker.java
@@ -28,7 +28,6 @@
package mage.sets.darkascension;
import java.util.UUID;
-import mage.constants.*;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbility;
@@ -42,11 +41,15 @@ import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
-import mage.filter.FilterPermanent;
-import mage.filter.predicate.mageobject.CardTypePredicate;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.filter.common.FilterArtifactPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
@@ -108,13 +111,17 @@ class WerewolfRansackerAbility extends TriggeredAbilityImpl {
return new WerewolfRansackerAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TRANSFORMED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TRANSFORMED) {
- if (event.getTargetId().equals(sourceId)) {
- Permanent permanent = game.getPermanent(sourceId);
- if (permanent != null && permanent.isTransformed())
- return true;
+ if (event.getTargetId().equals(sourceId)) {
+ Permanent permanent = game.getPermanent(sourceId);
+ if (permanent != null && permanent.isTransformed()) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java b/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java
index 95c340d8b7d..6803181b753 100644
--- a/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java
+++ b/Mage.Sets/src/mage/sets/darkascension/WithengarUnbound.java
@@ -28,9 +28,6 @@
package mage.sets.darkascension;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@@ -38,10 +35,13 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.IntimidateAbility;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -96,11 +96,14 @@ class WithengarUnboundTriggeredAbility extends TriggeredAbilityImpl {
return new WithengarUnboundTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LOST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LOST)
- return true;
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java b/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java
new file mode 100644
index 00000000000..b5dc2a20201
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/darksteel/GreaterHarvester.java
@@ -0,0 +1,106 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.sets.darksteel;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.SacrificeEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
+import mage.filter.FilterPermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.CardTypePredicate;
+import mage.game.Game;
+import mage.game.events.DamagedPlayerEvent;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
+import mage.target.targetpointer.FixedTarget;
+
+/**
+ *
+ * @author wanderer120
+ */
+public class GreaterHarvester extends CardImpl {
+
+ public static final FilterPermanent filter = new FilterPermanent("a permanent");
+
+ static {
+ filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT),
+ new CardTypePredicate(CardType.CREATURE),
+ new CardTypePredicate(CardType.ENCHANTMENT),
+ new CardTypePredicate(CardType.PLANESWALKER),
+ new CardTypePredicate(CardType.LAND)));
+ }
+
+ public GreaterHarvester(UUID ownerId) {
+ super(ownerId, 44, "Greater Harvester", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}{B}");
+ this.expansionSetCode = "DST";
+ this.subtype.add("Horror");
+
+ this.power = new MageInt(5);
+ this.toughness = new MageInt(6);
+
+ // At the beginning of your upkeep, sacrifice a permanent.
+ this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new SacrificeEffect(filter, 1, ""), TargetController.YOU, false));
+
+ //Whenever Greater Harvester deals combat damage to a player, that player sacrifices two permanents.
+ this.addAbility(new GreaterHarvesterAbility());
+ }
+
+ public GreaterHarvester(final GreaterHarvester card) {
+ super(card);
+ }
+
+ @Override
+ public GreaterHarvester copy() {
+ return new GreaterHarvester(this);
+ }
+}
+
+class GreaterHarvesterAbility extends TriggeredAbilityImpl {
+
+ public GreaterHarvesterAbility() {
+ super(Zone.BATTLEFIELD, new SacrificeEffect(new FilterPermanent(), 2, ""));
+ }
+
+ public GreaterHarvesterAbility(final GreaterHarvesterAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public GreaterHarvesterAbility copy() {
+ return new GreaterHarvesterAbility(this);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return EventType.DAMAGED_PLAYER.equals(event.getType());
+ }
+
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
+ }
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String getRule() {
+ return "Whenever {this} deals combat damage to a player, that player sacrifices two permanent.";
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java b/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java
index 522a57acdd4..3ec918d0114 100644
--- a/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java
+++ b/Mage.Sets/src/mage/sets/darksteel/LichsTomb.java
@@ -85,10 +85,15 @@ class LichsTombTriggeredAbility extends TriggeredAbilityImpl {
public LichsTombTriggeredAbility copy() {
return new LichsTombTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LOST_LIFE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.LOST_LIFE && event.getPlayerId() == this.getControllerId()) {
+ if (event.getPlayerId() == this.getControllerId()) {
((SacrificeEffect) this.getEffects().get(0)).setAmount(new StaticValue(event.getAmount()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java b/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java
new file mode 100644
index 00000000000..d13bc0e2504
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/darksteel/NimAbomination.java
@@ -0,0 +1,69 @@
+/*
+ * 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.darksteel;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
+import mage.abilities.condition.InvertCondition;
+import mage.abilities.condition.common.SourceTappedCondition;
+import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class NimAbomination extends CardImpl {
+
+ public NimAbomination(UUID ownerId) {
+ super(ownerId, 49, "Nim Abomination", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{B}");
+ this.expansionSetCode = "DST";
+ this.subtype.add("Zombie");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(4);
+
+ // At the beginning of your end step, if Nim Abomination is untapped, you lose 3 life.
+ this.addAbility(new BeginningOfEndStepTriggeredAbility(Zone.BATTLEFIELD, new LoseLifeSourceControllerEffect(3),
+ TargetController.YOU, new InvertCondition(new SourceTappedCondition()), false));
+ }
+
+ public NimAbomination(final NimAbomination card) {
+ super(card);
+ }
+
+ @Override
+ public NimAbomination copy() {
+ return new NimAbomination(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java b/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java
index e519e617778..7843ac73fcf 100644
--- a/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java
+++ b/Mage.Sets/src/mage/sets/darksteel/SwordOfFireAndIce.java
@@ -29,12 +29,6 @@
package mage.sets.darksteel;
import java.util.UUID;
-
-import mage.constants.AttachmentType;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -46,12 +40,18 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreatureOrPlayer;
@@ -111,16 +111,16 @@ class SwordOfFireAndIceAbility extends TriggeredAbilityImpl {
return new SwordOfFireAndIceAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java b/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java
index b4be8adc413..1d4414a3c46 100644
--- a/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java
+++ b/Mage.Sets/src/mage/sets/darksteel/SwordOfLightAndShadow.java
@@ -55,6 +55,7 @@ import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
@@ -129,16 +130,16 @@ class SwordOfLightAndShadowAbility extends TriggeredAbilityImpl {
return new SwordOfLightAndShadowAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/dissension/Drekavac.java b/Mage.Sets/src/mage/sets/dissension/Drekavac.java
new file mode 100644
index 00000000000..e752a3ac8fa
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/dissension/Drekavac.java
@@ -0,0 +1,76 @@
+/*
+ * 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.dissension;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.costs.common.DiscardTargetCost;
+import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.FilterCard;
+import mage.filter.common.FilterCreatureCard;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.CardTypePredicate;
+import mage.target.common.TargetCardInHand;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Drekavac extends CardImpl {
+
+ private static final FilterCard filter = new FilterCard("noncreature card");
+
+ static {
+ filter.add(Predicates.not(new CardTypePredicate(CardType.CREATURE)));
+ }
+
+ public Drekavac(UUID ownerId) {
+ super(ownerId, 43, "Drekavac", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
+ this.expansionSetCode = "DIS";
+ this.subtype.add("Beast");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(3);
+
+ // When Drekavac enters the battlefield, sacrifice it unless you discard a noncreature card.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(filter)))));
+ }
+
+ public Drekavac(final Drekavac card) {
+ super(card);
+ }
+
+ @Override
+ public Drekavac copy() {
+ return new Drekavac(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/dissension/PainMagnification.java b/Mage.Sets/src/mage/sets/dissension/PainMagnification.java
new file mode 100644
index 00000000000..418356ea74f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/dissension/PainMagnification.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.dissension;
+
+import java.util.UUID;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.discard.DiscardTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.target.targetpointer.FixedTarget;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class PainMagnification extends CardImpl {
+
+ public PainMagnification(UUID ownerId) {
+ super(ownerId, 121, "Pain Magnification", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}{R}");
+ this.expansionSetCode = "DIS";
+
+ // Whenever an opponent is dealt 3 or more damage by a single source, that player discards a card.
+ this.addAbility(new PainMagnificationTriggeredAbility());
+ }
+
+ public PainMagnification(final PainMagnification card) {
+ super(card);
+ }
+
+ @Override
+ public PainMagnification copy() {
+ return new PainMagnification(this);
+ }
+}
+
+class PainMagnificationTriggeredAbility extends TriggeredAbilityImpl {
+
+ public PainMagnificationTriggeredAbility() {
+ super(Zone.BATTLEFIELD, new DiscardTargetEffect(1), false);
+ }
+
+ public PainMagnificationTriggeredAbility(final PainMagnificationTriggeredAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public PainMagnificationTriggeredAbility copy() {
+ return new PainMagnificationTriggeredAbility(this);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ // If the damaged player is an opponent
+ if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
+ if(event.getAmount() >= 3) {
+ // If at least 3 damage is dealt, set the opponent as the Discard target
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
+ }
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String getRule() {
+ return "Whenever an opponent is dealt 3 or more damage by a single source, that player discards a card.";
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/dissension/ProperBurial.java b/Mage.Sets/src/mage/sets/dissension/ProperBurial.java
index e09d61985ed..a63d354ae58 100644
--- a/Mage.Sets/src/mage/sets/dissension/ProperBurial.java
+++ b/Mage.Sets/src/mage/sets/dissension/ProperBurial.java
@@ -28,14 +28,15 @@
package mage.sets.dissension;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
@@ -79,10 +80,14 @@ class ProperBurialTriggeredAbility extends TriggeredAbilityImpl {
return new ProperBurialTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE
- && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
+ if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java b/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java
index c2a687e9e82..c92e93989b1 100644
--- a/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java
+++ b/Mage.Sets/src/mage/sets/dissension/UtopiaSprawl.java
@@ -28,10 +28,6 @@
package mage.sets.dissension;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.Mana;
import mage.ObjectColor;
import mage.abilities.Ability;
@@ -43,12 +39,16 @@ import mage.abilities.keyword.EnchantAbility;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
+import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
@@ -138,14 +138,17 @@ class UtopiaSprawlTriggeredAbility extends TriggeredManaAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.getSourceId());
- if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
- if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- return true;
- }
- }
+ if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
+ return true;
+ }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java b/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java
index ad25ec436b2..8bed02cb907 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/BeckCall.java
@@ -29,24 +29,20 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.SplitCard;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
-/**
- *
- * @author LevelX2
- */
public class BeckCall extends SplitCard {
@@ -88,14 +84,17 @@ class BeckTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanent(targetId);
- if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
- return true;
- }
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanent(targetId);
+ if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java b/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java
index bcac27da9be..2deae6da5c2 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/BredForTheHunt.java
@@ -28,22 +28,19 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
-import mage.game.events.DamagedPlayerEvent;
+import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
-/**
- *
- * @author LevelX2
- */
public class BredForTheHunt extends CardImpl {
@@ -83,9 +80,14 @@ class BredForTheHuntTriggeredAbility extends TriggeredAbilityImpl {
return new BredForTheHuntTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (((DamagedEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters().getCount(CounterType.P1P1) > 0) {
return true;
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java b/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java
index 865e8d8b75f..452b6a2a433 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/CarnageGladiator.java
@@ -29,10 +29,6 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
@@ -40,15 +36,15 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
-/**
- *
- * @author LevelX2
- */
public class CarnageGladiator extends CardImpl {
@@ -97,14 +93,17 @@ class CarnageGladiatorTriggeredAbility extends TriggeredAbilityImpl {
return new CarnageGladiatorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent blocker = game.getPermanent(event.getSourceId());
- if (blocker != null) {
- getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId()));
- return true;
- }
+ Permanent blocker = game.getPermanent(event.getSourceId());
+ if (blocker != null) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java b/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java
index ff74e7bdacc..776570e5a0f 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/MasterOfCruelties.java
@@ -28,25 +28,25 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.OneShotEffect;
-import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.keyword.CanAttackOnlyAloneAbility;
-import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.DeathtouchAbility;
+import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.events.DamageEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -102,18 +102,21 @@ class MasterOfCrueltiesTriggeredAbility extends TriggeredAbilityImpl {
return new MasterOfCrueltiesTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_BLOCKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) {
- Permanent sourcePermanent = game.getPermanent(getSourceId());
- if (sourcePermanent.isAttacking()) {
- for (CombatGroup combatGroup: game.getCombat().getGroups()) {
- if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) {
- // check if a player is attacked (instead of a planeswalker)
- Player defendingPlayer = game.getPlayer(combatGroup.getDefenderId());
- if (defendingPlayer != null) {
- return true;
- }
+ Permanent sourcePermanent = game.getPermanent(getSourceId());
+ if (sourcePermanent.isAttacking()) {
+ for (CombatGroup combatGroup: game.getCombat().getGroups()) {
+ if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) {
+ // check if a player is attacked (instead of a planeswalker)
+ Player defendingPlayer = game.getPlayer(combatGroup.getDefenderId());
+ if (defendingPlayer != null) {
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java b/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java
index 86ab55c65f8..f174c83e2f2 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/MelekIzzetParagon.java
@@ -28,10 +28,6 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -40,6 +36,9 @@ import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.effects.common.continuous.PlayTheTopCardEffect;
import mage.abilities.effects.common.continuous.PlayWithTheTopCardRevealedEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
@@ -108,10 +107,14 @@ class MelekIzzetParagonTriggeredAbility extends TriggeredAbilityImpl {
return new MelekIzzetParagonTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.SPELL_CAST
- && event.getZone() == Zone.LIBRARY) {
+ if (event.getZone() == Zone.LIBRARY) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null
&& spell.getControllerId().equals(super.getControllerId())
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java b/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java
index a03b595e714..bc2c1c60145 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/PyrewildShaman.java
@@ -31,10 +31,6 @@ package mage.sets.dragonsmaze;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
@@ -43,16 +39,17 @@ import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.keyword.BloodrushAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
-import mage.game.events.DamagedPlayerEvent;
+import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
-/**
- *
- * @author LevelX2
- */
public class PyrewildShaman extends CardImpl {
@@ -102,10 +99,17 @@ class PyrewildShamanTriggeredAbility extends TriggeredAbilityImpl {
return new PyrewildShamanTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.END_COMBAT_STEP_POST
+ || event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if (((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (((DamagedEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null && creature.getControllerId().equals(controllerId) && !damagedPlayerIds.contains(event.getTargetId())) {
damagedPlayerIds.add(event.getTargetId());
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java b/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java
index efafb1dac5b..6bd8f47bef9 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/RenegadeKrasis.java
@@ -29,26 +29,23 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.abilities.keyword.EvolveAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.CounterPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.StackObject;
-/**
- *
- * @author LevelX2
- */
public class RenegadeKrasis extends CardImpl {
@@ -101,10 +98,14 @@ class RenegadeKrasisTriggeredAbility extends TriggeredAbilityImpl {
return new RenegadeKrasisTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_ADDED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.COUNTER_ADDED)
- && event.getTargetId().equals(getSourceId())) {
+ if (event.getTargetId().equals(getSourceId())) {
Object object = game.getState().getValue("EvolveAddCounterActive");
if (object != null && (Boolean) object) {
StackObject stackObject = game.getStack().getLast();
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java b/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java
index 161f0aa220c..9dbc81fb428 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/RuricTharTheUnbowed.java
@@ -28,20 +28,20 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AttacksEachTurnStaticAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
-import mage.abilities.keyword.VigilanceAbility;
import mage.abilities.keyword.ReachAbility;
+import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.targetpointer.FixedTarget;
@@ -99,18 +99,20 @@ class RuricTharTheUnbowedAbility extends TriggeredAbilityImpl {
return new RuricTharTheUnbowedAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null
- && !spell.getCardType().contains(CardType.CREATURE)) {
+ if (spell != null && !spell.getCardType().contains(CardType.CREATURE)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}
- }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java b/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java
index 720cbf0e21c..bab770d4b87 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/TeysaEnvoyOfGhosts.java
@@ -100,16 +100,19 @@ class TeysaEnvoyOfGhostsTriggeredAbility extends TriggeredAbilityImpl {
return new TeysaEnvoyOfGhostsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.getPlayerId().equals(controllerId) && damageEvent.isCombatDamage() && p != null && p.getCardType().contains(CardType.CREATURE)) {
- game.getState().setValue(sourceId.toString(), p.getControllerId());
- getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
- return true;
- }
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent sourcePermanent = game.getPermanent(event.getSourceId());
+ if (damageEvent.getPlayerId().equals(getControllerId()) && damageEvent.isCombatDamage() && sourcePermanent != null && sourcePermanent.getCardType().contains(CardType.CREATURE)) {
+ game.getState().setValue(sourceId.toString(), sourcePermanent.getControllerId());
+ getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java b/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java
index bad8df6dab8..8bebbae8f2e 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/VoiceOfResurgence.java
@@ -29,7 +29,6 @@ package mage.sets.dragonsmaze;
import java.util.UUID;
import mage.MageInt;
-import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
@@ -45,6 +44,7 @@ import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.token.Token;
import mage.game.stack.Spell;
@@ -88,6 +88,11 @@ class VoiceOfResurgenceTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST || event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// Opponent casts spell during your turn
diff --git a/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java b/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java
index 844cfa4b97b..783fafd52f6 100644
--- a/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java
+++ b/Mage.Sets/src/mage/sets/dragonsmaze/ZhurTaaDruid.java
@@ -28,17 +28,18 @@
package mage.sets.dragonsmaze;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.TargetController;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamagePlayersEffect;
import mage.abilities.mana.GreenManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -82,12 +83,14 @@ class ZhurTaaDruidAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && event.getSourceId().equals(getSourceId())) {
- return true;
- }
- return false;
+ return event.getSourceId().equals(getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java
index 786d8eb7b96..46169d9541e 100644
--- a/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java
+++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/ArashinForemost.java
@@ -38,11 +38,11 @@ import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
-import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetControlledCreaturePermanent;
/**
@@ -99,6 +99,11 @@ class ArashinForemostAbility extends TriggeredAbilityImpl {
return new ArashinForemostAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java
index 93568ecf4f2..9e801b7b500 100644
--- a/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java
+++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/FoeRazerRegent.java
@@ -34,14 +34,12 @@ import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.Effect;
-import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.FightTargetSourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
@@ -149,17 +147,18 @@ class FoeRazerRegentDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new FoeRazerRegentDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.END_TURN_STEP_PRE) {
- return true;
- }
- return false;
+ return true;
}
@Override
public String getRule() {
return "put two +1/+1 counters on it at the beginning of the next end step";
}
-
}
diff --git a/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java b/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java
index aa633789f00..b3385304d2b 100644
--- a/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java
+++ b/Mage.Sets/src/mage/sets/dragonsoftarkir/RuthlessDeathfang.java
@@ -40,6 +40,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetOpponent;
/**
@@ -89,14 +90,15 @@ class RuthlessDeathfangTriggeredAbility extends TriggeredAbilityImpl {
return new RuthlessDeathfangTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SACRIFICED_PERMANENT;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT
- && event.getPlayerId().equals(this.getControllerId())
- && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.getControllerId())
+ && game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java
index 259b571d0da..bbde1977f58 100644
--- a/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java
+++ b/Mage.Sets/src/mage/sets/elspethvskiora/IcatianJavelineers.java
@@ -33,7 +33,7 @@ import java.util.UUID;
*
* @author fireshoes
*/
-public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers {
+public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 {
public IcatianJavelineers(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java
index dea771ba4ba..3b525f22126 100644
--- a/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java
+++ b/Mage.Sets/src/mage/sets/eventide/AshlingTheExtinguisher.java
@@ -29,19 +29,19 @@
package mage.sets.eventide;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
@@ -90,19 +90,22 @@ class AshlingTheExtinguisherTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
- Player opponent = game.getPlayer(event.getPlayerId());
- if (opponent != null) {
- FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
- filter.add(new ControllerIdPredicate(opponent.getId()));
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
- this.getTargets().clear();
- this.addTarget(new TargetCreaturePermanent(filter));
- return true;
- }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
+ Player opponent = game.getPlayer(event.getPlayerId());
+ if (opponent != null) {
+ FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
+ filter.add(new ControllerIdPredicate(opponent.getId()));
+
+ this.getTargets().clear();
+ this.addTarget(new TargetCreaturePermanent(filter));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/eventide/Necroskitter.java b/Mage.Sets/src/mage/sets/eventide/Necroskitter.java
index 0b71d9524b5..5d67ee26ccd 100644
--- a/Mage.Sets/src/mage/sets/eventide/Necroskitter.java
+++ b/Mage.Sets/src/mage/sets/eventide/Necroskitter.java
@@ -40,6 +40,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -91,25 +92,28 @@ class NecroskitterTriggeredAbility extends TriggeredAbilityImpl {
return new NecroskitterTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (game.getPermanent(sourceId) == null) {
- if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
- return false;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (game.getPermanent(sourceId) == null) {
+ if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
+ return false;
}
- if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
- Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (permanent != null
- && permanent.getCounters().containsKey(CounterType.M1M1)
- && game.getOpponents(controllerId).contains(permanent.getControllerId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ }
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (permanent != null
+ && permanent.getCounters().containsKey(CounterType.M1M1)
+ && game.getOpponents(controllerId).contains(permanent.getControllerId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/eventide/Spitemare.java b/Mage.Sets/src/mage/sets/eventide/Spitemare.java
index e1f0be4bf9a..0f121a7a963 100644
--- a/Mage.Sets/src/mage/sets/eventide/Spitemare.java
+++ b/Mage.Sets/src/mage/sets/eventide/Spitemare.java
@@ -39,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
@@ -88,9 +89,14 @@ class SpitemareTriggeredAbility extends TriggeredAbilityImpl {
return new SpitemareTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
+ if (event.getTargetId().equals(this.sourceId)) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java b/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java
index c98427c63e3..b2b2cd080a0 100644
--- a/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java
+++ b/Mage.Sets/src/mage/sets/eventide/WakeThrasher.java
@@ -28,18 +28,18 @@
package mage.sets.eventide;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -86,12 +86,14 @@ class BecomesUntappedControlledPermanentTriggeredAbility extends TriggeredAbilit
return new BecomesUntappedControlledPermanentTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UNTAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UNTAPPED && game.getPermanent(event.getTargetId()).getControllerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return game.getPermanent(event.getTargetId()).getControllerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java b/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java
index c41dc5fdfa7..8b0ee765545 100644
--- a/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java
+++ b/Mage.Sets/src/mage/sets/eventide/WavesOfAggression.java
@@ -41,6 +41,7 @@ import mage.constants.Rarity;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
import mage.watchers.Watcher;
@@ -162,6 +163,11 @@ class WavesOfAggressionDelayedAddMainPhaseAbility extends DelayedTriggeredAbilit
return new WavesOfAggressionDelayedAddMainPhaseAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.PHASE_CHANGED || event.getType() == EventType.COMBAT_PHASE_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java b/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java
index 0659cbd5c0d..07d2ccdfd64 100644
--- a/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java
+++ b/Mage.Sets/src/mage/sets/exodus/CityOfTraitors.java
@@ -28,18 +28,18 @@
package mage.sets.exodus;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.Mana;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -79,17 +79,17 @@ class CityOfTraitorsTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LAND_PLAYED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LAND_PLAYED) {
- Permanent land = game.getPermanent(event.getTargetId());
- if (land.getCardType().contains(CardType.LAND)
- && land.getControllerId().equals(this.controllerId)
- && event.getTargetId() != this.getSourceId()) {
- return true;
- }
- }
- return false;
+ Permanent land = game.getPermanent(event.getTargetId());
+ return land.getCardType().contains(CardType.LAND)
+ && land.getControllerId().equals(this.controllerId)
+ && event.getTargetId() != this.getSourceId();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java b/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.java
new file mode 100644
index 00000000000..1f8625c7cf2
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/exodus/ElvishBerserker.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.exodus;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker {
+
+ public ElvishBerserker(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 110;
+ this.expansionSetCode = "EXO";
+ }
+
+ public ElvishBerserker(final ElvishBerserker card) {
+ super(card);
+ }
+
+ @Override
+ public ElvishBerserker copy() {
+ return new ElvishBerserker(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java b/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java
index 6e9b73d8b87..4e07f51447c 100644
--- a/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java
+++ b/Mage.Sets/src/mage/sets/exodus/SoltariVisionary.java
@@ -28,19 +28,19 @@
package mage.sets.exodus;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.ShadowAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterEnchantmentPermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
-import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@@ -91,18 +91,21 @@ class SoltariVisionaryTriggeredAbility extends TriggeredAbilityImpl {
return new SoltariVisionaryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- Permanent soltari = game.getPermanent(event.getSourceId());
- if (soltari != null && soltari.getId() == this.getSourceId()) {
- FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls.");
- filter.add(new ControllerIdPredicate(event.getPlayerId()));
- filter.setMessage("enchantment controlled by " + game.getPlayer(event.getTargetId()).getLogName());
- this.getTargets().clear();
- this.addTarget(new TargetPermanent(filter));
- return true;
- }
+ Permanent soltari = game.getPermanent(event.getSourceId());
+ if (soltari != null && soltari.getId() == this.getSourceId()) {
+ FilterEnchantmentPermanent filter = new FilterEnchantmentPermanent("enchantment that player controls.");
+ filter.add(new ControllerIdPredicate(event.getPlayerId()));
+ filter.setMessage("enchantment controlled by " + game.getPlayer(event.getTargetId()).getLogName());
+ this.getTargets().clear();
+ this.addTarget(new TargetPermanent(filter));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade.java b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade1.java
similarity index 86%
rename from Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade.java
rename to Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade1.java
index 0396099817d..9a8e8e4cf68 100644
--- a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade.java
+++ b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade1.java
@@ -34,21 +34,21 @@ import mage.constants.Rarity;
*
* @author North
*/
-public class GoblinGrenade extends mage.sets.magic2012.GoblinGrenade {
+public class GoblinGrenade1 extends mage.sets.magic2012.GoblinGrenade {
- public GoblinGrenade(UUID ownerId) {
+ public GoblinGrenade1(UUID ownerId) {
super(ownerId);
this.cardNumber = 114;
this.expansionSetCode = "FEM";
this.rarity = Rarity.COMMON;
}
- public GoblinGrenade(final GoblinGrenade card) {
+ public GoblinGrenade1(final GoblinGrenade1 card) {
super(card);
}
@Override
- public GoblinGrenade copy() {
- return new GoblinGrenade(this);
+ public GoblinGrenade1 copy() {
+ return new GoblinGrenade1(this);
}
}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade2.java b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade2.java
new file mode 100644
index 00000000000..a62d5202ee2
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade2.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.fallenempires;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author North
+ */
+public class GoblinGrenade2 extends mage.sets.magic2012.GoblinGrenade {
+
+ public GoblinGrenade2(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 115;
+ this.expansionSetCode = "FEM";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public GoblinGrenade2(final GoblinGrenade2 card) {
+ super(card);
+ }
+
+ @Override
+ public GoblinGrenade2 copy() {
+ return new GoblinGrenade2(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade3.java b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade3.java
new file mode 100644
index 00000000000..752f2d3062c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/GoblinGrenade3.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.fallenempires;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author North
+ */
+public class GoblinGrenade3 extends mage.sets.magic2012.GoblinGrenade {
+
+ public GoblinGrenade3(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 116;
+ this.expansionSetCode = "FEM";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public GoblinGrenade3(final GoblinGrenade3 card) {
+ super(card);
+ }
+
+ @Override
+ public GoblinGrenade3 copy() {
+ return new GoblinGrenade3(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/HighTide.java b/Mage.Sets/src/mage/sets/fallenempires/HighTide.java
index e4a947dc8ae..a05092aa2e8 100644
--- a/Mage.Sets/src/mage/sets/fallenempires/HighTide.java
+++ b/Mage.Sets/src/mage/sets/fallenempires/HighTide.java
@@ -28,21 +28,21 @@
package mage.sets.fallenempires;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.Mana;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.mana.DelayedTriggeredManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -56,10 +56,9 @@ public class HighTide extends CardImpl {
super(ownerId, 35, "High Tide", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{U}");
this.expansionSetCode = "FEM";
-
// Until end of turn, whenever a player taps an Island for mana, that player adds {U} to his or her mana pool.
this.getSpellAbility().addEffect(new CreateDelayedTriggeredAbilityEffect(new HighTideTriggeredAbility()));
-
+
}
public HighTide(final HighTide card) {
@@ -75,9 +74,9 @@ public class HighTide extends CardImpl {
class HighTideTriggeredAbility extends DelayedTriggeredManaAbility {
private static final FilterLandPermanent filter = new FilterLandPermanent("Island");
-
+
static {
- filter.add(new SubtypePredicate("Island"));
+ filter.add(new SubtypePredicate("Island"));
}
public HighTideTriggeredAbility() {
@@ -89,10 +88,15 @@ class HighTideTriggeredAbility extends DelayedTriggeredManaAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent land = game.getPermanent(event.getTargetId());
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && land != null && filter.match(land, game)) {
+ if (land != null && filter.match(land, game)) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(land.getControllerId()));
}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach1.java
similarity index 91%
rename from Mage.Sets/src/mage/sets/fallenempires/HymnToTourach.java
rename to Mage.Sets/src/mage/sets/fallenempires/HymnToTourach1.java
index 314a045ff79..ae9ec58249c 100644
--- a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach.java
+++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach1.java
@@ -38,9 +38,9 @@ import mage.target.TargetPlayer;
*
* @author jonubuu
*/
-public class HymnToTourach extends CardImpl {
+public class HymnToTourach1 extends CardImpl {
- public HymnToTourach(UUID ownerId) {
+ public HymnToTourach1(UUID ownerId) {
super(ownerId, 12, "Hymn to Tourach", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}{B}");
this.expansionSetCode = "FEM";
@@ -50,12 +50,12 @@ public class HymnToTourach extends CardImpl {
this.getSpellAbility().addTarget(new TargetPlayer());
}
- public HymnToTourach(final HymnToTourach card) {
+ public HymnToTourach1(final HymnToTourach1 card) {
super(card);
}
@Override
- public HymnToTourach copy() {
- return new HymnToTourach(this);
+ public HymnToTourach1 copy() {
+ return new HymnToTourach1(this);
}
}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach2.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach2.java
new file mode 100644
index 00000000000..e500765ff1d
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach2.java
@@ -0,0 +1,56 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+import mage.abilities.effects.common.discard.DiscardTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.TargetPlayer;
+
+/**
+ *
+ * @author jonubuu
+ */
+public class HymnToTourach2 extends mage.sets.fallenempires.HymnToTourach1 {
+
+ public HymnToTourach2(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 13;
+ }
+
+ public HymnToTourach2(final HymnToTourach2 card) {
+ super(card);
+ }
+
+ @Override
+ public HymnToTourach2 copy() {
+ return new HymnToTourach2(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach3.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach3.java
new file mode 100644
index 00000000000..b48d4ff5517
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach3.java
@@ -0,0 +1,56 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+import mage.abilities.effects.common.discard.DiscardTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.TargetPlayer;
+
+/**
+ *
+ * @author jonubuu
+ */
+public class HymnToTourach3 extends mage.sets.fallenempires.HymnToTourach1 {
+
+ public HymnToTourach3(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 14;
+ }
+
+ public HymnToTourach3(final HymnToTourach3 card) {
+ super(card);
+ }
+
+ @Override
+ public HymnToTourach3 copy() {
+ return new HymnToTourach3(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach4.java b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach4.java
new file mode 100644
index 00000000000..591b97f8789
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/HymnToTourach4.java
@@ -0,0 +1,56 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+import mage.abilities.effects.common.discard.DiscardTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.TargetPlayer;
+
+/**
+ *
+ * @author jonubuu
+ */
+public class HymnToTourach4 extends mage.sets.fallenempires.HymnToTourach1 {
+
+ public HymnToTourach4(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 15;
+ }
+
+ public HymnToTourach4(final HymnToTourach4 card) {
+ super(card);
+ }
+
+ @Override
+ public HymnToTourach4 copy() {
+ return new HymnToTourach4(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers1.java
similarity index 93%
rename from Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers.java
rename to Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers1.java
index e525ddff687..a3a36e41680 100644
--- a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers.java
+++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers1.java
@@ -47,9 +47,9 @@ import mage.target.common.TargetCreatureOrPlayer;
*
* @author fireshoes
*/
-public class IcatianJavelineers extends CardImpl {
+public class IcatianJavelineers1 extends CardImpl {
- public IcatianJavelineers(UUID ownerId) {
+ public IcatianJavelineers1(UUID ownerId) {
super(ownerId, 148, "Icatian Javelineers", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}");
this.expansionSetCode = "FEM";
this.subtype.add("Human");
@@ -67,12 +67,12 @@ public class IcatianJavelineers extends CardImpl {
this.addAbility(ability);
}
- public IcatianJavelineers(final IcatianJavelineers card) {
+ public IcatianJavelineers1(final IcatianJavelineers1 card) {
super(card);
}
@Override
- public IcatianJavelineers copy() {
- return new IcatianJavelineers(this);
+ public IcatianJavelineers1 copy() {
+ return new IcatianJavelineers1(this);
}
}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers2.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers2.java
new file mode 100644
index 00000000000..793fe6afae1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers2.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.timeshifted;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author fireshoes
+ */
+public class IcatianJavelineers2 extends mage.sets.fallenempires.IcatianJavelineers1 {
+
+ public IcatianJavelineers2(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 149;
+ }
+
+ public IcatianJavelineers2(final IcatianJavelineers2 card) {
+ super(card);
+ }
+
+ @Override
+ public IcatianJavelineers2 copy() {
+ return new IcatianJavelineers2(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.java
new file mode 100644
index 00000000000..85649357295
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/IcatianJavelineers3.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.timeshifted;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author fireshoes
+ */
+public class IcatianJavelineers3 extends mage.sets.fallenempires.IcatianJavelineers1 {
+
+ public IcatianJavelineers3(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 150;
+ }
+
+ public IcatianJavelineers3(final IcatianJavelineers3 card) {
+ super(card);
+ }
+
+ @Override
+ public IcatianJavelineers3 copy() {
+ return new IcatianJavelineers3(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil1.java
similarity index 91%
rename from Mage.Sets/src/mage/sets/fallenempires/NightSoil.java
rename to Mage.Sets/src/mage/sets/fallenempires/NightSoil1.java
index aa9118664a2..f31f9bfcb00 100644
--- a/Mage.Sets/src/mage/sets/fallenempires/NightSoil.java
+++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil1.java
@@ -45,9 +45,9 @@ import mage.target.common.TargetCardInASingleGraveyard;
*
* @author LevelX2
*/
-public class NightSoil extends CardImpl {
+public class NightSoil1 extends CardImpl {
- public NightSoil(UUID ownerId) {
+ public NightSoil1(UUID ownerId) {
super(ownerId, 80, "Night Soil", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{G}{G}");
this.expansionSetCode = "FEM";
@@ -58,12 +58,12 @@ public class NightSoil extends CardImpl {
this.addAbility(ability);
}
- public NightSoil(final NightSoil card) {
+ public NightSoil1(final NightSoil1 card) {
super(card);
}
@Override
- public NightSoil copy() {
- return new NightSoil(this);
+ public NightSoil1 copy() {
+ return new NightSoil1(this);
}
}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.java
new file mode 100644
index 00000000000..09706ba97b5
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil2.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.masterseditionii;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class NightSoil2 extends mage.sets.fallenempires.NightSoil1 {
+
+ public NightSoil2(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 81;
+ }
+
+ public NightSoil2(final NightSoil2 card) {
+ super(card);
+ }
+
+ @Override
+ public NightSoil2 copy() {
+ return new NightSoil2(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java b/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.java
new file mode 100644
index 00000000000..7289331f5f6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/NightSoil3.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.masterseditionii;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class NightSoil3 extends mage.sets.fallenempires.NightSoil1 {
+
+ public NightSoil3(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 82;
+ }
+
+ public NightSoil3(final NightSoil3 card) {
+ super(card);
+ }
+
+ @Override
+ public NightSoil3 copy() {
+ return new NightSoil3(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur1.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur1.java
new file mode 100644
index 00000000000..194a0bd052c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur1.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfLeitbur1 extends mage.sets.mastersedition.OrderOfLeitbur {
+
+ public OrderOfLeitbur1(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 163;
+ this.expansionSetCode = "FEM";
+ }
+
+ public OrderOfLeitbur1(final OrderOfLeitbur1 card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfLeitbur1 copy() {
+ return new OrderOfLeitbur1(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur2.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur2.java
new file mode 100644
index 00000000000..360fdfe329b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur2.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfLeitbur2 extends mage.sets.mastersedition.OrderOfLeitbur {
+
+ public OrderOfLeitbur2(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 164;
+ this.expansionSetCode = "FEM";
+ }
+
+ public OrderOfLeitbur2(final OrderOfLeitbur2 card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfLeitbur2 copy() {
+ return new OrderOfLeitbur2(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur3.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur3.java
new file mode 100644
index 00000000000..1f71602dbc4
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfLeitbur3.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfLeitbur3 extends mage.sets.mastersedition.OrderOfLeitbur {
+
+ public OrderOfLeitbur3(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 165;
+ this.expansionSetCode = "FEM";
+ }
+
+ public OrderOfLeitbur3(final OrderOfLeitbur3 card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfLeitbur3 copy() {
+ return new OrderOfLeitbur3(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand1.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand1.java
new file mode 100644
index 00000000000..221a35d91d7
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand1.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfTheEbonHand1 extends mage.sets.mastersedition.OrderOfTheEbonHand {
+
+ public OrderOfTheEbonHand1(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 25;
+ this.expansionSetCode = "FEM";
+ }
+
+ public OrderOfTheEbonHand1(final OrderOfTheEbonHand1 card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfTheEbonHand1 copy() {
+ return new OrderOfTheEbonHand1(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand2.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand2.java
new file mode 100644
index 00000000000..28270bc6488
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand2.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfTheEbonHand2 extends mage.sets.mastersedition.OrderOfTheEbonHand {
+
+ public OrderOfTheEbonHand2(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 26;
+ this.expansionSetCode = "FEM";
+ }
+
+ public OrderOfTheEbonHand2(final OrderOfTheEbonHand2 card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfTheEbonHand2 copy() {
+ return new OrderOfTheEbonHand2(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand3.java b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand3.java
new file mode 100644
index 00000000000..85e25ae3f45
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fallenempires/OrderOfTheEbonHand3.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fallenempires;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfTheEbonHand3 extends mage.sets.mastersedition.OrderOfTheEbonHand {
+
+ public OrderOfTheEbonHand3(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 27;
+ this.expansionSetCode = "FEM";
+ }
+
+ public OrderOfTheEbonHand3(final OrderOfTheEbonHand3 card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfTheEbonHand3 copy() {
+ return new OrderOfTheEbonHand3(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java b/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java
index 19991829197..b810c8e7265 100644
--- a/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java
+++ b/Mage.Sets/src/mage/sets/fifthdawn/BlindCreeper.java
@@ -28,18 +28,17 @@
package mage.sets.fifthdawn;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
-import mage.game.stack.Spell;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -85,15 +84,14 @@ class BlindCreeperAbility extends TriggeredAbilityImpl {
return new BlindCreeperAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null) {
- return true;
- }
- }
- return false;
+ return game.getStack().getSpell(event.getTargetId()) != null;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java b/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java
index 88c61fc57d8..8a06a839efe 100644
--- a/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java
+++ b/Mage.Sets/src/mage/sets/fifthdawn/DawnsReflection.java
@@ -42,6 +42,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
@@ -93,15 +94,15 @@ class DawnsReflectionTriggeredAbility extends TriggeredManaAbility {
return new DawnsReflectionTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- return true;
- }
- }
- return false;
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo());
}
diff --git a/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java b/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java
index b67288d2365..b0e425fdd15 100644
--- a/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java
+++ b/Mage.Sets/src/mage/sets/fifthdawn/RiteOfPassage.java
@@ -39,6 +39,7 @@ import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -87,16 +88,19 @@ class RiteOfPassageTriggeredAbility extends TriggeredAbilityImpl {
return new RiteOfPassageTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanent(targetId);
- if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- return true;
- }
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanent(targetId);
+ if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/fifthedition/Blight.java b/Mage.Sets/src/mage/sets/fifthedition/Blight.java
index 252c62715a6..dc7821b2b6a 100644
--- a/Mage.Sets/src/mage/sets/fifthedition/Blight.java
+++ b/Mage.Sets/src/mage/sets/fifthedition/Blight.java
@@ -28,9 +28,6 @@
package mage.sets.fifthedition;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
@@ -38,10 +35,13 @@ import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -89,18 +89,21 @@ class BlightTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent enchantment = game.getPermanent(this.sourceId);
- if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) {
- Permanent attached = game.getPermanent(enchantment.getAttachedTo());
- if (attached != null) {
- for (Effect e : getEffects()) {
- e.setTargetPointer(new FixedTarget(attached.getId()));
- }
- return true;
+ Permanent enchantment = game.getPermanent(this.sourceId);
+ if (enchantment != null && enchantment.getAttachedTo().equals(event.getTargetId())) {
+ Permanent attached = game.getPermanent(enchantment.getAttachedTo());
+ if (attached != null) {
+ for (Effect e : getEffects()) {
+ e.setTargetPointer(new FixedTarget(attached.getId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/fifthedition/ErgRaiders.java b/Mage.Sets/src/mage/sets/fifthedition/ErgRaiders.java
new file mode 100644
index 00000000000..dae9ebd5a3b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fifthedition/ErgRaiders.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fifthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders {
+
+ public ErgRaiders(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 20;
+ this.expansionSetCode = "5ED";
+ }
+
+ public ErgRaiders(final ErgRaiders card) {
+ super(card);
+ }
+
+ @Override
+ public ErgRaiders copy() {
+ return new ErgRaiders(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fifthedition/Errantry.java b/Mage.Sets/src/mage/sets/fifthedition/Errantry.java
new file mode 100644
index 00000000000..2c8cec04d91
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fifthedition/Errantry.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fifthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Errantry extends mage.sets.masterseditionii.Errantry {
+
+ public Errantry(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 224;
+ this.expansionSetCode = "5ED";
+ }
+
+ public Errantry(final Errantry card) {
+ super(card);
+ }
+
+ @Override
+ public Errantry copy() {
+ return new Errantry(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fifthedition/Justice.java b/Mage.Sets/src/mage/sets/fifthedition/Justice.java
index ffa932141df..0782eddfe83 100644
--- a/Mage.Sets/src/mage/sets/fifthedition/Justice.java
+++ b/Mage.Sets/src/mage/sets/fifthedition/Justice.java
@@ -27,7 +27,7 @@
*/
package mage.sets.fifthedition;
-import mage.constants.*;
+import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -37,15 +37,19 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
*
* @author jeffwadsworth
@@ -89,19 +93,22 @@ class JusticeTriggeredAbility extends TriggeredAbilityImpl {
return new JusticeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE
- || event.getType() == GameEvent.EventType.DAMAGED_PLAYER
- || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) {
- MageObject sourceObject = game.getObject(event.getSourceId());
- if (sourceObject.getColor(game).isRed()) {
- if (sourceObject instanceof Permanent && sourceObject.getCardType().contains(CardType.CREATURE)
- || sourceObject instanceof Spell) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getControllerId(sourceObject.getId())));
- return true;
- }
+ MageObject sourceObject = game.getObject(event.getSourceId());
+ if (sourceObject.getColor(game).isRed()) {
+ if (sourceObject instanceof Permanent && sourceObject.getCardType().contains(CardType.CREATURE)
+ || sourceObject instanceof Spell) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getControllerId(sourceObject.getId())));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/fifthedition/KnightOfStromgald.java b/Mage.Sets/src/mage/sets/fifthedition/KnightOfStromgald.java
new file mode 100644
index 00000000000..af5cc58290f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fifthedition/KnightOfStromgald.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fifthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class KnightOfStromgald extends mage.sets.iceage.KnightOfStromgald {
+
+ public KnightOfStromgald(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 33;
+ this.expansionSetCode = "5ED";
+ }
+
+ public KnightOfStromgald(final KnightOfStromgald card) {
+ super(card);
+ }
+
+ @Override
+ public KnightOfStromgald copy() {
+ return new KnightOfStromgald(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fifthedition/OrderOfTheWhiteShield.java b/Mage.Sets/src/mage/sets/fifthedition/OrderOfTheWhiteShield.java
new file mode 100644
index 00000000000..b131da9beef
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fifthedition/OrderOfTheWhiteShield.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fifthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfTheWhiteShield extends mage.sets.iceage.OrderOfTheWhiteShield {
+
+ public OrderOfTheWhiteShield(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 325;
+ this.expansionSetCode = "5ED";
+ }
+
+ public OrderOfTheWhiteShield(final OrderOfTheWhiteShield card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfTheWhiteShield copy() {
+ return new OrderOfTheWhiteShield(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.java
new file mode 100644
index 00000000000..66a87d3c2c7
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fifthedition/PhantasmalForces.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.fifthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {
+
+ public PhantasmalForces(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 106;
+ this.expansionSetCode = "5ED";
+ }
+
+ public PhantasmalForces(final PhantasmalForces card) {
+ super(card);
+ }
+
+ @Override
+ public PhantasmalForces copy() {
+ return new PhantasmalForces(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fifthedition/Tarpan.java b/Mage.Sets/src/mage/sets/fifthedition/Tarpan.java
new file mode 100644
index 00000000000..4dc3e23c5a5
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fifthedition/Tarpan.java
@@ -0,0 +1,53 @@
+/*
+ * 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.fifthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Tarpan extends mage.sets.iceage.Tarpan {
+
+ public Tarpan(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 192;
+ this.expansionSetCode = "5ED";
+ }
+
+ public Tarpan(final Tarpan card) {
+ super(card);
+ }
+
+ @Override
+ public Tarpan copy() {
+ return new Tarpan(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java
index 9554817d948..bfe1f16d8a4 100644
--- a/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java
+++ b/Mage.Sets/src/mage/sets/fifthedition/TheWretched.java
@@ -31,6 +31,7 @@ import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.common.EndOfCombatTriggeredAbility;
import mage.abilities.condition.common.SourceOnBattlefieldControlUnchangedCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.ContinuousEffect;
@@ -77,7 +78,7 @@ public class TheWretched extends CardImpl {
this.toughness = new MageInt(5);
// At end of combat, gain control of all creatures blocking The Wretched for as long as you control The Wretched.
- this.addAbility(new EndOfAnyCombatTriggeredAbility(), new BlockedAttackerWatcher());
+ this.addAbility(new EndOfCombatTriggeredAbility(new TheWretchedEffect(), false), new BlockedAttackerWatcher());
}
@@ -91,37 +92,6 @@ public class TheWretched extends CardImpl {
}
}
-class EndOfAnyCombatTriggeredAbility extends TriggeredAbilityImpl {
-
- EndOfAnyCombatTriggeredAbility() {
- super(Zone.BATTLEFIELD, new TheWretchedEffect(), false);
- }
-
- EndOfAnyCombatTriggeredAbility(final EndOfAnyCombatTriggeredAbility ability) {
- super(ability);
- }
-
- @Override
- public EndOfAnyCombatTriggeredAbility copy() {
- return new EndOfAnyCombatTriggeredAbility(this);
- }
-
- @Override
- public boolean checkEventType(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE;
- }
-
- @Override
- public boolean checkTrigger(GameEvent event, Game game) {
- return true;
- }
-
- @Override
- public String getRule() {
- return "At the end of combat, gain control of all creatures blocking {this} for as long as you control {this}.";
- }
-}
-
class TheWretchedEffect extends OneShotEffect {
TheWretchedEffect() {
diff --git a/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java b/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java
new file mode 100644
index 00000000000..edc6362f7d3
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fourthedition/ErgRaiders.java
@@ -0,0 +1,87 @@
+/*
+ * 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.fourthedition;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.TriggeredAbility;
+import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
+import mage.abilities.condition.Condition;
+import mage.abilities.decorator.ConditionalTriggeredAbility;
+import mage.abilities.effects.common.DamageControllerEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.watchers.common.AttackedThisTurnWatcher;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class ErgRaiders extends CardImpl {
+
+ public ErgRaiders(UUID ownerId) {
+ super(ownerId, 19, "Erg Raiders", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
+ this.expansionSetCode = "4ED";
+ this.subtype.add("Human");
+ this.subtype.add("Warrior");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(3);
+
+ // At the beginning of your end step, if Erg Raiders didn't attack this turn, Erg Raiders deals 2 damage to you unless it came under your control this turn.
+ TriggeredAbility ability = new ConditionalTriggeredAbility(new BeginningOfEndStepTriggeredAbility(new DamageControllerEffect(2), TargetController.YOU, false),
+ new ErgRaidersCondition(), "At the beginning of your end step, if {this} didn't attack this turn, {this} deals 2 damage to you unless it came under your control this turn.");
+ ability.addWatcher(new AttackedThisTurnWatcher());
+ this.addAbility(ability);
+ }
+
+ public ErgRaiders(final ErgRaiders card) {
+ super(card);
+ }
+
+ @Override
+ public ErgRaiders copy() {
+ return new ErgRaiders(this);
+ }
+}
+
+class ErgRaidersCondition implements Condition {
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Permanent raiders = game.getPermanentOrLKIBattlefield(source.getSourceId());
+ AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher) game.getState().getWatchers().get("AttackedThisTurn");
+ // wasControlledFromStartOfControllerTurn should be checked during resolution I guess, but shouldn't be relevant
+ return raiders.wasControlledFromStartOfControllerTurn() && !watcher.getAttackedThisTurnCreatures().contains(raiders.getId());
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fourthedition/Onulet.java b/Mage.Sets/src/mage/sets/fourthedition/Onulet.java
new file mode 100644
index 00000000000..f058249f256
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fourthedition/Onulet.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.fourthedition;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class Onulet extends mage.sets.mastersedition.Onulet {
+
+ public Onulet(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 358;
+ this.expansionSetCode = "4ED";
+ this.rarity = Rarity.RARE;
+ }
+
+ public Onulet(final Onulet card) {
+ super(card);
+ }
+
+ @Override
+ public Onulet copy() {
+ return new Onulet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java
new file mode 100644
index 00000000000..eb4c8632ca2
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/fourthedition/PhantasmalForces.java
@@ -0,0 +1,68 @@
+/*
+ * 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.fourthedition;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+
+/**
+ *
+ * @author anonymous
+ */
+public class PhantasmalForces extends CardImpl {
+
+ public PhantasmalForces(UUID ownerId) {
+ super(ownerId, 88, "Phantasmal Forces", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
+ this.expansionSetCode = "4ED";
+ this.subtype.add("Illusion");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(1);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // At the beginning of your upkeep, sacrifice Phantasmal Forces unless you pay {U}.
+ this.addAbility(new BeginningOfUpkeepTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new ManaCostsImpl("{U}")), TargetController.YOU, false));
+ }
+
+ public PhantasmalForces(final PhantasmalForces card) {
+ super(card);
+ }
+
+ @Override
+ public PhantasmalForces copy() {
+ return new PhantasmalForces(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/fourthedition/TheRack.java b/Mage.Sets/src/mage/sets/fourthedition/TheRack.java
index d87b9cab0b3..98b564a6bbf 100644
--- a/Mage.Sets/src/mage/sets/fourthedition/TheRack.java
+++ b/Mage.Sets/src/mage/sets/fourthedition/TheRack.java
@@ -39,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetOpponent;
@@ -85,12 +86,14 @@ class TheRackTriggeredAbility extends TriggeredAbilityImpl {
return new TheRackTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- return event.getPlayerId().equals((UUID) game.getState().getValue(new StringBuilder(this.getSourceId().toString()).append("_player").toString()));
- }
- return false;
+ return event.getPlayerId().equals((UUID) game.getState().getValue(new StringBuilder(this.getSourceId().toString()).append("_player").toString()));
}
@Override
diff --git a/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java b/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java
index 893abce9671..dd106c5a4a1 100644
--- a/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java
+++ b/Mage.Sets/src/mage/sets/futuresight/FrenzySliver.java
@@ -43,6 +43,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -99,15 +100,18 @@ class FrenzyAbility extends TriggeredAbilityImpl {
return new FrenzyAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_BLOCKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) {
- Permanent sourcePermanent = game.getPermanent(getSourceId());
- if (sourcePermanent.isAttacking()) {
- for (CombatGroup combatGroup: game.getCombat().getGroups()) {
- if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) {
- return true;
- }
+ Permanent sourcePermanent = game.getPermanent(getSourceId());
+ if (sourcePermanent.isAttacking()) {
+ for (CombatGroup combatGroup: game.getCombat().getGroups()) {
+ if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) {
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java b/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java
index 287277332dc..2ae7c2d510c 100644
--- a/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java
+++ b/Mage.Sets/src/mage/sets/futuresight/HeartwoodStoryteller.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -85,17 +86,20 @@ class HeartwoodStorytellerTriggeredAbility extends TriggeredAbilityImpl {
public HeartwoodStorytellerTriggeredAbility copy() {
return new HeartwoodStorytellerTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && !spell.getCardType().contains(CardType.CREATURE)) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && !spell.getCardType().contains(CardType.CREATURE)) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java b/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java
new file mode 100644
index 00000000000..12f7fedf8ad
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/futuresight/LlanowarEmpath.java
@@ -0,0 +1,113 @@
+/*
+ * 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.futuresight;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.MageObject;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.keyword.ScryEffect;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.cards.Cards;
+import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.players.Player;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class LlanowarEmpath extends CardImpl {
+
+ public LlanowarEmpath(UUID ownerId) {
+ super(ownerId, 130, "Llanowar Empath", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{G}");
+ this.expansionSetCode = "FUT";
+ this.subtype.add("Elf");
+ this.subtype.add("Shaman");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // When Llanowar Empath enters the battlefield, scry 2, then reveal the top card of your library. If it's a creature card, put it into your hand.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new ScryEffect(2));
+ ability.addEffect(new LlanowarEmpathEffect());
+ this.addAbility(ability);
+ }
+
+ public LlanowarEmpath(final LlanowarEmpath card) {
+ super(card);
+ }
+
+ @Override
+ public LlanowarEmpath copy() {
+ return new LlanowarEmpath(this);
+ }
+}
+
+class LlanowarEmpathEffect extends OneShotEffect {
+
+ public LlanowarEmpathEffect() {
+ super(Outcome.Benefit);
+ this.staticText = ", then reveal the top card of your library. If it's a creature card, put it into your hand.";
+ }
+
+ public LlanowarEmpathEffect(final LlanowarEmpathEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public LlanowarEmpathEffect copy() {
+ return new LlanowarEmpathEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ MageObject sourceObject = game.getObject(source.getSourceId());
+ Player controller = game.getPlayer(source.getControllerId());
+ if(controller == null || sourceObject == null) {
+ return false;
+ }
+ Cards cards = new CardsImpl();
+ Card card = controller.getLibrary().getFromTop(game);
+ if(card != null) {
+ cards.add(card);
+ controller.revealCards(sourceObject.getName(), cards, game);
+ if(card.getCardType().contains(CardType.CREATURE)) {
+ card.moveToZone(Zone.HAND, source.getSourceId(), game, true);
+ }
+ }
+ return true;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java b/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java
index 2a83f0ab877..11cfa55720f 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/AureliaTheWarleader.java
@@ -28,10 +28,6 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -43,8 +39,11 @@ import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.TurnPhase;
+import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -110,17 +109,22 @@ class AureliaAttacksTriggeredAbility extends TriggeredAbilityImpl {
@Override
public void reset(Game game) {
Card sourceCard = game.getCard(getSourceId());
- game.getState().setValue(getValueKey(sourceCard, game), new Integer(0));
+ game.getState().setValue(getValueKey(sourceCard, game), 0);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) {
+ if (event.getSourceId().equals(this.getSourceId()) ) {
Card sourceCard = game.getCard(getSourceId());
Integer amountAttacks = (Integer) game.getState().getValue(getValueKey(sourceCard, game));
- if (amountAttacks == null || amountAttacks.intValue() < 1) {
+ if (amountAttacks == null || amountAttacks < 1) {
if (amountAttacks == null) {
- amountAttacks = new Integer(1);
+ amountAttacks = 1;
} else {
++amountAttacks;
}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java b/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java
index 27cb238c2fc..9bed435422f 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/Bioshift.java
@@ -40,6 +40,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
+import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
/**
@@ -52,11 +53,12 @@ public class Bioshift extends CardImpl {
super(ownerId, 214, "Bioshift", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{G/U}");
this.expansionSetCode = "GTC";
-
// Move any number of +1/+1 counters from target creature onto another target creature with the same controller.
getSpellAbility().addEffect(new MoveCounterFromTargetToTargetEffect());
- getSpellAbility().addTarget(new TargetCreaturePermanentSameController(2,2,new FilterCreaturePermanent(),false));
+ getSpellAbility().addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature (you take counters from)")));
+ getSpellAbility().addTarget(new BioshiftSecondTargetPermanent());
}
+
public Bioshift(final Bioshift card) {
super(card);
@@ -68,37 +70,6 @@ public class Bioshift extends CardImpl {
}
}
-class TargetCreaturePermanentSameController extends TargetCreaturePermanent {
-
- public TargetCreaturePermanentSameController(int minNumTargets, int maxNumTargets, FilterCreaturePermanent filter, boolean notTarget) {
- super(minNumTargets, maxNumTargets, filter, notTarget);
- this.targetName = filter.getMessage();
- }
-
- public TargetCreaturePermanentSameController(final TargetCreaturePermanentSameController target) {
- super(target);
- }
-
- @Override
- public boolean canTarget(UUID id, Ability source, Game game) {
- UUID firstTarget = this.getFirstTarget();
- if (firstTarget != null) {
- Permanent permanent = game.getPermanent(firstTarget);
- Permanent targetPermanent = game.getPermanent(id);
- if (permanent == null || targetPermanent == null
- || !permanent.getControllerId().equals(targetPermanent.getOwnerId())) {
- return false;
- }
- }
- return super.canTarget(id, source, game);
- }
-
- @Override
- public TargetCreaturePermanentSameController copy() {
- return new TargetCreaturePermanentSameController(this);
- }
-}
-
class MoveCounterFromTargetToTargetEffect extends OneShotEffect {
public MoveCounterFromTargetToTargetEffect() {
@@ -117,22 +88,56 @@ class MoveCounterFromTargetToTargetEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- Permanent fromPermanent = game.getPermanent(targetPointer.getFirst(game, source));
- Permanent toPermanent = null;
- if (targetPointer.getTargets(game, source).size() > 1) {
- toPermanent = game.getPermanent(targetPointer.getTargets(game, source).get(1));
- }
- if (fromPermanent == null || toPermanent == null || !fromPermanent.getControllerId().equals(toPermanent.getControllerId())) {
- return false;
- }
- int amountCounters = fromPermanent.getCounters().getCount(CounterType.P1P1);
- if (amountCounters > 0) {
- Player controller = game.getPlayer(source.getControllerId());
- if (controller.getAmount(0, amountCounters, "How many counters do you want to move?", game) > 0){
- fromPermanent.getCounters().removeCounter(CounterType.P1P1, amountCounters);
- toPermanent.addCounters(CounterType.P1P1.createInstance(amountCounters), game);
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ Permanent fromPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
+ Permanent toPermanent = null;
+ if (source.getTargets().size() > 1) {
+ toPermanent = game.getPermanent(source.getTargets().get(1).getFirstTarget());
}
+ if (fromPermanent == null || toPermanent == null || !fromPermanent.getControllerId().equals(toPermanent.getControllerId())) {
+ return false;
+ }
+ int amountCounters = fromPermanent.getCounters().getCount(CounterType.P1P1);
+ if (amountCounters > 0) {
+ int amountToMove = controller.getAmount(0, amountCounters, "How many counters do you want to move?", game);
+ if (amountToMove > 0) {
+ fromPermanent.removeCounters(CounterType.P1P1.createInstance(amountToMove), game);
+ toPermanent.addCounters(CounterType.P1P1.createInstance(amountToMove), game);
+ }
+ }
+ return true;
}
- return true;
+ return false;
+
+ }
+}
+
+class BioshiftSecondTargetPermanent extends TargetPermanent {
+
+ BioshiftSecondTargetPermanent() {
+ super();
+ this.filter = new FilterCreaturePermanent("another target creature with the same controller (counters go to)");
+ }
+
+ BioshiftSecondTargetPermanent(final BioshiftSecondTargetPermanent target) {
+ super(target);
+ }
+
+ @Override
+ public boolean canTarget(UUID controllerId, UUID id, Ability source, Game game) {
+ Permanent firstPermanent = game.getPermanent(source.getTargets().getFirstTarget());
+ Permanent secondPermanent = game.getPermanent(id);
+ if (firstPermanent != null && secondPermanent != null) {
+ if (!firstPermanent.getId().equals(id) && firstPermanent.getControllerId().equals(secondPermanent.getControllerId())) {
+ return super.canTarget(controllerId, id, source, game);
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public BioshiftSecondTargetPermanent copy() {
+ return new BioshiftSecondTargetPermanent(this);
}
}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java b/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java
index 69d29454f28..87693e80a76 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/CryptGhast.java
@@ -29,19 +29,20 @@
package mage.sets.gatecrash;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.Mana;
import mage.abilities.effects.common.BasicManaEffect;
import mage.abilities.keyword.ExtortAbility;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -90,15 +91,15 @@ class CryptGhastTriggeredAbility extends TriggeredManaAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) {
- Permanent land = game.getPermanent(event.getTargetId());
- if (land != null && filter.match(land, this.getSourceId(), this.getControllerId(), game)) {
- return true;
- }
- }
- return false;
+ Permanent land = game.getPermanent(event.getTargetId());
+ return land != null && filter.match(land, this.getSourceId(), this.getControllerId(), game);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java b/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java
index 6cfb3ad6b2d..c608882f9a0 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/DuskmantleGuildmage.java
@@ -28,10 +28,6 @@
package mage.sets.gatecrash;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -43,6 +39,10 @@ import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -99,19 +99,22 @@ class CardPutIntoOpponentGraveThisTurn extends DelayedTriggeredAbility {
return new CardPutIntoOpponentGraveThisTurn(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- UUID cardId = event.getTargetId();
- Card card = game.getCard(cardId);
- if (card != null && zEvent.getToZone() == Zone.GRAVEYARD && !card.isCopy()
- && game.getOpponents(controllerId).contains(card.getOwnerId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(card.getOwnerId()));
- }
- return true;
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ UUID cardId = event.getTargetId();
+ Card card = game.getCard(cardId);
+ if (card != null && zEvent.getToZone() == Zone.GRAVEYARD && !card.isCopy()
+ && game.getOpponents(controllerId).contains(card.getOwnerId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(card.getOwnerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java b/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java
index 2a399e55387..67f67d0d830 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/FathomMage.java
@@ -29,18 +29,18 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.EvolveAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -86,14 +86,14 @@ class FathomMageTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_ADDED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.COUNTER_ADDED) {
- if (event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName())) {
- return true;
- }
- }
- return false;
+ return event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java b/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java
index 1d18de1d7df..cfb6dce7dc3 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/FiveAlarmFire.java
@@ -101,23 +101,29 @@ class FiveAlarmFireTriggeredAbility extends TriggeredAbilityImpl {
return new FiveAlarmFireTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLANESWALKER
+ || event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE
- || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER
- || event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
+ if (event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLANESWALKER
+ || event.getType() == EventType.DAMAGED_PLAYER) {
if (((DamagedEvent) event).isCombatDamage() && !triggeringCreatures.contains(event.getSourceId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
triggeringCreatures.add(event.getSourceId());
return true;
}
-
}
-
}
// reset the remembered creatures for every combat damage step
- if (event.getType().equals(EventType.COMBAT_DAMAGE_STEP_PRE)) {
+ if (event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE) {
triggeringCreatures.clear();
}
return false;
diff --git a/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java b/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java
index d2e18c0c0dd..d1f3b76f5e9 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/GruulRagebeast.java
@@ -28,19 +28,23 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.*;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.CardIdPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
@@ -100,20 +104,23 @@ class GruulRagebeastTriggeredAbility extends TriggeredAbilityImpl {
return new GruulRagebeastTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanent(targetId);
- if (permanent.getControllerId().equals(this.controllerId)
- && permanent.getCardType().contains(CardType.CREATURE)
- && (targetId.equals(this.getSourceId())
- || !targetId.equals(this.getSourceId()))) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanent(targetId);
+ if (permanent.getControllerId().equals(this.controllerId)
+ && permanent.getCardType().contains(CardType.CREATURE)
+ && (targetId.equals(this.getSourceId())
+ || !targetId.equals(this.getSourceId()))) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java b/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java
index 40afe2cf989..1c2196d126b 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/HighPriestOfPenance.java
@@ -29,16 +29,16 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetNonlandPermanent;
/**
@@ -88,14 +88,14 @@ class HighPriestOfPenanceTriggeredAbility extends TriggeredAbilityImpl {
return new HighPriestOfPenanceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- if (event.getTargetId().equals(this.sourceId)) {
- return true;
- }
- }
- return false;
+ return event.getTargetId().equals(this.sourceId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java b/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java
index ff3acf02366..83a86cc47b6 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/IllusionistsBracers.java
@@ -28,10 +28,6 @@
package mage.sets.gatecrash;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
@@ -40,8 +36,13 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.mana.ManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.StackAbility;
import mage.players.Player;
@@ -88,17 +89,20 @@ class AbilityActivatedTriggeredAbility extends TriggeredAbilityImpl {
return new AbilityActivatedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ACTIVATED_ABILITY;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) {
- Permanent equipment = game.getPermanent(this.getSourceId());
- if (equipment != null && equipment.getAttachedTo() != null && equipment.getAttachedTo().equals(event.getSourceId())) {
- StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
- if (!(stackAbility.getStackAbility() instanceof ManaAbility)) {
- Effect effect = this.getEffects().get(0);
- effect.setValue("stackAbility", stackAbility.getStackAbility());
- return true;
- }
+ Permanent equipment = game.getPermanent(this.getSourceId());
+ if (equipment != null && equipment.getAttachedTo() != null && equipment.getAttachedTo().equals(event.getSourceId())) {
+ StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
+ if (!(stackAbility.getStackAbility() instanceof ManaAbility)) {
+ Effect effect = this.getEffects().get(0);
+ effect.setValue("stackAbility", stackAbility.getStackAbility());
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java b/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java
index ffbdfecb931..915acc973a2 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/IncursionSpecialist.java
@@ -28,15 +28,19 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.*;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.WatcherScope;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.watchers.Watcher;
@@ -85,9 +89,14 @@ class IncursionTriggeredAbility extends TriggeredAbilityImpl {
return new IncursionTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) {
+ if (event.getPlayerId().equals(controllerId)) {
Watcher watcher = game.getState().getWatchers().get("SecondSpellCast", controllerId);
if (watcher != null && watcher.conditionMet()) {
return true;
diff --git a/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java b/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java
index 7738e497bce..211072dca85 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/LeylinePhantom.java
@@ -29,17 +29,17 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -73,7 +73,6 @@ public class LeylinePhantom extends CardImpl {
class LeylinePhantomTriggeredAbility extends TriggeredAbilityImpl {
-
public LeylinePhantomTriggeredAbility() {
super(Zone.BATTLEFIELD, new ReturnToHandSourceEffect(true), false);
}
@@ -87,14 +86,14 @@ class LeylinePhantomTriggeredAbility extends TriggeredAbilityImpl {
return new LeylinePhantomTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE || event.getType() == EventType.DAMAGED_PLANESWALKER || event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER || event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if(((DamagedEvent) event).isCombatDamage() && event.getSourceId().equals(this.getSourceId())){
- return true;
- }
- }
- return false;
+ return ((DamagedEvent) event).isCombatDamage() && event.getSourceId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java b/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java
index 1e15e297516..8de83fd6c9d 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/ObzedatGhostCouncil.java
@@ -29,9 +29,6 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -46,13 +43,16 @@ import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetOpponent;
@@ -138,9 +138,14 @@ class BeginningOfYourUpkeepdelayTriggeredAbility extends DelayedTriggeredAbility
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId);
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java b/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java
index 1d29e0ce3ad..02819caf9d9 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/RustScarab.java
@@ -28,15 +28,13 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
-import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
@@ -44,6 +42,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.Target;
import mage.target.TargetPermanent;
@@ -89,9 +88,14 @@ class BecomesBlockedTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.CREATURE_BLOCKED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.CREATURE_BLOCKED && event.getTargetId().equals(this.getSourceId())) {
+ if (event.getTargetId().equals(this.getSourceId())) {
UUID defenderId = game.getState().getCombat().findGroup(this.getSourceId()).getDefenderId();
if (defenderId != null) {
this.getTargets().clear();
diff --git a/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java b/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java
index d0abdaa242c..f53b501b94a 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/VerdantHaven.java
@@ -42,6 +42,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -98,14 +99,14 @@ class VerdantHavenTriggeredAbility extends TriggeredManaAbility {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- return true;
- }
- }
- return false;
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo());
}
diff --git a/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java b/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java
index cf9b249967c..04b112d2ef0 100644
--- a/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java
+++ b/Mage.Sets/src/mage/sets/gatecrash/VizkopaGuildmage.java
@@ -29,12 +29,6 @@
package mage.sets.gatecrash;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -45,8 +39,14 @@ import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
@@ -106,10 +106,15 @@ class VizkopaGuildmageDelayedTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getTargetId().equals(controllerId)) {
- getEffects().get(0).setValue("amountLifeGained", new Integer(event.getAmount()));
+ if (event.getTargetId().equals(controllerId)) {
+ getEffects().get(0).setValue("amountLifeGained", event.getAmount());
return true;
}
return false;
diff --git a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java
index 6147d04f377..dded38dbd82 100644
--- a/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java
+++ b/Mage.Sets/src/mage/sets/guildpact/BurningTreeShaman.java
@@ -29,17 +29,17 @@
package mage.sets.guildpact;
import java.util.UUID;
-
-import mage.constants.AbilityType;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.AbilityType;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.StackAbility;
import mage.target.TargetPlayer;
@@ -86,14 +86,17 @@ class BurningTreeShamanTriggeredAbility extends TriggeredAbilityImpl {
return new BurningTreeShamanTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ACTIVATED_ABILITY;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ACTIVATED_ABILITY) {
- StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
- if (stackAbility.getAbilityType() == AbilityType.ACTIVATED) {
- this.getTargets().get(0).add(event.getPlayerId(), game);
- return true;
- }
+ StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
+ if (stackAbility.getAbilityType() == AbilityType.ACTIVATED) {
+ this.getTargets().get(0).add(event.getPlayerId(), game);
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java b/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java
index bba04f81dab..00dfc684c65 100644
--- a/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java
+++ b/Mage.Sets/src/mage/sets/guildpact/InkTreaderNephilim.java
@@ -28,21 +28,22 @@
package mage.sets.guildpact;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
-import mage.cards.CardImpl;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
-import mage.constants.Zone;
-import mage.game.Game;
-import mage.game.events.GameEvent;
-import mage.game.stack.Spell;
import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterInPlay;
import mage.filter.common.FilterCreaturePermanent;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
+import mage.game.stack.Spell;
import mage.target.Target;
import mage.util.TargetAddress;
@@ -88,17 +89,20 @@ class InkTreaderNephilimTriggeredAbility extends TriggeredAbilityImpl {
return new InkTreaderNephilimTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null &&
- (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))){
- for (Effect effect : getEffects()) {
- effect.setValue("triggeringSpell", spell);
- }
- return true;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null &&
+ (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))){
+ for (Effect effect : getEffects()) {
+ effect.setValue("triggeringSpell", spell);
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java b/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java
index 6cd66ece7e1..ca4f72da4ee 100644
--- a/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java
+++ b/Mage.Sets/src/mage/sets/guildpact/SoulsOfTheFaultless.java
@@ -42,6 +42,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -90,10 +91,14 @@ class SoulsOfTheFaultlessTriggeredAbility extends TriggeredAbilityImpl {
return new SoulsOfTheFaultlessTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE
- && event.getTargetId().equals(this.sourceId)
+ if (event.getTargetId().equals(this.sourceId)
&& ((DamagedCreatureEvent) event).isCombatDamage()) {
Permanent source = game.getPermanent(event.getSourceId());
if (source == null) {
diff --git a/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java b/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java
index 1e344e09817..d81bd55dca7 100644
--- a/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java
+++ b/Mage.Sets/src/mage/sets/heroesvsmonsters/DeusOfCalamity.java
@@ -90,10 +90,14 @@ class DeusOfCalamityTriggeredAbility extends TriggeredAbilityImpl {
return new DeusOfCalamityTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.DAMAGED_PLAYER)
- && event.getSourceId().equals(this.getSourceId())
+ if (event.getSourceId().equals(this.getSourceId())
&& event.getAmount() > 5
&& game.getOpponents(this.getControllerId()).contains(event.getTargetId())) {
FilterLandPermanent filter = new FilterLandPermanent("land of the damaged player");
diff --git a/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java b/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java
index 64654ecfdcc..853103d47ab 100644
--- a/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java
+++ b/Mage.Sets/src/mage/sets/heroesvsmonsters/KavuPredator.java
@@ -41,6 +41,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -89,9 +90,14 @@ class KavuPredatorTriggeredAbility extends TriggeredAbilityImpl {
return new KavuPredatorTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.GAINED_LIFE) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
this.getEffects().get(0).setValue("gainedLife", new Integer(event.getAmount()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/homelands/SerraAviary.java b/Mage.Sets/src/mage/sets/homelands/SerraAviary.java
new file mode 100644
index 00000000000..56700a59dbd
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/homelands/SerraAviary.java
@@ -0,0 +1,71 @@
+/*
+ * 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.homelands;
+
+import java.util.UUID;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.effects.common.continuous.BoostAllEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.mageobject.AbilityPredicate;
+
+/**
+ *
+ * @author anonymous
+ */
+public class SerraAviary extends CardImpl {
+
+ private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Creatures with flying");
+
+ static {
+ filter1.add(new AbilityPredicate(FlyingAbility.class));
+ }
+
+ public SerraAviary(UUID ownerId) {
+ super(ownerId, 118, "Serra Aviary", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
+ this.expansionSetCode = "HML";
+ this.supertype.add("World");
+
+ // Creatures with flying get +1/+1.
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(1, 1, Duration.WhileOnBattlefield, filter1, false)));
+ }
+
+ public SerraAviary(final SerraAviary card) {
+ super(card);
+ }
+
+ @Override
+ public SerraAviary copy() {
+ return new SerraAviary(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java b/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java
index d0f72fc69f1..8c694ba376d 100644
--- a/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java
+++ b/Mage.Sets/src/mage/sets/iceage/DanceOfTheDead.java
@@ -42,6 +42,7 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DoIfCostPaid;
+import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepSourceEffect;
import mage.abilities.effects.common.UntapEnchantedEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
@@ -96,7 +97,7 @@ public class DanceOfTheDead extends CardImpl {
// Enchanted creature gets +1/+1 and doesn't untap during its controller's untap step.
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
- Effect effect = new DontUntapInControllersUntapStepSourceEffect();
+ Effect effect = new DontUntapInControllersUntapStepEnchantedEffect();
effect.setText("and doesn't untap during its controller's untap step");
ability.addEffect(effect);
this.addAbility(ability);
@@ -144,7 +145,7 @@ class DanceOfTheDeadReAttachEffect extends OneShotEffect {
}
// put card into play
- controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId());
+ controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId(), true);
Permanent enchantedCreature = game.getPermanent(cardInGraveyard.getId());
FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with Dance of the Dead");
diff --git a/Mage.Sets/src/mage/sets/iceage/Errantry.java b/Mage.Sets/src/mage/sets/iceage/Errantry.java
new file mode 100644
index 00000000000..72fe3f5d1dd
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/iceage/Errantry.java
@@ -0,0 +1,53 @@
+/*
+ * 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.iceage;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Errantry extends mage.sets.masterseditionii.Errantry {
+
+ public Errantry(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 183;
+ this.expansionSetCode = "ICE";
+ }
+
+ public Errantry(final Errantry card) {
+ super(card);
+ }
+
+ @Override
+ public Errantry copy() {
+ return new Errantry(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/iceage/KnightOfStromgald.java b/Mage.Sets/src/mage/sets/iceage/KnightOfStromgald.java
new file mode 100644
index 00000000000..c923743d0be
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/iceage/KnightOfStromgald.java
@@ -0,0 +1,86 @@
+/*
+ * 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.iceage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.ObjectColor;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
+import mage.abilities.keyword.FirstStrikeAbility;
+import mage.abilities.keyword.ProtectionAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.ColorPredicate;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class KnightOfStromgald extends CardImpl {
+
+ private static final FilterCard filter = new FilterCard("White");
+
+ static {
+ filter.add(new ColorPredicate(ObjectColor.WHITE));
+ }
+
+ public KnightOfStromgald(UUID ownerId) {
+ super(ownerId, 26, "Knight of Stromgald", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}");
+ this.expansionSetCode = "ICE";
+ this.subtype.add("Human");
+ this.subtype.add("Knight");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Protection from white
+ this.addAbility(new ProtectionAbility(filter));
+
+ // {B}: Knight of Stromgald gains first strike until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}")));
+
+ // {B}{B}: Knight of Stromgald gets +1/+0 until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{B}{B}")));
+ }
+
+ public KnightOfStromgald(final KnightOfStromgald card) {
+ super(card);
+ }
+
+ @Override
+ public KnightOfStromgald copy() {
+ return new KnightOfStromgald(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java b/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java
index a0de5638da4..9354f14178c 100644
--- a/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java
+++ b/Mage.Sets/src/mage/sets/iceage/MagusOfTheUnseen.java
@@ -108,10 +108,14 @@ class MagusOfTheUnseenDelayedTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LOST_CONTROL;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return EventType.LOST_CONTROL.equals(event.getType())
- && event.getPlayerId().equals(controllerId)
+ return event.getPlayerId().equals(controllerId)
&& event.getSourceId().equals(this.getEffects().get(0).getTargetPointer().getFirst(game, this));
}
diff --git a/Mage.Sets/src/mage/sets/iceage/Necropotence.java b/Mage.Sets/src/mage/sets/iceage/Necropotence.java
index 0d5516191ba..60044a1b7bd 100644
--- a/Mage.Sets/src/mage/sets/iceage/Necropotence.java
+++ b/Mage.Sets/src/mage/sets/iceage/Necropotence.java
@@ -49,6 +49,7 @@ import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -97,9 +98,14 @@ class NecropotenceTriggeredAbility extends TriggeredAbilityImpl {
return new NecropotenceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) && getControllerId().equals(event.getPlayerId())) {
+ if (getControllerId().equals(event.getPlayerId())) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java b/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java
new file mode 100644
index 00000000000..ef0cebf67d2
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/iceage/OrcishCannoneers.java
@@ -0,0 +1,72 @@
+/*
+ * 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.iceage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.effects.common.DamageControllerEffect;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.common.TargetCreatureOrPlayer;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrcishCannoneers extends CardImpl {
+
+ public OrcishCannoneers(UUID ownerId) {
+ super(ownerId, 205, "Orcish Cannoneers", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
+ this.expansionSetCode = "ICE";
+ this.subtype.add("Orc");
+ this.subtype.add("Warrior");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(3);
+
+ // {tap}: Orcish Cannoneers deals 2 damage to target creature or player and 3 damage to you.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new TapSourceCost()); ability.addTarget(new TargetCreatureOrPlayer());
+ ability.addEffect(new DamageControllerEffect(3));
+ this.addAbility(ability);
+ }
+
+ public OrcishCannoneers(final OrcishCannoneers card) {
+ super(card);
+ }
+
+ @Override
+ public OrcishCannoneers copy() {
+ return new OrcishCannoneers(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/iceage/OrderOfTheWhiteShield.java b/Mage.Sets/src/mage/sets/iceage/OrderOfTheWhiteShield.java
new file mode 100644
index 00000000000..dc31f84840d
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/iceage/OrderOfTheWhiteShield.java
@@ -0,0 +1,86 @@
+/*
+ * 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.iceage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.ObjectColor;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
+import mage.abilities.keyword.FirstStrikeAbility;
+import mage.abilities.keyword.ProtectionAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.ColorPredicate;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfTheWhiteShield extends CardImpl {
+
+ private static final FilterCard filter = new FilterCard("Black");
+
+ static {
+ filter.add(new ColorPredicate(ObjectColor.BLACK));
+ }
+
+ public OrderOfTheWhiteShield(UUID ownerId) {
+ super(ownerId, 270, "Order of the White Shield", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{W}{W}");
+ this.expansionSetCode = "ICE";
+ this.subtype.add("Human");
+ this.subtype.add("Knight");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Protection from black
+ this.addAbility(new ProtectionAbility(filter));
+
+ // {W}: Order of the White Shield gains first strike until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}")));
+
+ // {W}{W}: Order of the White Shield gets +1/+0 until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{W}{W}")));
+ }
+
+ public OrderOfTheWhiteShield(final OrderOfTheWhiteShield card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfTheWhiteShield copy() {
+ return new OrderOfTheWhiteShield(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java b/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java
index 9a84518e77a..b94dc0b7930 100644
--- a/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java
+++ b/Mage.Sets/src/mage/sets/iceage/RayOfCommand.java
@@ -44,6 +44,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreaturePermanent;
/**
@@ -91,11 +92,17 @@ class RayOfCommandDelayedTriggeredAbility extends DelayedTriggeredAbility {
RayOfCommandDelayedTriggeredAbility(RayOfCommandDelayedTriggeredAbility ability) {
super(ability);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LOST_CONTROL;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return GameEvent.EventType.LOST_CONTROL.equals(event.getType()) && event.getPlayerId().equals(controllerId);
+ return event.getPlayerId().equals(controllerId);
}
+
@Override
public RayOfCommandDelayedTriggeredAbility copy() {
return new RayOfCommandDelayedTriggeredAbility(this);
diff --git a/Mage.Sets/src/mage/sets/iceage/SoldeviSimulacrum.java b/Mage.Sets/src/mage/sets/iceage/SoldeviSimulacrum.java
new file mode 100644
index 00000000000..a79829b58e6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/iceage/SoldeviSimulacrum.java
@@ -0,0 +1,53 @@
+/*
+ * 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.iceage;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SoldeviSimulacrum extends mage.sets.masterseditionii.SoldeviSimulacrum {
+
+ public SoldeviSimulacrum(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 314;
+ this.expansionSetCode = "ICE";
+ }
+
+ public SoldeviSimulacrum(final SoldeviSimulacrum card) {
+ super(card);
+ }
+
+ @Override
+ public SoldeviSimulacrum copy() {
+ return new SoldeviSimulacrum(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/iceage/Tarpan.java b/Mage.Sets/src/mage/sets/iceage/Tarpan.java
new file mode 100644
index 00000000000..27a4804f1dc
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/iceage/Tarpan.java
@@ -0,0 +1,64 @@
+/*
+ * 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.iceage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.DiesTriggeredAbility;
+import mage.abilities.effects.common.GainLifeEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Tarpan extends CardImpl {
+
+ public Tarpan(UUID ownerId) {
+ super(ownerId, 155, "Tarpan", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
+ this.expansionSetCode = "ICE";
+ this.subtype.add("Horse");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(1);
+
+ // When Tarpan dies, you gain 1 life.
+ this.addAbility(new DiesTriggeredAbility(new GainLifeEffect(1), false));
+ }
+
+ public Tarpan(final Tarpan card) {
+ super(card);
+ }
+
+ @Override
+ public Tarpan copy() {
+ return new Tarpan(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/iceage/WildGrowth.java b/Mage.Sets/src/mage/sets/iceage/WildGrowth.java
index 513e4568d09..b7fa06e0043 100644
--- a/Mage.Sets/src/mage/sets/iceage/WildGrowth.java
+++ b/Mage.Sets/src/mage/sets/iceage/WildGrowth.java
@@ -28,9 +28,6 @@
package mage.sets.iceage;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.effects.Effect;
@@ -39,11 +36,14 @@ import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -98,19 +98,22 @@ class WildGrowthTriggeredAbility extends TriggeredManaAbility {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- if (permanent != null) {
- for(Effect effect : getEffects()) {
- effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
- }
- return true;
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ if (permanent != null) {
+ for(Effect effect : getEffects()) {
+ effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
}
+ return true;
}
- }
+ }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java
index 1c7d05c764d..94a3961d9d5 100644
--- a/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java
+++ b/Mage.Sets/src/mage/sets/innistrad/BloodlineKeeper.java
@@ -67,7 +67,7 @@ public class BloodlineKeeper extends CardImpl {
this.secondSideCard = new LordOfLineage(ownerId);
this.addAbility(FlyingAbility.getInstance());
- // {tap}: Put a 2/2 black Vampire creature token with flying onto the battlefield.
+ // {T}: Put a 2/2 black Vampire creature token with flying onto the battlefield.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new VampireToken()), new TapSourceCost()));
// {B}: Transform Bloodline Keeper. Activate this ability only if you control five or more Vampires.
this.addAbility(new TransformAbility());
diff --git a/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java b/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java
index 917a07f35a4..a417a498a93 100644
--- a/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java
+++ b/Mage.Sets/src/mage/sets/innistrad/BurningVengeance.java
@@ -27,18 +27,18 @@
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreatureOrPlayer;
-import java.util.UUID;
-
/**
* @author nantuko
*/
@@ -77,14 +77,14 @@ class BurningVengeanceOnCastAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST
- && event.getPlayerId().equals(controllerId)
- && event.getZone().equals(Zone.GRAVEYARD)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(controllerId) && event.getZone().equals(Zone.GRAVEYARD);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java b/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java
index 903130ea3dc..9d64dbcd5e2 100644
--- a/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java
+++ b/Mage.Sets/src/mage/sets/innistrad/CreepyDoll.java
@@ -26,25 +26,25 @@
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
* @author nantuko
*/
@@ -90,13 +90,16 @@ class CreepyDollTriggeredAbility extends TriggeredAbilityImpl {
return new CreepyDollTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedCreatureEvent) {
- if (((DamagedCreatureEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
- return true;
- }
+ if (((DamagedCreatureEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/innistrad/Curiosity.java b/Mage.Sets/src/mage/sets/innistrad/Curiosity.java
index 80226a7f55a..1293fda005a 100644
--- a/Mage.Sets/src/mage/sets/innistrad/Curiosity.java
+++ b/Mage.Sets/src/mage/sets/innistrad/Curiosity.java
@@ -27,25 +27,24 @@
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
-import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
-import java.util.UUID;
-
/**
*
* @author Alvin, noxx
@@ -95,15 +94,15 @@ class CuriosityAbility extends TriggeredAbilityImpl {
return new CuriosityAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- if (permanent != null && game.getOpponents(this.controllerId).contains(event.getTargetId()) && permanent.getAttachments().contains(this.getSourceId())) {
- return true;
- }
- }
- return false;
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ return permanent != null && game.getOpponents(this.controllerId).contains(event.getTargetId()) && permanent.getAttachments().contains(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java
index 5c736744649..19c77d5c77c 100644
--- a/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java
+++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfOblivion.java
@@ -28,17 +28,16 @@
package mage.sets.innistrad;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.ExileFromZoneTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -97,16 +96,19 @@ class CurseOfOblivionAbility extends TriggeredAbilityImpl {
return new CurseOfOblivionAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.UPKEEP_STEP_PRE) {
- Permanent enchantment = game.getPermanent(this.sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- Player player = game.getPlayer(enchantment.getAttachedTo());
- if (player != null && game.getActivePlayerId().equals(player.getId())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
- return true;
- }
+ Permanent enchantment = game.getPermanent(this.sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ Player player = game.getPlayer(enchantment.getAttachedTo());
+ if (player != null && game.getActivePlayerId().equals(player.getId())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java
index 898e0504477..0803298ad65 100644
--- a/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java
+++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfStalkedPrey.java
@@ -28,17 +28,16 @@
package mage.sets.innistrad;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
@@ -99,9 +98,14 @@ class CurseOfStalkedPreyTriggeredAbility extends TriggeredAbilityImpl {
return new CurseOfStalkedPreyTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent enchantment = game.getPermanent(this.sourceId);
if (enchantment != null && enchantment.getAttachedTo() != null) {
Player player = game.getPlayer(enchantment.getAttachedTo());
diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java
index 57821a1edd7..e50bce3c6ce 100644
--- a/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java
+++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfTheBloodyTome.java
@@ -28,16 +28,16 @@
package mage.sets.innistrad;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -95,16 +95,19 @@ class CurseOfTheBloodyTomeAbility extends TriggeredAbilityImpl {
return new CurseOfTheBloodyTomeAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.UPKEEP_STEP_PRE) {
- Permanent enchantment = game.getPermanent(this.sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- Player player = game.getPlayer(enchantment.getAttachedTo());
- if (player != null && game.getActivePlayerId().equals(player.getId())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
- return true;
- }
+ Permanent enchantment = game.getPermanent(this.sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ Player player = game.getPlayer(enchantment.getAttachedTo());
+ if (player != null && game.getActivePlayerId().equals(player.getId())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java b/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java
index b0cc02e2dd7..35193e3cdfb 100644
--- a/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java
+++ b/Mage.Sets/src/mage/sets/innistrad/CurseOfThePiercedHeart.java
@@ -28,17 +28,16 @@
package mage.sets.innistrad;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -96,16 +95,19 @@ class CurseOfThePiercedHeartAbility extends TriggeredAbilityImpl {
return new CurseOfThePiercedHeartAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DRAW_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DRAW_STEP_PRE) {
- Permanent enchantment = game.getPermanent(this.sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- Player player = game.getPlayer(enchantment.getAttachedTo());
- if (player != null && game.getActivePlayerId().equals(player.getId())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
- return true;
- }
+ Permanent enchantment = game.getPermanent(this.sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ Player player = game.getPlayer(enchantment.getAttachedTo());
+ if (player != null && game.getActivePlayerId().equals(player.getId())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java b/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java
index 8e8e1bbf7e7..ce8a5d39fdc 100644
--- a/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java
+++ b/Mage.Sets/src/mage/sets/innistrad/FalkenrathNoble.java
@@ -28,17 +28,18 @@
package mage.sets.innistrad;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPlayer;
@@ -89,19 +90,22 @@ class FalkenrathNobleTriggeredAbility extends TriggeredAbilityImpl {
return new FalkenrathNobleTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
- Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (permanent != null) {
- if (permanent.getId().equals(this.getSourceId())) {
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (permanent != null) {
+ if (permanent.getId().equals(this.getSourceId())) {
+ return true;
+ } else {
+ if (permanent.getCardType().contains(CardType.CREATURE)) {
return true;
- } else {
- if (permanent.getCardType().contains(CardType.CREATURE)) {
- return true;
- }
}
}
}
diff --git a/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java b/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java
index 2bc737f28f6..3d3e258a14b 100644
--- a/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java
+++ b/Mage.Sets/src/mage/sets/innistrad/GarrukRelentless.java
@@ -27,8 +27,7 @@
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.TriggeredAbilityImpl;
@@ -39,17 +38,18 @@ import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfToken;
import mage.target.common.TargetCreaturePermanent;
-import java.util.UUID;
-
/**
* @author nantuko
*/
@@ -105,9 +105,14 @@ class GarrukRelentlessTriggeredAbility extends TriggeredAbilityImpl {
return new GarrukRelentlessTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER && event.getTargetId().equals(sourceId)) {
+ if (event.getTargetId().equals(sourceId)) {
Permanent permanent = game.getPermanent(sourceId);
if (permanent != null && !permanent.isTransformed() && permanent.getCounters().getCount(CounterType.LOYALTY) <= 2) {
return true;
diff --git a/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java b/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java
index db9609e39cf..727d038438d 100644
--- a/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java
+++ b/Mage.Sets/src/mage/sets/innistrad/GrimgrinCorpseBorn.java
@@ -49,6 +49,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
@@ -109,9 +110,14 @@ class GrimgrinCorpseBornAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
+ if (event.getSourceId().equals(this.getSourceId())) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(sourceId);
filter.add(new ControllerIdPredicate(defenderId));
diff --git a/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java b/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java
index 59e9efb8756..1994869f6a8 100644
--- a/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java
+++ b/Mage.Sets/src/mage/sets/innistrad/GutterGrime.java
@@ -27,6 +27,7 @@
*/
package mage.sets.innistrad;
+import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@@ -38,7 +39,11 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
-import mage.constants.*;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -48,8 +53,6 @@ import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.Token;
-import java.util.UUID;
-
/**
*
* @author BetaSteward
@@ -91,21 +94,24 @@ class GutterGrimeTriggeredAbility extends TriggeredAbilityImpl {
return new GutterGrimeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- UUID targetId = event.getTargetId();
- MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
- if (card instanceof Permanent && !(card instanceof PermanentToken)) {
- Permanent permanent = (Permanent) card;
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD
- && permanent.getControllerId().equals(this.controllerId)
- && (targetId.equals(this.getSourceId())
- || (permanent.getCardType().contains(CardType.CREATURE)
- && !(permanent instanceof PermanentToken)))) {
- return true;
- }
+ UUID targetId = event.getTargetId();
+ MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
+ if (card instanceof Permanent && !(card instanceof PermanentToken)) {
+ Permanent permanent = (Permanent) card;
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD
+ && permanent.getControllerId().equals(this.controllerId)
+ && (targetId.equals(this.getSourceId())
+ || (permanent.getCardType().contains(CardType.CREATURE)
+ && !(permanent instanceof PermanentToken)))) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java b/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java
index 6207edd2734..087265e34dd 100644
--- a/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java
+++ b/Mage.Sets/src/mage/sets/innistrad/HomicidalBrute.java
@@ -27,18 +27,18 @@
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.TapSourceEffect;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
-
-import java.util.UUID;
+import mage.game.events.GameEvent.EventType;
import mage.watchers.Watcher;
/**
@@ -91,9 +91,14 @@ class HomicidalBruteTriggeredAbility extends TriggeredAbilityImpl {
return new HomicidalBruteTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
Watcher watcher = game.getState().getWatchers().get("HomicidalBruteAttacked", sourceId);
if (watcher == null || !watcher.conditionMet()) {
return true;
diff --git a/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java b/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java
index cfb3ed4a2cc..298f51a5558 100644
--- a/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java
+++ b/Mage.Sets/src/mage/sets/innistrad/MaskOfAvacyn.java
@@ -37,6 +37,8 @@ import mage.abilities.keyword.HexproofAbility;
import mage.cards.CardImpl;
import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.effects.Effect;
/**
* @author nantuko
@@ -52,8 +54,11 @@ public class MaskOfAvacyn extends CardImpl {
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));
// Equipped creature gets +1/+2 and has hexproof.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT)));
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 2)));
+ Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(HexproofAbility.getInstance(), AttachmentType.EQUIPMENT));
+ Effect effect = new BoostEquippedEffect(1, 2);
+ effect.setText("and has hexproof");
+ ability.addEffect(effect);
+ this.addAbility(ability);
}
public MaskOfAvacyn(final MaskOfAvacyn card) {
diff --git a/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java b/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java
index 8df3ac41ad6..1936fd5c492 100644
--- a/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java
+++ b/Mage.Sets/src/mage/sets/innistrad/RakishHeir.java
@@ -28,17 +28,18 @@
package mage.sets.innistrad;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -85,19 +86,22 @@ class RakishHeirTriggeredAbility extends TriggeredAbilityImpl {
return new RakishHeirTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- Permanent permanent = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && permanent != null
- && permanent.hasSubtype("Vampire") && permanent.getControllerId().equals(controllerId)) {
- this.getEffects().clear();
- AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
- effect.setTargetPointer(new FixedTarget(permanent.getId()));
- this.addEffect(effect);
- return true;
- }
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && permanent != null
+ && permanent.hasSubtype("Vampire") && permanent.getControllerId().equals(controllerId)) {
+ this.getEffects().clear();
+ AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
+ effect.setTargetPointer(new FixedTarget(permanent.getId()));
+ this.addEffect(effect);
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java
index fccc03b9e34..c64bb9f2f06 100644
--- a/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java
+++ b/Mage.Sets/src/mage/sets/innistrad/ReaperFromTheAbyss.java
@@ -29,21 +29,21 @@
package mage.sets.innistrad;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.Watcher;
@@ -99,13 +99,15 @@ class ReaperFromTheAbyssAbility extends TriggeredAbilityImpl {
return new ReaperFromTheAbyssAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) {
- Watcher watcher = game.getState().getWatchers().get("Morbid");
- return watcher.conditionMet();
- }
- return false;
+ Watcher watcher = game.getState().getWatchers().get("Morbid");
+ return watcher.conditionMet();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java b/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java
index 7ebc1ee753c..5948bfa65c0 100644
--- a/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java
+++ b/Mage.Sets/src/mage/sets/innistrad/ScreechingBat.java
@@ -27,27 +27,27 @@
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.condition.common.TransformedCondition;
import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.TransformAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
-import java.util.UUID;
-import mage.abilities.condition.common.TransformedCondition;
-import mage.abilities.decorator.ConditionalTriggeredAbility;
-
/**
* @author nantuko
*/
@@ -96,12 +96,14 @@ class ScreechingBatBeginningOfUpkeepTriggeredAbility extends TriggeredAbilityImp
return new ScreechingBatBeginningOfUpkeepTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- return event.getPlayerId().equals(this.controllerId);
- }
- return false;
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java b/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java
index bae289634cb..8d3e95c0cb3 100644
--- a/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java
+++ b/Mage.Sets/src/mage/sets/innistrad/StromkirkNoble.java
@@ -29,20 +29,18 @@ package mage.sets.innistrad;
import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
+import mage.abilities.common.SimpleEvasionAbility;
+import mage.abilities.effects.common.combat.CantBeBlockedByCreaturesSourceEffect;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
-import mage.constants.Zone;
-import mage.MageInt;
-import mage.abilities.Ability;
-import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
-import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.effects.RestrictionEffect;
-import mage.abilities.effects.common.counter.AddCountersSourceEffect;
-import mage.cards.CardImpl;
import mage.counters.CounterType;
-import mage.game.Game;
-import mage.game.permanent.Permanent;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.mageobject.SubtypePredicate;
/**
*
@@ -51,6 +49,12 @@ import mage.game.permanent.Permanent;
*/
public class StromkirkNoble extends CardImpl {
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Humans");
+
+ static {
+ filter.add(new SubtypePredicate("Human"));
+ }
+
public StromkirkNoble(UUID ownerId) {
super(ownerId, 164, "Stromkirk Noble", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}");
this.expansionSetCode = "ISD";
@@ -60,8 +64,8 @@ public class StromkirkNoble extends CardImpl {
this.toughness = new MageInt(1);
// Stromkirk Noble can't be blocked by Humans.
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new StromkirkEffect()));
- // Whenever Stromkirk Noble deals combat damage to a player, put a +1/+1 counter on it.
+ this.addAbility(new SimpleEvasionAbility(new CantBeBlockedByCreaturesSourceEffect(filter, Duration.WhileOnBattlefield)));
+ // Whenever Stromkirk Noble deals combat damage to a player, put a +1/+1 counter on it.
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), false));
}
@@ -75,33 +79,3 @@ public class StromkirkNoble extends CardImpl {
return new StromkirkNoble(this);
}
}
-
-class StromkirkEffect extends RestrictionEffect {
-
- public StromkirkEffect() {
- super(Duration.WhileOnBattlefield);
- }
-
- public StromkirkEffect(final StromkirkEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean applies(Permanent permanent, Ability source, Game game) {
- if (permanent.getId().equals(source.getSourceId())) {
- return true;
- }
- return false;
- }
-
- @Override
- public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
- return !blocker.hasSubtype("Human");
- }
-
- @Override
- public StromkirkEffect copy() {
- return new StromkirkEffect(this);
- }
-
-}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java b/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java
index 4ca0ffb0748..a18f74df8d2 100644
--- a/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java
+++ b/Mage.Sets/src/mage/sets/innistrad/ThrabenSentry.java
@@ -27,22 +27,22 @@
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.TransformSourceEffect;
import mage.abilities.keyword.TransformAbility;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
-import java.util.UUID;
-
/**
* @author nantuko
*/
@@ -92,27 +92,24 @@ class ThrabenSentryTriggeredAbility extends TriggeredAbilityImpl {
return new ThrabenSentryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
-
- Permanent source = game.getPermanent(this.sourceId);
- if (source == null) {
- return false;
- }
-
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- Permanent permanent = zEvent.getTarget();
-
- if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) &&
- zEvent.getToZone() == Zone.GRAVEYARD &&
- zEvent.getFromZone() == Zone.BATTLEFIELD &&
- permanent.getControllerId().equals(this.getControllerId()) &&
- !source.isTransformed()) {
- return true;
- }
+ Permanent source = game.getPermanent(this.sourceId);
+ if (source == null) {
+ return false;
}
- return false;
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ Permanent permanent = zEvent.getTarget();
+ return permanent != null && permanent.getCardType().contains(CardType.CREATURE) &&
+ zEvent.getToZone() == Zone.GRAVEYARD &&
+ zEvent.getFromZone() == Zone.BATTLEFIELD &&
+ permanent.getControllerId().equals(this.getControllerId()) &&
+ !source.isTransformed();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java b/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java
index e00e0240adf..7a42dde251a 100644
--- a/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java
+++ b/Mage.Sets/src/mage/sets/innistrad/VillageCannibals.java
@@ -28,16 +28,17 @@
package mage.sets.innistrad;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
@@ -84,16 +85,19 @@ class VillageCannibalsTriggeredAbility extends TriggeredAbilityImpl {
return new VillageCannibalsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
- Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.hasSubtype("Human")
- && !permanent.getId().equals(this.getSourceId())) {
- return true;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.hasSubtype("Human")
+ && !permanent.getId().equals(this.getSourceId())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java b/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java
index ddc5fe84969..b0d1ceaa685 100644
--- a/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java
+++ b/Mage.Sets/src/mage/sets/innistrad/WoodenStake.java
@@ -27,8 +27,7 @@
*/
package mage.sets.innistrad;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
@@ -37,15 +36,16 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
* @author nantuko
*/
@@ -86,31 +86,34 @@ class WoodenStakeBlocksOrBecomesBlockedTriggeredAbility extends TriggeredAbility
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent equipment = game.getPermanent(sourceId);
- if (equipment != null && equipment.getAttachedTo() != null) {
- if (event.getSourceId().equals(equipment.getAttachedTo())) {
- Permanent blocks = game.getPermanent(event.getTargetId());
- if (blocks != null && blocks.hasSubtype("Vampire")) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ Permanent equipment = game.getPermanent(sourceId);
+ if (equipment != null && equipment.getAttachedTo() != null) {
+ if (event.getSourceId().equals(equipment.getAttachedTo())) {
+ Permanent blocks = game.getPermanent(event.getTargetId());
+ if (blocks != null && blocks.hasSubtype("Vampire")) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
- return false;
+ return true;
}
- if (event.getTargetId().equals(equipment.getAttachedTo())) {
- Permanent blockedBy = game.getPermanent(event.getSourceId());
- if (blockedBy != null && blockedBy.hasSubtype("Vampire")) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- }
- return true;
+ return false;
+ }
+ if (event.getTargetId().equals(equipment.getAttachedTo())) {
+ Permanent blockedBy = game.getPermanent(event.getSourceId());
+ if (blockedBy != null && blockedBy.hasSubtype("Vampire")) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
- return false;
+ return true;
}
+ return false;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/invasion/Disrupt.java b/Mage.Sets/src/mage/sets/invasion/Disrupt.java
new file mode 100644
index 00000000000..8a4718a3498
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/invasion/Disrupt.java
@@ -0,0 +1,77 @@
+/*
+ * 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.invasion;
+
+import java.util.UUID;
+import mage.abilities.costs.mana.GenericManaCost;
+import mage.abilities.effects.common.CounterTargetEffect;
+import mage.abilities.effects.common.CounterUnlessPaysEffect;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.FilterSpell;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.CardTypePredicate;
+import mage.target.TargetSpell;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Disrupt extends CardImpl {
+
+ private static final FilterSpell filter = new FilterSpell("instant or sorcery spell");
+
+ static {
+ filter.add(Predicates.or(
+ new CardTypePredicate(CardType.INSTANT),
+ new CardTypePredicate(CardType.SORCERY)));
+ }
+
+ public Disrupt(UUID ownerId) {
+ super(ownerId, 51, "Disrupt", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}");
+ this.expansionSetCode = "INV";
+
+ // Counter target instant or sorcery spell unless its controller pays {1}.
+ this.getSpellAbility().addTarget(new TargetSpell(filter));
+ this.getSpellAbility().addEffect(new CounterUnlessPaysEffect(new GenericManaCost(1)));
+ // Draw a card.
+ this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
+ }
+
+ public Disrupt(final Disrupt card) {
+ super(card);
+ }
+
+ @Override
+ public Disrupt copy() {
+ return new Disrupt(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java b/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java
index f801f9e50c7..8ee804a8952 100644
--- a/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java
+++ b/Mage.Sets/src/mage/sets/jacevsvraska/AeonChronicler.java
@@ -95,9 +95,14 @@ class AeonChroniclerTriggeredAbility extends TriggeredAbilityImpl {
return new AeonChroniclerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_REMOVED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
+ return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java b/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java
index 59c9e325d88..412b1ecaad7 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/AthreosGodOfPassage.java
@@ -51,6 +51,7 @@ import mage.filter.predicate.other.OwnerPredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -166,18 +167,21 @@ class AthreosDiesCreatureTriggeredAbility extends TriggeredAbilityImpl {
return new AthreosDiesCreatureTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.ZONE_CHANGE)) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) {
- Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
- for (Effect effect : this.getEffects()) {
- effect.setValue("creatureId", event.getTargetId());
- }
- return true;
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
+ for (Effect effect : this.getEffects()) {
+ effect.setValue("creatureId", event.getTargetId());
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java b/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java
index f7cf7470313..c5b745b5894 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/BloodcrazedHoplite.java
@@ -44,6 +44,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreaturePermanent;
/**
@@ -95,14 +96,14 @@ class BloodcrazedHopliteTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_ADDED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.COUNTER_ADDED) {
- if (event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName())) {
- return true;
- }
- }
- return false;
+ return event.getTargetId().equals(this.getSourceId()) && event.getData().equals(CounterType.P1P1.getName());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java b/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java
index ccbaf681714..8918170eb32 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/DictateOfKruphix.java
@@ -37,6 +37,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -81,13 +82,15 @@ class DictateOfKruphixAbility extends TriggeredAbilityImpl {
return new DictateOfKruphixAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DRAW_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
- return false;
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java b/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java
index 988022c3b70..28bfbc5d63e 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/EidolonOfTheGreatRevel.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.targetpointer.FixedTarget;
@@ -88,16 +89,19 @@ class EidolonOfTheGreatRevelTriggeredAbility extends TriggeredAbilityImpl {
return new EidolonOfTheGreatRevelTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.SPELL_CAST){
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if(spell != null && spell.getConvertedManaCost() <= 3){
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && spell.getConvertedManaCost() <= 3){
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java b/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java
index 52aad224e4e..bb0f16bed26 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/Godsend.java
@@ -113,47 +113,50 @@ class GodsendTriggeredAbility extends TriggeredAbilityImpl {
return new GodsendTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_BLOCKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.DECLARED_BLOCKERS)) {
- Permanent equipment = game.getPermanentOrLKIBattlefield((this.getSourceId()));
- if (equipment != null && equipment.getAttachedTo()!= null) {
- Permanent equippedPermanent = game.getPermanentOrLKIBattlefield((equipment.getAttachedTo()));
- if (equippedPermanent != null) {
- possibleTargets.clear();
- String targetName = "";
- if (equippedPermanent.isAttacking()) {
- for (CombatGroup group: game.getCombat().getGroups()) {
- if (group.getAttackers().contains(equippedPermanent.getId())) {
- possibleTargets.addAll(group.getBlockers());
- }
+ Permanent equipment = game.getPermanentOrLKIBattlefield((this.getSourceId()));
+ if (equipment != null && equipment.getAttachedTo()!= null) {
+ Permanent equippedPermanent = game.getPermanentOrLKIBattlefield((equipment.getAttachedTo()));
+ if (equippedPermanent != null) {
+ possibleTargets.clear();
+ String targetName = "";
+ if (equippedPermanent.isAttacking()) {
+ for (CombatGroup group: game.getCombat().getGroups()) {
+ if (group.getAttackers().contains(equippedPermanent.getId())) {
+ possibleTargets.addAll(group.getBlockers());
}
- targetName = "a creature blocking attacker ";
- } else if (equippedPermanent.getBlocking() > 0) {
- for (CombatGroup group: game.getCombat().getGroups()) {
- if (group.getBlockers().contains(equippedPermanent.getId())) {
- possibleTargets.addAll(group.getAttackers());
- }
- }
- targetName = "a creature blocked by creature ";
- }
- if (possibleTargets.size() > 0) {
- this.getTargets().clear();
- if (possibleTargets.size() == 1) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(possibleTargets.iterator().next()));
- } else {
- this.getEffects().get(0).setTargetPointer(new FirstTargetPointer());
- targetName = new StringBuilder(targetName).append("equipped by ").append(equipment.getName()).toString();
- FilterCreaturePermanent filter = new FilterCreaturePermanent(targetName);
- List uuidPredicates = new ArrayList<>();
- for (UUID creatureId : possibleTargets) {
- uuidPredicates.add(new PermanentIdPredicate(creatureId));
- }
- filter.add(Predicates.or(uuidPredicates));
- this.getTargets().add(new TargetCreaturePermanent(filter));
- }
- return true;
}
+ targetName = "a creature blocking attacker ";
+ } else if (equippedPermanent.getBlocking() > 0) {
+ for (CombatGroup group: game.getCombat().getGroups()) {
+ if (group.getBlockers().contains(equippedPermanent.getId())) {
+ possibleTargets.addAll(group.getAttackers());
+ }
+ }
+ targetName = "a creature blocked by creature ";
+ }
+ if (possibleTargets.size() > 0) {
+ this.getTargets().clear();
+ if (possibleTargets.size() == 1) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(possibleTargets.iterator().next()));
+ } else {
+ this.getEffects().get(0).setTargetPointer(new FirstTargetPointer());
+ targetName = new StringBuilder(targetName).append("equipped by ").append(equipment.getName()).toString();
+ FilterCreaturePermanent filter = new FilterCreaturePermanent(targetName);
+ List uuidPredicates = new ArrayList<>();
+ for (UUID creatureId : possibleTargets) {
+ uuidPredicates.add(new PermanentIdPredicate(creatureId));
+ }
+ filter.add(Predicates.or(uuidPredicates));
+ this.getTargets().add(new TargetCreaturePermanent(filter));
+ }
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java b/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java
index f94df13e691..fc36df89d6a 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/KeranosGodOfStorms.java
@@ -51,6 +51,7 @@ import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
@@ -112,9 +113,14 @@ class KeranosGodOfStormsTriggeredAbility extends TriggeredAbilityImpl {
return new KeranosGodOfStormsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DREW_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
if (game.getActivePlayerId().equals(this.getControllerId())) {
CardsDrawnDuringTurnWatcher watcher = (CardsDrawnDuringTurnWatcher) game.getState().getWatchers().get("CardsDrawnDuringTurn");
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) != 1) {
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java b/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java
index f9869338b55..024239a5aa7 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/KnowledgeAndPower.java
@@ -32,12 +32,8 @@ import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
-import mage.abilities.effects.common.continuous.BoostSourceEffect;
-import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
-import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
-import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
@@ -87,12 +83,14 @@ class ScryTriggeredAbility extends TriggeredAbilityImpl {
return new ScryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SCRY;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.SCRY) && event.getPlayerId().equals(this.getControllerId())) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.getControllerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java b/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java
index b1e9946c821..6075982ce44 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/MarketFestival.java
@@ -43,6 +43,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
@@ -96,15 +97,15 @@ class MarketFestivalTriggeredAbility extends TriggeredManaAbility {
return new MarketFestivalTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- return true;
- }
- }
- return false;
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ return enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo());
}
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java b/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java
index 41db761d453..41311f25265 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/MortalObstinacy.java
@@ -46,6 +46,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetControlledCreaturePermanent;
@@ -103,16 +104,16 @@ class MortalObstinacyAbility extends TriggeredAbilityImpl {
return new MortalObstinacyAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent damageMakingCreature = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && damageMakingCreature != null && damageMakingCreature.getAttachments().contains(this.getSourceId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent damageMakingCreature = game.getPermanent(event.getSourceId());
+ return damageEvent.isCombatDamage() && damageMakingCreature != null && damageMakingCreature.getAttachments().contains(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java b/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java
index 6bd88fd895a..59a2497194a 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/Starfall.java
@@ -30,7 +30,6 @@ package mage.sets.journeyintonyx;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
-import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
diff --git a/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java b/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java
index dd3ca1dd5ac..a19131e178d 100644
--- a/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java
+++ b/Mage.Sets/src/mage/sets/journeyintonyx/SwarmbornGiant.java
@@ -46,6 +46,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -101,9 +102,14 @@ class SwarmbornGiantTriggeredAbility extends TriggeredAbilityImpl {
return new SwarmbornGiantTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER) && event.getTargetId().equals(this.getControllerId())) {
+ if (event.getTargetId().equals(this.getControllerId())) {
DamagedEvent damagedEvent = (DamagedEvent) event;
return damagedEvent.isCombatDamage();
}
diff --git a/Mage.Sets/src/mage/sets/judgment/GuidedStrike.java b/Mage.Sets/src/mage/sets/judgment/GuidedStrike.java
new file mode 100644
index 00000000000..7545602758c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/judgment/GuidedStrike.java
@@ -0,0 +1,53 @@
+/*
+ * 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.judgment;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class GuidedStrike extends mage.sets.weatherlight.GuidedStrike {
+
+ public GuidedStrike(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 13;
+ this.expansionSetCode = "JUD";
+ }
+
+ public GuidedStrike(final GuidedStrike card) {
+ super(card);
+ }
+
+ @Override
+ public GuidedStrike copy() {
+ return new GuidedStrike(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java b/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java
index e003a002255..01fbf263c89 100644
--- a/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java
+++ b/Mage.Sets/src/mage/sets/khansoftarkir/ZurgoHelmsmasher.java
@@ -29,7 +29,7 @@ package mage.sets.khansoftarkir;
import java.util.UUID;
import mage.MageInt;
-import mage.abilities.common.AttacksEachTurnStaticAbility;
+import mage.abilities.common.AttacksEachCombatStaticAbility;
import mage.abilities.common.DiesAndDealtDamageThisTurnTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MyTurnCondition;
@@ -64,7 +64,7 @@ public class ZurgoHelmsmasher extends CardImpl {
// Haste
this.addAbility(HasteAbility.getInstance());
// Zurgo Helmsmasher attacks each combat if able.
- this.addAbility(new AttacksEachTurnStaticAbility());
+ this.addAbility(new AttacksEachCombatStaticAbility());
// Zurgo Helmsmasher has indestructible as long as it's your turn.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
new ConditionalContinuousEffect(new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.WhileOnBattlefield),
diff --git a/Mage.Sets/src/mage/sets/legends/Abomination.java b/Mage.Sets/src/mage/sets/legends/Abomination.java
index 0c33a7c7818..5bf815d95f1 100644
--- a/Mage.Sets/src/mage/sets/legends/Abomination.java
+++ b/Mage.Sets/src/mage/sets/legends/Abomination.java
@@ -28,10 +28,6 @@
package mage.sets.legends;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -40,8 +36,13 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -89,42 +90,44 @@ class AbominationTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent blocker = game.getPermanent(event.getSourceId());
- Permanent blocked = game.getPermanent(event.getTargetId());
- Permanent abomination = game.getPermanent(sourceId);
- if (blocker != null && blocker != abomination
- && blocker.getColor(game).isWhite()
- && blocked == abomination) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- return true;
- }
- }
- if (blocker != null && blocker == abomination
- && game.getPermanent(event.getTargetId()).getColor(game).isWhite()) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- return true;
- }
- }
- if (blocker != null && blocker != abomination
- && blocker.getColor(game).isGreen()
- && blocked == abomination) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- return true;
- }
- }
- if (blocker != null && blocker == abomination
- && game.getPermanent(event.getTargetId()).getColor(game).isGreen()) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- return true;
- }
- }
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent blocker = game.getPermanent(event.getSourceId());
+ Permanent blocked = game.getPermanent(event.getTargetId());
+ Permanent abomination = game.getPermanent(sourceId);
+ if (blocker != null && blocker != abomination
+ && blocker.getColor(game).isWhite()
+ && blocked == abomination) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
+ return true;
+ }
+ }
+ if (blocker != null && blocker == abomination
+ && game.getPermanent(event.getTargetId()).getColor(game).isWhite()) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
+ return true;
+ }
+ }
+ if (blocker != null && blocker != abomination
+ && blocker.getColor(game).isGreen()
+ && blocked == abomination) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
+ return true;
+ }
+ }
+ if (blocker != null && blocker == abomination
+ && game.getPermanent(event.getTargetId()).getColor(game).isGreen()) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
+ return true;
+ }
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/legends/AcidRain.java b/Mage.Sets/src/mage/sets/legends/AcidRain.java
new file mode 100644
index 00000000000..3cde320343e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/legends/AcidRain.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.legends;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DestroyAllEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.FilterPermanent;
+import mage.filter.predicate.mageobject.SubtypePredicate;
+
+/**
+ *
+ * @author anonymous
+ */
+public class AcidRain extends CardImpl {
+
+ private static final FilterPermanent filter = new FilterPermanent("Forests");
+ static {
+ filter.add(new SubtypePredicate("Forest"));
+ }
+
+ public AcidRain(UUID ownerId) {
+ super(ownerId, 44, "Acid Rain", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{U}");
+ this.expansionSetCode = "LEG";
+
+ // Destroy all Forests.
+ this.getSpellAbility().addEffect(new DestroyAllEffect(filter));
+ }
+
+ public AcidRain(final AcidRain card) {
+ super(card);
+ }
+
+ @Override
+ public AcidRain copy() {
+ return new AcidRain(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java
new file mode 100644
index 00000000000..4c89862c354
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/legends/HornOfDeafening.java
@@ -0,0 +1,72 @@
+/*
+ * 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.legends;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.PreventDamageByTargetEffect;
+import mage.abilities.effects.common.PreventDamageToTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author anonymous
+ */
+public class HornOfDeafening extends CardImpl {
+
+ public HornOfDeafening(UUID ownerId) {
+ super(ownerId, 224, "Horn of Deafening", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
+ this.expansionSetCode = "LEG";
+
+ // {2}, {tap}: Prevent all combat damage that would be dealt by target creature this turn.
+ Effect effect = new PreventDamageByTargetEffect(Duration.EndOfTurn, true);
+ effect.setText("Prevent all combat damage that would be dealt by target creature this turn.");
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{2}"));
+ ability.addCost(new TapSourceCost());
+ ability.addTarget(new TargetCreaturePermanent());
+ this.addAbility(ability);
+ }
+
+ public HornOfDeafening(final HornOfDeafening card) {
+ super(card);
+ }
+
+ @Override
+ public HornOfDeafening copy() {
+ return new HornOfDeafening(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/legions/DreambornMuse.java b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java
new file mode 100644
index 00000000000..f2e6b86c256
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/legions/DreambornMuse.java
@@ -0,0 +1,68 @@
+/*
+ * 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.legions;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
+import mage.abilities.dynamicvalue.common.CardsInTargetPlayerHandCount;
+import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+
+/**
+ *
+ * @author cbrianhill
+ */
+public class DreambornMuse extends CardImpl {
+
+ public DreambornMuse(UUID ownerId) {
+ super(ownerId, 36, "Dreamborn Muse", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{U}{U}");
+ this.expansionSetCode = "LGN";
+ this.subtype.add("Spirit");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // At the beginning of each player's upkeep, that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand.
+ PutLibraryIntoGraveTargetEffect effect = new PutLibraryIntoGraveTargetEffect(new CardsInTargetPlayerHandCount());
+ effect.setText("that player puts the top X cards of his or her library into his or her graveyard, where X is the number of cards in his or her hand.");
+ this.addAbility(new BeginningOfUpkeepTriggeredAbility(effect, TargetController.ANY, false));
+
+ }
+
+ public DreambornMuse(final DreambornMuse card) {
+ super(card);
+ }
+
+ @Override
+ public DreambornMuse copy() {
+ return new DreambornMuse(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/legions/ToxinSliver.java b/Mage.Sets/src/mage/sets/legions/ToxinSliver.java
index b7aa297b0ee..be0a4e660ac 100644
--- a/Mage.Sets/src/mage/sets/legions/ToxinSliver.java
+++ b/Mage.Sets/src/mage/sets/legions/ToxinSliver.java
@@ -39,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -57,7 +58,7 @@ public class ToxinSliver extends CardImpl {
// Whenever a Sliver deals combat damage to a creature, destroy that creature. It can't be regenerated.
this.addAbility(new DealsDamageToACreatureTriggeredAbility(new DestroyTargetEffect(true), true, false, true));
-
+
}
public ToxinSliver(final ToxinSliver card) {
@@ -71,8 +72,8 @@ public class ToxinSliver extends CardImpl {
}
class DealsDamageTriggeredAbility extends TriggeredAbilityImpl {
-
- private boolean setTargetPointer;
+
+ private boolean setTargetPointer;
public DealsDamageTriggeredAbility(Effect effect, boolean optional, boolean setTargetPointer) {
super(Zone.BATTLEFIELD, effect, optional);
@@ -80,35 +81,37 @@ class DealsDamageTriggeredAbility extends TriggeredAbilityImpl {
}
public DealsDamageTriggeredAbility(final DealsDamageTriggeredAbility ability) {
- super(ability);
- this.setTargetPointer = ability.setTargetPointer;
+ super(ability);
+ this.setTargetPointer = ability.setTargetPointer;
}
@Override
public DealsDamageTriggeredAbility copy() {
- return new DealsDamageTriggeredAbility(this);
+ return new DealsDamageTriggeredAbility(this);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) {
- if (setTargetPointer) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getTargetId())));
- effect.setValue("damage", event.getAmount());
- }
- }
- return true;
+ if (game.getPermanent(event.getSourceId()).hasSubtype("Sliver")) {
+ if (setTargetPointer) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(game.getControllerId(event.getTargetId())));
+ effect.setValue("damage", event.getAmount());
}
-
+ }
+ return true;
}
- return false;
+ return false;
}
@Override
public String getRule() {
- return "Whenever a Sliver deals damage to a creature" + super.getRule();
+ return "Whenever a Sliver deals damage to a creature" + super.getRule();
}
}
diff --git a/Mage.Sets/src/mage/sets/legions/WallOfHope.java b/Mage.Sets/src/mage/sets/legions/WallOfHope.java
index a589525fcb8..5e56e96860f 100644
--- a/Mage.Sets/src/mage/sets/legions/WallOfHope.java
+++ b/Mage.Sets/src/mage/sets/legions/WallOfHope.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -59,7 +60,7 @@ public class WallOfHope extends CardImpl {
this.addAbility(DefenderAbility.getInstance());
// Whenever Wall of Hope is dealt damage, you gain that much life.
this.addAbility(new WallOfHopeTriggeredAbility());
-
+
}
public WallOfHope(final WallOfHope card) {
@@ -87,11 +88,16 @@ class WallOfHopeTriggeredAbility extends TriggeredAbilityImpl {
return new WallOfHopeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- return true;
+ if (event.getTargetId().equals(this.sourceId)) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ return true;
}
return false;
}
@@ -104,10 +110,10 @@ class WallOfHopeTriggeredAbility extends TriggeredAbilityImpl {
class WallOfHopeGainLifeEffect extends OneShotEffect {
- public WallOfHopeGainLifeEffect() {
- super(Outcome.GainLife);
- staticText = "you gain that much life";
- }
+ public WallOfHopeGainLifeEffect() {
+ super(Outcome.GainLife);
+ staticText = "you gain that much life";
+ }
public WallOfHopeGainLifeEffect(final WallOfHopeGainLifeEffect effect) {
super(effect);
@@ -127,5 +133,4 @@ class WallOfHopeGainLifeEffect extends OneShotEffect {
return true;
}
-
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java b/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java
index e96a52d584f..b69b7d0f676 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/AnkhOfMishra.java
@@ -37,6 +37,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -82,18 +83,21 @@ class AnkhOfMishraAbility extends TriggeredAbilityImpl {
return new AnkhOfMishraAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
- Player player = game.getPlayer(permanent.getControllerId());
- if (player != null) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(player.getId()));
- }
- return true;
+ if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
+ Player player = game.getPlayer(permanent.getControllerId());
+ if (player != null) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(player.getId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java b/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java
index 26e436ef112..057ebaa541b 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/BlackVise.java
@@ -28,7 +28,6 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AsEntersBattlefieldAbility;
@@ -40,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetOpponent;
@@ -121,12 +121,14 @@ class BlackViseTriggeredAbility extends TriggeredAbilityImpl {
return new BlackViseTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- return event.getPlayerId().equals((UUID) game.getState().getValue(getSourceId().toString() + "_player"));
- }
- return false;
+ return event.getPlayerId().equals(game.getState().getValue(getSourceId().toString() + "_player"));
}
@Override
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java b/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java
index 8cefbba278b..eb9712905e9 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/Cockatrice.java
@@ -28,22 +28,23 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.abilities.effects.OneShotEffect;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
-import mage.cards.CardImpl;
/**
*
@@ -90,23 +91,26 @@ class CockatriceTriggeredAbility extends TriggeredAbilityImpl {
return new CockatriceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent blocker = game.getPermanent(event.getSourceId());
- Permanent blocked = game.getPermanent(event.getTargetId());
- Permanent cockatrice = game.getPermanent(sourceId);
- if (blocker != null && blocker != cockatrice
- && !blocker.getSubtype().contains("Wall")
- && blocked == cockatrice) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
- return true;
- }
- if (blocker != null && blocker == cockatrice
- && !blocked.getSubtype().contains("Wall")) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
- return true;
- }
+ Permanent blocker = game.getPermanent(event.getSourceId());
+ Permanent blocked = game.getPermanent(event.getTargetId());
+ Permanent cockatrice = game.getPermanent(sourceId);
+ if (blocker != null && blocker != cockatrice
+ && !blocker.getSubtype().contains("Wall")
+ && blocked == cockatrice) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
+ return true;
+ }
+ if (blocker != null && blocker == cockatrice
+ && !blocked.getSubtype().contains("Wall")) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java b/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java
index 3b0b24aff4a..789a1b08001 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/CrystalRod.java
@@ -28,7 +28,6 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
@@ -40,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -82,15 +82,15 @@ class CrystalRodAbility extends TriggeredAbilityImpl {
return new CrystalRodAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).contains(ObjectColor.BLUE)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).contains(ObjectColor.BLUE);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java b/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java
index 1198a0bbd9f..0c197a4e188 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/DingusEgg.java
@@ -28,7 +28,6 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
@@ -40,7 +39,6 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
-import mage.target.TargetPlayer;
import mage.target.targetpointer.FixedTarget;
/**
@@ -77,23 +75,24 @@ class DingusEggTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD
- && zEvent.getToZone() == Zone.GRAVEYARD
- && zEvent.getTarget().getCardType().contains(CardType.LAND)) {
-
- if (getTargets().size() == 0) {
- UUID targetId = zEvent.getTarget().getControllerId();
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(targetId));
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD
+ && zEvent.getToZone() == Zone.GRAVEYARD
+ && zEvent.getTarget().getCardType().contains(CardType.LAND)) {
+ if (getTargets().size() == 0) {
+ UUID targetId = zEvent.getTarget().getControllerId();
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(targetId));
}
- return true;
-
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java b/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java
index d220484fc1c..3be02bbc3d2 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/Fastbond.java
@@ -39,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -72,8 +73,6 @@ public class Fastbond extends CardImpl {
class PlayALandTriggeredAbility extends TriggeredAbilityImpl {
-
-
public PlayALandTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageControllerEffect(1), false);
}
@@ -82,19 +81,21 @@ class PlayALandTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LAND_PLAYED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LAND_PLAYED && event.getPlayerId() == this.getControllerId()) {
- return true;
- }
- return false;
+ return event.getPlayerId() == this.getControllerId();
}
@Override
public boolean checkInterveningIfClause(Game game) {
Player player = game.getPlayer(this.getControllerId());
- if(player != null){
- if(player.getLandsPlayed() != 1){
+ if (player != null){
+ if (player.getLandsPlayed() != 1){
return true;
}
}
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java b/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java
index 0ff69ced1f0..37be1119c46 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/IronStar.java
@@ -28,7 +28,6 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
@@ -40,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -82,15 +82,15 @@ class IronStarAbility extends TriggeredAbilityImpl {
return new IronStarAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).contains(ObjectColor.RED)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).contains(ObjectColor.RED);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java b/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java
index cfde122dc89..e94d96eb1ef 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/IvoryCup.java
@@ -28,7 +28,6 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
@@ -40,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -81,15 +81,15 @@ class IvoryCupAbility extends TriggeredAbilityImpl {
return new IvoryCupAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).contains(ObjectColor.WHITE)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).contains(ObjectColor.WHITE);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.java
new file mode 100644
index 00000000000..2a21c51caf1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/limitedalpha/PhantasmalForces.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.limitedalpha;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {
+
+ public PhantasmalForces(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 68;
+ this.expansionSetCode = "LEA";
+ }
+
+ public PhantasmalForces(final PhantasmalForces card) {
+ super(card);
+ }
+
+ @Override
+ public PhantasmalForces copy() {
+ return new PhantasmalForces(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java b/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java
index 1071952555a..20f2a5d9b91 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/PsychicVenom.java
@@ -41,6 +41,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -89,18 +90,20 @@ class PsychicVenomAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent source = game.getPermanent(this.sourceId);
- if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
- Permanent attached = game.getPermanent(source.getAttachedTo());
- if (attached != null) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
- for (Effect e : getEffects()) {
- e.setTargetPointer(new FixedTarget(attached.getControllerId()));
- }
- return true;
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent source = game.getPermanent(this.sourceId);
+ if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
+ Permanent attached = game.getPermanent(source.getAttachedTo());
+ if (attached != null) {
+ for (Effect e : getEffects()) {
+ e.setTargetPointer(new FixedTarget(attached.getControllerId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java b/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.java
new file mode 100644
index 00000000000..d72be7da06b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/limitedalpha/SedgeTroll.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.limitedalpha;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {
+
+ public SedgeTroll(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 173;
+ this.expansionSetCode = "LEA";
+ }
+
+ public SedgeTroll(final SedgeTroll card) {
+ super(card);
+ }
+
+ @Override
+ public SedgeTroll copy() {
+ return new SedgeTroll(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java b/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java
index 448809c03cc..1c8dfda7ce2 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/ThicketBasilisk.java
@@ -28,21 +28,22 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.abilities.effects.OneShotEffect;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
-import mage.cards.CardImpl;
/**
*
@@ -87,23 +88,26 @@ class ThicketBasiliskTriggeredAbility extends TriggeredAbilityImpl {
return new ThicketBasiliskTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent blocker = game.getPermanent(event.getSourceId());
- Permanent blocked = game.getPermanent(event.getTargetId());
- Permanent thicketBasilisk = game.getPermanent(sourceId);
- if (blocker != null && blocker != thicketBasilisk
- && !blocker.getSubtype().contains("Wall")
- && blocked == thicketBasilisk) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
- return true;
- }
- if (blocker != null && blocker == thicketBasilisk
- && !blocked.getSubtype().contains("Wall")) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
- return true;
- }
+ Permanent blocker = game.getPermanent(event.getSourceId());
+ Permanent blocked = game.getPermanent(event.getTargetId());
+ Permanent thicketBasilisk = game.getPermanent(sourceId);
+ if (blocker != null && blocker != thicketBasilisk
+ && !blocker.getSubtype().contains("Wall")
+ && blocked == thicketBasilisk) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
+ return true;
+ }
+ if (blocker != null && blocker == thicketBasilisk
+ && !blocked.getSubtype().contains("Wall")) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java b/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java
index 529bd128f8d..18d571cf300 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/ThroneOfBone.java
@@ -28,7 +28,6 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
@@ -40,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -82,15 +82,15 @@ class ThroneOfBoneAbility extends TriggeredAbilityImpl {
return new ThroneOfBoneAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).contains(ObjectColor.BLACK)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).contains(ObjectColor.BLACK);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java b/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java
index f342a150cc6..156dfd3d6af 100644
--- a/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java
+++ b/Mage.Sets/src/mage/sets/limitedalpha/WoodenSphere.java
@@ -28,7 +28,6 @@
package mage.sets.limitedalpha;
import java.util.UUID;
-
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
@@ -40,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -82,15 +82,15 @@ class WoodenSphereAbility extends TriggeredAbilityImpl {
return new WoodenSphereAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).contains(ObjectColor.GREEN)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).contains(ObjectColor.GREEN);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java b/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.java
new file mode 100644
index 00000000000..26f73deb1c9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/limitedbeta/PhantasmalForces.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.limitedbeta;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {
+
+ public PhantasmalForces(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 68;
+ this.expansionSetCode = "LEB";
+ }
+
+ public PhantasmalForces(final PhantasmalForces card) {
+ super(card);
+ }
+
+ @Override
+ public PhantasmalForces copy() {
+ return new PhantasmalForces(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java b/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.java
new file mode 100644
index 00000000000..727f55b9a73
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/limitedbeta/SedgeTroll.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.limitedbeta;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {
+
+ public SedgeTroll(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 174;
+ this.expansionSetCode = "LEB";
+ }
+
+ public SedgeTroll(final SedgeTroll card) {
+ super(card);
+ }
+
+ @Override
+ public SedgeTroll copy() {
+ return new SedgeTroll(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java
new file mode 100644
index 00000000000..a92d4b2eaa9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/lorwyn/AquitectsWill.java
@@ -0,0 +1,112 @@
+/*
+ * 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.lorwyn;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
+import mage.abilities.decorator.ConditionalOneShotEffect;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
+import mage.abilities.effects.common.counter.AddCountersTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
+import mage.constants.Rarity;
+import mage.constants.SubLayer;
+import mage.counters.CounterType;
+import mage.filter.common.FilterControlledCreaturePermanent;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.target.common.TargetLandPermanent;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class AquitectsWill extends CardImpl {
+
+ public AquitectsWill(UUID ownerId) {
+ super(ownerId, 52, "Aquitect's Will", Rarity.COMMON, new CardType[]{CardType.TRIBAL, CardType.SORCERY}, "{U}");
+ this.expansionSetCode = "LRW";
+ this.subtype.add("Merfolk");
+
+ // Put a flood counter on target land.
+ this.getSpellAbility().addEffect(new AddCountersTargetEffect(CounterType.FLOOD.createInstance()));
+ this.getSpellAbility().addTarget(new TargetLandPermanent());
+
+ // That land is an Island in addition to its other types for as long as it has a flood counter on it.
+ this.getSpellAbility().addEffect(new AquitectsWillEffect(Duration.Custom, false, false, "Island"));
+
+ // If you control a Merfolk, draw a card.
+ this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
+ new DrawCardSourceControllerEffect(1),
+ new PermanentsOnTheBattlefieldCondition(new FilterControlledCreaturePermanent("Merfolk", "Merfolk")),
+ "If you control a Merfolk, draw a card"));
+ }
+
+ public AquitectsWill(final AquitectsWill card) {
+ super(card);
+ }
+
+ @Override
+ public AquitectsWill copy() {
+ return new AquitectsWill(this);
+ }
+}
+
+class AquitectsWillEffect extends BecomesBasicLandTargetEffect {
+
+ public AquitectsWillEffect(Duration duration, boolean chooseLandType, boolean loseType, String... landNames) {
+ super(duration, chooseLandType, loseType, landNames);
+ staticText = "That land is an Island in addition to its other types for as long as it has a flood counter on it";
+ }
+
+ public AquitectsWillEffect(final AquitectsWillEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
+ Permanent land = game.getPermanent(this.targetPointer.getFirst(game, source));
+ if (land == null) {
+ // if permanent left battlefield the effect can be removed because it was only valid for that object
+ this.discard();
+ } else if (land.getCounters().getCount(CounterType.FLOOD) > 0) {
+ // only if Flood counter is on the object it becomes an Island.(it would be possible to remove and return the counters with e.g. Fate Transfer if the land becomes a creature too)
+ super.apply(layer, sublayer, source, game);
+ }
+ return true;
+ }
+
+ @Override
+ public AquitectsWillEffect copy() {
+ return new AquitectsWillEffect(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/lorwyn/Dread.java b/Mage.Sets/src/mage/sets/lorwyn/Dread.java
index 16658558b8a..ec0d5f34708 100644
--- a/Mage.Sets/src/mage/sets/lorwyn/Dread.java
+++ b/Mage.Sets/src/mage/sets/lorwyn/Dread.java
@@ -94,10 +94,15 @@ class DreadTriggeredAbility extends TriggeredAbilityImpl {
public DreadTriggeredAbility copy() {
return new DreadTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
for (Effect effect : this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java b/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java
index 2df798e1afe..8762ed5e81b 100644
--- a/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java
+++ b/Mage.Sets/src/mage/sets/lorwyn/EntanglingTrap.java
@@ -94,9 +94,14 @@ class EntanglingClashTriggeredAbility extends TriggeredAbilityImpl {
return new EntanglingClashTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.CLASHED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (EventType.CLASHED.equals(event.getType()) && event.getPlayerId().equals(getControllerId())) {
+ if (event.getPlayerId().equals(getControllerId())) {
if (event.getFlag()) { // clash won
addEffect(new DontUntapInControllersNextUntapStepTargetEffect("that creature"));
}
diff --git a/Mage.Sets/src/mage/sets/lorwyn/MerrowHarbinger.java b/Mage.Sets/src/mage/sets/lorwyn/MerrowHarbinger.java
new file mode 100644
index 00000000000..984104412a0
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/lorwyn/MerrowHarbinger.java
@@ -0,0 +1,77 @@
+/*
+ * 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.lorwyn;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.search.SearchLibraryPutOnLibraryEffect;
+import mage.abilities.keyword.IslandwalkAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.SubtypePredicate;
+import mage.target.common.TargetCardInLibrary;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class MerrowHarbinger extends CardImpl {
+
+ public static final FilterCard filter = new FilterCard("Merfolk card");
+
+ static {
+ filter.add(new SubtypePredicate("Merfolk"));
+ }
+
+ public MerrowHarbinger(UUID ownerId) {
+ super(ownerId, 73, "Merrow Harbinger", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
+ this.expansionSetCode = "LRW";
+ this.subtype.add("Merfolk");
+ this.subtype.add("Wizard");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(3);
+
+ // Islandwalk
+ this.addAbility(new IslandwalkAbility());
+ // When Merrow Harbinger enters the battlefield, you may search your library for a Merfolk card, reveal it, then shuffle your library and put that card on top of it.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(filter), true, true), true));
+ }
+
+ public MerrowHarbinger(final MerrowHarbinger card) {
+ super(card);
+ }
+
+ @Override
+ public MerrowHarbinger copy() {
+ return new MerrowHarbinger(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java b/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java
index 291cbdf40d1..51675f87b0c 100644
--- a/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java
+++ b/Mage.Sets/src/mage/sets/lorwyn/RingsOfBrighthearth.java
@@ -84,10 +84,15 @@ class RingsOfBrighthearthTriggeredAbility extends TriggeredAbilityImpl {
public RingsOfBrighthearthTriggeredAbility copy() {
return new RingsOfBrighthearthTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ACTIVATED_ABILITY;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ACTIVATED_ABILITY && event.getPlayerId().equals(getControllerId())) {
+ if (event.getPlayerId().equals(getControllerId())) {
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
if (!(stackAbility.getStackAbility() instanceof ManaAbility)) {
Effect effect = this.getEffects().get(0);
diff --git a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java
index 9ca2d3e923c..5ec15b0a5a3 100644
--- a/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java
+++ b/Mage.Sets/src/mage/sets/magic2010/HowlingMine.java
@@ -29,12 +29,12 @@
package mage.sets.magic2010;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -77,13 +77,15 @@ class HowlingMineAbility extends TriggeredAbilityImpl {
return new HowlingMineAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DRAW_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DRAW_STEP_PRE) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
- return false;
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2010/IceCage.java b/Mage.Sets/src/mage/sets/magic2010/IceCage.java
index 1a0b9bc894d..911d57ec0d6 100644
--- a/Mage.Sets/src/mage/sets/magic2010/IceCage.java
+++ b/Mage.Sets/src/mage/sets/magic2010/IceCage.java
@@ -29,18 +29,18 @@
package mage.sets.magic2010;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.AttachEffect;
-import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect;
import mage.abilities.effects.common.DestroySourceEffect;
+import mage.abilities.effects.common.combat.CantBlockAttackActivateAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -99,14 +99,17 @@ class IceCageAbility extends TriggeredAbilityImpl {
return new IceCageAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED) {
- Permanent enchantment = game.getPermanent(sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- if (event.getTargetId().equals(enchantment.getAttachedTo())) {
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ if (event.getTargetId().equals(enchantment.getAttachedTo())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java b/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java
index b85a1364463..b532f4207a4 100644
--- a/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java
+++ b/Mage.Sets/src/mage/sets/magic2010/LightwielderPaladin.java
@@ -28,15 +28,15 @@
package mage.sets.magic2010;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
@@ -92,10 +92,14 @@ class LightwielderPaladinTriggeredAbility extends TriggeredAbilityImpl {
return new LightwielderPaladinTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
Player player = game.getPlayer(event.getTargetId());
if (player != null) {
FilterPermanent filter = new FilterPermanent("black or red permanent controlled by " + player.getLogName());
diff --git a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java
index feb2ccc3206..9ca788f1489 100644
--- a/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java
+++ b/Mage.Sets/src/mage/sets/magic2010/ProteanHydra.java
@@ -49,6 +49,7 @@ import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import java.util.UUID;
+import mage.abilities.effects.PreventionEffectData;
/**
*
@@ -121,7 +122,7 @@ public class ProteanHydra extends CardImpl {
class ProteanHydraEffect2 extends PreventionEffectImpl {
public ProteanHydraEffect2() {
- super(Duration.WhileOnBattlefield);
+ super(Duration.WhileOnBattlefield, Integer.MAX_VALUE, false, false);
staticText = "If damage would be dealt to {this}, prevent that damage and remove that many +1/+1 counters from it";
}
@@ -141,19 +142,14 @@ public class ProteanHydra extends CardImpl {
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
- boolean retValue = false;
- GameEvent preventEvent = new GameEvent(GameEvent.EventType.PREVENT_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), event.getAmount(), false);
- int damage = event.getAmount();
- if (!game.replaceEvent(preventEvent)) {
- event.setAmount(0);
- game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE, source.getFirstTarget(), source.getSourceId(), source.getControllerId(), damage));
- retValue = true;
+ PreventionEffectData preventionEffectData = preventDamageAction(event, source, game);
+ if (preventionEffectData.getPreventedDamage() > 0) {
+ Permanent permanent = game.getPermanent(source.getSourceId());
+ if (permanent != null) {
+ permanent.removeCounters(CounterType.P1P1.createInstance(preventionEffectData.getPreventedDamage()), game);
+ }
}
- Permanent permanent = game.getPermanent(source.getSourceId());
- if (permanent != null) {
- permanent.removeCounters(CounterType.P1P1.createInstance(damage), game);
- }
- return retValue;
+ return false;
}
@Override
@@ -183,9 +179,14 @@ public class ProteanHydra extends CardImpl {
return new ProteanHydraAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_REMOVED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.COUNTER_REMOVED && event.getData().equals("+1/+1") && event.getTargetId().equals(this.getSourceId())) {
+ if (event.getData().equals("+1/+1") && event.getTargetId().equals(this.getSourceId())) {
return true;
}
return false;
@@ -213,12 +214,14 @@ public class ProteanHydra extends CardImpl {
return new ProteanHydraDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.END_TURN_STEP_PRE) {
- return true;
- }
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java b/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java
index b56127071c6..f72721de4f7 100644
--- a/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java
+++ b/Mage.Sets/src/mage/sets/magic2010/SanguineBond.java
@@ -28,14 +28,15 @@
package mage.sets.magic2010;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetOpponent;
/**
@@ -80,9 +81,14 @@ class SanguineBondTriggeredAbility extends TriggeredAbilityImpl {
return new SanguineBondTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
this.getEffects().clear();
this.addEffect(new LoseLifeTargetEffect(event.getAmount()));
return true;
diff --git a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java
index 0818fa5dd96..57e2e4dd192 100644
--- a/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java
+++ b/Mage.Sets/src/mage/sets/magic2011/AjanisPridemate.java
@@ -29,13 +29,13 @@
package mage.sets.magic2011;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -85,12 +85,14 @@ class AjanisPridemateAbility extends TriggeredAbilityImpl {
return new AjanisPridemateAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java b/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java
index 1154a69bd6b..8a4c98ab7b6 100644
--- a/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java
+++ b/Mage.Sets/src/mage/sets/magic2011/ChandrasSpitfire.java
@@ -29,18 +29,19 @@
package mage.sets.magic2011;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -81,15 +82,15 @@ class ChandrasSpitfireAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- if (!damageEvent.isCombatDamage() && game.getOpponents(controllerId).contains(event.getTargetId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ return !damageEvent.isCombatDamage() && game.getOpponents(controllerId).contains(event.getTargetId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java
index 4282f7e051a..b478145b76c 100644
--- a/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java
+++ b/Mage.Sets/src/mage/sets/magic2011/GraveTitan.java
@@ -29,14 +29,14 @@
package mage.sets.magic2011;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -86,6 +86,11 @@ class GraveTitanAbility extends TriggeredAbilityImpl {
return new GraveTitanAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java b/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java
index cbef2790095..aba8d9e873e 100644
--- a/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java
+++ b/Mage.Sets/src/mage/sets/magic2011/HarborSerpent.java
@@ -39,7 +39,6 @@ import mage.abilities.effects.RestrictionEffect;
import mage.abilities.keyword.IslandwalkAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent;
-import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
@@ -58,7 +57,10 @@ public class HarborSerpent extends CardImpl {
this.power = new MageInt(5);
this.toughness = new MageInt(5);
+ // Islandwalk (This creature is unblockable as long as defending player controls an Island.)
this.addAbility(new IslandwalkAbility());
+
+ // Harbor Serpent can't attack unless there are five or more Islands on the battlefield.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new HarborSerpentEffect()));
}
@@ -74,11 +76,10 @@ public class HarborSerpent extends CardImpl {
class HarborSerpentEffect extends RestrictionEffect {
- private final FilterLandPermanent filter = new FilterLandPermanent("Island");
+ private static final FilterLandPermanent filter = new FilterLandPermanent("Island", "Island");
public HarborSerpentEffect() {
super(Duration.WhileOnBattlefield);
- filter.add(new SubtypePredicate("Island"));
staticText = "{this} can't attack unless there are five or more Islands on the battlefield";
}
@@ -97,10 +98,8 @@ class HarborSerpentEffect extends RestrictionEffect {
}
@Override
- public boolean applies(Permanent permanent, Ability source, Game game) {
- if (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 5) {
- return true;
- }
- return false;
+ public boolean applies(Permanent permanent, Ability source, Game game) {
+ return permanent.getId().equals(source.getSourceId()) &&
+ game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) < 5;
}
}
diff --git a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java
index 083d75001fa..484242f65d6 100644
--- a/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java
+++ b/Mage.Sets/src/mage/sets/magic2011/InfernoTitan.java
@@ -29,17 +29,17 @@
package mage.sets.magic2011;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.effects.common.DamageMultiEffect;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -90,6 +90,11 @@ class InfernoTitanAbility extends TriggeredAbilityImpl {
return new InfernoTitanAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java
index de0eea24e4f..3166f1aaed4 100644
--- a/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java
+++ b/Mage.Sets/src/mage/sets/magic2011/LilianasCaress.java
@@ -82,10 +82,15 @@ class LilianasCaressAbility extends TriggeredAbilityImpl {
return new LilianasCaressAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) {
- for (Effect effect :this.getEffects()) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
diff --git a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java
index 4cf1ce21498..a510afc62cd 100644
--- a/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java
+++ b/Mage.Sets/src/mage/sets/magic2011/PrimalCocoon.java
@@ -29,17 +29,17 @@
package mage.sets.magic2011;
import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.effects.common.AttachEffect;
+import mage.abilities.effects.common.DestroySourceEffect;
+import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
-import mage.abilities.Ability;
-import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.effects.common.counter.AddPlusOneCountersAttachedEffect;
-import mage.abilities.effects.common.AttachEffect;
-import mage.abilities.effects.common.DestroySourceEffect;
-import mage.abilities.keyword.EnchantAbility;
-import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -94,12 +94,14 @@ class PrimalCocoonAbility1 extends TriggeredAbilityImpl {
return new PrimalCocoonAbility1(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
@@ -123,15 +125,15 @@ class PrimalCocoonAbility2 extends TriggeredAbilityImpl {
return new PrimalCocoonAbility2(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.BLOCKER_DECLARED) {
- Permanent enchantment = game.getPermanent(sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null && event.getSourceId() != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- return true;
- }
- }
- return false;
+ Permanent enchantment = game.getPermanent(sourceId);
+ return enchantment != null && enchantment.getAttachedTo() != null && event.getSourceId() != null && event.getSourceId().equals(enchantment.getAttachedTo());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java
index a631cbf8395..6249ea6ee65 100644
--- a/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java
+++ b/Mage.Sets/src/mage/sets/magic2011/SerraAscendant.java
@@ -62,7 +62,10 @@ public class SerraAscendant extends CardImpl {
this.power = new MageInt(1);
this.toughness = new MageInt(1);
+ // Lifelink (Damage dealt by this creature also causes you to gain that much life.)
this.addAbility(LifelinkAbility.getInstance());
+
+ // As long as you have 30 or more life, Serra Ascendant gets +5/+5 and has flying.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SerraAscendantEffect()));
}
diff --git a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java
index 050b9d6ce2c..03f7d21a769 100644
--- a/Mage.Sets/src/mage/sets/magic2011/SunTitan.java
+++ b/Mage.Sets/src/mage/sets/magic2011/SunTitan.java
@@ -29,14 +29,14 @@
package mage.sets.magic2011;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.Filter.ComparisonType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
@@ -107,6 +107,11 @@ class SunTitanAbility extends TriggeredAbilityImpl {
return new SunTitanAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED || event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java
index f06f9cda101..3677a7b9cc7 100644
--- a/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java
+++ b/Mage.Sets/src/mage/sets/magic2012/ChandraTheFirebrand.java
@@ -29,9 +29,6 @@
package mage.sets.magic2012;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
@@ -41,9 +38,13 @@ import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.targetpointer.FixedTarget;
@@ -103,9 +104,14 @@ class ChandraTheFirebrandAbility extends DelayedTriggeredAbility {
return new ChandraTheFirebrandAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {
for (Effect effect : this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java b/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java
index 27c7871fafe..1aeed25f2da 100644
--- a/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java
+++ b/Mage.Sets/src/mage/sets/magic2012/ChandrasPhoenix.java
@@ -28,9 +28,6 @@
package mage.sets.magic2012;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
@@ -38,9 +35,12 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -85,15 +85,18 @@ class ChandrasPhoenixTriggeredAbility extends TriggeredAbilityImpl {
return new ChandrasPhoenixTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
- Card c = game.getCard(event.getSourceId());
- if (c != null) {
- if (c.getColor(game).isRed() && (c.getCardType().contains(CardType.PLANESWALKER) || c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY))) {
- return true;
- }
+ if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
+ Card c = game.getCard(event.getSourceId());
+ if (c != null) {
+ if (c.getColor(game).isRed() && (c.getCardType().contains(CardType.PLANESWALKER) || c.getCardType().contains(CardType.INSTANT) || c.getCardType().contains(CardType.SORCERY))) {
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java b/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java
index 7377f637e5f..be8206d7cb8 100644
--- a/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java
+++ b/Mage.Sets/src/mage/sets/magic2012/CircleOfFlame.java
@@ -28,17 +28,17 @@
package mage.sets.magic2012;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -82,33 +82,35 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl {
return new CircleOfFlameTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
+ // check has flying
+ Permanent attacker = game.getPermanent(event.getSourceId());
+ if (attacker == null || attacker.getAbilities().contains(FlyingAbility.getInstance())) {
+ return false;
+ }
- // check has flying
- Permanent attacker = game.getPermanent(event.getSourceId());
- if (attacker == null || attacker.getAbilities().contains(FlyingAbility.getInstance())) {
- return false;
- }
-
- // check attacks you
- boolean youOrYourPlaneswalker = false;
- boolean you = event.getTargetId().equals(this.getControllerId());
- if (you) {
- youOrYourPlaneswalker = true;
- } else{ // check attacks your planeswalker
- Permanent permanent = game.getPermanent(event.getTargetId());
- youOrYourPlaneswalker = permanent != null
- && permanent.getCardType().contains(CardType.PLANESWALKER)
- && permanent.getControllerId().equals(this.getControllerId());
- }
- if (youOrYourPlaneswalker) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(attacker.getId()));
- }
- return true;
+ // check attacks you
+ boolean youOrYourPlaneswalker;
+ boolean you = event.getTargetId().equals(this.getControllerId());
+ if (you) {
+ youOrYourPlaneswalker = true;
+ } else{ // check attacks your planeswalker
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ youOrYourPlaneswalker = permanent != null
+ && permanent.getCardType().contains(CardType.PLANESWALKER)
+ && permanent.getControllerId().equals(this.getControllerId());
+ }
+ if (youOrYourPlaneswalker) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(attacker.getId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java
index 77e9c98bab9..be7f26d1122 100644
--- a/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java
+++ b/Mage.Sets/src/mage/sets/magic2012/GideonsAvenger.java
@@ -28,17 +28,17 @@
package mage.sets.magic2012;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -83,14 +83,17 @@ class GideonsAvengerTriggeredAbility extends TriggeredAbilityImpl {
return new GideonsAvengerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent p = game.getPermanent(event.getTargetId());
- if (p != null && p.getCardType().contains(CardType.CREATURE)) {
- if (game.getOpponents(this.controllerId).contains(p.getControllerId()))
- return true;
- }
+ Permanent p = game.getPermanent(event.getTargetId());
+ if (p != null && p.getCardType().contains(CardType.CREATURE)) {
+ if (game.getOpponents(this.controllerId).contains(p.getControllerId()))
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java b/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java
index 2e54d863365..c580c5679b9 100644
--- a/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java
+++ b/Mage.Sets/src/mage/sets/magic2012/HuntersInsight.java
@@ -28,14 +28,14 @@
package mage.sets.magic2012;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
@@ -83,10 +83,14 @@ class HuntersInsightTriggeredAbility extends TriggeredAbilityImpl {
return new HuntersInsightTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if ((event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.DAMAGED_PLANESWALKER)
- && event.getSourceId().equals(this.sourceId) && ((DamagedEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedEvent) event).isCombatDamage()) {
this.getEffects().clear();
this.addEffect(new DrawCardSourceControllerEffect(event.getAmount()));
return true;
diff --git a/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java b/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java
index 14f33e50ca2..5318f83ad4c 100644
--- a/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java
+++ b/Mage.Sets/src/mage/sets/magic2012/RitesOfFlourishing.java
@@ -28,16 +28,17 @@
package mage.sets.magic2012;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.abilities.effects.common.continuous.PlayAdditionalLandsAllEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -82,13 +83,15 @@ class RitesOfFlourishingAbility extends TriggeredAbilityImpl {
return new RitesOfFlourishingAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DRAW_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DRAW_STEP_PRE) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
- return false;
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java b/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java
index 24c54246ef8..61e118d1248 100644
--- a/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java
+++ b/Mage.Sets/src/mage/sets/magic2012/TectonicRift.java
@@ -31,13 +31,13 @@ import java.util.UUID;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
-import mage.abilities.Ability;
-import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.abilities.effects.common.combat.CantBlockAllEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
-import mage.game.Game;
-import mage.game.permanent.Permanent;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.target.common.TargetLandPermanent;
/**
@@ -45,15 +45,22 @@ import mage.target.common.TargetLandPermanent;
* @author North
*/
public class TectonicRift extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying");
+ static {
+ filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
+ }
+
public TectonicRift(UUID ownerId) {
super(ownerId, 157, "Tectonic Rift", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}");
this.expansionSetCode = "M12";
-
+ // Destroy target land.
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetLandPermanent());
- this.getSpellAbility().addEffect(new TectonicRiftEffect());
+ // Creatures without flying can't block this turn.
+ this.getSpellAbility().addEffect(new CantBlockAllEffect(filter, Duration.EndOfTurn));
}
public TectonicRift(final TectonicRift card) {
@@ -65,34 +72,3 @@ public class TectonicRift extends CardImpl {
return new TectonicRift(this);
}
}
-
-class TectonicRiftEffect extends RestrictionEffect {
-
- TectonicRiftEffect() {
- super(Duration.EndOfTurn);
- staticText = "Creatures without flying can't block this turn";
- }
-
- TectonicRiftEffect(final TectonicRiftEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean applies(Permanent permanent, Ability source, Game game) {
- if (!permanent.getAbilities().contains(FlyingAbility.getInstance())) {
- return true;
- }
- return false;
- }
-
- @Override
- public TectonicRiftEffect copy() {
- return new TectonicRiftEffect(this);
- }
-
- @Override
- public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
- return false;
- }
-
-}
diff --git a/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java b/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java
index dac1f2a8dab..9ec321e2752 100644
--- a/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java
+++ b/Mage.Sets/src/mage/sets/magic2012/WarstormSurge.java
@@ -28,15 +28,15 @@
package mage.sets.magic2012;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -80,16 +80,19 @@ class WarstormSurgeTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent.getCardType().contains(CardType.CREATURE)
- && permanent.getControllerId().equals(this.controllerId)) {
- Effect effect = this.getEffects().get(0);
- effect.setValue("damageSource", event.getTargetId());
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent.getCardType().contains(CardType.CREATURE)
+ && permanent.getControllerId().equals(this.controllerId)) {
+ Effect effect = this.getEffects().get(0);
+ effect.setValue("damageSource", event.getTargetId());
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java b/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java
index 9468b0554c3..84ee5ea38f9 100644
--- a/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java
+++ b/Mage.Sets/src/mage/sets/magic2012/Worldslayer.java
@@ -29,19 +29,20 @@ package mage.sets.magic2012;
import java.util.List;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -84,16 +85,16 @@ class WorldslayerTriggeredAbility extends TriggeredAbilityImpl {
return new WorldslayerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java b/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java
index ad16db66da8..45113efc7c9 100644
--- a/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java
+++ b/Mage.Sets/src/mage/sets/magic2013/BloodReckoning.java
@@ -28,18 +28,18 @@
package mage.sets.magic2013;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
-import mage.abilities.effects.common.LoseLifeTargetEffect;
/**
*
@@ -81,31 +81,34 @@ class BloodReckoningTriggeredAbility extends TriggeredAbilityImpl {
return new BloodReckoningTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
- Permanent attacker = game.getPermanent(event.getSourceId());
- if (attacker != null) {
- // check attacks you
- boolean youOrYourPlaneswalker = false;
- boolean you = event.getTargetId().equals(this.getControllerId());
- if (you) {
- youOrYourPlaneswalker = true;
- } else{ // check attacks your planeswalker
- Permanent permanent = game.getPermanent(event.getTargetId());
- youOrYourPlaneswalker = permanent != null
- && permanent.getCardType().contains(CardType.PLANESWALKER)
- && permanent.getControllerId().equals(this.getControllerId());
- }
- if (youOrYourPlaneswalker) {
- for (Effect effect : this.getEffects()) {
- UUID controller = attacker.getControllerId();
- if (controller != null) {
- effect.setTargetPointer(new FixedTarget(controller));
- }
+ Permanent attacker = game.getPermanent(event.getSourceId());
+ if (attacker != null) {
+ // check attacks you
+ boolean youOrYourPlaneswalker = false;
+ boolean you = event.getTargetId().equals(this.getControllerId());
+ if (you) {
+ youOrYourPlaneswalker = true;
+ } else{ // check attacks your planeswalker
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ youOrYourPlaneswalker = permanent != null
+ && permanent.getCardType().contains(CardType.PLANESWALKER)
+ && permanent.getControllerId().equals(this.getControllerId());
+ }
+ if (youOrYourPlaneswalker) {
+ for (Effect effect : this.getEffects()) {
+ UUID controller = attacker.getControllerId();
+ if (controller != null) {
+ effect.setTargetPointer(new FixedTarget(controller));
}
- return true;
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java b/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java
index 83c91c3983b..f02794b92bd 100644
--- a/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java
+++ b/Mage.Sets/src/mage/sets/magic2013/HamletbackGoliath.java
@@ -28,20 +28,20 @@
package mage.sets.magic2013;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -88,18 +88,21 @@ class HamletbackGoliathTriggeredAbility extends TriggeredAbilityImpl {
return new HamletbackGoliathTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanent(targetId);
- if (permanent.getCardType().contains(CardType.CREATURE)
- && !(targetId.equals(this.getSourceId()))) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanent(targetId);
+ if (permanent.getCardType().contains(CardType.CREATURE)
+ && !(targetId.equals(this.getSourceId()))) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java
index 9dc0c2910a3..a6f7b79e94e 100644
--- a/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java
+++ b/Mage.Sets/src/mage/sets/magic2013/NefaroxOverlordOfGrixis.java
@@ -27,23 +27,23 @@
*/
package mage.sets.magic2013;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.keyword.ExaltedAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
*
* @author jeffwadsworth
@@ -99,9 +99,14 @@ class NefaroxOverlordOfGrixisTriggeredAbility extends TriggeredAbilityImpl {
return new NefaroxOverlordOfGrixisTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) {
+ if (game.getActivePlayerId().equals(this.controllerId) ) {
UUID nefarox = this.getSourceId();
if (nefarox != null) {
if (game.getCombat().attacksAlone() && nefarox == game.getCombat().getAttackers().get(0)) {
diff --git a/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java b/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java
index 7ccca5333b5..4ff2a34e1b8 100644
--- a/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java
+++ b/Mage.Sets/src/mage/sets/magic2013/OdricMasterTactician.java
@@ -27,19 +27,23 @@
*/
package mage.sets.magic2013;
-import mage.constants.*;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
-import java.util.UUID;
-
/**
* @author noxx
*/
@@ -87,14 +91,17 @@ class OdricMasterTacticianTriggeredAbility extends TriggeredAbilityImpl {
return new OdricMasterTacticianTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS) {
- resetEffect();
- if (game.getCombat().getAttackers().size() >= 4 && game.getCombat().getAttackers().contains(this.sourceId)) {
- enableEffect();
- return true;
- }
+ resetEffect();
+ if (game.getCombat().getAttackers().size() >= 4 && game.getCombat().getAttackers().contains(this.sourceId)) {
+ enableEffect();
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java b/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java
index 637c8521d8c..08c01e41a5a 100644
--- a/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java
+++ b/Mage.Sets/src/mage/sets/magic2013/RingOfThune.java
@@ -67,7 +67,7 @@ public class RingOfThune extends CardImpl {
// At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white.
TriggeredAbility triggeredAbility = new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AddPlusOneCountersAttachedEffect(1), TargetController.YOU, false);
- ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white");
+ ConditionalTriggeredAbility ability = new ConditionalTriggeredAbility(triggeredAbility, new EquippedMatchesFilterCondition(filter), "At the beginning of your upkeep, put a +1/+1 counter on equipped creature if it's white.");
this.addAbility(ability);
// Equip {1}
diff --git a/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java b/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java
index 31bef35ef92..e822e2fdb3c 100644
--- a/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java
+++ b/Mage.Sets/src/mage/sets/magic2013/SlumberingDragon.java
@@ -28,9 +28,6 @@
package mage.sets.magic2013;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -39,11 +36,14 @@ import mage.abilities.effects.RestrictionEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -136,18 +136,21 @@ class SlumberingDragonTriggeredAbility extends TriggeredAbilityImpl {
return new SlumberingDragonTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
- if (event.getTargetId().equals(controllerId)) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
- return true;
- }
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER) && permanent.getControllerId().equals(controllerId)) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
- return true;
- }
+ if (event.getTargetId().equals(controllerId)) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
+ return true;
+ }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent != null && permanent.getCardType().contains(CardType.PLANESWALKER) && permanent.getControllerId().equals(controllerId)) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java b/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java
index 35ac93db9ba..f03ff584858 100644
--- a/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java
+++ b/Mage.Sets/src/mage/sets/magic2014/ArchangelOfThune.java
@@ -41,6 +41,7 @@ import mage.counters.CounterType;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -90,12 +91,14 @@ class ArchangelOfThuneAbility extends TriggeredAbilityImpl {
return new ArchangelOfThuneAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java b/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java
index b6f2de8f329..187439dba28 100644
--- a/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java
+++ b/Mage.Sets/src/mage/sets/magic2014/ColossalWhale.java
@@ -45,6 +45,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
@@ -92,9 +93,14 @@ class ColossalWhaleAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
+ if (event.getSourceId().equals(this.getSourceId())) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
UUID defenderId = game.getCombat().getDefenderId(sourceId);
filter.add(new ControllerIdPredicate(defenderId));
diff --git a/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java b/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java
index 162acea4797..5cbd32e4098 100644
--- a/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java
+++ b/Mage.Sets/src/mage/sets/magic2014/DoorOfDestinies.java
@@ -28,7 +28,6 @@
package mage.sets.magic2014;
import java.util.UUID;
-import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.AsEntersBattlefieldAbility;
@@ -52,10 +51,10 @@ import mage.counters.CounterType;
import mage.filter.FilterSpell;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
-import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
@@ -141,20 +140,23 @@ class AddCounterAbility extends TriggeredAbilityImpl {
return new AddCounterAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent doorOfDestinies = game.getPermanent(getSourceId());
if (doorOfDestinies != null) {
String subtype = (String) game.getState().getValue(doorOfDestinies.getId() + "_type");
if (subtype != null) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- FilterSpell filter = new FilterSpell();
- filter.add(new ControllerPredicate(TargetController.YOU));
- filter.add(new SubtypePredicate(subtype));
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && filter.match(spell, controllerId, game)) {
- return true;
- }
+ FilterSpell filter = new FilterSpell();
+ filter.add(new ControllerPredicate(TargetController.YOU));
+ filter.add(new SubtypePredicate(subtype));
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && filter.match(spell, controllerId, game)) {
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java b/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java
index a2abff465b9..6ef6c1266ac 100644
--- a/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java
+++ b/Mage.Sets/src/mage/sets/magic2014/GuardianOfTheAges.java
@@ -28,13 +28,13 @@
package mage.sets.magic2014;
import java.util.UUID;
-import mage.cards.CardImpl;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.keyword.DefenderAbility;
-import mage.abilities.keyword.TrampleAbility;
import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
import mage.abilities.effects.common.continuous.LoseAbilitySourceEffect;
+import mage.abilities.keyword.DefenderAbility;
+import mage.abilities.keyword.TrampleAbility;
+import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
@@ -43,6 +43,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -86,16 +87,19 @@ class GuardianOfTheAgesTriggerAbility extends TriggeredAbilityImpl {
public GuardianOfTheAgesTriggerAbility(final GuardianOfTheAgesTriggerAbility ability){
super(ability);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game){
- if(event.getType() == GameEvent.EventType.ATTACKER_DECLARED){
- Permanent creature = game.getPermanent(event.getSourceId());
- if(creature != null && filter.match(creature, game)
- && game.getOpponents(this.getControllerId()).contains(creature.getControllerId())
- && game.getPermanent(this.getSourceId()).getAbilities().contains(DefenderAbility.getInstance())) {
- return true;
- }
+ Permanent creature = game.getPermanent(event.getSourceId());
+ if (creature != null && filter.match(creature, game)
+ && game.getOpponents(this.getControllerId()).contains(creature.getControllerId())
+ && game.getPermanent(this.getSourceId()).getAbilities().contains(DefenderAbility.getInstance())) {
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java b/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java
index 0a6947cbb50..07129d69f2f 100644
--- a/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java
+++ b/Mage.Sets/src/mage/sets/magic2014/IllusionaryArmor.java
@@ -42,6 +42,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@@ -95,14 +96,17 @@ class IllusionaryArmorAbility extends TriggeredAbilityImpl {
return new IllusionaryArmorAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TARGETED) {
- Permanent enchantment = game.getPermanent(sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- if (event.getTargetId().equals(enchantment.getAttachedTo())) {
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ if (event.getTargetId().equals(enchantment.getAttachedTo())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java b/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java
index e5fa803cc8b..a43e8d31670 100644
--- a/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java
+++ b/Mage.Sets/src/mage/sets/magic2014/MaraudingMaulhorn.java
@@ -63,7 +63,7 @@ public class MaraudingMaulhorn extends CardImpl {
// Marauding Maulhorn attacks each combat if able unless you control a creature named Advocate of the Beast.
Effect effect = new ConditionalRequirementEffect(
- new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield),
+ new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true),
new PermanentsOnTheBattlefieldCondition(filter, PermanentsOnTheBattlefieldCondition.CountType.FEWER_THAN, 1));
effect.setText("{this} attacks each combat if able unless you control a creature named Advocate of the Beast");
diff --git a/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java b/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java
index 91ecb779aa9..b537128b3f1 100644
--- a/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java
+++ b/Mage.Sets/src/mage/sets/magic2014/PathOfBravery.java
@@ -46,6 +46,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -112,14 +113,14 @@ class PathOfBraveryTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS
- && !game.getCombat().noAttackers()
- && event.getPlayerId().equals(controllerId)) {
- return true;
- }
- return false;
+ return !game.getCombat().noAttackers() && event.getPlayerId().equals(controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java b/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java
index a8d57175e10..a35907ae63e 100644
--- a/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java
+++ b/Mage.Sets/src/mage/sets/magic2014/SeismicStomp.java
@@ -28,29 +28,34 @@
package mage.sets.magic2014;
import java.util.UUID;
-import mage.abilities.Ability;
-import mage.abilities.effects.RestrictionEffect;
+import mage.abilities.effects.common.combat.CantBlockAllEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
-import mage.game.Game;
-import mage.game.permanent.Permanent;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.AbilityPredicate;
/**
*
* @author jeffwadsworth
*/
public class SeismicStomp extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying");
+ static {
+ filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
+ }
+
public SeismicStomp(UUID ownerId) {
super(ownerId, 152, "Seismic Stomp", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}");
this.expansionSetCode = "M14";
-
// Creatures without flying can't block this turn.
- this.getSpellAbility().addEffect(new SeismicStompEffect());
+ this.getSpellAbility().addEffect(new CantBlockAllEffect(filter, Duration.EndOfTurn));
}
public SeismicStomp(final SeismicStomp card) {
@@ -62,34 +67,3 @@ public class SeismicStomp extends CardImpl {
return new SeismicStomp(this);
}
}
-
-class SeismicStompEffect extends RestrictionEffect {
-
- SeismicStompEffect() {
- super(Duration.EndOfTurn);
- staticText = "Creatures without flying can't block this turn";
- }
-
- SeismicStompEffect(final SeismicStompEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean applies(Permanent permanent, Ability source, Game game) {
- if (!permanent.getAbilities().contains(FlyingAbility.getInstance())) {
- return true;
- }
- return false;
- }
-
- @Override
- public SeismicStompEffect copy() {
- return new SeismicStompEffect(this);
- }
-
- @Override
- public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
- return false;
- }
-
-}
diff --git a/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java b/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java
index bf937abb290..975240eb203 100644
--- a/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java
+++ b/Mage.Sets/src/mage/sets/magic2014/WindreaderSphinx.java
@@ -40,6 +40,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.AbilityPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -87,15 +88,15 @@ class WindreaderSphinxTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED ) {
- Permanent attacker = game.getPermanent(event.getSourceId());
- if (attacker != null && filter.match(attacker, game)) {
- return true;
- }
- }
- return false;
+ Permanent attacker = game.getPermanent(event.getSourceId());
+ return attacker != null && filter.match(attacker, game);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java b/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java
index 1a2fe2b3db1..2ef916758ed 100644
--- a/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java
+++ b/Mage.Sets/src/mage/sets/magic2014/Witchstalker.java
@@ -43,6 +43,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -92,19 +93,18 @@ class WitchstalkerTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- // Opponent casts spell during your turn
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null
- && filter.match(spell,game)
- && game.getOpponents(this.getControllerId()).contains(spell.getControllerId())
- && game.getActivePlayerId().equals(this.getControllerId())) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null
+ && filter.match(spell,game)
+ && game.getOpponents(this.getControllerId()).contains(spell.getControllerId())
+ && game.getActivePlayerId().equals(this.getControllerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2015/HotSoup.java b/Mage.Sets/src/mage/sets/magic2015/HotSoup.java
index b14a940e4e7..4404b0c357a 100644
--- a/Mage.Sets/src/mage/sets/magic2015/HotSoup.java
+++ b/Mage.Sets/src/mage/sets/magic2015/HotSoup.java
@@ -43,6 +43,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -91,19 +92,22 @@ class HotSoupTriggeredAbility extends TriggeredAbilityImpl {
public HotSoupTriggeredAbility copy() {
return new HotSoupTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- Permanent equipment = game.getPermanent(this.getSourceId());
- if (equipment != null && equipment.getAttachedTo() != null) {
- if (event.getTargetId() == equipment.getAttachedTo()) {
- for(Effect effect : this.getEffects())
- {
- effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo()));
- }
- return true;
+ Permanent equipment = game.getPermanent(this.getSourceId());
+ if (equipment != null && equipment.getAttachedTo() != null) {
+ if (event.getTargetId() == equipment.getAttachedTo()) {
+ for(Effect effect : this.getEffects())
+ {
+ effect.setTargetPointer(new FixedTarget(equipment.getAttachedTo()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java b/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java
index f662144a930..3838c745cda 100644
--- a/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java
+++ b/Mage.Sets/src/mage/sets/magic2015/KurkeshOnakkeAncient.java
@@ -93,18 +93,21 @@ class KurkeshOnakkeAncientTriggeredAbility extends TriggeredAbilityImpl {
public KurkeshOnakkeAncientTriggeredAbility copy() {
return new KurkeshOnakkeAncientTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ACTIVATED_ABILITY;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ACTIVATED_ABILITY) {
- Card source = game.getPermanentOrLKIBattlefield(event.getSourceId());
- if (source.getCardType().contains(CardType.ARTIFACT)) {
- StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
- if (!(stackAbility.getStackAbility() instanceof ManaAbility)) {
- Effect effect = this.getEffects().get(0);
- effect.setValue("stackAbility", stackAbility.getStackAbility());
- return true;
- }
+ Card source = game.getPermanentOrLKIBattlefield(event.getSourceId());
+ if (source.getCardType().contains(CardType.ARTIFACT)) {
+ StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
+ if (!(stackAbility.getStackAbility() instanceof ManaAbility)) {
+ Effect effect = this.getEffects().get(0);
+ effect.setValue("stackAbility", stackAbility.getStackAbility());
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java b/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java
index 2ae4449ff7f..e4830e2ed8b 100644
--- a/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java
+++ b/Mage.Sets/src/mage/sets/magic2015/MilitaryIntelligence.java
@@ -37,6 +37,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -78,14 +79,14 @@ class MilitaryIntelligenceTriggeredAbility extends TriggeredAbilityImpl {
return new MilitaryIntelligenceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS) {
- if (game.getCombat().getAttackers().size() >= 2 && game.getCombat().getAttackerId().equals(getControllerId())) {
- return true;
- }
- }
- return false;
+ return game.getCombat().getAttackers().size() >= 2 && game.getCombat().getAttackerId().equals(getControllerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java b/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java
index 9e906d5e41b..bb12bea1b97 100644
--- a/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java
+++ b/Mage.Sets/src/mage/sets/magic2015/NetcasterSpider.java
@@ -83,13 +83,15 @@ class BlocksCreatureWithFlyingTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.BLOCKER_DECLARED && event.getSourceId().equals(this.getSourceId())
- && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId())) {
- return true;
- }
- return false;
+ return event.getSourceId().equals(this.getSourceId())
+ && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java b/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java
index fd7afe9f5c3..3becd6b81db 100644
--- a/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java
+++ b/Mage.Sets/src/mage/sets/magic2015/ObNixilisUnshackled.java
@@ -101,16 +101,19 @@ class ObNixilisUnshackledTriggeredAbility extends TriggeredAbilityImpl {
public ObNixilisUnshackledTriggeredAbility copy() {
return new ObNixilisUnshackledTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LIBRARY_SEARCHED;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.LIBRARY_SEARCHED) {
- Player controller = game.getPlayer(this.getControllerId());
- if (controller != null && game.isOpponent(controller, event.getTargetId())) {
- this.addTarget(new TargetPlayer());
- getTargets().get(0).add(event.getPlayerId(), game);
- return true;
- }
+ Player controller = game.getPlayer(this.getControllerId());
+ if (controller != null && game.isOpponent(controller, event.getTargetId())) {
+ this.addTarget(new TargetPlayer());
+ getTargets().get(0).add(event.getPlayerId(), game);
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java b/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java
index 7729d2e67fd..a255b90bb54 100644
--- a/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java
+++ b/Mage.Sets/src/mage/sets/magic2015/ProfaneMemento.java
@@ -37,6 +37,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
/**
@@ -77,10 +78,15 @@ class ProfaneMementoTriggeredAbility extends TriggeredAbilityImpl {
public ProfaneMementoTriggeredAbility copy() {
return new ProfaneMementoTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) {
+ if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) {
Card card = game.getCard(event.getTargetId());
if (card != null && card.getCardType().contains(CardType.CREATURE) && game.getOpponents(controllerId).contains(card.getOwnerId())) {
return true;
diff --git a/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java b/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java
index 2b8f9282c24..78d0392cecd 100644
--- a/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java
+++ b/Mage.Sets/src/mage/sets/magic2015/SiegeDragon.java
@@ -50,6 +50,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -114,9 +115,14 @@ class SiegeDragonAttacksTriggeredAbility extends TriggeredAbilityImpl {
return new SiegeDragonAttacksTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return GameEvent.EventType.ATTACKER_DECLARED.equals(event.getType()) && event.getSourceId().equals(this.getSourceId());
+ return event.getSourceId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java b/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java
index 887c5263a62..1fb7aae3b05 100644
--- a/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java
+++ b/Mage.Sets/src/mage/sets/magic2015/WallOfLimbs.java
@@ -46,6 +46,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.TargetPlayer;
/**
@@ -102,10 +103,15 @@ class WallOfLimbsTriggeredAbility extends TriggeredAbilityImpl {
public WallOfLimbsTriggeredAbility copy() {
return new WallOfLimbsTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.GAINED_LIFE && event.getPlayerId().equals(controllerId);
+ return event.getPlayerId().equals(controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/magic2015/WasteNot.java b/Mage.Sets/src/mage/sets/magic2015/WasteNot.java
index a04546e38b4..4fba77c7a41 100644
--- a/Mage.Sets/src/mage/sets/magic2015/WasteNot.java
+++ b/Mage.Sets/src/mage/sets/magic2015/WasteNot.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.ZombieToken;
/**
@@ -87,10 +88,15 @@ class WasteNotCreatureTriggeredAbility extends TriggeredAbilityImpl {
public WasteNotCreatureTriggeredAbility copy() {
return new WasteNotCreatureTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
Card discarded = game.getCard(event.getTargetId());
if (discarded != null && discarded.getCardType().contains(CardType.CREATURE)) {
return true;
@@ -119,10 +125,15 @@ class WasteNotLandTriggeredAbility extends TriggeredAbilityImpl {
public WasteNotLandTriggeredAbility copy() {
return new WasteNotLandTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
Card discarded = game.getCard(event.getTargetId());
if (discarded != null && discarded.getCardType().contains(CardType.LAND)) {
return true;
@@ -151,10 +162,15 @@ class WasteNotOtherTriggeredAbility extends TriggeredAbilityImpl {
public WasteNotOtherTriggeredAbility copy() {
return new WasteNotOtherTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
Card discarded = game.getCard(event.getTargetId());
if (discarded != null && !discarded.getCardType().contains(CardType.LAND) && !discarded.getCardType().contains(CardType.CREATURE)) {
return true;
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ActOfTreason.java b/Mage.Sets/src/mage/sets/magicorigins/ActOfTreason.java
new file mode 100644
index 00000000000..ab0270570c9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ActOfTreason.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.magicorigins;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ActOfTreason extends mage.sets.magic2010.ActOfTreason {
+
+ public ActOfTreason(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 999;
+ this.expansionSetCode = "ORI";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public ActOfTreason(final ActOfTreason card) {
+ super(card);
+ }
+
+ @Override
+ public ActOfTreason copy() {
+ return new ActOfTreason(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/AegisAngel.java b/Mage.Sets/src/mage/sets/magicorigins/AegisAngel.java
new file mode 100644
index 00000000000..8f604f6dbf6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/AegisAngel.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class AegisAngel extends mage.sets.magic2012.AegisAngel {
+
+ public AegisAngel(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 273;
+ this.expansionSetCode = "ORI";
+ }
+
+ public AegisAngel(final AegisAngel card) {
+ super(card);
+ }
+
+ @Override
+ public AegisAngel copy() {
+ return new AegisAngel(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/AkroanJailer.java b/Mage.Sets/src/mage/sets/magicorigins/AkroanJailer.java
new file mode 100644
index 00000000000..cd3162e2c69
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/AkroanJailer.java
@@ -0,0 +1,74 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.Cost;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.TapTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class AkroanJailer extends CardImpl {
+
+ public AkroanJailer(UUID ownerId) {
+ super(ownerId, 1, "Akroan Jailer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Human");
+ this.subtype.add("Soldier");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(1);
+
+ // {2}{W}, {T}: Tap target creature.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new TapTargetEffect(), new ManaCostsImpl("{2}{W}"));
+ ability.addCost(new TapSourceCost());
+ ability.addTarget(new TargetCreaturePermanent());
+ this.addAbility(ability);
+
+ }
+
+ public AkroanJailer(final AkroanJailer card) {
+ super(card);
+ }
+
+ @Override
+ public AkroanJailer copy() {
+ return new AkroanJailer(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/AvariciousDragon.java b/Mage.Sets/src/mage/sets/magicorigins/AvariciousDragon.java
new file mode 100644
index 00000000000..6b63ce07dee
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/AvariciousDragon.java
@@ -0,0 +1,72 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.BeginningOfDrawTriggeredAbility;
+import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.discard.DiscardHandControllerEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class AvariciousDragon extends CardImpl {
+
+ public AvariciousDragon(UUID ownerId) {
+ super(ownerId, 131, "Avaricious Dragon", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Dragon");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // At the beginning of your draw step, draw an additional card.
+ this.addAbility(new BeginningOfDrawTriggeredAbility(new DrawCardSourceControllerEffect(1), TargetController.YOU, false));
+ // At the beginning of your end step, discard your hand.
+ this.addAbility(new BeginningOfEndStepTriggeredAbility(new DiscardHandControllerEffect(), TargetController.YOU, false));
+ }
+
+ public AvariciousDragon(final AvariciousDragon card) {
+ super(card);
+ }
+
+ @Override
+ public AvariciousDragon copy() {
+ return new AvariciousDragon(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/BellowsLizard.java b/Mage.Sets/src/mage/sets/magicorigins/BellowsLizard.java
new file mode 100644
index 00000000000..f43dc9c3ea2
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/BellowsLizard.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class BellowsLizard extends mage.sets.returntoravnica.BellowsLizard {
+
+ public BellowsLizard(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 132;
+ this.expansionSetCode = "ORI";
+ }
+
+ public BellowsLizard(final BellowsLizard card) {
+ super(card);
+ }
+
+ @Override
+ public BellowsLizard copy() {
+ return new BellowsLizard(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/BoggartBrute.java b/Mage.Sets/src/mage/sets/magicorigins/BoggartBrute.java
new file mode 100644
index 00000000000..e4778a4b55d
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/BoggartBrute.java
@@ -0,0 +1,63 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.keyword.MenaceAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class BoggartBrute extends CardImpl {
+
+ public BoggartBrute(UUID ownerId) {
+ super(ownerId, 133, "Boggart Brute", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Goblin");
+ this.subtype.add("Warrior");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(2);
+
+ // Menace
+ this.addAbility(new MenaceAbility());
+ }
+
+ public BoggartBrute(final BoggartBrute card) {
+ super(card);
+ }
+
+ @Override
+ public BoggartBrute copy() {
+ return new BoggartBrute(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.java
new file mode 100644
index 00000000000..ab61208dc24
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/CatacombSlug.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class CatacombSlug extends mage.sets.returntoravnica.CatacombSlug {
+
+ public CatacombSlug(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 998;
+ this.expansionSetCode = "ORI";
+ }
+
+ public CatacombSlug(final CatacombSlug card) {
+ super(card);
+ }
+
+ @Override
+ public CatacombSlug copy() {
+ return new CatacombSlug(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandraFireOfKaladesh.java b/Mage.Sets/src/mage/sets/magicorigins/ChandraFireOfKaladesh.java
new file mode 100644
index 00000000000..a81cf2576b9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ChandraFireOfKaladesh.java
@@ -0,0 +1,96 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.ObjectColor;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.common.SpellCastControllerTriggeredAbility;
+import mage.abilities.condition.common.SourceDealtDamageCondition;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.decorator.ConditionalOneShotEffect;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
+import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender;
+import mage.abilities.effects.common.UntapSourceEffect;
+import mage.abilities.keyword.TransformAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterSpell;
+import mage.filter.predicate.mageobject.ColorPredicate;
+import mage.target.TargetPlayer;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ChandraFireOfKaladesh extends CardImpl {
+
+ private static final FilterSpell filter = new FilterSpell("a red spell");
+
+ static {
+ filter.add(new ColorPredicate(ObjectColor.RED));
+ }
+
+ public ChandraFireOfKaladesh(UUID ownerId) {
+ super(ownerId, 135, "Chandra, Fire of Kaladesh", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{1}{R}{R}");
+ this.expansionSetCode = "ORI";
+ this.supertype.add("Legendary");
+ this.subtype.add("Human");
+ this.subtype.add("Shaman");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ this.canTransform = true;
+ this.secondSideCard = new ChandraRoaringFlame(ownerId);
+
+ // Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.
+ this.addAbility(new SpellCastControllerTriggeredAbility(new UntapSourceEffect(), filter, false));
+
+ // {T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.
+ this.addAbility(new TransformAbility());
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
+ ability.addEffect(new ConditionalOneShotEffect(new ExileAndReturnTransformedSourceEffect(Gender.FEMAL), new SourceDealtDamageCondition(3)));
+ ability.addTarget(new TargetPlayer());
+ this.addAbility(ability);
+
+ }
+
+ public ChandraFireOfKaladesh(final ChandraFireOfKaladesh card) {
+ super(card);
+ }
+
+ @Override
+ public ChandraFireOfKaladesh copy() {
+ return new ChandraFireOfKaladesh(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java b/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java
new file mode 100644
index 00000000000..a12cfc19dd7
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ChandraRoaringFlame.java
@@ -0,0 +1,146 @@
+/*
+ * 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.magicorigins;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.LoyaltyAbility;
+import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
+import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.DamageSelfEffect;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import mage.game.Game;
+import mage.game.command.Emblem;
+import mage.players.Player;
+import mage.target.TargetPlayer;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ChandraRoaringFlame extends CardImpl {
+
+ public ChandraRoaringFlame(UUID ownerId) {
+ super(ownerId, 135, "Chandra, Roaring Flame", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Chandra");
+ this.color.setRed(true);
+
+ this.nightCard = true;
+ this.canTransform = true;
+
+ this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(4)), false));
+
+ // +1: Chandra, Roaring Flame deals 2 damage to target player.
+ LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), 1);
+ loyaltyAbility.addTarget(new TargetPlayer());
+ this.addAbility(loyaltyAbility);
+
+ //-2: Chandra, Roaring Flame deals 2 damage to target creature.
+ loyaltyAbility = new LoyaltyAbility(new DamageTargetEffect(2), -2);
+ loyaltyAbility.addTarget(new TargetCreaturePermanent());
+ this.addAbility(loyaltyAbility);
+
+ //-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."
+ this.addAbility(new LoyaltyAbility(new ChandraRoaringFlameEmblemEffect(), -7));
+
+
+ }
+
+ public ChandraRoaringFlame(final ChandraRoaringFlame card) {
+ super(card);
+ }
+
+ @Override
+ public ChandraRoaringFlame copy() {
+ return new ChandraRoaringFlame(this);
+ }
+}
+
+class ChandraRoaringFlameEmblemEffect extends OneShotEffect {
+
+ public ChandraRoaringFlameEmblemEffect() {
+ super(Outcome.Damage);
+ this.staticText = "{this} deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with \"At the beginning of your upkeep, this emblem deals 3 damage to you.\"";
+ }
+
+ public ChandraRoaringFlameEmblemEffect(final ChandraRoaringFlameEmblemEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public ChandraRoaringFlameEmblemEffect copy() {
+ return new ChandraRoaringFlameEmblemEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ List opponentsEmblem = new ArrayList<>();
+ for(UUID playerId: game.getOpponents(controller.getId())) {
+ Player opponent = game.getPlayer(playerId);
+ if (opponent != null) {
+ if (opponent.damage(6, source.getSourceId(), game, false, true) > 0) {
+ opponentsEmblem.add(opponent);
+ }
+ }
+ }
+ for (Player opponent : opponentsEmblem) {
+ game.addEmblem(new ChandraRoaringFlameEmblem(), source, opponent.getId());
+ }
+ }
+ return false;
+ }
+}
+
+/**
+ * Emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."
+ */
+class ChandraRoaringFlameEmblem extends Emblem {
+
+ public ChandraRoaringFlameEmblem() {
+ setName("EMBLEM: Chandra, Roaring Flame");
+ Effect effect = new DamageTargetEffect(3);
+ effect.setText("this emblem deals 3 damage to you");
+ this.getAbilities().add(new BeginningOfUpkeepTriggeredAbility(Zone.COMMAND, effect, TargetController.YOU, false, true));
+ }
+}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.java
new file mode 100644
index 00000000000..9415221491c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ChandrasFury.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ChandrasFury extends mage.sets.magic2013.ChandrasFury {
+
+ public ChandrasFury(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 997;
+ this.expansionSetCode = "ORI";
+ }
+
+ public ChandrasFury(final ChandrasFury card) {
+ super(card);
+ }
+
+ @Override
+ public ChandrasFury copy() {
+ return new ChandrasFury(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChandrasIgnition.java b/Mage.Sets/src/mage/sets/magicorigins/ChandrasIgnition.java
new file mode 100644
index 00000000000..b6c28101735
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ChandrasIgnition.java
@@ -0,0 +1,102 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.effects.OneShotEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.players.Player;
+import mage.target.common.TargetControlledCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ChandrasIgnition extends CardImpl {
+
+ public ChandrasIgnition(UUID ownerId) {
+ super(ownerId, 137, "Chandra's Ignition", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{3}{R}{R}");
+ this.expansionSetCode = "ORI";
+
+ // Target creature you control deals damage equal to its power to each other creature and each opponent.
+ this.getSpellAbility().addEffect(new ChandrasIgnitionEffect());
+ this.getSpellAbility().addTarget(new TargetControlledCreaturePermanent());
+ }
+
+ public ChandrasIgnition(final ChandrasIgnition card) {
+ super(card);
+ }
+
+ @Override
+ public ChandrasIgnition copy() {
+ return new ChandrasIgnition(this);
+ }
+}
+
+class ChandrasIgnitionEffect extends OneShotEffect {
+
+ public ChandrasIgnitionEffect() {
+ super(Outcome.Benefit);
+ this.staticText = "Target creature you control deals damage equal to its power to each other creature and each opponent";
+ }
+
+ public ChandrasIgnitionEffect(final ChandrasIgnitionEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public ChandrasIgnitionEffect copy() {
+ return new ChandrasIgnitionEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Permanent targetCreature = game.getPermanent(getTargetPointer().getFirst(game, source));
+ if (targetCreature != null && targetCreature.getPower().getValue() > 0) {
+ for (Permanent creature : game.getState().getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) {
+ if (!creature.getId().equals(targetCreature.getId())) {
+ creature.damage(targetCreature.getPower().getValue(), source.getSourceId(), game, false, true);
+ }
+ }
+ for(UUID opponentId : game.getOpponents(source.getControllerId())) {
+ Player opponent = game.getPlayer(opponentId);
+ if (opponent != null) {
+ opponent.damage(targetCreature.getPower().getValue(), source.getSourceId(), game, false, true);
+ }
+ }
+ }
+ return true;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.java
new file mode 100644
index 00000000000..60c62df9cbd
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ChargingGriffin.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ChargingGriffin extends mage.sets.magic2014.ChargingGriffin {
+
+ public ChargingGriffin(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 996;
+ this.expansionSetCode = "ORI";
+ }
+
+ public ChargingGriffin(final ChargingGriffin card) {
+ super(card);
+ }
+
+ @Override
+ public ChargingGriffin copy() {
+ return new ChargingGriffin(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.java
new file mode 100644
index 00000000000..ef033f9db46
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/Claustrophobia.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Claustrophobia extends mage.sets.innistrad.Claustrophobia {
+
+ public Claustrophobia(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 995;
+ this.expansionSetCode = "ORI";
+ }
+
+ public Claustrophobia(final Claustrophobia card) {
+ super(card);
+ }
+
+ @Override
+ public Claustrophobia copy() {
+ return new Claustrophobia(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.java
new file mode 100644
index 00000000000..7c282ccd931
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/Cobblebrute.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Cobblebrute extends mage.sets.returntoravnica.Cobblebrute {
+
+ public Cobblebrute(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 994;
+ this.expansionSetCode = "ORI";
+ }
+
+ public Cobblebrute(final Cobblebrute card) {
+ super(card);
+ }
+
+ @Override
+ public Cobblebrute copy() {
+ return new Cobblebrute(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ConclaveNaturalists.java b/Mage.Sets/src/mage/sets/magicorigins/ConclaveNaturalists.java
new file mode 100644
index 00000000000..d7e12aefcca
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ConclaveNaturalists.java
@@ -0,0 +1,68 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
+import mage.target.TargetPermanent;
+
+/**
+ *
+ * @author emerald000
+ */
+public class ConclaveNaturalists extends CardImpl {
+
+ public ConclaveNaturalists(UUID ownerId) {
+ super(ownerId, 171, "Conclave Naturalists", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Dryad");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), true);
+ ability.addTarget(new TargetPermanent(new FilterArtifactOrEnchantmentPermanent()));
+ this.addAbility(ability);
+ }
+
+ public ConclaveNaturalists(final ConclaveNaturalists card) {
+ super(card);
+ }
+
+ @Override
+ public ConclaveNaturalists copy() {
+ return new ConclaveNaturalists(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.java
new file mode 100644
index 00000000000..c82e1c25a66
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/CruelRevival.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class CruelRevival extends mage.sets.onslaught.CruelRevival {
+
+ public CruelRevival(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 993;
+ this.expansionSetCode = "ORI";
+ }
+
+ public CruelRevival(final CruelRevival card) {
+ super(card);
+ }
+
+ @Override
+ public CruelRevival copy() {
+ return new CruelRevival(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/Disperse.java b/Mage.Sets/src/mage/sets/magicorigins/Disperse.java
new file mode 100644
index 00000000000..962e36434b6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/Disperse.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Disperse extends mage.sets.scarsofmirrodin.Disperse {
+
+ public Disperse(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 992;
+ this.expansionSetCode = "ORI";
+ }
+
+ public Disperse(final Disperse card) {
+ super(card);
+ }
+
+ @Override
+ public Disperse copy() {
+ return new Disperse(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/DivineVerdict.java b/Mage.Sets/src/mage/sets/magicorigins/DivineVerdict.java
new file mode 100644
index 00000000000..492afb6c562
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/DivineVerdict.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class DivineVerdict extends mage.sets.magic2010.DivineVerdict {
+
+ public DivineVerdict(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 274;
+ this.expansionSetCode = "ORI";
+ }
+
+ public DivineVerdict(final DivineVerdict card) {
+ super(card);
+ }
+
+ @Override
+ public DivineVerdict copy() {
+ return new DivineVerdict(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/EagleOfTheWatch.java b/Mage.Sets/src/mage/sets/magicorigins/EagleOfTheWatch.java
new file mode 100644
index 00000000000..48ef646ab0b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/EagleOfTheWatch.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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.keyword.FlyingAbility;
+import mage.abilities.keyword.VigilanceAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class EagleOfTheWatch extends CardImpl {
+
+ public EagleOfTheWatch(UUID ownerId) {
+ super(ownerId, 275, "Eagle of the Watch", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Bird");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // Vigilance
+ this.addAbility(VigilanceAbility.getInstance());
+ }
+
+ public EagleOfTheWatch(final EagleOfTheWatch card) {
+ super(card);
+ }
+
+ @Override
+ public EagleOfTheWatch copy() {
+ return new EagleOfTheWatch(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.java
new file mode 100644
index 00000000000..4b13a997457
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ElvishVisionary.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ElvishVisionary extends mage.sets.shardsofalara.ElvishVisionary {
+
+ public ElvishVisionary(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 991;
+ this.expansionSetCode = "ORI";
+ }
+
+ public ElvishVisionary(final ElvishVisionary card) {
+ super(card);
+ }
+
+ @Override
+ public ElvishVisionary copy() {
+ return new ElvishVisionary(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/EnthrallingVictor.java b/Mage.Sets/src/mage/sets/magicorigins/EnthrallingVictor.java
new file mode 100644
index 00000000000..231b0d9ac5e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/EnthrallingVictor.java
@@ -0,0 +1,90 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.UntapTargetEffect;
+import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
+import mage.abilities.effects.common.continuous.GainControlTargetEffect;
+import mage.abilities.keyword.HasteAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.filter.Filter;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.mageobject.PowerPredicate;
+import mage.filter.predicate.permanent.ControllerPredicate;
+import mage.target.common.TargetCreaturePermanent;
+
+
+/**
+ *
+ * @author LevelX2
+ */
+public class EnthrallingVictor extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls with power 2 or less");
+
+ static {
+ filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3));
+ filter.add(new ControllerPredicate(TargetController.OPPONENT));
+ }
+
+ public EnthrallingVictor(UUID ownerId) {
+ super(ownerId, 142, "Enthralling Victor", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Human");
+ this.subtype.add("Warrior");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(2);
+
+ // When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new GainControlTargetEffect(Duration.EndOfTurn, true), false);
+ Effect effect = new UntapTargetEffect();
+ effect.setText("untap that creature");
+ ability.addEffect(effect);
+ ability.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn, "it gains haste until end of turn"));
+ ability.addTarget(new TargetCreaturePermanent(filter));
+ this.addAbility(ability);
+ }
+
+ public EnthrallingVictor(final EnthrallingVictor card) {
+ super(card);
+ }
+
+ @Override
+ public EnthrallingVictor copy() {
+ return new EnthrallingVictor(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.java
new file mode 100644
index 00000000000..92348e1805a
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/FieryConclusion.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class FieryConclusion extends mage.sets.ravnica.FieryConclusion {
+
+ public FieryConclusion(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 990;
+ this.expansionSetCode = "ORI";
+ }
+
+ public FieryConclusion(final FieryConclusion card) {
+ super(card);
+ }
+
+ @Override
+ public FieryConclusion copy() {
+ return new FieryConclusion(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/FieryHellhound.java b/Mage.Sets/src/mage/sets/magicorigins/FieryHellhound.java
new file mode 100644
index 00000000000..7c1fa061165
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/FieryHellhound.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class FieryHellhound extends mage.sets.magic2010.FieryHellhound {
+
+ public FieryHellhound(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 284;
+ this.expansionSetCode = "ORI";
+ }
+
+ public FieryHellhound(final FieryHellhound card) {
+ super(card);
+ }
+
+ @Override
+ public FieryHellhound copy() {
+ return new FieryHellhound(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/FleshToDust.java b/Mage.Sets/src/mage/sets/magicorigins/FleshToDust.java
new file mode 100644
index 00000000000..2c04313f824
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/FleshToDust.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class FleshToDust extends mage.sets.magic2015.FleshToDust {
+
+ public FleshToDust(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 280;
+ this.expansionSetCode = "ORI";
+ }
+
+ public FleshToDust(final FleshToDust card) {
+ super(card);
+ }
+
+ @Override
+ public FleshToDust copy() {
+ return new FleshToDust(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java
new file mode 100644
index 00000000000..67c718987ce
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/GideonBattleForged.java
@@ -0,0 +1,209 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.MageObjectReference;
+import mage.abilities.Ability;
+import mage.abilities.LoyaltyAbility;
+import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.RequirementEffect;
+import mage.abilities.effects.common.PreventAllDamageToSourceEffect;
+import mage.abilities.effects.common.UntapTargetEffect;
+import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
+import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.abilities.keyword.IndestructibleAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.TurnPhase;
+import mage.counters.CounterType;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.permanent.ControllerPredicate;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.game.permanent.token.Token;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class GideonBattleForged extends CardImpl {
+
+ private final static FilterCreaturePermanent filter = new FilterCreaturePermanent();
+
+ static {
+ filter.add(new ControllerPredicate(TargetController.OPPONENT));
+ }
+
+ public GideonBattleForged(UUID ownerId) {
+ super(ownerId, 23, "Gideon, Battle-Forged", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Gideon");
+
+ this.color.setWhite(true);
+
+ this.nightCard = true;
+ this.canTransform = true;
+
+ this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
+
+ // +2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.
+ LoyaltyAbility loyaltyAbility = new LoyaltyAbility(new GideonBattleForgedAttacksIfAbleTargetEffect(Duration.Custom), 2);
+ loyaltyAbility.addTarget(new TargetCreaturePermanent(0,1,filter, false));
+ this.addAbility(loyaltyAbility);
+
+ // +1: Until your next turn, target creature gains indestructible. Untap that creature.
+ Effect effect = new GainAbilityTargetEffect(IndestructibleAbility.getInstance(), Duration.UntilYourNextTurn);
+ effect.setText("Until your next turn, target creature gains indestructible");
+ loyaltyAbility = new LoyaltyAbility(effect, 1);
+ loyaltyAbility.addTarget(new TargetCreaturePermanent());
+ effect = new UntapTargetEffect();
+ effect.setText("Untap that creature");
+ loyaltyAbility.addEffect(effect);
+ this.addAbility(loyaltyAbility);
+
+ // 0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
+ LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonBattleForgedToken(), "planeswalker", Duration.EndOfTurn), 0);
+ effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
+ effect.setText("Prevent all damage that would be dealt to him this turn");
+ ability3.addEffect(effect);
+ this.addAbility(ability3);
+
+ }
+
+ public GideonBattleForged(final GideonBattleForged card) {
+ super(card);
+ }
+
+ @Override
+ public GideonBattleForged copy() {
+ return new GideonBattleForged(this);
+ }
+}
+
+class GideonBattleForgedToken extends Token {
+
+ public GideonBattleForgedToken() {
+ super("", "4/4 Human Soldier creature with indestructible");
+ cardType.add(CardType.CREATURE);
+ subtype.add("Human");
+ subtype.add("Soldier");
+ power = new MageInt(4);
+ toughness = new MageInt(4);
+ this.addAbility(IndestructibleAbility.getInstance());
+ }
+
+}
+
+class GideonBattleForgedAttacksIfAbleTargetEffect extends RequirementEffect {
+
+ int nextTurnTargetController = 0;
+ protected MageObjectReference targetPermanentReference;
+
+ public GideonBattleForgedAttacksIfAbleTargetEffect(Duration duration) {
+ super(duration);
+ staticText = "Up to one target creature an opponent controls attacks {this} during its controller's next turn if able";
+ }
+
+ public GideonBattleForgedAttacksIfAbleTargetEffect(final GideonBattleForgedAttacksIfAbleTargetEffect effect) {
+ super(effect);
+ this.nextTurnTargetController = effect.nextTurnTargetController;
+ this.targetPermanentReference = effect.targetPermanentReference;
+ }
+
+ @Override
+ public GideonBattleForgedAttacksIfAbleTargetEffect copy() {
+ return new GideonBattleForgedAttacksIfAbleTargetEffect(this);
+ }
+
+ @Override
+ public boolean isInactive(Ability source, Game game) {
+ if (targetPermanentReference == null) {
+ return true;
+ }
+ Permanent targetPermanent = targetPermanentReference.getPermanent(game);
+ if (targetPermanent == null) {
+ return true;
+ }
+ if (nextTurnTargetController == 0 && startingTurn != game.getTurnNum() && game.getActivePlayerId().equals(targetPermanent.getControllerId())) {
+ nextTurnTargetController = game.getTurnNum();
+ }
+ if (game.getPhase().getType() == TurnPhase.END && nextTurnTargetController > 0 && game.getTurnNum() > nextTurnTargetController) {
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public void init(Ability source, Game game) {
+ super.init(source, game);
+ if (getTargetPointer().getFirst(game, source) == null) {
+ discard();
+ } else {
+ targetPermanentReference = new MageObjectReference(getTargetPointer().getFirst(game, source), game);
+ }
+ }
+
+ @Override
+ public boolean applies(Permanent permanent, Ability source, Game game) {
+ if (permanent.getId().equals(getTargetPointer().getFirst(game, source))) {
+ if (game.getActivePlayerId().equals(permanent.getControllerId())) {
+ Permanent planeswalker = game.getPermanent(source.getSourceId());
+ if (planeswalker != null) {
+ return true;
+ } else {
+ discard();
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public UUID mustAttackDefender(Ability source, Game game) {
+ return source.getSourceId();
+ }
+
+ @Override
+ public boolean mustAttack(Game game) {
+ return true;
+ }
+
+ @Override
+ public boolean mustBlock(Game game) {
+ return false;
+ }
+
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.java
new file mode 100644
index 00000000000..6d2b6f15f2c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/GoldForgedSentinel.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class GoldForgedSentinel extends mage.sets.journeyintonyx.GoldForgedSentinel {
+
+ public GoldForgedSentinel(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 989;
+ this.expansionSetCode = "ORI";
+ }
+
+ public GoldForgedSentinel(final GoldForgedSentinel card) {
+ super(card);
+ }
+
+ @Override
+ public GoldForgedSentinel copy() {
+ return new GoldForgedSentinel(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java b/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java
new file mode 100644
index 00000000000..811fabbf54a
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/GraspOfTheHieromancer.java
@@ -0,0 +1,138 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.AttachEffect;
+import mage.abilities.effects.common.TapTargetEffect;
+import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
+import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.SetTargetPointer;
+import mage.constants.Zone;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.permanent.ControllerIdPredicate;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.target.TargetPermanent;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class GraspOfTheHieromancer extends CardImpl {
+
+ public GraspOfTheHieromancer(UUID ownerId) {
+ super(ownerId, 15, "Grasp of the Hieromancer", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Aura");
+
+ // Enchant creature
+ TargetPermanent auraTarget = new TargetCreaturePermanent();
+ this.getSpellAbility().addTarget(auraTarget);
+ this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
+ Ability ability = new EnchantAbility(auraTarget.getTargetName());
+ this.addAbility(ability);
+
+ // Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."
+ ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
+ Ability gainedAbility = new GraspOfTheHieromancerTriggeredAbility(new TapTargetEffect(), false);
+ gainedAbility.addTarget(new TargetCreaturePermanent(new FilterCreaturePermanent("creature defending player controls")));
+ Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
+ effect.setText("and has \"Whenever this creature attacks, tap target creature defending player controls.\"");
+ ability.addEffect(effect);
+ this.addAbility(ability);
+
+ }
+
+ public GraspOfTheHieromancer(final GraspOfTheHieromancer card) {
+ super(card);
+ }
+
+ @Override
+ public GraspOfTheHieromancer copy() {
+ return new GraspOfTheHieromancer(this);
+ }
+}
+
+class GraspOfTheHieromancerTriggeredAbility extends TriggeredAbilityImpl {
+
+
+
+ public GraspOfTheHieromancerTriggeredAbility(Effect effect, boolean optional) {
+ super(Zone.BATTLEFIELD, effect, optional);
+ }
+
+ public GraspOfTheHieromancerTriggeredAbility(final GraspOfTheHieromancerTriggeredAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.DECLARED_ATTACKERS;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ if (game.getCombat().getAttackers().contains(getSourceId()) ) {
+ UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
+ if (defendingPlayerId != null) {
+ this.getTargets().clear();
+ FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
+ UUID defenderId = game.getCombat().getDefenderId(getSourceId());
+ filter.add(new ControllerIdPredicate(defenderId));
+ TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
+ this.addTarget(target);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String getRule() {
+ return "Whenever {this} attacks, tap target creature defending player controls.";
+ }
+
+ @Override
+ public GraspOfTheHieromancerTriggeredAbility copy() {
+ return new GraspOfTheHieromancerTriggeredAbility(this);
+ }
+
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java b/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java
new file mode 100644
index 00000000000..5640bfc4bc4
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/HeavyInfantry.java
@@ -0,0 +1,77 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.TapTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.permanent.ControllerPredicate;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class HeavyInfantry extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature an opponent controls");
+
+ static {
+ filter.add(new ControllerPredicate(TargetController.OPPONENT));
+ }
+
+ public HeavyInfantry(UUID ownerId) {
+ super(ownerId, 18, "Heavy Infantry", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{W}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Human");
+ this.subtype.add("Soldier");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(4);
+
+ // When Heavy Infantry enters the battlefield, tap target creature an opponent controls.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new TapTargetEffect());
+ ability.addTarget(new TargetCreaturePermanent(filter));
+ this.addAbility(ability);
+ }
+
+ public HeavyInfantry(final HeavyInfantry card) {
+ super(card);
+ }
+
+ @Override
+ public HeavyInfantry copy() {
+ return new HeavyInfantry(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/HitchclawRecluse.java b/Mage.Sets/src/mage/sets/magicorigins/HitchclawRecluse.java
new file mode 100644
index 00000000000..23193c76d9b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/HitchclawRecluse.java
@@ -0,0 +1,62 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.keyword.ReachAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class HitchclawRecluse extends CardImpl {
+
+ public HitchclawRecluse(UUID ownerId) {
+ super(ownerId, 181, "Hitchclaw Recluse", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Spider");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(4);
+
+ // Reach
+ this.addAbility(ReachAbility.getInstance());
+ }
+
+ public HitchclawRecluse(final HitchclawRecluse card) {
+ super(card);
+ }
+
+ @Override
+ public HitchclawRecluse copy() {
+ return new HitchclawRecluse(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java
new file mode 100644
index 00000000000..43db2e99f16
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/HixusPrisonWarden.java
@@ -0,0 +1,159 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.MageObject;
+import mage.abilities.Ability;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.common.delayed.OnLeaveReturnExiledToBattlefieldAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
+import mage.abilities.effects.common.ExileTargetEffect;
+import mage.abilities.keyword.FlashAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.events.DamagedPlayerEvent;
+import mage.game.events.GameEvent;
+import mage.game.permanent.Permanent;
+import mage.target.targetpointer.FixedTarget;
+import mage.util.CardUtil;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class HixusPrisonWarden extends CardImpl {
+
+ public HixusPrisonWarden(UUID ownerId) {
+ super(ownerId, 19, "Hixus, Prison Warden", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
+ this.expansionSetCode = "ORI";
+ this.supertype.add("Legendary");
+ this.subtype.add("Human");
+ this.subtype.add("Soldier");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // Flash
+ this.addAbility(FlashAbility.getInstance());
+
+ // Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.
+ this.addAbility(new HixusPrisonWardenTriggeredAbility(new HixusPrisonWardenExileEffect()));
+ }
+
+ public HixusPrisonWarden(final HixusPrisonWarden card) {
+ super(card);
+ }
+
+ @Override
+ public HixusPrisonWarden copy() {
+ return new HixusPrisonWarden(this);
+ }
+}
+
+class HixusPrisonWardenTriggeredAbility extends TriggeredAbilityImpl {
+
+ public HixusPrisonWardenTriggeredAbility(Effect effect) {
+ super(Zone.BATTLEFIELD, effect);
+ this.addEffect(new CreateDelayedTriggeredAbilityEffect(new OnLeaveReturnExiledToBattlefieldAbility()));
+ }
+
+ public HixusPrisonWardenTriggeredAbility(final HixusPrisonWardenTriggeredAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public HixusPrisonWardenTriggeredAbility copy() {
+ return new HixusPrisonWardenTriggeredAbility(this);
+ }
+
+ @Override
+ public boolean checkInterveningIfClause(Game game) {
+ MageObject mageObject = getSourceObject(game);
+ return (mageObject instanceof Permanent) && ((Permanent)mageObject).getTurnsOnBattlefield() ==1;
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent sourcePermanent = game.getPermanent(event.getSourceId());
+ if (damageEvent.getPlayerId().equals(getControllerId()) &&
+ damageEvent.isCombatDamage() &&
+ sourcePermanent != null &&
+ sourcePermanent.getCardType().contains(CardType.CREATURE)) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(event.getSourceId()));
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public String getRule() {
+ return "Whenever a creature deals combat damage to you, if {this} entered the battlefield this turn, exile that creature until {this} leaves the battlefield.";
+ }
+
+}
+
+class HixusPrisonWardenExileEffect extends OneShotEffect {
+
+ public HixusPrisonWardenExileEffect() {
+ super(Outcome.Benefit);
+ this.staticText = "exile that creature until {this} leaves the battlefield";
+ }
+
+ public HixusPrisonWardenExileEffect(final HixusPrisonWardenExileEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public HixusPrisonWardenExileEffect copy() {
+ return new HixusPrisonWardenExileEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Permanent permanent = (Permanent) source.getSourceObjectIfItStillExists(game);
+ // If Prison Warden leaves the battlefield before its triggered ability resolves,
+ // the target creature won't be exiled.
+ if (permanent != null) {
+ return new ExileTargetEffect(CardUtil.getExileZoneId(game, source.getSourceId(), source.getSourceObjectZoneChangeCounter()), permanent.getIdName()).apply(game, source);
+ }
+ return false;
+ }
+}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/magicorigins/Hydrolash.java b/Mage.Sets/src/mage/sets/magicorigins/Hydrolash.java
new file mode 100644
index 00000000000..73e088a3dc6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/Hydrolash.java
@@ -0,0 +1,63 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.continuous.BoostAllEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.filter.common.FilterAttackingCreature;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Hydrolash extends CardImpl {
+
+ public Hydrolash(UUID ownerId) {
+ super(ownerId, 59, "Hydrolash", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{2}{U}");
+ this.expansionSetCode = "ORI";
+
+ // Attacking creatures get -2/-0 until end of turn.
+ this.getSpellAbility().addEffect(new BoostAllEffect(-2, 0, Duration.EndOfTurn, new FilterAttackingCreature(), false));
+ // Draw a card.
+ this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
+ }
+
+ public Hydrolash(final Hydrolash card) {
+ super(card);
+ }
+
+ @Override
+ public Hydrolash copy() {
+ return new Hydrolash(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/IntoTheVoid.java b/Mage.Sets/src/mage/sets/magicorigins/IntoTheVoid.java
new file mode 100644
index 00000000000..8f4a7129709
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/IntoTheVoid.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class IntoTheVoid extends mage.sets.avacynrestored.IntoTheVoid {
+
+ public IntoTheVoid(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 277;
+ this.expansionSetCode = "ORI";
+ }
+
+ public IntoTheVoid(final IntoTheVoid card) {
+ super(card);
+ }
+
+ @Override
+ public IntoTheVoid copy() {
+ return new IntoTheVoid(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.java
new file mode 100644
index 00000000000..4679bf67104
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/JayemdaeTome.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.magicorigins;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class JayemdaeTome extends mage.sets.tenthedition.JayemdaeTome {
+
+ public JayemdaeTome(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 988;
+ this.expansionSetCode = "ORI";
+ this.rarity = Rarity.UNCOMMON;
+ }
+
+ public JayemdaeTome(final JayemdaeTome card) {
+ super(card);
+ }
+
+ @Override
+ public JayemdaeTome copy() {
+ return new JayemdaeTome(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java b/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java
new file mode 100644
index 00000000000..0da1c307fc7
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/KytheonHeroOfAkros.java
@@ -0,0 +1,120 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.MageObjectReference;
+import mage.abilities.Ability;
+import mage.abilities.common.EndOfCombatTriggeredAbility;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.condition.Condition;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.decorator.ConditionalTriggeredAbility;
+import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
+import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender;
+import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
+import mage.abilities.keyword.IndestructibleAbility;
+import mage.abilities.keyword.TransformAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.watchers.common.AttackedThisCombatWatcher;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class KytheonHeroOfAkros extends CardImpl {
+
+ public KytheonHeroOfAkros(UUID ownerId) {
+ super(ownerId, 23, "Kytheon, Hero of Akros", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{W}");
+ this.expansionSetCode = "ORI";
+ this.supertype.add("Legendary");
+ this.subtype.add("Human");
+ this.subtype.add("Soldier");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ this.canTransform = true;
+ this.secondSideCard = new GideonBattleForged(ownerId);
+
+ // At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon,
+ // then return him to the battlefield transformed under his owner's control.
+ this.addAbility(new TransformAbility());
+ this.addAbility(new ConditionalTriggeredAbility(new EndOfCombatTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.MALE), false),
+ new KytheonHeroOfAkrosCondition(), "At end of combat, if {this} and at least two other creatures attacked this combat, exile {this}, " +
+ "then return him to the battlefield transformed under his owner's control."), new AttackedThisCombatWatcher());
+
+ // {2}{W}: Kytheon gains indestructible until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(IndestructibleAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl<>("{2}{W}")));
+
+ }
+
+ public KytheonHeroOfAkros(final KytheonHeroOfAkros card) {
+ super(card);
+ }
+
+ @Override
+ public KytheonHeroOfAkros copy() {
+ return new KytheonHeroOfAkros(this);
+ }
+}
+
+class KytheonHeroOfAkrosCondition implements Condition {
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Permanent sourceObject = game.getPermanent(source.getSourceId());
+ if (sourceObject != null) {
+ AttackedThisCombatWatcher watcher = (AttackedThisCombatWatcher) game.getState().getWatchers().get("AttackedThisCombat");
+ if (watcher != null) {
+ boolean sourceFound = false;
+ int number = 0;
+ for (MageObjectReference mor: watcher.getAttackedThisTurnCreatures()) {
+ if (mor.refersTo(sourceObject, game)) {
+ sourceFound = true;
+ } else {
+ number++;
+ }
+ }
+ return sourceFound && number >= 2;
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "if {this} and at least two other creatures attacked this combat";
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.java
new file mode 100644
index 00000000000..e4346108392
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/LeafGilder.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class LeafGilder extends mage.sets.lorwyn.LeafGilder {
+
+ public LeafGilder(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 987;
+ this.expansionSetCode = "ORI";
+ }
+
+ public LeafGilder(final LeafGilder card) {
+ super(card);
+ }
+
+ @Override
+ public LeafGilder copy() {
+ return new LeafGilder(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/LightningJavelin.java b/Mage.Sets/src/mage/sets/magicorigins/LightningJavelin.java
new file mode 100644
index 00000000000..f81246bc81b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/LightningJavelin.java
@@ -0,0 +1,63 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.effects.keyword.ScryEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreatureOrPlayer;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class LightningJavelin extends CardImpl {
+
+ public LightningJavelin(UUID ownerId) {
+ super(ownerId, 153, "Lightning Javelin", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}");
+ this.expansionSetCode = "ORI";
+
+ // Lightning Javelin deals 3 damage to target creature or player.
+ this.getSpellAbility().addEffect(new DamageTargetEffect(3));
+ this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
+ // Scry 1.
+ this.getSpellAbility().addEffect(new ScryEffect(1));
+ }
+
+ public LightningJavelin(final LightningJavelin card) {
+ super(card);
+ }
+
+ @Override
+ public LightningJavelin copy() {
+ return new LightningJavelin(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/MahamotiDjinn.java b/Mage.Sets/src/mage/sets/magicorigins/MahamotiDjinn.java
new file mode 100644
index 00000000000..b43f3266594
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/MahamotiDjinn.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MahamotiDjinn extends mage.sets.tenthedition.MahamotiDjinn {
+
+ public MahamotiDjinn(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 278;
+ this.expansionSetCode = "ORI";
+ }
+
+ public MahamotiDjinn(final MahamotiDjinn card) {
+ super(card);
+ }
+
+ @Override
+ public MahamotiDjinn copy() {
+ return new MahamotiDjinn(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/MantleOfWebs.java b/Mage.Sets/src/mage/sets/magicorigins/MantleOfWebs.java
new file mode 100644
index 00000000000..5cd47e569ba
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/MantleOfWebs.java
@@ -0,0 +1,82 @@
+/*
+ * 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.magicorigins;
+
+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.continuous.BoostEnchantedEffect;
+import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.abilities.keyword.ReachAbility;
+import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.TargetPermanent;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author emerald000
+ */
+public class MantleOfWebs extends CardImpl {
+
+ public MantleOfWebs(UUID ownerId) {
+ super(ownerId, 187, "Mantle of Webs", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Aura");
+
+ // Enchant creature
+ TargetPermanent auraTarget = new TargetCreaturePermanent();
+ this.getSpellAbility().addTarget(auraTarget);
+ this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
+ Ability ability = new EnchantAbility(auraTarget.getTargetName());
+ this.addAbility(ability);
+
+ // Enchanted creature gets +1/+3 and has reach.
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 3, Duration.WhileOnBattlefield)));
+ Effect effect = new GainAbilityAttachedEffect(ReachAbility.getInstance(), AttachmentType.AURA);
+ effect.setText("and has reach");
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, effect));
+ }
+
+ public MantleOfWebs(final MantleOfWebs card) {
+ super(card);
+ }
+
+ @Override
+ public MantleOfWebs copy() {
+ return new MantleOfWebs(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.java
new file mode 100644
index 00000000000..5aefd0e3821
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/MaritimeGuard.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MaritimeGuard extends mage.sets.magic2011.MaritimeGuard {
+
+ public MaritimeGuard(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 986;
+ this.expansionSetCode = "ORI";
+ }
+
+ public MaritimeGuard(final MaritimeGuard card) {
+ super(card);
+ }
+
+ @Override
+ public MaritimeGuard copy() {
+ return new MaritimeGuard(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.java
new file mode 100644
index 00000000000..2996f3fa423
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/Meteorite.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Meteorite extends mage.sets.magic2015.Meteorite {
+
+ public Meteorite(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 985;
+ this.expansionSetCode = "ORI";
+ }
+
+ public Meteorite(final Meteorite card) {
+ super(card);
+ }
+
+ @Override
+ public Meteorite copy() {
+ return new Meteorite(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.java
new file mode 100644
index 00000000000..3686162a484
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/MightyLeap.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MightyLeap extends mage.sets.magic2011.MightyLeap {
+
+ public MightyLeap(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 984;
+ this.expansionSetCode = "ORI";
+ }
+
+ public MightyLeap(final MightyLeap card) {
+ super(card);
+ }
+
+ @Override
+ public MightyLeap copy() {
+ return new MightyLeap(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/MindRot.java b/Mage.Sets/src/mage/sets/magicorigins/MindRot.java
new file mode 100644
index 00000000000..00bc85d1f7e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/MindRot.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MindRot extends mage.sets.tenthedition.MindRot {
+
+ public MindRot(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 281;
+ this.expansionSetCode = "ORI";
+ }
+
+ public MindRot(final MindRot card) {
+ super(card);
+ }
+
+ @Override
+ public MindRot copy() {
+ return new MindRot(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/Nightmare.java b/Mage.Sets/src/mage/sets/magicorigins/Nightmare.java
new file mode 100644
index 00000000000..66b16d06b81
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/Nightmare.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Nightmare extends mage.sets.tenthedition.Nightmare {
+
+ public Nightmare(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 282;
+ this.expansionSetCode = "ORI";
+ }
+
+ public Nightmare(final Nightmare card) {
+ super(card);
+ }
+
+ @Override
+ public Nightmare copy() {
+ return new Nightmare(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java b/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java
new file mode 100644
index 00000000000..ff93fac4615
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/NissaSageAnimist.java
@@ -0,0 +1,198 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.LoyaltyAbility;
+import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.effects.ContinuousEffectImpl;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.effects.common.UntapTargetEffect;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.SubLayer;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import mage.filter.common.FilterLandPermanent;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.game.permanent.token.Token;
+import mage.players.Player;
+import mage.target.common.TargetLandPermanent;
+
+/**
+ *
+ * @author emerald000
+ */
+public class NissaSageAnimist extends CardImpl {
+
+ public NissaSageAnimist(UUID ownerId) {
+ super(ownerId, 189, "Nissa, Sage Animist", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Nissa");
+ this.color.setGreen(true);
+
+ this.nightCard = true;
+ this.canTransform = true;
+
+ this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.LOYALTY.createInstance(3)), false));
+
+ // +1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.
+ this.addAbility(new LoyaltyAbility(new NissaSageAnimistPlusOneEffect(), 1));
+
+ // -2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.
+ this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new NissaSageAnimistToken()), -2));
+
+ // -7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.
+ Ability ability = new LoyaltyAbility(new UntapTargetEffect(), -7);
+ ability.addTarget(new TargetLandPermanent(0, 6, new FilterLandPermanent("lands"), false));
+ ability.addEffect(new NissaSageAnimistMinusSevenEffect());
+ this.addAbility(ability);
+ }
+
+ public NissaSageAnimist(final NissaSageAnimist card) {
+ super(card);
+ }
+
+ @Override
+ public NissaSageAnimist copy() {
+ return new NissaSageAnimist(this);
+ }
+}
+
+class NissaSageAnimistPlusOneEffect extends OneShotEffect {
+
+ NissaSageAnimistPlusOneEffect() {
+ super(Outcome.Benefit);
+ this.staticText = "Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.";
+ }
+
+ NissaSageAnimistPlusOneEffect(final NissaSageAnimistPlusOneEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public NissaSageAnimistPlusOneEffect copy() {
+ return new NissaSageAnimistPlusOneEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null && controller.getLibrary().size() > 0) {
+ Card card = controller.getLibrary().getFromTop(game);
+ if (card == null) {
+ return false;
+ }
+ CardsImpl cards = new CardsImpl();
+ cards.add(card);
+ controller.revealCards("Nissa, Sage Animist", cards, game);
+ if (card.getCardType().contains(CardType.LAND)) {
+ return controller.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId());
+ } else {
+ return controller.moveCards(card, Zone.LIBRARY, Zone.HAND, source, game);
+ }
+ }
+ return true;
+ }
+}
+
+class NissaSageAnimistToken extends Token {
+
+ NissaSageAnimistToken() {
+ super("Ashaya, the Awoken World", "legendary 4/4 green Elemental creature token named Ashaya, the Awoken World");
+ this.setOriginalExpansionSetCode("ORI");
+ this.getSupertype().add("Legendary");
+ this.getPower().initValue(4);
+ this.getToughness().initValue(4);
+ this.color.setGreen(true);
+ this.getSubtype().add("Elemental");
+ this.getCardType().add(CardType.CREATURE);
+ }
+}
+
+class NissaSageAnimistMinusSevenEffect extends ContinuousEffectImpl {
+
+ NissaSageAnimistMinusSevenEffect() {
+ super(Duration.EndOfGame, Outcome.BecomeCreature);
+ this.staticText = "They become 6/6 Elemental creatures. They're still lands";
+ }
+
+ NissaSageAnimistMinusSevenEffect(final NissaSageAnimistMinusSevenEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public NissaSageAnimistMinusSevenEffect copy() {
+ return new NissaSageAnimistMinusSevenEffect(this);
+ }
+
+ @Override
+ public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
+ for (UUID permanentId : this.getTargetPointer().getTargets(game, source)) {
+ Permanent permanent = game.getPermanent(permanentId);
+ if (permanent != null) {
+ switch (layer) {
+ case TypeChangingEffects_4:
+ if (!permanent.getCardType().contains(CardType.CREATURE)) {
+ permanent.getCardType().add(CardType.CREATURE);
+ }
+ if (!permanent.getSubtype().contains("Elemental")) {
+ permanent.getSubtype().add("Elemental");
+ }
+ break;
+ case PTChangingEffects_7:
+ if (sublayer == SubLayer.SetPT_7b) {
+ permanent.getToughness().setValue(6);
+ permanent.getPower().setValue(6);
+ }
+ }
+ }
+ }
+ return true;
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ return false;
+ }
+
+ @Override
+ public boolean hasLayer(Layer layer) {
+ return layer == Layer.TypeChangingEffects_4 || layer == Layer.PTChangingEffects_7;
+ }
+}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java
new file mode 100644
index 00000000000..439cf1fb125
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/NissaVastwoodSeer.java
@@ -0,0 +1,93 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition;
+import mage.abilities.condition.common.PermanentsOnTheBattlefieldCondition.CountType;
+import mage.abilities.decorator.ConditionalTriggeredAbility;
+import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect;
+import mage.abilities.effects.common.ExileAndReturnTransformedSourceEffect.Gender;
+import mage.abilities.effects.common.search.SearchLibraryPutInHandEffect;
+import mage.abilities.keyword.TransformAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.FilterCard;
+import mage.filter.common.FilterLandPermanent;
+import mage.filter.predicate.mageobject.SubtypePredicate;
+import mage.filter.predicate.mageobject.SupertypePredicate;
+import mage.target.common.TargetCardInLibrary;
+
+/**
+ *
+ * @author emerald000
+ */
+public class NissaVastwoodSeer extends CardImpl {
+
+ private static final FilterCard filter = new FilterCard("basic Forest card");
+ static {
+ filter.add(new SupertypePredicate("Basic"));
+ filter.add(new SubtypePredicate("Forest"));
+ }
+
+ public NissaVastwoodSeer(UUID ownerId) {
+ super(ownerId, 189, "Nissa, Vastwood Seer", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{2}{G}");
+ this.expansionSetCode = "ORI";
+ this.supertype.add("Legendary");
+ this.subtype.add("Elf");
+ this.subtype.add("Scout");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ this.canTransform = true;
+ this.secondSideCard = new NissaSageAnimist(ownerId);
+
+ // When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 1, filter), true, true), true));
+
+ // Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.
+ this.addAbility(new TransformAbility());
+ this.addAbility(new ConditionalTriggeredAbility(
+ new EntersBattlefieldControlledTriggeredAbility(new ExileAndReturnTransformedSourceEffect(Gender.FEMAL), new FilterLandPermanent()),
+ new PermanentsOnTheBattlefieldCondition(new FilterLandPermanent(), CountType.MORE_THAN, 6, true),
+ "Whenever a land enters the battlefield under your control, if you control seven or more lands, exile {this}, then return her to the battlefield transformed under her owner's control."));
+ }
+
+ public NissaVastwoodSeer(final NissaVastwoodSeer card) {
+ super(card);
+ }
+
+ @Override
+ public NissaVastwoodSeer copy() {
+ return new NissaVastwoodSeer(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java b/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java
new file mode 100644
index 00000000000..62aa3fc7883
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/PiaAndKiranNalaar.java
@@ -0,0 +1,95 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.SacrificeTargetCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.common.FilterControlledArtifactPermanent;
+import mage.game.permanent.token.Token;
+import mage.target.common.TargetControlledPermanent;
+import mage.target.common.TargetCreatureOrPlayer;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class PiaAndKiranNalaar extends CardImpl {
+
+ public PiaAndKiranNalaar(UUID ownerId) {
+ super(ownerId, 157, "Pia and Kiran Nalaar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
+ this.expansionSetCode = "ORI";
+ this.supertype.add("Legendary");
+ this.subtype.add("Human");
+ this.subtype.add("Artificer");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new CreateTokenEffect(new PiaAndKiranNalaarThopterToken(), 2)));
+
+ // {2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new ManaCostsImpl("{2}{R}"));
+ ability.addCost(new SacrificeTargetCost(new TargetControlledPermanent(1,1, new FilterControlledArtifactPermanent("an artifact"),true)));
+ ability.addTarget(new TargetCreatureOrPlayer());
+ this.addAbility(ability);
+ }
+
+ public PiaAndKiranNalaar(final PiaAndKiranNalaar card) {
+ super(card);
+ }
+
+ @Override
+ public PiaAndKiranNalaar copy() {
+ return new PiaAndKiranNalaar(this);
+ }
+}
+
+
+class PiaAndKiranNalaarThopterToken extends Token {
+ PiaAndKiranNalaarThopterToken() {
+ super("Thopter", "a 1/1 colorless Thopter artifact creature token with flying");
+ cardType.add(CardType.CREATURE);
+ cardType.add(CardType.ARTIFACT);
+ subtype.add("Thopter");
+ power = new MageInt(1);
+ toughness = new MageInt(1);
+ this.addAbility(FlyingAbility.getInstance());
+ }
+}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/magicorigins/Plummet.java b/Mage.Sets/src/mage/sets/magicorigins/Plummet.java
new file mode 100644
index 00000000000..656174705bc
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/Plummet.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class Plummet extends mage.sets.magic2011.Plummet {
+
+ public Plummet(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 286;
+ this.expansionSetCode = "ORI";
+ }
+
+ public Plummet(final Plummet card) {
+ super(card);
+ }
+
+ @Override
+ public Plummet copy() {
+ return new Plummet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/PrizedUnicorn.java b/Mage.Sets/src/mage/sets/magicorigins/PrizedUnicorn.java
new file mode 100644
index 00000000000..53404983129
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/PrizedUnicorn.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class PrizedUnicorn extends mage.sets.magic2010.PrizedUnicorn {
+
+ public PrizedUnicorn(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 287;
+ this.expansionSetCode = "ORI";
+ }
+
+ public PrizedUnicorn(final PrizedUnicorn card) {
+ super(card);
+ }
+
+ @Override
+ public PrizedUnicorn copy() {
+ return new PrizedUnicorn(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/RavagingBlaze.java b/Mage.Sets/src/mage/sets/magicorigins/RavagingBlaze.java
new file mode 100644
index 00000000000..15d9672c16f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/RavagingBlaze.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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.condition.common.SpellMasteryCondition;
+import mage.abilities.effects.OneShotEffect;
+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 RavagingBlaze extends CardImpl {
+
+ public RavagingBlaze(UUID ownerId) {
+ super(ownerId, 159, "Ravaging Blaze", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{X}{R}{R}");
+ this.expansionSetCode = "ORI";
+
+ // Ravaging Blaze deals X damage to target creature.
+ // Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.
+ this.getSpellAbility().addEffect(new RavagingBlazeEffect());
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent());
+ }
+
+ public RavagingBlaze(final RavagingBlaze card) {
+ super(card);
+ }
+
+ @Override
+ public RavagingBlaze copy() {
+ return new RavagingBlaze(this);
+ }
+}
+
+class RavagingBlazeEffect extends OneShotEffect {
+
+ public RavagingBlazeEffect() {
+ super(Outcome.Damage);
+ staticText = "{this} deals X damage to target creature.
"
+ + "Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, {this} also deals X damage to that creature's controller.";
+ }
+
+ public RavagingBlazeEffect(final RavagingBlazeEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public RavagingBlazeEffect copy() {
+ return new RavagingBlazeEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
+ if (permanent != null) {
+ int xValue = source.getManaCostsToPay().getX();
+ if (xValue > 0) {
+ permanent.damage(xValue, source.getSourceId(), game, false, true);
+ if (SpellMasteryCondition.getInstance().apply(game, source)) {
+ Player targetController = game.getPlayer(permanent.getControllerId());
+ if (targetController != null) {
+ targetController.damage(xValue, source.getSourceId(), game, false, true);
+ }
+ }
+ }
+ return true;
+ }
+ return false;
+ }
+
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/RingwardenOwl.java b/Mage.Sets/src/mage/sets/magicorigins/RingwardenOwl.java
new file mode 100644
index 00000000000..5f1b4be7822
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/RingwardenOwl.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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.keyword.FlyingAbility;
+import mage.abilities.keyword.ProwessAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class RingwardenOwl extends CardImpl {
+
+ public RingwardenOwl(UUID ownerId) {
+ super(ownerId, 68, "Ringwarden Owl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Bird");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(3);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // Prowess
+ this.addAbility(new ProwessAbility());
+ }
+
+ public RingwardenOwl(final RingwardenOwl card) {
+ super(card);
+ }
+
+ @Override
+ public RingwardenOwl copy() {
+ return new RingwardenOwl(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.java
new file mode 100644
index 00000000000..71446b0a5d9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/RunedServitor.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class RunedServitor extends mage.sets.riseoftheeldrazi.RunedServitor {
+
+ public RunedServitor(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 983;
+ this.expansionSetCode = "ORI";
+ }
+
+ public RunedServitor(final RunedServitor card) {
+ super(card);
+ }
+
+ @Override
+ public RunedServitor copy() {
+ return new RunedServitor(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.java
new file mode 100644
index 00000000000..f03d8afd2a5
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ScrapskinDrake.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ScrapskinDrake extends mage.sets.avacynrestored.ScrapskinDrake {
+
+ public ScrapskinDrake(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 982;
+ this.expansionSetCode = "ORI";
+ }
+
+ public ScrapskinDrake(final ScrapskinDrake card) {
+ super(card);
+ }
+
+ @Override
+ public ScrapskinDrake copy() {
+ return new ScrapskinDrake(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java
new file mode 100644
index 00000000000..3f67be9e03c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/SeismicElemental.java
@@ -0,0 +1,74 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.combat.CantBlockAllEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.AbilityPredicate;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SeismicElemental extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures without flying");
+
+ static {
+ filter.add(Predicates.not(new AbilityPredicate(FlyingAbility.class)));
+ }
+
+ public SeismicElemental(UUID ownerId) {
+ super(ownerId, 161, "Seismic Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Elemental");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // When Seismic Elemental enters the battlefield, creatures without flying can't block this turn.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new CantBlockAllEffect(filter, Duration.EndOfTurn), false));
+ }
+
+ public SeismicElemental(final SeismicElemental card) {
+ super(card);
+ }
+
+ @Override
+ public SeismicElemental copy() {
+ return new SeismicElemental(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/SengirVampire.java b/Mage.Sets/src/mage/sets/magicorigins/SengirVampire.java
new file mode 100644
index 00000000000..22738918ecb
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/SengirVampire.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.magicorigins;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SengirVampire extends mage.sets.tenthedition.SengirVampire {
+
+ public SengirVampire(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 283;
+ this.expansionSetCode = "ORI";
+ this.rarity = Rarity.UNCOMMON;
+ }
+
+ public SengirVampire(final SengirVampire card) {
+ super(card);
+ }
+
+ @Override
+ public SengirVampire copy() {
+ return new SengirVampire(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/SentinelOfTheEternalWatch.java b/Mage.Sets/src/mage/sets/magicorigins/SentinelOfTheEternalWatch.java
new file mode 100644
index 00000000000..7571edab198
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/SentinelOfTheEternalWatch.java
@@ -0,0 +1,98 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.BeginningOfCombatTriggeredAbility;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.common.TapTargetEffect;
+import mage.abilities.keyword.VigilanceAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.permanent.ControllerIdPredicate;
+import mage.game.Game;
+import mage.players.Player;
+import mage.target.Target;
+import mage.target.common.TargetCreaturePermanent;
+import mage.target.targetpointer.FirstTargetPointer;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SentinelOfTheEternalWatch extends CardImpl {
+
+ public SentinelOfTheEternalWatch(UUID ownerId) {
+ super(ownerId, 30, "Sentinel of the Eternal Watch", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{5}{W}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Giant");
+ this.subtype.add("Soldier");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(6);
+
+ // Vigilance
+ this.addAbility(VigilanceAbility.getInstance());
+ // At the beginning of combat on each opponent's turn, tap target creature that player controls.
+ this.addAbility(new BeginningOfCombatTriggeredAbility(Zone.BATTLEFIELD, new TapTargetEffect("target creature that player controls"), TargetController.OPPONENT, false, true));
+
+ }
+
+ public SentinelOfTheEternalWatch(final SentinelOfTheEternalWatch card) {
+ super(card);
+ }
+
+ @Override
+ public SentinelOfTheEternalWatch copy() {
+ return new SentinelOfTheEternalWatch(this);
+ }
+
+ @Override
+ public void adjustTargets(Ability ability, Game game) {
+ if (ability instanceof BeginningOfCombatTriggeredAbility) {
+ for (Effect effect: ability.getEffects()) {
+ UUID opponentId = effect.getTargetPointer().getFirst(game, ability);
+ Player opponent = game.getPlayer(opponentId);
+ if (opponent != null) {
+ effect.setTargetPointer(new FirstTargetPointer());
+ FilterCreaturePermanent filter = new FilterCreaturePermanent("a creature from the active opponent");
+ filter.add(new ControllerIdPredicate(opponentId));
+ Target target = new TargetCreaturePermanent(filter);
+ ability.addTarget(target);
+ }
+ }
+ }
+ }
+
+
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/SerraAngel.java b/Mage.Sets/src/mage/sets/magicorigins/SerraAngel.java
new file mode 100644
index 00000000000..66a988ea548
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/SerraAngel.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.magicorigins;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SerraAngel extends mage.sets.tenthedition.SerraAngel {
+
+ public SerraAngel(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 276;
+ this.expansionSetCode = "ORI";
+ this.rarity = Rarity.UNCOMMON;
+ }
+
+ public SerraAngel(final SerraAngel card) {
+ super(card);
+ }
+
+ @Override
+ public SerraAngel copy() {
+ return new SerraAngel(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ShivanDragon.java b/Mage.Sets/src/mage/sets/magicorigins/ShivanDragon.java
new file mode 100644
index 00000000000..8b8db501f71
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ShivanDragon.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ShivanDragon extends mage.sets.tenthedition.ShivanDragon {
+
+ public ShivanDragon(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 285;
+ this.expansionSetCode = "ORI";
+ }
+
+ public ShivanDragon(final ShivanDragon card) {
+ super(card);
+ }
+
+ @Override
+ public ShivanDragon copy() {
+ return new ShivanDragon(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/SubterraneanScout.java b/Mage.Sets/src/mage/sets/magicorigins/SubterraneanScout.java
new file mode 100644
index 00000000000..9604a67346d
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/SubterraneanScout.java
@@ -0,0 +1,78 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.combat.CantBeBlockedTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.Filter;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.mageobject.PowerPredicate;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class SubterraneanScout extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power 2 or less");
+
+ static {
+ filter.add(new PowerPredicate(Filter.ComparisonType.LessThan, 3));
+ }
+
+ public SubterraneanScout(UUID ownerId) {
+ super(ownerId, 164, "Subterranean Scout", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Goblin");
+ this.subtype.add("Scout");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // When Subterranean Scout enters the battlefield, target creature with power 2 or less can't be blocked this turn.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new CantBeBlockedTargetEffect(), false);
+ ability.addTarget(new TargetCreaturePermanent(filter));
+ this.addAbility(ability);
+
+ }
+
+ public SubterraneanScout(final SubterraneanScout card) {
+ super(card);
+ }
+
+ @Override
+ public SubterraneanScout copy() {
+ return new SubterraneanScout(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/TerraStomper.java b/Mage.Sets/src/mage/sets/magicorigins/TerraStomper.java
new file mode 100644
index 00000000000..ccc15798ad3
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/TerraStomper.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class TerraStomper extends mage.sets.zendikar.TerraStomper {
+
+ public TerraStomper(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 288;
+ this.expansionSetCode = "ORI";
+ }
+
+ public TerraStomper(final TerraStomper card) {
+ super(card);
+ }
+
+ @Override
+ public TerraStomper copy() {
+ return new TerraStomper(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.java
new file mode 100644
index 00000000000..0d1b8d2ffad
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/TitanicGrowth.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class TitanicGrowth extends mage.sets.magic2012.TitanicGrowth {
+
+ public TitanicGrowth(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 981;
+ this.expansionSetCode = "ORI";
+ }
+
+ public TitanicGrowth(final TitanicGrowth card) {
+ super(card);
+ }
+
+ @Override
+ public TitanicGrowth copy() {
+ return new TitanicGrowth(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.java
new file mode 100644
index 00000000000..a8cba796028
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/TitansStrength.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class TitansStrength extends mage.sets.theros.TitansStrength {
+
+ public TitansStrength(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 980;
+ this.expansionSetCode = "ORI";
+ }
+
+ public TitansStrength(final TitansStrength card) {
+ super(card);
+ }
+
+ @Override
+ public TitansStrength copy() {
+ return new TitansStrength(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.java
new file mode 100644
index 00000000000..a80343127c6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/TowerGeist.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class TowerGeist extends mage.sets.darkascension.TowerGeist {
+
+ public TowerGeist(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 979;
+ this.expansionSetCode = "ORI";
+ }
+
+ public TowerGeist(final TowerGeist card) {
+ super(card);
+ }
+
+ @Override
+ public TowerGeist copy() {
+ return new TowerGeist(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/ValorInAkros.java b/Mage.Sets/src/mage/sets/magicorigins/ValorInAkros.java
new file mode 100644
index 00000000000..82f5128b61c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/ValorInAkros.java
@@ -0,0 +1,60 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.common.CreatureEntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.continuous.BoostControlledEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class ValorInAkros extends CardImpl {
+
+ public ValorInAkros(UUID ownerId) {
+ super(ownerId, 39, "Valor in Akros", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
+ this.expansionSetCode = "ORI";
+
+ // Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.
+ this.addAbility(new CreatureEntersBattlefieldTriggeredAbility(new BoostControlledEffect(1,1,Duration.EndOfTurn)));
+ }
+
+ public ValorInAkros(final ValorInAkros card) {
+ super(card);
+ }
+
+ @Override
+ public ValorInAkros copy() {
+ return new ValorInAkros(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.java
new file mode 100644
index 00000000000..c0a4be303e3
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/VastwoodGorger.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class VastwoodGorger extends mage.sets.zendikar.VastwoodGorger {
+
+ public VastwoodGorger(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 978;
+ this.expansionSetCode = "ORI";
+ }
+
+ public VastwoodGorger(final VastwoodGorger card) {
+ super(card);
+ }
+
+ @Override
+ public VastwoodGorger copy() {
+ return new VastwoodGorger(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/VeteransSidearm.java b/Mage.Sets/src/mage/sets/magicorigins/VeteransSidearm.java
new file mode 100644
index 00000000000..554ce687644
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/VeteransSidearm.java
@@ -0,0 +1,67 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.costs.mana.GenericManaCost;
+import mage.abilities.effects.common.continuous.BoostEquippedEffect;
+import mage.abilities.keyword.EquipAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author emerald000
+ */
+public class VeteransSidearm extends CardImpl {
+
+ public VeteransSidearm(UUID ownerId) {
+ super(ownerId, 242, "Veteran's Sidearm", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Equipment");
+
+ // Equipped creature gets +1/+1.
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(1, 1)));
+
+ // Equip {1}
+ this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(1)));
+ }
+
+ public VeteransSidearm(final VeteransSidearm card) {
+ super(card);
+ }
+
+ @Override
+ public VeteransSidearm copy() {
+ return new VeteransSidearm(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/VolcanicRambler.java b/Mage.Sets/src/mage/sets/magicorigins/VolcanicRambler.java
new file mode 100644
index 00000000000..17361c9fc80
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/VolcanicRambler.java
@@ -0,0 +1,71 @@
+/*
+ * 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.magicorigins;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.TargetPlayer;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class VolcanicRambler extends CardImpl {
+
+ public VolcanicRambler(UUID ownerId) {
+ super(ownerId, 167, "Volcanic Rambler", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{5}{R}");
+ this.expansionSetCode = "ORI";
+ this.subtype.add("Elemental");
+ this.power = new MageInt(6);
+ this.toughness = new MageInt(4);
+
+ // {2}{R}: Volcanic Rambler deals 1 damage to target player.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new ManaCostsImpl("{2}{R}"));
+ ability.addCost(new TapSourceCost());
+ ability.addTarget(new TargetPlayer());
+ this.addAbility(ability);
+ }
+
+ public VolcanicRambler(final VolcanicRambler card) {
+ super(card);
+ }
+
+ @Override
+ public VolcanicRambler copy() {
+ return new VolcanicRambler(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/WeaveFate.java b/Mage.Sets/src/mage/sets/magicorigins/WeaveFate.java
new file mode 100644
index 00000000000..88eef44bb47
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/WeaveFate.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class WeaveFate extends mage.sets.khansoftarkir.WeaveFate {
+
+ public WeaveFate(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 279;
+ this.expansionSetCode = "ORI";
+ }
+
+ public WeaveFate(final WeaveFate card) {
+ super(card);
+ }
+
+ @Override
+ public WeaveFate copy() {
+ return new WeaveFate(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.java
new file mode 100644
index 00000000000..19b5635b498
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/WeightOfTheUnderworld.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class WeightOfTheUnderworld extends mage.sets.bornofthegods.WeightOfTheUnderworld {
+
+ public WeightOfTheUnderworld(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 977;
+ this.expansionSetCode = "ORI";
+ }
+
+ public WeightOfTheUnderworld(final WeightOfTheUnderworld card) {
+ super(card);
+ }
+
+ @Override
+ public WeightOfTheUnderworld copy() {
+ return new WeightOfTheUnderworld(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.java
new file mode 100644
index 00000000000..3eadb733209
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/YevasForcemage.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class YevasForcemage extends mage.sets.magic2013.YevasForcemage {
+
+ public YevasForcemage(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 976;
+ this.expansionSetCode = "ORI";
+ }
+
+ public YevasForcemage(final YevasForcemage card) {
+ super(card);
+ }
+
+ @Override
+ public YevasForcemage copy() {
+ return new YevasForcemage(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.java
new file mode 100644
index 00000000000..24dd1b11194
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/magicorigins/YokedOx.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.magicorigins;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class YokedOx extends mage.sets.theros.YokedOx {
+
+ public YokedOx(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 975;
+ this.expansionSetCode = "ORI";
+ }
+
+ public YokedOx(final YokedOx card) {
+ super(card);
+ }
+
+ @Override
+ public YokedOx copy() {
+ return new YokedOx(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mastersedition/ErgRaiders.java b/Mage.Sets/src/mage/sets/mastersedition/ErgRaiders.java
new file mode 100644
index 00000000000..854f83d1a03
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mastersedition/ErgRaiders.java
@@ -0,0 +1,53 @@
+/*
+ * 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.mastersedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders {
+
+ public ErgRaiders(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 68;
+ this.expansionSetCode = "MED";
+ }
+
+ public ErgRaiders(final ErgRaiders card) {
+ super(card);
+ }
+
+ @Override
+ public ErgRaiders copy() {
+ return new ErgRaiders(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java b/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java
index cc7ebcd2527..dd707a170d4 100644
--- a/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java
+++ b/Mage.Sets/src/mage/sets/mastersedition/Forcefield.java
@@ -28,6 +28,7 @@
package mage.sets.mastersedition;
import java.util.UUID;
+import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.GenericManaCost;
@@ -45,6 +46,7 @@ import mage.filter.predicate.permanent.UnblockedPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
+import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
@@ -98,9 +100,14 @@ class ForcefieldEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
- if (controller != null) {
+ MageObject sourceObject = source.getSourceObject(game);
+ if (controller != null && sourceObject != null) {
Target target = new TargetCreaturePermanent(1, 1, filter, true);
if (controller.choose(Outcome.PreventDamage, target, source.getSourceId(), game)) {
+ Permanent creature = game.getPermanent(target.getFirstTarget());
+ if (creature != null) {
+ game.informPlayers(sourceObject.getLogName() + ": " + controller.getLogName() + " has chosen " + creature.getLogName());
+ }
ContinuousEffect effect = new ForcefieldPreventionEffect();
effect.setTargetPointer(new FixedTarget(target.getFirstTarget()));
game.addEffect(effect, source);
diff --git a/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java b/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java
index 1d8d6d5d373..21e4af02e9f 100644
--- a/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java
+++ b/Mage.Sets/src/mage/sets/mastersedition/HymnToTourach.java
@@ -34,7 +34,7 @@ import mage.constants.Rarity;
*
* @author LevelX2
*/
-public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach {
+public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach1 {
public HymnToTourach(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/mastersedition/Onulet.java b/Mage.Sets/src/mage/sets/mastersedition/Onulet.java
new file mode 100644
index 00000000000..26d81b2f413
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mastersedition/Onulet.java
@@ -0,0 +1,63 @@
+/*
+ * 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.mastersedition;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.DiesTriggeredAbility;
+import mage.abilities.effects.common.GainLifeEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class Onulet extends CardImpl {
+
+ public Onulet(UUID ownerId) {
+ super(ownerId, 161, "Onulet", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
+ this.expansionSetCode = "MED";
+ this.subtype.add("Construct");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // When Onulet dies, you gain 2 life.
+ this.addAbility(new DiesTriggeredAbility(new GainLifeEffect(2)));
+ }
+
+ public Onulet(final Onulet card) {
+ super(card);
+ }
+
+ @Override
+ public Onulet copy() {
+ return new Onulet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mastersedition/OrderOfLeitbur.java b/Mage.Sets/src/mage/sets/mastersedition/OrderOfLeitbur.java
new file mode 100644
index 00000000000..fae1e77830f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mastersedition/OrderOfLeitbur.java
@@ -0,0 +1,87 @@
+/*
+ * 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.mastersedition;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.ObjectColor;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
+import mage.abilities.keyword.FirstStrikeAbility;
+import mage.abilities.keyword.ProtectionAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.ColorPredicate;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfLeitbur extends CardImpl {
+
+ private static final FilterCard filter = new FilterCard("Black");
+
+ static {
+ filter.add(new ColorPredicate(ObjectColor.BLACK));
+ }
+
+ public OrderOfLeitbur(UUID ownerId) {
+ super(ownerId, 22, "Order of Leitbur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{W}{W}");
+ this.expansionSetCode = "MED";
+ this.subtype.add("Human");
+ this.subtype.add("Cleric");
+ this.subtype.add("Knight");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Protection from black
+ this.addAbility(new ProtectionAbility(filter));
+
+ // {W}: Order of Leitbur gains first strike until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{W}")));
+
+ // {W}{W}: Order of Leitbur gets +1/+0 until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{W}{W}")));
+ }
+
+ public OrderOfLeitbur(final OrderOfLeitbur card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfLeitbur copy() {
+ return new OrderOfLeitbur(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mastersedition/OrderOfTheEbonHand.java b/Mage.Sets/src/mage/sets/mastersedition/OrderOfTheEbonHand.java
new file mode 100644
index 00000000000..2bbbd28ddca
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mastersedition/OrderOfTheEbonHand.java
@@ -0,0 +1,86 @@
+/*
+ * 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.mastersedition;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.ObjectColor;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
+import mage.abilities.keyword.FirstStrikeAbility;
+import mage.abilities.keyword.ProtectionAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.ColorPredicate;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfTheEbonHand extends CardImpl {
+
+ private static final FilterCard filter = new FilterCard("White");
+
+ static {
+ filter.add(new ColorPredicate(ObjectColor.WHITE));
+ }
+
+ public OrderOfTheEbonHand(UUID ownerId) {
+ super(ownerId, 78, "Order of the Ebon Hand", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}");
+ this.expansionSetCode = "MED";
+ this.subtype.add("Cleric");
+ this.subtype.add("Knight");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Protection from white
+ this.addAbility(new ProtectionAbility(filter));
+
+ // {B}: Order of the Ebon Hand gains first strike until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{B}")));
+
+ // {B}{B}: Order of the Ebon Hand gets +1/+0 until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{B}{B}")));
+ }
+
+ public OrderOfTheEbonHand(final OrderOfTheEbonHand card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfTheEbonHand copy() {
+ return new OrderOfTheEbonHand(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mastersedition/YavimayaAnts.java b/Mage.Sets/src/mage/sets/mastersedition/YavimayaAnts.java
new file mode 100644
index 00000000000..d91f842e169
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mastersedition/YavimayaAnts.java
@@ -0,0 +1,53 @@
+/*
+ * 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.mastersedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class YavimayaAnts extends mage.sets.alliances.YavimayaAnts {
+
+ public YavimayaAnts(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 140;
+ this.expansionSetCode = "MED";
+ }
+
+ public YavimayaAnts(final YavimayaAnts card) {
+ super(card);
+ }
+
+ @Override
+ public YavimayaAnts copy() {
+ return new YavimayaAnts(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java b/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java
new file mode 100644
index 00000000000..b9214d5aa2a
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditionii/Errantry.java
@@ -0,0 +1,83 @@
+/*
+ * 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.masterseditionii;
+
+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.continuous.BoostEnchantedEffect;
+import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
+import mage.abilities.keyword.CanAttackOnlyAloneAbility;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.TargetPermanent;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Errantry extends CardImpl {
+
+ public Errantry(UUID ownerId) {
+ super(ownerId, 124, "Errantry", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}");
+ this.expansionSetCode = "ME2";
+ this.subtype.add("Aura");
+
+ // Enchant creature
+ TargetPermanent auraTarget = new TargetCreaturePermanent();
+ this.getSpellAbility().addTarget(auraTarget);
+ this.getSpellAbility().addEffect(new AttachEffect(Outcome.Benefit));
+ Ability ability = new EnchantAbility(auraTarget.getTargetName());
+ this.addAbility(ability);
+ // Enchanted creature gets +3/+0 and can only attack alone.
+ ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(3, 0, Duration.WhileOnBattlefield));
+ Effect effect = new GainAbilityAttachedEffect(CanAttackOnlyAloneAbility.getInstance(), AttachmentType.AURA);
+ effect.setText("and can only attack alone.");
+ ability.addEffect(effect);
+ this.addAbility(ability);
+ }
+
+ public Errantry(final Errantry card) {
+ super(card);
+ }
+
+ @Override
+ public Errantry copy() {
+ return new Errantry(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java
index cd8d2c60232..5df5c74144e 100644
--- a/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java
+++ b/Mage.Sets/src/mage/sets/masterseditionii/IcatianJavelineers.java
@@ -33,7 +33,7 @@ import java.util.UUID;
*
* @author LevelX2
*/
-public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers {
+public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 {
public IcatianJavelineers(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/masterseditionii/KnightOfStromgald.java b/Mage.Sets/src/mage/sets/masterseditionii/KnightOfStromgald.java
new file mode 100644
index 00000000000..221d23aee70
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditionii/KnightOfStromgald.java
@@ -0,0 +1,53 @@
+/*
+ * 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.masterseditionii;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class KnightOfStromgald extends mage.sets.iceage.KnightOfStromgald {
+
+ public KnightOfStromgald(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 99;
+ this.expansionSetCode = "ME2";
+ }
+
+ public KnightOfStromgald(final KnightOfStromgald card) {
+ super(card);
+ }
+
+ @Override
+ public KnightOfStromgald copy() {
+ return new KnightOfStromgald(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java b/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java
index bfd1a3da304..17998657fbb 100644
--- a/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java
+++ b/Mage.Sets/src/mage/sets/masterseditionii/NightSoil.java
@@ -34,7 +34,7 @@ import mage.constants.Rarity;
*
* @author LevelX2
*/
-public class NightSoil extends mage.sets.fallenempires.NightSoil {
+public class NightSoil extends mage.sets.fallenempires.NightSoil1 {
public NightSoil(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/masterseditionii/OrcishCannoneers.java b/Mage.Sets/src/mage/sets/masterseditionii/OrcishCannoneers.java
new file mode 100644
index 00000000000..ad2ace68f89
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditionii/OrcishCannoneers.java
@@ -0,0 +1,53 @@
+/*
+ * 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.masterseditionii;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrcishCannoneers extends mage.sets.iceage.OrcishCannoneers {
+
+ public OrcishCannoneers(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 138;
+ this.expansionSetCode = "ME2";
+ }
+
+ public OrcishCannoneers(final OrcishCannoneers card) {
+ super(card);
+ }
+
+ @Override
+ public OrcishCannoneers copy() {
+ return new OrcishCannoneers(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditionii/OrderOfTheWhiteShield.java b/Mage.Sets/src/mage/sets/masterseditionii/OrderOfTheWhiteShield.java
new file mode 100644
index 00000000000..0f056198a83
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditionii/OrderOfTheWhiteShield.java
@@ -0,0 +1,53 @@
+/*
+ * 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.masterseditionii;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OrderOfTheWhiteShield extends mage.sets.iceage.OrderOfTheWhiteShield {
+
+ public OrderOfTheWhiteShield(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 26;
+ this.expansionSetCode = "ME2";
+ }
+
+ public OrderOfTheWhiteShield(final OrderOfTheWhiteShield card) {
+ super(card);
+ }
+
+ @Override
+ public OrderOfTheWhiteShield copy() {
+ return new OrderOfTheWhiteShield(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditionii/SoldeviSimulacrum.java b/Mage.Sets/src/mage/sets/masterseditionii/SoldeviSimulacrum.java
new file mode 100644
index 00000000000..9dd318919b9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditionii/SoldeviSimulacrum.java
@@ -0,0 +1,70 @@
+/*
+ * 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.masterseditionii;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.abilities.keyword.CumulativeUpkeepAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SoldeviSimulacrum extends CardImpl {
+
+ public SoldeviSimulacrum(UUID ownerId) {
+ super(ownerId, 222, "Soldevi Simulacrum", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}");
+ this.expansionSetCode = "ME2";
+ this.subtype.add("Soldier");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(4);
+
+ // Cumulative upkeep {1}
+ this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
+ // {1}: Soldevi Simulacrum gets +1/+0 until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1,0, Duration.EndOfTurn), new ManaCostsImpl("{1}")));
+ }
+
+ public SoldeviSimulacrum(final SoldeviSimulacrum card) {
+ super(card);
+ }
+
+ @Override
+ public SoldeviSimulacrum copy() {
+ return new SoldeviSimulacrum(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/FireAmbush.java b/Mage.Sets/src/mage/sets/masterseditioniii/FireAmbush.java
new file mode 100644
index 00000000000..20a2913cdb7
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniii/FireAmbush.java
@@ -0,0 +1,53 @@
+/*
+ * 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.masterseditioniii;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FireAmbush extends mage.sets.portalthreekingdoms.FireAmbush {
+
+ public FireAmbush(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 97;
+ this.expansionSetCode = "ME3";
+ }
+
+ public FireAmbush(final FireAmbush card) {
+ super(card);
+ }
+
+ @Override
+ public FireAmbush copy() {
+ return new FireAmbush(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniii/JungleLion.java b/Mage.Sets/src/mage/sets/masterseditioniii/JungleLion.java
new file mode 100644
index 00000000000..3dee958c18a
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniii/JungleLion.java
@@ -0,0 +1,53 @@
+/*
+ * 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.masterseditioniii;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class JungleLion extends mage.sets.portal.JungleLion {
+
+ public JungleLion(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 125;
+ this.expansionSetCode = "ME3";
+ }
+
+ public JungleLion(final JungleLion card) {
+ super(card);
+ }
+
+ @Override
+ public JungleLion copy() {
+ return new JungleLion(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java b/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.java
new file mode 100644
index 00000000000..3364fb827a9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/AcidRain.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.masterseditioniv;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class AcidRain extends mage.sets.legends.AcidRain {
+
+ public AcidRain(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 36;
+ this.expansionSetCode = "ME4";
+ }
+
+ public AcidRain(final AcidRain card) {
+ super(card);
+ }
+
+ @Override
+ public AcidRain copy() {
+ return new AcidRain(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java b/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.java
new file mode 100644
index 00000000000..02f566a2eaa
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/AlluringScent.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.masterseditioniv;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class AlluringScent extends mage.sets.portal.AlluringScent {
+
+ public AlluringScent(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 141;
+ this.expansionSetCode = "ME4";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public AlluringScent(final AlluringScent card) {
+ super(card);
+ }
+
+ @Override
+ public AlluringScent copy() {
+ return new AlluringScent(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java b/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.java
new file mode 100644
index 00000000000..9aa50ac612f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/BeeSting.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.masterseditioniv;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class BeeSting extends mage.sets.portal.BeeSting {
+
+ public BeeSting(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 144;
+ this.expansionSetCode = "ME4";
+ }
+
+ public BeeSting(final BeeSting card) {
+ super(card);
+ }
+
+ @Override
+ public BeeSting copy() {
+ return new BeeSting(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java b/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.java
new file mode 100644
index 00000000000..88024ad7fc7
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/CitanulDruid.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.masterseditioniv;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class CitanulDruid extends mage.sets.antiquities.CitanulDruid {
+
+ public CitanulDruid(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 146;
+ this.expansionSetCode = "ME4";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public CitanulDruid(final CitanulDruid card) {
+ super(card);
+ }
+
+ @Override
+ public CitanulDruid copy() {
+ return new CitanulDruid(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java b/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java
new file mode 100644
index 00000000000..346ed2c10a1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/CloudDragon.java
@@ -0,0 +1,66 @@
+/*
+ * 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.masterseditioniv;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.CanBlockOnlyFlyingAbility;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class CloudDragon extends CardImpl {
+
+ public CloudDragon(UUID ownerId) {
+ super(ownerId, 41, "Cloud Dragon", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{U}");
+ this.expansionSetCode = "ME4";
+ this.subtype.add("Illusion");
+ this.subtype.add("Dragon");
+ this.power = new MageInt(5);
+ this.toughness = new MageInt(4);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // Cloud Dragon can block only creatures with flying.
+ this.addAbility(new CanBlockOnlyFlyingAbility());
+ }
+
+ public CloudDragon(final CloudDragon card) {
+ super(card);
+ }
+
+ @Override
+ public CloudDragon copy() {
+ return new CloudDragon(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/FireImp.java b/Mage.Sets/src/mage/sets/masterseditioniv/FireImp.java
new file mode 100644
index 00000000000..5a61e3c4634
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/FireImp.java
@@ -0,0 +1,53 @@
+/*
+ * 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.masterseditioniv;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FireImp extends mage.sets.portal.FireImp {
+
+ public FireImp(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 113;
+ this.expansionSetCode = "ME4";
+ }
+
+ public FireImp(final FireImp card) {
+ super(card);
+ }
+
+ @Override
+ public FireImp copy() {
+ return new FireImp(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java b/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.java
new file mode 100644
index 00000000000..0b5846ce451
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/FireTempest.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.masterseditioniv;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class FireTempest extends mage.sets.portal.FireTempest {
+
+ public FireTempest(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 114;
+ this.expansionSetCode = "ME4";
+ }
+
+ public FireTempest(final FireTempest card) {
+ super(card);
+ }
+
+ @Override
+ public FireTempest copy() {
+ return new FireTempest(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/HasranOgress.java b/Mage.Sets/src/mage/sets/masterseditioniv/HasranOgress.java
new file mode 100644
index 00000000000..f183ab6e5a5
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/HasranOgress.java
@@ -0,0 +1,103 @@
+/*
+ * 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.masterseditioniv;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.AttacksTriggeredAbility;
+import mage.abilities.costs.Cost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.OneShotEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.game.Game;
+import mage.players.Player;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class HasranOgress extends CardImpl {
+
+ public HasranOgress(UUID ownerId) {
+ super(ownerId, 86, "Hasran Ogress", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{B}");
+ this.expansionSetCode = "ME4";
+ this.subtype.add("Ogre");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(2);
+
+ // Whenever Hasran Ogress attacks, it deals 3 damage to you unless you pay {2}.
+ this.addAbility(new AttacksTriggeredAbility(new HasranOgressEffect(), false));
+ }
+
+ public HasranOgress(final HasranOgress card) {
+ super(card);
+ }
+
+ @Override
+ public HasranOgress copy() {
+ return new HasranOgress(this);
+ }
+}
+
+class HasranOgressEffect extends OneShotEffect {
+
+ public HasranOgressEffect() {
+ super(Outcome.Damage);
+ this.staticText = "{this} deals 3 damage to you unless you pay {2}";
+ }
+
+ public HasranOgressEffect(final HasranOgressEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public HasranOgressEffect copy() {
+ return new HasranOgressEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ Cost cost = new ManaCostsImpl("{2}");
+ String message = "Would you like to pay {2} to prevent taking 3 damage from Hasran Ogress?";
+ if (!(controller.chooseUse(Outcome.Benefit, message, game)
+ && cost.pay(source, game, source.getSourceId(), controller.getId(), false))) {
+ controller.damage(3, source.getSourceId(), game, false, true);
+ }
+ return true;
+ }
+ return false;
+ }
+}
+
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java b/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.java
new file mode 100644
index 00000000000..0b311293e79
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/HornOfDeafening.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.masterseditioniv;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class HornOfDeafening extends mage.sets.legends.HornOfDeafening {
+
+ public HornOfDeafening(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 205;
+ this.expansionSetCode = "ME4";
+ this.rarity = Rarity.UNCOMMON;
+ }
+
+ public HornOfDeafening(final HornOfDeafening card) {
+ super(card);
+ }
+
+ @Override
+ public HornOfDeafening copy() {
+ return new HornOfDeafening(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java b/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.java
new file mode 100644
index 00000000000..5c40de1cc18
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/IronhoofOx.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.masterseditioniv;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class IronhoofOx extends mage.sets.portalsecondage.IronhoofOx {
+
+ public IronhoofOx(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 158;
+ this.expansionSetCode = "ME4";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public IronhoofOx(final IronhoofOx card) {
+ super(card);
+ }
+
+ @Override
+ public IronhoofOx copy() {
+ return new IronhoofOx(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java b/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.java
new file mode 100644
index 00000000000..28e23ad688c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/LavaFlow.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.masterseditioniv;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class LavaFlow extends mage.sets.portal.LavaFlow {
+
+ public LavaFlow(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 126;
+ this.expansionSetCode = "ME4";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public LavaFlow(final LavaFlow card) {
+ super(card);
+ }
+
+ @Override
+ public LavaFlow copy() {
+ return new LavaFlow(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java b/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.java
new file mode 100644
index 00000000000..c60fa210652
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/Onulet.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.masterseditioniv;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class Onulet extends mage.sets.mastersedition.Onulet {
+
+ public Onulet(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 219;
+ this.expansionSetCode = "ME4";
+ }
+
+ public Onulet(final Onulet card) {
+ super(card);
+ }
+
+ @Override
+ public Onulet copy() {
+ return new Onulet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java b/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.java
new file mode 100644
index 00000000000..a0423b8bc0e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/PhantasmalForces.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.masterseditioniv;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {
+
+ public PhantasmalForces(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 55;
+ this.expansionSetCode = "ME4";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public PhantasmalForces(final PhantasmalForces card) {
+ super(card);
+ }
+
+ @Override
+ public PhantasmalForces copy() {
+ return new PhantasmalForces(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java b/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java
new file mode 100644
index 00000000000..bd09ae6f64b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/SedgeTroll.java
@@ -0,0 +1,77 @@
+/*
+ * 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.masterseditioniv;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.RegenerateSourceEffect;
+import mage.abilities.effects.common.continuous.BoostSourceWhileControlsEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterPermanent;
+import mage.filter.predicate.mageobject.SubtypePredicate;
+
+/**
+ *
+ * @author anonymous
+ */
+public class SedgeTroll extends CardImpl {
+
+ private static final FilterPermanent filter = new FilterPermanent("Swamp");
+
+ static {
+ filter.add(new SubtypePredicate("Swamp"));
+ }
+
+ public SedgeTroll(UUID ownerId) {
+ super(ownerId, 135, "Sedge Troll", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}");
+ this.expansionSetCode = "ME4";
+ this.subtype.add("Troll");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // Sedge Troll gets +1/+1 as long as you control a Swamp.
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceWhileControlsEffect(filter, 1, 1)));
+ // {B}: Regenerate Sedge Troll.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")));
+ }
+
+ public SedgeTroll(final SedgeTroll card) {
+ super(card);
+ }
+
+ @Override
+ public SedgeTroll copy() {
+ return new SedgeTroll(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java b/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.java
new file mode 100644
index 00000000000..466ff99dd01
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/SerraAviary.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.masterseditioniv;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class SerraAviary extends mage.sets.homelands.SerraAviary {
+
+ public SerraAviary(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 26;
+ this.expansionSetCode = "ME4";
+ this.rarity = Rarity.UNCOMMON;
+ }
+
+ public SerraAviary(final SerraAviary card) {
+ super(card);
+ }
+
+ @Override
+ public SerraAviary copy() {
+ return new SerraAviary(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java
new file mode 100644
index 00000000000..fd9f8cd3f42
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/masterseditioniv/StaffOfZegon.java
@@ -0,0 +1,68 @@
+/*
+ * 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.masterseditioniv;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author anonymous
+ */
+public class StaffOfZegon extends CardImpl {
+
+ public StaffOfZegon(UUID ownerId) {
+ super(ownerId, 229, "Staff of Zegon", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{4}");
+ this.expansionSetCode = "ME4";
+
+ // {3}, {tap}: Target creature gets -2/-0 until end of turn.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(-2, 0, Duration.EndOfTurn), new ManaCostsImpl("{3}"));
+ ability.addCost(new TapSourceCost());
+ ability.addTarget(new TargetCreaturePermanent());
+ this.addAbility(ability);
+ }
+
+ public StaffOfZegon(final StaffOfZegon card) {
+ super(card);
+ }
+
+ @Override
+ public StaffOfZegon copy() {
+ return new StaffOfZegon(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mediainserts/OgreArsonist.java b/Mage.Sets/src/mage/sets/mediainserts/OgreArsonist.java
new file mode 100644
index 00000000000..c832c8d75a3
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mediainserts/OgreArsonist.java
@@ -0,0 +1,55 @@
+/*
+ * 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.mediainserts;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OgreArsonist extends mage.sets.portalsecondage.OgreArsonist {
+
+ public OgreArsonist(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 63;
+ this.expansionSetCode = "MBP";
+ this.rarity = Rarity.SPECIAL;
+ }
+
+ public OgreArsonist(final OgreArsonist card) {
+ super(card);
+ }
+
+ @Override
+ public OgreArsonist copy() {
+ return new OgreArsonist(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java b/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java
index f8db6c978b8..0a4049322a7 100644
--- a/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/CausticWasps.java
@@ -92,10 +92,14 @@ class CausticWaspsTriggeredAbility extends TriggeredAbilityImpl {
return new CausticWaspsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
Player player = game.getPlayer(event.getTargetId());
if (player != null) {
FilterPermanent filter = new FilterPermanent("an artifact controlled by " + player.getLogName());
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java b/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java
index 4cd2a9a7d15..f36b5381410 100644
--- a/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/Larceny.java
@@ -28,17 +28,17 @@
package mage.sets.mercadianmasques;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -82,18 +82,21 @@ class LarcenyTriggeredAbility extends TriggeredAbilityImpl {
return new LarcenyTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if (((DamagedPlayerEvent) event).isCombatDamage()) {
- Permanent creature = game.getPermanent(event.getSourceId());
- if (creature != null && creature.getControllerId().equals(controllerId)) {
- for(Effect effect : this.getEffects())
- {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ if (((DamagedPlayerEvent) event).isCombatDamage()) {
+ Permanent creature = game.getPermanent(event.getSourceId());
+ if (creature != null && creature.getControllerId().equals(controllerId)) {
+ for(Effect effect : this.getEffects())
+ {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java b/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java
index 8cc87540cf4..da8e111ea6c 100644
--- a/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/NoblePurpose.java
@@ -37,6 +37,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -78,19 +79,24 @@ class NoblePurposeTriggeredAbility extends TriggeredAbilityImpl {
public NoblePurposeTriggeredAbility copy() {
return new NoblePurposeTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedEvent) {
- DamagedEvent damageEvent = (DamagedEvent) event;
- if (damageEvent.isCombatDamage()) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)
- && permanent.getControllerId().equals(this.getControllerId())) {
- this.getEffects().clear();
- this.getEffects().add(new GainLifeEffect(damageEvent.getAmount()));
- return true;
- }
+ DamagedEvent damageEvent = (DamagedEvent) event;
+ if (damageEvent.isCombatDamage()) {
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)
+ && permanent.getControllerId().equals(this.getControllerId())) {
+ this.getEffects().clear();
+ this.getEffects().add(new GainLifeEffect(damageEvent.getAmount()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java b/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java
index a068a919de1..b1845f275c5 100644
--- a/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/PiousWarrior.java
@@ -28,19 +28,19 @@
package mage.sets.mercadianmasques;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -88,10 +88,14 @@ class PiousWarriorTriggeredAbility extends TriggeredAbilityImpl {
return new PiousWarriorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)
- && ((DamagedCreatureEvent)event).isCombatDamage() ) {
+ if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent)event).isCombatDamage() ) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java b/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java
new file mode 100644
index 00000000000..7dea5c1fd8f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/PowerMatrix.java
@@ -0,0 +1,83 @@
+/*
+ * 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.mercadianmasques;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.effects.common.continuous.BoostTargetEffect;
+import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
+import mage.abilities.effects.Effect;
+import mage.abilities.keyword.FirstStrikeAbility;
+import mage.abilities.keyword.FlyingAbility;
+import mage.abilities.keyword.TrampleAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class PowerMatrix extends CardImpl {
+
+ public PowerMatrix(UUID ownerId) {
+ super(ownerId, 309, "Power Matrix", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
+ this.expansionSetCode = "MMQ";
+
+ // {tap}: Target creature gets +1/+1 and gains flying, first strike, and trample until end of turn.
+ Effect effect = new BoostTargetEffect(1, 1, Duration.EndOfTurn);
+ effect.setText("Target creature gets +1/+1");
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
+ effect = new GainAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn);
+ effect.setText("and gains flying");
+ ability.addEffect(effect);
+ effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
+ effect.setText(", first strike,");
+ ability.addEffect(effect);
+ effect = new GainAbilityTargetEffect(TrampleAbility.getInstance(), Duration.EndOfTurn);
+ effect.setText("and trample until end of turn.");
+ ability.addEffect(effect);
+ ability.addTarget(new TargetCreaturePermanent());
+ this.addAbility(ability);
+ }
+
+ public PowerMatrix(final PowerMatrix card) {
+ super(card);
+ }
+
+ @Override
+ public PowerMatrix copy() {
+ return new PowerMatrix(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java b/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java
new file mode 100644
index 00000000000..86d7afe6d90
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/SaberAnts.java
@@ -0,0 +1,98 @@
+/*
+ * 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.mercadianmasques;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.DealtDamageToSourceTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.permanent.token.InsectToken;
+import mage.players.Player;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SaberAnts extends CardImpl {
+
+ public SaberAnts(UUID ownerId) {
+ super(ownerId, 267, "Saber Ants", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}");
+ this.expansionSetCode = "MMQ";
+ this.subtype.add("Insect");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(3);
+
+ // Whenever Saber Ants is dealt damage, you may put that many 1/1 green Insect creature tokens onto the battlefield.
+ this.addAbility(new DealtDamageToSourceTriggeredAbility(Zone.BATTLEFIELD, new SaberAntsEffect(), true));
+ }
+
+ public SaberAnts(final SaberAnts card) {
+ super(card);
+ }
+
+ @Override
+ public SaberAnts copy() {
+ return new SaberAnts(this);
+ }
+}
+
+class SaberAntsEffect extends OneShotEffect {
+
+ public SaberAntsEffect() {
+ super(Outcome.Benefit);
+ this.staticText = "you may put that many 1/1 green Insect creature tokens onto the battlefield";
+ }
+
+ public SaberAntsEffect(final SaberAntsEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public SaberAntsEffect copy() {
+ return new SaberAntsEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
+ int damage = (Integer) this.getValue("damage");
+ return new CreateTokenEffect(new InsectToken(), damage).apply(game, source);
+ }
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mercadianmasques/ThrashingWumpus.java b/Mage.Sets/src/mage/sets/mercadianmasques/ThrashingWumpus.java
new file mode 100644
index 00000000000..ca9a4b4e971
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mercadianmasques/ThrashingWumpus.java
@@ -0,0 +1,66 @@
+/*
+ * 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.mercadianmasques;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.DamageEverythingEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class ThrashingWumpus extends CardImpl {
+
+ public ThrashingWumpus(UUID ownerId) {
+ super(ownerId, 166, "Thrashing Wumpus", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
+ this.expansionSetCode = "MMQ";
+ this.subtype.add("Beast");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(3);
+
+ // {B}: Thrashing Wumpus deals 1 damage to each creature and each player.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageEverythingEffect(1), new ManaCostsImpl("{B}")));
+ }
+
+ public ThrashingWumpus(final ThrashingWumpus card) {
+ super(card);
+ }
+
+ @Override
+ public ThrashingWumpus copy() {
+ return new ThrashingWumpus(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mirage/AmberPrison.java b/Mage.Sets/src/mage/sets/mirage/AmberPrison.java
index 1127a3244b4..502ac964fb9 100644
--- a/Mage.Sets/src/mage/sets/mirage/AmberPrison.java
+++ b/Mage.Sets/src/mage/sets/mirage/AmberPrison.java
@@ -48,6 +48,7 @@ import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@@ -177,11 +178,14 @@ class AmberPrisonUntapTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType().equals(GameEvent.EventType.UNTAP) && event.getTargetId().equals(this.getSourceId());
-
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UNTAP;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ return event.getTargetId().equals(this.getSourceId());
}
-
}
class AmberPrisonReleaseOnUntapEffect extends OneShotEffect {
diff --git a/Mage.Sets/src/mage/sets/mirage/HarbingerOfNight.java b/Mage.Sets/src/mage/sets/mirage/HarbingerOfNight.java
new file mode 100644
index 00000000000..fc31ace1c0c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mirage/HarbingerOfNight.java
@@ -0,0 +1,68 @@
+/*
+ * 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.mirage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.OnEventTriggeredAbility;
+import mage.abilities.effects.common.counter.AddCountersAllEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.counters.CounterType;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.game.events.GameEvent.EventType;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class HarbingerOfNight extends CardImpl {
+
+ public HarbingerOfNight(UUID ownerId) {
+ super(ownerId, 26, "Harbinger of Night", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
+ this.expansionSetCode = "MIR";
+ this.subtype.add("Spirit");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(3);
+
+ // At the beginning of your upkeep, put a -1/-1 counter on each creature.
+ this.addAbility(new OnEventTriggeredAbility(EventType.UPKEEP_STEP_PRE, "beginning of your upkeep",
+ new AddCountersAllEffect(CounterType.M1M1.createInstance(), new FilterCreaturePermanent()), false));
+ }
+
+ public HarbingerOfNight(final HarbingerOfNight card) {
+ super(card);
+ }
+
+ @Override
+ public HarbingerOfNight copy() {
+ return new HarbingerOfNight(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mirage/KaerveksTorch.java b/Mage.Sets/src/mage/sets/mirage/KaerveksTorch.java
new file mode 100644
index 00000000000..c9c1c4b1a28
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mirage/KaerveksTorch.java
@@ -0,0 +1,55 @@
+/*
+ * 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.mirage;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class KaerveksTorch extends mage.sets.vintagemasters.KaerveksTorch {
+
+ public KaerveksTorch(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 185;
+ this.expansionSetCode = "MIR";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public KaerveksTorch(final KaerveksTorch card) {
+ super(card);
+ }
+
+ @Override
+ public KaerveksTorch copy() {
+ return new KaerveksTorch(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java b/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java
index 6bed4e6f21d..66e96becae5 100644
--- a/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java
+++ b/Mage.Sets/src/mage/sets/mirage/RockBasilisk.java
@@ -28,21 +28,22 @@
package mage.sets.mirage;
import java.util.UUID;
-import mage.constants.Outcome;
-import mage.constants.Zone;
-import mage.abilities.effects.OneShotEffect;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
-import mage.cards.CardImpl;
/**
*
@@ -87,24 +88,26 @@ class RockBasiliskTriggeredAbility extends TriggeredAbilityImpl {
return new RockBasiliskTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent blocker = game.getPermanent(event.getSourceId());
- Permanent blocked = game.getPermanent(event.getTargetId());
- Permanent rockBasilisk = game.getPermanent(sourceId);
- if (blocker != null && blocker != rockBasilisk
- && !blocker.getSubtype().contains("Wall")
- && blocked == rockBasilisk) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
- return true;
- }
- if (blocker != null && blocker == rockBasilisk
- && !blocked.getSubtype().contains("Wall")) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
- return true;
- }
- return false;
+ Permanent blocker = game.getPermanent(event.getSourceId());
+ Permanent blocked = game.getPermanent(event.getTargetId());
+ Permanent rockBasilisk = game.getPermanent(sourceId);
+ if (blocker != null && blocker != rockBasilisk
+ && !blocker.getSubtype().contains("Wall")
+ && blocked == rockBasilisk) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
+ return true;
+ }
+ if (blocker != null && blocker == rockBasilisk
+ && !blocked.getSubtype().contains("Wall")) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/mirage/SewerRats.java b/Mage.Sets/src/mage/sets/mirage/SewerRats.java
new file mode 100644
index 00000000000..4422dd8667c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mirage/SewerRats.java
@@ -0,0 +1,71 @@
+/*
+ * 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.mirage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.LimitedTimesPerTurnActivatedAbility;
+import mage.abilities.costs.common.PayLifeCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SewerRats extends CardImpl {
+
+ public SewerRats(UUID ownerId) {
+ super(ownerId, 37, "Sewer Rats", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}");
+ this.expansionSetCode = "MIR";
+ this.subtype.add("Rat");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(1);
+
+ // {B}, Pay 1 life: Sewer Rats gets +1/+0 until end of turn. Activate this ability no more than three times each turn.
+ Ability ability = new LimitedTimesPerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{B}"), 3);
+ ability.addCost(new PayLifeCost(1));
+ this.addAbility(ability);
+ }
+
+ public SewerRats(final SewerRats card) {
+ super(card);
+ }
+
+ @Override
+ public SewerRats copy() {
+ return new SewerRats(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java b/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java
index 4761b1ac579..896454e6952 100644
--- a/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java
+++ b/Mage.Sets/src/mage/sets/mirrodin/BansheesBlade.java
@@ -44,6 +44,7 @@ import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -95,6 +96,14 @@ class BansheesBladeAbility extends TriggeredAbilityImpl {
return new BansheesBladeAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLANESWALKER
+ || event.getType() == EventType.COMBAT_DAMAGE_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event instanceof DamagedEvent && ((DamagedEvent) event).isCombatDamage() && !usedInPhase) {
diff --git a/Mage.Sets/src/mage/sets/mirrodin/BetrayalOfFlesh.java b/Mage.Sets/src/mage/sets/mirrodin/BetrayalOfFlesh.java
new file mode 100644
index 00000000000..b947a3451f1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mirrodin/BetrayalOfFlesh.java
@@ -0,0 +1,80 @@
+/*
+ * 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.mirrodin;
+
+import java.util.UUID;
+import mage.abilities.Mode;
+import mage.abilities.costs.common.SacrificeTargetCost;
+import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
+import mage.abilities.keyword.EntwineAbility;
+import mage.abilities.keyword.EntwineAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.common.FilterControlledLandPermanent;
+import mage.filter.common.FilterCreatureCard;
+import mage.target.common.TargetCardInYourGraveyard;
+import mage.target.common.TargetControlledPermanent;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class BetrayalOfFlesh extends CardImpl {
+
+ public BetrayalOfFlesh(UUID ownerId) {
+ super(ownerId, 58, "Betrayal of Flesh", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{5}{B}");
+ this.expansionSetCode = "MRD";
+
+ // Choose one -
+ this.getSpellAbility().getModes().setMinModes(1);
+ this.getSpellAbility().getModes().setMaxModes(1);
+ // Destroy target creature;
+ this.getSpellAbility().addEffect(new DestroyTargetEffect());
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent());
+ // or return target creature card from your graveyard to the battlefield.
+ Mode mode = new Mode();
+ mode.getEffects().add(new ReturnFromGraveyardToBattlefieldTargetEffect());
+ mode.getTargets().add(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
+ this.getSpellAbility().getModes().addMode(mode);
+ // Entwine-Sacrifice three lands.
+ this.addAbility(new EntwineAbility(new SacrificeTargetCost(new TargetControlledPermanent(3, 3, new FilterControlledLandPermanent(), true))));
+ }
+
+ public BetrayalOfFlesh(final BetrayalOfFlesh card) {
+ super(card);
+ }
+
+ @Override
+ public BetrayalOfFlesh copy() {
+ return new BetrayalOfFlesh(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java b/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java
index 862ed867526..f8f27d33be2 100644
--- a/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java
+++ b/Mage.Sets/src/mage/sets/mirrodin/Glimmervoid.java
@@ -28,17 +28,17 @@
package mage.sets.mirrodin;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.mana.AnyColorManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterArtifactPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -81,19 +81,22 @@ class GlimmervoidTriggeredAbility extends TriggeredAbilityImpl {
return new GlimmervoidTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) {
- FilterArtifactPermanent filter = new FilterArtifactPermanent();
- if (!game.getBattlefield().contains(filter, controllerId, 1, game)) {
- return true;
- }
+ FilterArtifactPermanent filter = new FilterArtifactPermanent();
+ if (!game.getBattlefield().contains(filter, controllerId, 1, game)) {
+ return true;
}
return false;
}
@Override
public String getRule() {
- return "At the beginning of the end step, if you control no Artifacts, sacrifice {this}.";
+ return "At the beginning of the end step, if you control no artifacts, sacrifice {this}.";
}
}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/LivingHive.java b/Mage.Sets/src/mage/sets/mirrodin/LivingHive.java
new file mode 100644
index 00000000000..d2e38bc750b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/mirrodin/LivingHive.java
@@ -0,0 +1,103 @@
+/*
+ * 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.mirrodin;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.keyword.TrampleAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.game.Game;
+import mage.game.permanent.token.InsectToken;
+import mage.players.Player;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class LivingHive extends CardImpl {
+
+ public LivingHive(UUID ownerId) {
+ super(ownerId, 124, "Living Hive", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{6}{G}{G}");
+ this.expansionSetCode = "MRD";
+ this.subtype.add("Elemental");
+ this.subtype.add("Insect");
+ this.power = new MageInt(6);
+ this.toughness = new MageInt(6);
+
+ // Trample
+ this.addAbility(TrampleAbility.getInstance());
+ // Whenever Living Hive deals combat damage to a player, put that many 1/1 green Insect creature tokens onto the battlefield.
+ this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new LivingHiveEffect(), false, true));
+ }
+
+ public LivingHive(final LivingHive card) {
+ super(card);
+ }
+
+ @Override
+ public LivingHive copy() {
+ return new LivingHive(this);
+ }
+}
+
+class LivingHiveEffect extends OneShotEffect {
+
+ public LivingHiveEffect() {
+ super(Outcome.PutCreatureInPlay);
+ this.staticText = "put that many 1/1 green Insect creature tokens onto the battlefield";
+ }
+
+ public LivingHiveEffect(final LivingHiveEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public LivingHiveEffect copy() {
+ return new LivingHiveEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player player = game.getPlayer(targetPointer.getFirst(game, source));
+ if (player != null) {
+ int amount = (Integer)getValue("damage");
+ if (amount > 0) {
+ return new CreateTokenEffect(new InsectToken(), amount).apply(game, source);
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java b/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java
index 2725cdf1853..7b237c99fef 100644
--- a/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java
+++ b/Mage.Sets/src/mage/sets/mirrodin/MesmericOrb.java
@@ -37,6 +37,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -81,14 +82,17 @@ class BecomesUntappedPermanentTriggeredAbility extends TriggeredAbilityImpl{
return new BecomesUntappedPermanentTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UNTAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UNTAPPED) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent != null) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent != null) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java b/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java
index 3f3361791f5..669833fd276 100644
--- a/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java
+++ b/Mage.Sets/src/mage/sets/mirrodin/RustmouthOgre.java
@@ -40,6 +40,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.TargetPermanent;
/**
@@ -86,18 +87,21 @@ class RustmouthOgreTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
- FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact that player controls");
- filter.add(new ControllerIdPredicate(event.getPlayerId()));
- filter.setMessage("artifact controlled by " + game.getPlayer(event.getTargetId()).getLogName());
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
- this.getTargets().clear();
- this.addTarget(new TargetPermanent(filter));
- return true;
- }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
+ FilterArtifactPermanent filter = new FilterArtifactPermanent("artifact that player controls");
+ filter.add(new ControllerIdPredicate(event.getPlayerId()));
+ filter.setMessage("artifact controlled by " + game.getPlayer(event.getTargetId()).getLogName());
+
+ this.getTargets().clear();
+ this.addTarget(new TargetPermanent(filter));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java b/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java
index f90d0a851a4..6000151549e 100644
--- a/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java
+++ b/Mage.Sets/src/mage/sets/mirrodin/ScytheOfTheWretched.java
@@ -113,11 +113,10 @@ class ScytheOfTheWretchedTriggeredAbility extends TriggeredAbilityImpl {
ZoneChangeEvent zoneChange = (ZoneChangeEvent) event;
if (zoneChange.isDiesEvent() && zoneChange.getTarget().getCardType().contains(CardType.CREATURE)) {
Permanent equippedCreature = getEquippedCreature(game);
- if (equippedCreature == null) {
- return false;
- }
for (MageObjectReference mor : zoneChange.getTarget().getDealtDamageByThisTurn()) {
- if (mor.refersTo(equippedCreature, game)) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(mor.getSourceId(), Zone.BATTLEFIELD);
+ if((equippedCreature != null && mor.refersTo(equippedCreature, game))
+ || (permanent != null && permanent.getAttachments().contains(getSourceId()))) {
setTarget(new FixedTarget(event.getTargetId()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java b/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java
index cd94be9ca31..8e4c6a28792 100644
--- a/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java
+++ b/Mage.Sets/src/mage/sets/mirrodin/SoulFoundry.java
@@ -65,7 +65,7 @@ public class SoulFoundry extends CardImpl {
// Imprint - When Soul Foundry enters the battlefield, you may exile a creature card from your hand.
this.addAbility(new EntersBattlefieldTriggeredAbility(new SoulFoundryImprintEffect(), true, "Imprint - "));
- // {X}, {tap}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card.
+ // {X}, {T}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new SoulFoundryEffect(), new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
@@ -78,20 +78,23 @@ public class SoulFoundry extends CardImpl {
@Override
public void adjustCosts(Ability ability, Game game) {
- Permanent card = game.getPermanent(ability.getSourceId());
- if (card != null) {
- if (card.getImprinted().size() > 0) {
- Card imprinted = game.getCard(card.getImprinted().get(0));
- if (imprinted != null) {
- ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost()));
+ if (ability instanceof SimpleActivatedAbility) {
+ Permanent sourcePermanent = game.getPermanent(ability.getSourceId());
+ if (sourcePermanent != null) {
+ if (sourcePermanent.getImprinted().size() > 0) {
+ Card imprinted = game.getCard(sourcePermanent.getImprinted().get(0));
+ if (imprinted != null) {
+ ability.getManaCostsToPay().clear();
+ ability.getManaCostsToPay().add(0, new GenericManaCost(imprinted.getManaCost().convertedManaCost()));
+ }
}
}
- }
- // no {X} anymore as we already have imprinted the card with defined manacost
- for (ManaCost cost : ability.getManaCostsToPay()) {
- if (cost instanceof VariableCost) {
- cost.setPaid();
+ // no {X} anymore as we already have imprinted the card with defined manacost
+ for (ManaCost cost : ability.getManaCostsToPay()) {
+ if (cost instanceof VariableCost) {
+ cost.setPaid();
+ }
}
}
}
diff --git a/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java b/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java
index 13387f70c25..cf7921dbde9 100644
--- a/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java
+++ b/Mage.Sets/src/mage/sets/mirrodin/SwordOfKaldra.java
@@ -93,18 +93,20 @@ class SwordOfKaldraTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_CREATURE) {
- Permanent equipment = game.getPermanent(this.getSourceId());
- if (equipment != null
- && equipment.getAttachedTo() != null
- && event.getSourceId().equals(equipment.getAttachedTo())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
- }
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent equipment = game.getPermanent(this.getSourceId());
+ if (equipment != null
+ && equipment.getAttachedTo() != null
+ && event.getSourceId().equals(equipment.getAttachedTo())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
+ }
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java
index 410eaa83e94..c344a161b43 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlackSunsZenith.java
@@ -51,6 +51,7 @@ public class BlackSunsZenith extends CardImpl {
super(ownerId, 39, "Black Sun's Zenith", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{B}{B}");
this.expansionSetCode = "MBS";
+ // Put X -1/-1 counters on each creature. Shuffle Black Sun's Zenith into its owner's library.
this.getSpellAbility().addEffect(new BlackSunsZenithEffect());
this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance());
}
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java
index 6f0f4e2ac2a..ec71848b5b5 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/BlueSunsZenith.java
@@ -47,6 +47,7 @@ public class BlueSunsZenith extends CardImpl {
super(ownerId, 20, "Blue Sun's Zenith", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{U}{U}{U}");
this.expansionSetCode = "MBS";
+ // Target player draws X cards. Shuffle Blue Sun's Zenith into its owner's library.
this.getSpellAbility().addEffect(new DrawCardTargetEffect(new ManacostVariableValue()));
this.getSpellAbility().addEffect(ShuffleSpellEffect.getInstance());
this.getSpellAbility().addTarget(new TargetPlayer());
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java
index 3b658942d11..738f32b57bf 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ConsecratedSphinx.java
@@ -29,17 +29,17 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -83,12 +83,14 @@ class ConsecratedSphinxTriggeredAbility extends TriggeredAbilityImpl {
return new ConsecratedSphinxTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DREW_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DREW_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
- return true;
- }
- return false;
+ return game.getOpponents(this.getControllerId()).contains(event.getPlayerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java
index 18aa0237fd6..1558ed15381 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ContestedWarZone.java
@@ -28,7 +28,6 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-import mage.Mana;
import mage.constants.CardType;
import mage.constants.Duration;
@@ -46,7 +45,6 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.mana.ColorlessManaAbility;
-import mage.abilities.mana.SimpleManaAbility;
import mage.cards.CardImpl;
import mage.filter.common.FilterAttackingCreature;
import mage.game.Game;
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java
index 9d5026c995e..5b9188d9291 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/GlissaTheTraitor.java
@@ -29,20 +29,20 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInYourGraveyard;
@@ -102,9 +102,14 @@ class GlissaTheTraitorTriggeredAbility extends TriggeredAbilityImpl {
return new GlissaTheTraitorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ if (((ZoneChangeEvent)event).isDiesEvent()) {
Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (p != null && p.getCardType().contains(CardType.CREATURE) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) {
return true;
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java
index 3a2df2e2079..d2146f6213b 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/KnowledgePool.java
@@ -27,12 +27,7 @@
*/
package mage.sets.mirrodinbesieged;
-import mage.target.common.TargetCardInExile;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@@ -40,12 +35,17 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterNonlandCard;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.players.Player;
+import mage.target.common.TargetCardInExile;
import mage.target.targetpointer.FixedTarget;
/**
@@ -122,9 +122,14 @@ class KnowledgePoolAbility extends TriggeredAbilityImpl {
return new KnowledgePoolAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.HAND) {
+ if (event.getZone() == Zone.HAND) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null) {
for (Effect effect : this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java
index b84b9b7c1ee..1cb4d5ae238 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MagneticMine.java
@@ -28,13 +28,13 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -76,17 +76,20 @@ class MagneticMineTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD
- && zEvent.getToZone() == Zone.GRAVEYARD
- && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)
- && zEvent.getTarget().getId() != this.getSourceId()) {
- this.getTargets().get(0).add(zEvent.getTarget().getControllerId(), game);
- return true;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD
+ && zEvent.getToZone() == Zone.GRAVEYARD
+ && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)
+ && zEvent.getTarget().getId() != this.getSourceId()) {
+ this.getTargets().get(0).add(zEvent.getTarget().getControllerId(), game);
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java
index 69c80992b9a..3600167dada 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/MassacreWurm.java
@@ -29,9 +29,6 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@@ -39,10 +36,13 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.continuous.BoostOpponentsEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -89,9 +89,14 @@ class MassacreWurmTriggeredAbility extends TriggeredAbilityImpl {
return new MassacreWurmTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ if (((ZoneChangeEvent)event).isDiesEvent()) {
Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (p != null && p.getCardType().contains(CardType.CREATURE) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) {
for (Effect effect : this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java
index 206e931f52b..7e0ecbd7775 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Mirrorworks.java
@@ -41,6 +41,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.EmptyToken;
@@ -89,9 +90,14 @@ class MirrorworksAbility extends TriggeredAbilityImpl {
return new MirrorworksAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && !event.getTargetId().equals(this.getSourceId())) {
+ if (!event.getTargetId().equals(this.getSourceId())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null
&& permanent.getControllerId().equals(getControllerId())
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java
index 27eae919aae..6751f451c29 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/NestedGhoul.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.ZombieToken;
/**
@@ -82,12 +83,14 @@ class NestedGhoulTriggeredAbility extends TriggeredAbilityImpl {
return new NestedGhoulTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
- return true;
- }
- return false;
+ return event.getTargetId().equals(this.sourceId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java
index 0f644d47dfb..bfd4bd93ddf 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/Sangromancer.java
@@ -29,17 +29,17 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
@@ -86,9 +86,14 @@ class SangromancerFirstTriggeredAbility extends TriggeredAbilityImpl {
return new SangromancerFirstTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ if (((ZoneChangeEvent) event).isDiesEvent()) {
Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (p != null && p.getCardType().contains(CardType.CREATURE) && game.getOpponents(this.getControllerId()).contains(p.getControllerId())) {
return true;
@@ -117,12 +122,14 @@ class SangromancerSecondTriggeredAbility extends TriggeredAbilityImpl {
return new SangromancerSecondTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
- return true;
- }
- return false;
+ return game.getOpponents(this.getControllerId()).contains(event.getPlayerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java
index 9dfa604a43a..b484423a45b 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SepticRats.java
@@ -28,19 +28,19 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -85,13 +85,20 @@ class SepticRatsTriggeredAbility extends TriggeredAbilityImpl {
return new SepticRatsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) {
+ if (event.getSourceId().equals(this.getSourceId()) ) {
Player target = game.getPlayer(event.getTargetId());
- if (target != null)
- if (target.getCounters().getCount(CounterType.POISON) > 0)
+ if (target != null) {
+ if (target.getCounters().getCount(CounterType.POISON) > 0) {
return true;
+ }
+ }
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java
index 238dbe813a4..fe1da156925 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/SwordOfFeastAndFamine.java
@@ -29,30 +29,30 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
-import mage.abilities.effects.common.continuous.BoostEquippedEffect;
-import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.effects.common.UntapAllLandsControllerEffect;
+import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
+import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
import mage.constants.AttachmentType;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -106,17 +106,20 @@ class SwordOfFeastAndFamineAbility extends TriggeredAbilityImpl {
return new SwordOfFeastAndFamineAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java
index 4de16ffabe8..c53527f619a 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/ThopterAssembly.java
@@ -42,6 +42,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.Token;
/**
@@ -99,9 +100,14 @@ class ThopterAssemblyTriggeredAbility extends TriggeredAbilityImpl {
return new ThopterAssemblyTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
if (game.getBattlefield().count(filter, this.getSourceId(), this.getControllerId(), game) == 0) {
return true;
}
diff --git a/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java b/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java
index a653caa7835..c214b50e504 100644
--- a/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java
+++ b/Mage.Sets/src/mage/sets/mirrodinbesieged/VirulentWound.java
@@ -28,16 +28,16 @@
package mage.sets.mirrodinbesieged;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -116,9 +116,14 @@ class VirulentWoundDelayedTriggeredAbility extends DelayedTriggeredAbility {
this.target = ability.target;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE && event.getTargetId().equals(target)) {
+ if (event.getTargetId().equals(target)) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
return true;
diff --git a/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java b/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java
index ac211f2a112..cd4379e7e8e 100644
--- a/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java
+++ b/Mage.Sets/src/mage/sets/modernmasters/AuntiesSnitch.java
@@ -45,6 +45,7 @@ import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -101,16 +102,16 @@ class AuntiesSnitchTriggeredAbility extends TriggeredAbilityImpl {
return new AuntiesSnitchTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && filter.match(p, getSourceId(), getControllerId(), game)) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ return damageEvent.isCombatDamage() && p != null && filter.match(p, getSourceId(), getControllerId(), game);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java b/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java
index c20d6f7aade..24b3b74b88c 100644
--- a/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java
+++ b/Mage.Sets/src/mage/sets/modernmasters/DreamspoilerWitches.java
@@ -39,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreaturePermanent;
/**
@@ -89,14 +90,14 @@ class DreamspoilerWitchesTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST
- && event.getPlayerId().equals(this.controllerId)
- && game.getOpponents(this.controllerId).contains(game.getActivePlayerId())) {
- return true;
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
- }
- return false;
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ return event.getPlayerId().equals(this.controllerId)
+ && game.getOpponents(this.controllerId).contains(game.getActivePlayerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java b/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java
index cc72de228cd..44d11fc8d92 100644
--- a/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java
+++ b/Mage.Sets/src/mage/sets/modernmasters/TrygonPredator.java
@@ -92,10 +92,14 @@ class TrygonPredatorTriggeredAbility extends TriggeredAbilityImpl {
return new TrygonPredatorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
Player player = game.getPlayer(event.getTargetId());
if (player != null) {
FilterPermanent filter = new FilterPermanent("an artifact or enchantment controlled by " + player.getLogName());
diff --git a/Mage.Sets/src/mage/sets/morningtide/Fertilid.java b/Mage.Sets/src/mage/sets/morningtide/Fertilid.java
new file mode 100644
index 00000000000..3a9e5670b46
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/morningtide/Fertilid.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.morningtide;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class Fertilid extends mage.sets.commander.Fertilid {
+
+ public Fertilid(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 122;
+ this.expansionSetCode = "MOR";
+ }
+
+ public Fertilid(final Fertilid card) {
+ super(card);
+ }
+
+ @Override
+ public Fertilid copy() {
+ return new Fertilid(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java b/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java
index ed4882fe4ce..eba1fdfac0c 100644
--- a/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java
+++ b/Mage.Sets/src/mage/sets/morningtide/GreatbowDoyen.java
@@ -28,8 +28,6 @@
package mage.sets.morningtide;
import java.util.UUID;
-
-import mage.constants.*;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -37,11 +35,18 @@ import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -99,20 +104,23 @@ class GreatbowDoyenTriggeredAbility extends TriggeredAbilityImpl {
return new GreatbowDoyenTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- Permanent creature = game.getPermanent(event.getSourceId());
- Permanent damagedCreature = game.getPermanent(event.getTargetId());
- if (creature != null && damagedCreature != null
- && creature.getCardType().contains(CardType.CREATURE)
- && creature.hasSubtype("Archer")
- && creature.getControllerId().equals(controllerId)) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- this.getEffects().get(0).setValue("controller", damagedCreature.getControllerId());
- this.getEffects().get(0).setValue("source", event.getSourceId());
- return true;
- }
+ Permanent creature = game.getPermanent(event.getSourceId());
+ Permanent damagedCreature = game.getPermanent(event.getTargetId());
+ if (creature != null && damagedCreature != null
+ && creature.getCardType().contains(CardType.CREATURE)
+ && creature.hasSubtype("Archer")
+ && creature.getControllerId().equals(controllerId)) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ this.getEffects().get(0).setValue("controller", damagedCreature.getControllerId());
+ this.getEffects().get(0).setValue("source", event.getSourceId());
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java b/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java
index 69d1fd40a34..377e70bf95d 100644
--- a/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java
+++ b/Mage.Sets/src/mage/sets/morningtide/OonasBlackguard.java
@@ -148,9 +148,14 @@ class OonasBlackguardTriggeredAbility extends TriggeredAbilityImpl {
return new OonasBlackguardTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null && creature.getControllerId().equals(getControllerId()) && creature.getCounters().getCount(CounterType.P1P1) > 0) {
for(Effect effect : this.getEffects())
diff --git a/Mage.Sets/src/mage/sets/nemesis/FlowstoneOverseer.java b/Mage.Sets/src/mage/sets/nemesis/FlowstoneOverseer.java
new file mode 100644
index 00000000000..27b1985b6bb
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/nemesis/FlowstoneOverseer.java
@@ -0,0 +1,71 @@
+/*
+ * 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.nemesis;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BoostTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FlowstoneOverseer extends CardImpl {
+
+ public FlowstoneOverseer(UUID ownerId) {
+ super(ownerId, 82, "Flowstone Overseer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{R}{R}{R}");
+ this.expansionSetCode = "NMS";
+ this.subtype.add("Beast");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // {R}{R}: Target creature gets +1/-1 until end of turn.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostTargetEffect(1, -1, Duration.EndOfTurn), new ManaCostsImpl("{R}{R}"));
+ ability.addTarget(new TargetCreaturePermanent());
+ this.addAbility(ability);
+ }
+
+ public FlowstoneOverseer(final FlowstoneOverseer card) {
+ super(card);
+ }
+
+ @Override
+ public FlowstoneOverseer copy() {
+ return new FlowstoneOverseer(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/nemesis/RootwaterThief.java b/Mage.Sets/src/mage/sets/nemesis/RootwaterThief.java
new file mode 100644
index 00000000000..7329fbab21e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/nemesis/RootwaterThief.java
@@ -0,0 +1,124 @@
+/*
+ * 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.nemesis;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.Cost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.continuous.GainAbilitySourceEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.players.Player;
+import mage.target.common.TargetCardInLibrary;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class RootwaterThief extends CardImpl {
+
+ public RootwaterThief(UUID ownerId) {
+ super(ownerId, 40, "Rootwater Thief", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}");
+ this.expansionSetCode = "NMS";
+ this.subtype.add("Merfolk");
+ this.subtype.add("Rogue");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(2);
+
+ // {U}: Rootwater Thief gains flying until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{U}")));
+ // Whenever Rootwater Thief deals combat damage to a player, you may pay {2}. If you do, search that player's library for a card and exile it, then the player shuffles his or her library.
+ this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new RootwaterThiefEffect(), false, true));
+ }
+
+ public RootwaterThief(final RootwaterThief card) {
+ super(card);
+ }
+
+ @Override
+ public RootwaterThief copy() {
+ return new RootwaterThief(this);
+ }
+}
+
+class RootwaterThiefEffect extends OneShotEffect {
+
+ RootwaterThiefEffect() {
+ super(Outcome.Exile);
+ staticText = "you may pay {2}. If you do, search that player's library for a card and exile it, then the player shuffles his or her library.";
+ }
+
+ RootwaterThiefEffect(final RootwaterThiefEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player controller = game.getPlayer(source.getControllerId());
+ Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source));
+ if (controller == null || damagedPlayer == null) {
+ return false;
+ }
+ String message = "Pay {2} to exile a card from damaged player's library?";
+ Cost cost = new ManaCostsImpl("{2}");
+ if(controller.chooseUse(Outcome.Benefit, message, game) && cost.pay(source, game, source.getSourceId(), controller.getId(), false))
+ {
+ TargetCardInLibrary target = new TargetCardInLibrary();
+ if (controller.searchLibrary(target, game, damagedPlayer.getId())) {
+ if (target.getTargets().size() > 0) {
+ Card card = damagedPlayer.getLibrary().remove(target.getFirstTarget(), game);
+ if (card != null) {
+ controller.moveCardToExileWithInfo(card, null, "", source.getSourceId(), game, Zone.LIBRARY, true);
+ }
+ }
+ }
+
+ damagedPlayer.shuffleLibrary(game);
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public RootwaterThiefEffect copy() {
+ return new RootwaterThiefEffect(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java
index 79bdbcafa4f..1106bb635aa 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ApostlesBlessing.java
@@ -87,7 +87,7 @@ class ApostlesBlessingEffect extends OneShotEffect {
public ApostlesBlessingEffect() {
super(Outcome.AddAbility);
- this.staticText = "Target artifact or creature gains protection from artifacts or from the color of your choice until end of turn";
+ this.staticText = "Target artifact or creature you control gains protection from artifacts or from the color of your choice until end of turn";
}
public ApostlesBlessingEffect(final ApostlesBlessingEffect effect) {
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java b/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java
index 10810e3a16e..ba41a9d2fcc 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ArmWithAEther.java
@@ -28,19 +28,20 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityControlledEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
@@ -86,10 +87,15 @@ class ArmWithAEtherTriggeredAbility extends TriggeredAbilityImpl {
return new ArmWithAEtherTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Player opponent = game.getPlayer(event.getPlayerId());
- if (opponent != null && event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)) {
+ if (opponent != null && event.getSourceId().equals(this.sourceId)) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
filter.add(new ControllerIdPredicate(opponent.getId()));
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java b/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java
index f1608622608..6bee1ff994d 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/BlindZealot.java
@@ -28,16 +28,16 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.IntimidateAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
@@ -93,9 +93,14 @@ class BlindZealotTriggeredAbility extends TriggeredAbilityImpl {
return new BlindZealotTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
+ if (event.getSourceId().equals(this.sourceId)
&& ((DamagedPlayerEvent) event).isCombatDamage()) {
Player player = game.getPlayer(this.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java b/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java
index e7fdb969e10..08e62f19988 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/CagedSun.java
@@ -28,33 +28,30 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.Mana;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
-import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ChooseColorEffect;
import mage.abilities.effects.common.ManaEffect;
import mage.abilities.mana.TriggeredManaAbility;
import mage.cards.CardImpl;
-import mage.choices.ChoiceColor;
+import mage.constants.CardType;
import mage.constants.ColoredManaSymbol;
+import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.SubLayer;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
-import mage.util.CardUtil;
/**
*
@@ -135,9 +132,14 @@ class CagedSunTriggeredAbility extends TriggeredManaAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.MANA_ADDED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.MANA_ADDED && event.getPlayerId().equals(controllerId)) {
+ if (event.getPlayerId().equals(controllerId)) {
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
ObjectColor color = (ObjectColor) game.getState().getValue(this.sourceId + "_color");
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java
index c68d2b0bd97..cacff52229b 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheAnnex.java
@@ -28,9 +28,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -41,11 +38,15 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CounterUnlessPaysEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -124,9 +125,14 @@ class ChancellorOfTheAnnexDelayedTriggeredAbility extends DelayedTriggeredAbilit
this.playerId = ability.playerId;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(playerId)) {
+ if (event.getPlayerId().equals(playerId)) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java
index 41747b07803..f91dc4953dd 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheDross.java
@@ -28,9 +28,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -39,8 +36,12 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -85,12 +86,14 @@ class ChancellorOfTheDrossDelayedTriggeredAbility extends DelayedTriggeredAbilit
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- return true;
- }
- return false;
+ return true;
}
@Override
public ChancellorOfTheDrossDelayedTriggeredAbility copy() {
@@ -115,8 +118,9 @@ class ChancellorOfTheDrossEffect extends OneShotEffect {
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
loseLife += game.getPlayer(opponentId).loseLife(3, game);
}
- if (loseLife > 0)
+ if (loseLife > 0) {
game.getPlayer(source.getControllerId()).gainLife(loseLife, game);
+ }
return true;
}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java
index dcd832f67ad..581d2670154 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheForge.java
@@ -28,9 +28,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.TargetController;
import mage.MageInt;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.ChancellorAbility;
@@ -40,10 +37,14 @@ import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.Token;
/**
@@ -95,12 +96,14 @@ class ChancellorOfTheForgeDelayedTriggeredAbility extends DelayedTriggeredAbilit
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- return true;
- }
- return false;
+ return true;
}
@Override
public ChancellorOfTheForgeDelayedTriggeredAbility copy() {
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java
index 0f7592fde23..1a1c43a3e2d 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheSpires.java
@@ -28,10 +28,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -41,11 +37,16 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.PlayTargetWithoutPayingManaEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCardInOpponentsGraveyard;
@@ -103,10 +104,15 @@ class ChancellorOfTheSpiresDelayedTriggeredAbility extends DelayedTriggeredAbili
ChancellorOfTheSpiresDelayedTriggeredAbility(ChancellorOfTheSpiresDelayedTriggeredAbility ability) {
super(ability);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE;
+ return true;
}
@Override
public ChancellorOfTheSpiresDelayedTriggeredAbility copy() {
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java
index b8634fc3996..810a3c9db94 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ChancellorOfTheTangle.java
@@ -28,18 +28,19 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.Mana;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.ChancellorAbility;
import mage.abilities.effects.common.BasicManaEffect;
-import mage.abilities.keyword.VigilanceAbility;
import mage.abilities.keyword.ReachAbility;
+import mage.abilities.keyword.VigilanceAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -85,12 +86,14 @@ class ChancellorOfTheTangleDelayedTriggeredAbility extends DelayedTriggeredAbili
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.PRECOMBAT_MAIN_PHASE_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.PRECOMBAT_MAIN_PHASE_PRE && game.getActivePlayerId().equals(controllerId)) {
- return true;
- }
- return false;
+ return game.getActivePlayerId().equals(controllerId);
}
@Override
public ChancellorOfTheTangleDelayedTriggeredAbility copy() {
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java b/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java
index a4d08f27ef6..8e590125377 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/InvaderParasite.java
@@ -28,9 +28,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -40,10 +37,13 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetLandPermanent;
import mage.target.targetpointer.FixedTarget;
@@ -118,9 +118,14 @@ class InvaderParasiteTriggeredAbility extends TriggeredAbilityImpl {
return new InvaderParasiteTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
Permanent p = game.getPermanent(event.getTargetId());
Permanent sourcePermanent = game.getPermanent(getSourceId());
if (p != null && sourcePermanent != null) {
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java
index 09348348fc0..38deecc35fe 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/KarnLiberated.java
@@ -177,12 +177,14 @@ class KarnLiberatedDelayedTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BEGINNING_PHASE_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.BEGINNING_PHASE_PRE) {
- return true;
- }
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java
index 6adb55f68ea..b4aad1e5299 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/NumbingDose.java
@@ -28,23 +28,23 @@
package mage.sets.newphyrexia;
import java.util.UUID;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.effects.common.AttachEffect;
+import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
+import mage.abilities.effects.common.LoseLifeTargetEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
-import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.effects.common.AttachEffect;
-import mage.abilities.effects.common.LoseLifeTargetEffect;
-import mage.abilities.effects.common.DontUntapInControllersUntapStepEnchantedEffect;
-import mage.abilities.keyword.EnchantAbility;
-import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
-import mage.filter.common.FilterArtifactOrEnchantmentPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget;
@@ -107,13 +107,17 @@ class NumbingDoseTriggeredAbility extends TriggeredAbilityImpl {
return new NumbingDoseTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent equipment = game.getPermanent(this.getSourceId());
if (equipment != null) {
Permanent permanent = game.getPermanent(equipment.getAttachedTo());
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE
- && permanent != null && event.getPlayerId().equals(permanent.getControllerId())) {
+ if (permanent != null && event.getPlayerId().equals(permanent.getControllerId())) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java
index c4ca04c7f52..681c7882c45 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianMetamorph.java
@@ -30,23 +30,20 @@ package mage.sets.newphyrexia;
import java.util.UUID;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.effects.Effect;
import mage.abilities.effects.EntersBattlefieldEffect;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CopyPermanentEffect;
import mage.cards.CardImpl;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
-import mage.players.Player;
-import mage.target.Target;
-import mage.target.TargetPermanent;
import mage.util.functions.ApplyToPermanent;
/**
@@ -54,7 +51,15 @@ import mage.util.functions.ApplyToPermanent;
* @author Loki
*/
public class PhyrexianMetamorph extends CardImpl {
+
+ private static final FilterPermanent filter = new FilterPermanent("artifact or creature");
+ static {
+ filter.add(Predicates.or(
+ new CardTypePredicate(CardType.ARTIFACT),
+ new CardTypePredicate(CardType.CREATURE)));
+ }
+
public PhyrexianMetamorph (UUID ownerId) {
super(ownerId, 42, "Phyrexian Metamorph", Rarity.RARE, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}{UP}");
this.expansionSetCode = "NPH";
@@ -63,10 +68,21 @@ public class PhyrexianMetamorph extends CardImpl {
this.power = new MageInt(0);
this.toughness = new MageInt(0);
- Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(
- new PhyrexianMetamorphEffect(),
- "You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types",
- true));
+ ApplyToPermanent phyrexianMetamorphApplier = new ApplyToPermanent() {
+ @Override
+ public Boolean apply(Game game, Permanent permanent) {
+ if (!permanent.getCardType().contains(CardType.ARTIFACT)) {
+ permanent.getCardType().add(CardType.ARTIFACT);
+ }
+ return true;
+ }
+ };
+
+ // {UP} ( can be paid with either {U} or 2 life.)
+ // You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
+ Effect effect = new CopyPermanentEffect(filter, phyrexianMetamorphApplier);
+ effect.setText("You may have {this} enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types");
+ Ability ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new EntersBattlefieldEffect(effect));
this.addAbility(ability);
}
@@ -80,56 +96,3 @@ public class PhyrexianMetamorph extends CardImpl {
}
}
-
-class PhyrexianMetamorphEffect extends OneShotEffect {
-
- private static final FilterPermanent filter = new FilterPermanent("artifact or creature");
-
- static {
- filter.add(Predicates.or(
- new CardTypePredicate(CardType.ARTIFACT),
- new CardTypePredicate(CardType.CREATURE)));
- }
-
- public PhyrexianMetamorphEffect() {
- super(Outcome.Copy);
- }
-
- public PhyrexianMetamorphEffect(final PhyrexianMetamorphEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- Permanent sourcePermanent = game.getPermanent(source.getSourceId());
- if (player != null && sourcePermanent != null) {
- Target target = new TargetPermanent(filter);
- target.setNotTarget(true);
- if (target.canChoose(source.getControllerId(), game)) {
- player.choose(Outcome.Copy, target, source.getSourceId(), game);
- Permanent copyFromPermanent = game.getPermanent(target.getFirstTarget());
- if (copyFromPermanent != null) {
- game.copyPermanent(copyFromPermanent, sourcePermanent, source, new ApplyToPermanent() {
- @Override
- public Boolean apply(Game game, Permanent permanent) {
- if (!permanent.getCardType().contains(CardType.ARTIFACT)) {
- permanent.getCardType().add(CardType.ARTIFACT);
- }
- return true;
- }
- });
-
- return true;
- }
- }
- }
- return false;
- }
-
- @Override
- public PhyrexianMetamorphEffect copy() {
- return new PhyrexianMetamorphEffect(this);
- }
-
-}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java
index 1ad441cca6d..5811c99d20a 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/PhyrexianObliterator.java
@@ -28,19 +28,19 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -86,9 +86,14 @@ class PhyrexianObliteratorTriggeredAbility extends TriggeredAbilityImpl {
return new PhyrexianObliteratorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
+ if (event.getTargetId().equals(this.sourceId)) {
UUID controller = game.getControllerId(event.getSourceId());
if (controller != null) {
Player player = game.getPlayer(controller);
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java b/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java
index cbe7316723a..45073f0eb6d 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/PsychicSurgery.java
@@ -28,10 +28,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
@@ -39,9 +35,14 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.TargetCard;
@@ -84,9 +85,14 @@ class PsychicSurgeryTriggeredAbility extends TriggeredAbilityImpl {
return new PsychicSurgeryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LIBRARY_SHUFFLED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LIBRARY_SHUFFLED && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
this.getEffects().get(0).setValue("PsychicSurgeryOpponent", event.getPlayerId());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java b/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java
index 4cb2367ce79..cd3c011410f 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/RageExtractor.java
@@ -28,19 +28,18 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.PhyrexianManaCost;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.DamageTargetEffect;
-import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.common.TargetCreatureOrPlayer;
@@ -82,9 +81,14 @@ class RageExtractorTriggeredAbility extends TriggeredAbilityImpl {
return new RageExtractorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
Spell spell = (Spell) game.getStack().getStackObject(event.getTargetId());
if (spell != null) {
for (ManaCost cost : spell.getCard().getManaCost()) {
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java b/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java
index d4fb7ce5d23..c8da60dba23 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/ReaperOfSheoldred.java
@@ -28,19 +28,19 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.InfectAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -85,9 +85,14 @@ class ReaperOfSheoldredTriggeredAbility extends TriggeredAbilityImpl {
return new ReaperOfSheoldredTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.getSourceId())) {
+ if (event.getTargetId().equals(this.getSourceId())) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java b/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java
index 68c43806518..73456cb31bd 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/SuturePriest.java
@@ -29,9 +29,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldControlledTriggeredAbility;
@@ -40,6 +37,8 @@ import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
@@ -47,6 +46,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -100,9 +100,14 @@ class SuturePriestSecondTriggeredAbility extends TriggeredAbilityImpl {
return new SuturePriestSecondTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent)event;
Card card = zEvent.getTarget();
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java b/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java
index b75e1b27ef9..1bfd7373e8e 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/SwordOfWarAndPeace.java
@@ -29,12 +29,6 @@
package mage.sets.newphyrexia;
import java.util.UUID;
-
-import mage.constants.AttachmentType;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -49,12 +43,18 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
@@ -119,15 +119,18 @@ class SwordOfWarAndPeaceAbility extends TriggeredAbilityImpl {
return new SwordOfWarAndPeaceAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- getTargets().get(0).add(event.getPlayerId(), game);
- return true;
- }
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
+ getTargets().get(0).add(event.getPlayerId(), game);
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java
index c89f8dafe3c..00d838eea5e 100644
--- a/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java
+++ b/Mage.Sets/src/mage/sets/newphyrexia/VorinclexVoiceOfHunger.java
@@ -43,6 +43,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -95,9 +96,14 @@ class VorinclexTriggeredAbility2 extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
diff --git a/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java b/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java
index 8df3fd58fb5..2b7fc3a8202 100644
--- a/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java
+++ b/Mage.Sets/src/mage/sets/ninthedition/Cowardice.java
@@ -28,7 +28,6 @@
package mage.sets.ninthedition;
import java.util.UUID;
-
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
@@ -37,6 +36,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.StackObject;
import mage.target.targetpointer.FixedTarget;
@@ -76,15 +76,18 @@ class CowardiceTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (GameEvent.EventType.TARGETED.equals(event.getType())) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) &&
- StackObject.class.isInstance(game.getObject(event.getSourceId()))) {
- getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) &&
+ StackObject.class.isInstance(game.getObject(event.getSourceId()))) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java b/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java
index 6bd0b64e1dd..68f56668e4d 100644
--- a/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java
+++ b/Mage.Sets/src/mage/sets/ninthedition/Deathgazer.java
@@ -28,17 +28,17 @@
package mage.sets.ninthedition;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -82,28 +82,29 @@ class DeathgazerTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
if (event.getSourceId().equals(this.getSourceId())) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if(permanent != null && !permanent.getColor(game).isBlack())
- {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent != null && !permanent.getColor(game).isBlack()) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
- if (event.getTargetId().equals(this.getSourceId())) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- if(permanent != null && !permanent.getColor(game).isBlack())
- {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- }
- return true;
+ }
+ if (event.getTargetId().equals(this.getSourceId())) {
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ if (permanent != null && !permanent.getColor(game).isBlack()) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java b/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.java
new file mode 100644
index 00000000000..b111c600ed6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/ninthedition/ElvishBerserker.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.ninthedition;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.BecomesBlockedByCreatureTriggeredAbility;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class ElvishBerserker extends CardImpl {
+
+ public ElvishBerserker(UUID ownerId) {
+ super(ownerId, 237, "Elvish Berserker", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
+ this.expansionSetCode = "9ED";
+ this.subtype.add("Elf");
+ this.subtype.add("Berserker");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(1);
+
+ // Whenever Elvish Berserker becomes blocked, it gets +1/+1 until end of turn for each creature blocking it.
+ this.addAbility(new BecomesBlockedByCreatureTriggeredAbility(new BoostSourceEffect(1, 1, Duration.EndOfTurn), false));
+ }
+
+ public ElvishBerserker(final ElvishBerserker card) {
+ super(card);
+ }
+
+ @Override
+ public ElvishBerserker copy() {
+ return new ElvishBerserker(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/ninthedition/GravePact.java b/Mage.Sets/src/mage/sets/ninthedition/GravePact.java
index 08c949d9b2e..c501bccf124 100644
--- a/Mage.Sets/src/mage/sets/ninthedition/GravePact.java
+++ b/Mage.Sets/src/mage/sets/ninthedition/GravePact.java
@@ -30,16 +30,17 @@ package mage.sets.ninthedition;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -85,10 +86,14 @@ class GravePactTriggeredAbility extends TriggeredAbilityImpl {
return new GravePactTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE
- && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
+ if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java b/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java
index 093240dfd8a..052be88b5cf 100644
--- a/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java
+++ b/Mage.Sets/src/mage/sets/ninthedition/GuerrillaTactics.java
@@ -27,7 +27,7 @@
*/
package mage.sets.ninthedition;
-import mage.MageObject;
+import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
@@ -36,11 +36,10 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.StackObject;
import mage.target.common.TargetCreatureOrPlayer;
-import java.util.UUID;
-
/**
*
* @author dustinconrad
@@ -85,10 +84,14 @@ class GuerrillaTacticsTriggeredAbility extends TriggeredAbilityImpl {
return new GuerrillaTacticsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) &&
- game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) &&
+ return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) &&
StackObject.class.isInstance(game.getObject(event.getSourceId())) &&
getSourceId().equals(event.getTargetId());
}
diff --git a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java
index 15daeb33623..e506714d397 100644
--- a/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java
+++ b/Mage.Sets/src/mage/sets/ninthedition/ViashinoSandstalker.java
@@ -28,18 +28,18 @@
package mage.sets.ninthedition;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -90,12 +90,14 @@ class BeginningOfEndStepTriggeredAbility extends TriggeredAbilityImpl {
return new BeginningOfEndStepTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) {
- return true;
- }
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java b/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java
index 4f11353d94a..131fcb69db8 100644
--- a/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java
+++ b/Mage.Sets/src/mage/sets/odyssey/BattleStrain.java
@@ -36,6 +36,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -79,14 +80,17 @@ class BattleStrainTriggeredAbility extends TriggeredAbilityImpl {
return new BattleStrainTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent blocker = game.getPermanent(event.getSourceId());
- if (blocker != null) {
- getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId()));
- return true;
- }
+ Permanent blocker = game.getPermanent(event.getSourceId());
+ if (blocker != null) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/odyssey/BombSquad.java b/Mage.Sets/src/mage/sets/odyssey/BombSquad.java
index ece09b89c1a..0f370761a0c 100644
--- a/Mage.Sets/src/mage/sets/odyssey/BombSquad.java
+++ b/Mage.Sets/src/mage/sets/odyssey/BombSquad.java
@@ -112,9 +112,14 @@ class BombSquadTriggeredAbility extends TriggeredAbilityImpl {
return new BombSquadTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_ADDED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.COUNTER_ADDED) && event.getData().equals(CounterType.FUSE.getName())) {
+ if (event.getData().equals(CounterType.FUSE.getName())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && filter.match(permanent, game)) {
if (4 <= permanent.getCounters().getCount(CounterType.FUSE)) {
diff --git a/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java
index 4acbfaa5dfd..5f0b340da9a 100644
--- a/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java
+++ b/Mage.Sets/src/mage/sets/odyssey/DecayingSoil.java
@@ -53,6 +53,7 @@ import mage.filter.predicate.other.OwnerPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -84,9 +85,9 @@ public class DecayingSoil extends CardImpl {
// Threshold - As long as seven or more cards are in your graveyard, Decaying Soil has "Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand."
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD,
- new ConditionalContinuousEffect(new GainAbilitySourceEffect(new DecayingSoilTriggeredAbility(new DecayingSoilEffect(), filter)),
- new CardsInControllerGraveCondition(7),
- "Threshold - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand")));
+ new ConditionalContinuousEffect(new GainAbilitySourceEffect(new DecayingSoilTriggeredAbility(new DecayingSoilEffect(), filter)),
+ new CardsInControllerGraveCondition(7),
+ "Threshold - As long as seven or more cards are in your graveyard, {this} has \"Whenever a nontoken creature is put into your graveyard from the battlefield, you may pay {1}. If you do, return that card to your hand")));
}
public DecayingSoil(final DecayingSoil card) {
@@ -118,16 +119,19 @@ class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl {
return new DecayingSoilTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
- Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (permanent != null && filter.match(permanent, this.getSourceId(), this.getControllerId(), game)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
- return true;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (permanent != null && filter.match(permanent, this.getSourceId(), this.getControllerId(), game)) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
+ return true;
}
}
return false;
@@ -136,10 +140,7 @@ class DecayingSoilTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkInterveningIfClause(Game game) {
Player controller = game.getPlayer(this.getControllerId());
- if(controller != null && controller.getGraveyard().contains(this.getSourceId())) {
- return true;
- }
- return false;
+ return controller != null && controller.getGraveyard().contains(this.getSourceId());
}
diff --git a/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java b/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java
index 68d02ca94ec..7746b54f027 100644
--- a/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java
+++ b/Mage.Sets/src/mage/sets/odyssey/DruidsCall.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SquirrelToken;
import mage.game.permanent.token.Token;
@@ -96,16 +97,19 @@ class DruidsCallTriggeredAbility extends TriggeredAbilityImpl {
return new DruidsCallTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- Permanent enchantment = game.getPermanent(sourceId);
- UUID targetId = event.getTargetId();
- if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ UUID targetId = event.getTargetId();
+ if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java b/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java
index cf41b23ce12..c6b83071738 100644
--- a/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java
+++ b/Mage.Sets/src/mage/sets/odyssey/FilthyCur.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -83,14 +84,17 @@ class DealtDamageLoseLifeTriggeredAbility extends TriggeredAbilityImpl {
return new DealtDamageLoseLifeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- if (event.getTargetId().equals(this.sourceId)) {
- this.getEffects().clear();
- this.addEffect(new LoseLifeSourceControllerEffect(event.getAmount()));
- return true;
- }
+ if (event.getTargetId().equals(this.sourceId)) {
+ this.getEffects().clear();
+ this.addEffect(new LoseLifeSourceControllerEffect(event.getAmount()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java b/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java
index 700b591ffa7..5b3978c5bb1 100644
--- a/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java
+++ b/Mage.Sets/src/mage/sets/odyssey/KarmicJustice.java
@@ -82,10 +82,15 @@ class KarmicJusticeTriggeredAbility extends TriggeredAbilityImpl {
public KarmicJusticeTriggeredAbility copy() {
return new KarmicJusticeTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DESTROYED_PERMANENT;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DESTROYED_PERMANENT && event.getPlayerId().equals(controllerId)
+ if (event.getPlayerId().equals(controllerId)
&& game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) {
MageObject mageObject = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (!mageObject.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java
index 3d5b5cfc7c6..2e372d71a3a 100644
--- a/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java
+++ b/Mage.Sets/src/mage/sets/odyssey/PriceOfGlory.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -79,18 +80,21 @@ class PriceOfGloryAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- if (permanent == null) {
- permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
- }
- if (permanent != null && permanent.getCardType().contains(CardType.LAND)
- && !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause
- getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ if (permanent == null) {
+ permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
+ }
+ if (permanent != null && permanent.getCardType().contains(CardType.LAND)
+ && !permanent.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause
+ getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java b/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java
index 4369d8ec24c..2d74fc979d8 100644
--- a/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java
+++ b/Mage.Sets/src/mage/sets/odyssey/SavageFirecat.java
@@ -93,19 +93,20 @@ class SavageFirecatTriggeredAbility extends TriggeredAbilityImpl {
return new SavageFirecatTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TAPPED_FOR_MANA &&
- game.getCard(event.getSourceId()).getCardType().contains(CardType.LAND) &&
- event.getPlayerId().equals(this.controllerId)){
- return true;
- }
- return false;
-}
+ return game.getCard(event.getSourceId()).getCardType().contains(CardType.LAND) &&
+ event.getPlayerId().equals(this.controllerId);
+ }
@Override
public String getRule() {
return "Whenever you tap a land for mana, remove a +1/+1 counter from {this}";
-}
+ }
}
\ No newline at end of file
diff --git a/Mage.Sets/src/mage/sets/odyssey/SparkMage.java b/Mage.Sets/src/mage/sets/odyssey/SparkMage.java
index 9b4db2dd7ec..817b3446221 100644
--- a/Mage.Sets/src/mage/sets/odyssey/SparkMage.java
+++ b/Mage.Sets/src/mage/sets/odyssey/SparkMage.java
@@ -40,6 +40,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
@@ -74,41 +75,44 @@ public class SparkMage extends CardImpl {
class SparkMageTriggeredAbility extends TriggeredAbilityImpl {
- public SparkMageTriggeredAbility(){
+ public SparkMageTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(1));
this.addTarget(new TargetCreaturePermanent());
}
-
+
public SparkMageTriggeredAbility(final SparkMageTriggeredAbility ability) {
super(ability);
}
-
-@Override
+
+ @Override
public SparkMageTriggeredAbility copy() {
return new SparkMageTriggeredAbility(this);
}
-@Override
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
+ @Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())){
- Player opponent = game.getPlayer(event.getPlayerId());
- if (opponent != null) {
- FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
- filter.add(new ControllerIdPredicate(opponent.getId()));
- this.getTargets().clear();
- this.getTargets().add(new TargetCreaturePermanent(filter));
- return true;
- }
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ if (damageEvent.isCombatDamage() && event.getSourceId().equals(this.getSourceId())) {
+ Player opponent = game.getPlayer(event.getPlayerId());
+ if (opponent != null) {
+ FilterCreaturePermanent filter = new FilterCreaturePermanent("creature " + opponent.getLogName() + " controls");
+ filter.add(new ControllerIdPredicate(opponent.getId()));
+ this.getTargets().clear();
+ this.getTargets().add(new TargetCreaturePermanent(filter));
+ return true;
}
}
return false;
}
-@Override
+ @Override
public String getRule() {
return "Whenever {this} deals combat damage to a player, you may have {this} deal 1 damage to target creature that player controls.";
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java b/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java
index f13eb6d123f..d18b15eebb7 100644
--- a/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java
+++ b/Mage.Sets/src/mage/sets/odyssey/Spiritualize.java
@@ -41,6 +41,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
@@ -88,18 +89,21 @@ class SpiritualizeTriggeredAbility extends DelayedTriggeredAbility {
return new SpiritualizeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.DAMAGED_CREATURE)
- || event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER)
- || event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER)) {
- Permanent target = game.getPermanent(this.getFirstTarget());
- if (target != null && event.getSourceId().equals(target.getId())) {
- for (Effect effect : this.getEffects()) {
- effect.setValue("damage", event.getAmount());
- }
- return true;
+ Permanent target = game.getPermanent(this.getFirstTarget());
+ if (target != null && event.getSourceId().equals(target.getId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setValue("damage", event.getAmount());
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/odyssey/Standstill.java b/Mage.Sets/src/mage/sets/odyssey/Standstill.java
index 9cc4fa20b2a..58472b1bceb 100644
--- a/Mage.Sets/src/mage/sets/odyssey/Standstill.java
+++ b/Mage.Sets/src/mage/sets/odyssey/Standstill.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -77,13 +78,15 @@ class SpellCastTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
- return false;
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/odyssey/StillLife.java b/Mage.Sets/src/mage/sets/odyssey/StillLife.java
new file mode 100644
index 00000000000..97e9d7d2ee9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/odyssey/StillLife.java
@@ -0,0 +1,76 @@
+/*
+ * 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.odyssey;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.permanent.token.Token;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class StillLife extends CardImpl {
+
+ public StillLife(UUID ownerId) {
+ super(ownerId, 275, "Still Life", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}");
+ this.expansionSetCode = "ODY";
+
+ // {G}{G}: Still Life becomes a 4/3 Centaur creature until end of turn. It's still an enchantment.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesCreatureSourceEffect(new StillLifeCentaur(), "", Duration.EndOfTurn), new ManaCostsImpl("{G}{G}")));
+ }
+
+ public StillLife(final StillLife card) {
+ super(card);
+ }
+
+ @Override
+ public StillLife copy() {
+ return new StillLife(this);
+ }
+}
+
+class StillLifeCentaur extends Token {
+
+ public StillLifeCentaur() {
+ super("Centaur", "a 4/3 Centaur creature token");
+ cardType.add(CardType.CREATURE);
+ subtype.add("Centaur");
+ power = new MageInt(4);
+ toughness = new MageInt(3);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/onslaught/FalseCure.java b/Mage.Sets/src/mage/sets/onslaught/FalseCure.java
index 5b5f4cf1221..baa02d6fbf2 100644
--- a/Mage.Sets/src/mage/sets/onslaught/FalseCure.java
+++ b/Mage.Sets/src/mage/sets/onslaught/FalseCure.java
@@ -80,17 +80,19 @@ class FalseCureTriggeredAbility extends DelayedTriggeredAbility {
public FalseCureTriggeredAbility copy() {
return new FalseCureTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.GAINED_LIFE) {
- this.getEffects().clear();
- Effect effect = new LoseLifeTargetEffect(2 * event.getAmount());
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- this.addEffect(effect);
- return true;
- }
- return false;
+ this.getEffects().clear();
+ Effect effect = new LoseLifeTargetEffect(2 * event.getAmount());
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
+ this.addEffect(effect);
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/planarchaos/AnaBattlemage.java b/Mage.Sets/src/mage/sets/planarchaos/AnaBattlemage.java
new file mode 100644
index 00000000000..3bb4ab66ce5
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/planarchaos/AnaBattlemage.java
@@ -0,0 +1,129 @@
+/*
+ * 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.planarchaos;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.TriggeredAbility;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.condition.common.KickedCostCondition;
+import mage.abilities.decorator.ConditionalTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.discard.DiscardTargetEffect;
+import mage.abilities.keyword.KickerAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.permanent.TappedPredicate;
+import mage.game.Game;
+import mage.game.permanent.Permanent;
+import mage.players.Player;
+import mage.target.common.TargetCreaturePermanent;
+import mage.target.common.TargetOpponent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class AnaBattlemage extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("untapped creature");
+ static {
+ filter.add(Predicates.not(new TappedPredicate()));
+ }
+
+ public AnaBattlemage(UUID ownerId) {
+ super(ownerId, 124, "Ana Battlemage", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
+ this.expansionSetCode = "PLC";
+ this.subtype.add("Human");
+ this.subtype.add("Wizard");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // Kicker {2}{U} and/or {1}{B}
+ KickerAbility kickerAbility = new KickerAbility("{2}{U}");
+ kickerAbility.addKickerCost("{1}{B}");
+ this.addAbility(kickerAbility);
+ // When Ana Battlemage enters the battlefield, if it was kicked with its {2}{U} kicker, target player discards three cards.
+ TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(3));
+ ability.addTarget(new TargetOpponent());
+ this.addAbility(new ConditionalTriggeredAbility(ability, new KickedCostCondition("{2}{U}"),
+ "When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, target player discards three cards."));
+ // When Ana Battlemage enters the battlefield, if it was kicked with its {1}{B} kicker, tap target untapped creature and that creature deals damage equal to its power to its controller.
+ ability = new EntersBattlefieldTriggeredAbility(new AnaBattlemageKickerEffect());
+ ability.addTarget(new TargetCreaturePermanent(filter));
+ this.addAbility(new ConditionalTriggeredAbility(ability, new KickedCostCondition("{1}{B}"),
+ "When {this} enters the battlefield, if it was kicked with its {1}{B} kicker, tap target untapped creature and that creature deals damage equal to its power to its controller."));
+ }
+
+ public AnaBattlemage(final AnaBattlemage card) {
+ super(card);
+ }
+
+ @Override
+ public AnaBattlemage copy() {
+ return new AnaBattlemage(this);
+ }
+}
+
+class AnaBattlemageKickerEffect extends OneShotEffect {
+
+ public AnaBattlemageKickerEffect() {
+ super(Outcome.Detriment);
+ this.staticText = "tap target untapped creature and it deals damage equal to its power to its controller";
+ }
+
+ public AnaBattlemageKickerEffect(final AnaBattlemageKickerEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public AnaBattlemageKickerEffect copy() {
+ return new AnaBattlemageKickerEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ boolean applied = false;
+ Permanent targetCreature = game.getPermanent(targetPointer.getFirst(game, source));
+ if (targetCreature != null) {
+ applied = targetCreature.tap(game);
+ Player controller = game.getPlayer(targetCreature.getControllerId());
+ if (controller != null) {
+ controller.damage(targetCreature.getPower().getValue(), source.getSourceId(), game, false, true);
+ applied = true;
+ }
+ }
+ return applied;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java b/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java
index b19067af0ba..63b9a0f1474 100644
--- a/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java
+++ b/Mage.Sets/src/mage/sets/planarchaos/BenalishCommander.java
@@ -105,9 +105,14 @@ class BenalishCommanderTriggeredAbility extends TriggeredAbilityImpl {
return new BenalishCommanderTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_REMOVED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
+ return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java b/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java
index 49abf2bda3e..bfa18d8ca8a 100644
--- a/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java
+++ b/Mage.Sets/src/mage/sets/planarchaos/Detritivore.java
@@ -47,7 +47,6 @@ import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
-import mage.filter.predicate.mageobject.NamePredicate;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -106,9 +105,14 @@ class DetritivoreTriggeredAbility extends TriggeredAbilityImpl {
return new DetritivoreTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_REMOVED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
+ return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java b/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java
index 9ed7ce665b1..7317d947f4c 100644
--- a/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java
+++ b/Mage.Sets/src/mage/sets/planarchaos/FungalBehemoth.java
@@ -100,9 +100,14 @@ class FungalBehemothTriggeredAbility extends TriggeredAbilityImpl {
return new FungalBehemothTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_REMOVED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
+ return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java b/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java
new file mode 100644
index 00000000000..01a618d528e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/planarchaos/Ovinize.java
@@ -0,0 +1,64 @@
+/*
+ * 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.planarchaos;
+
+import java.util.UUID;
+import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
+import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Ovinize extends CardImpl {
+
+ public Ovinize(UUID ownerId) {
+ super(ownerId, 57, "Ovinize", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{U}");
+ this.expansionSetCode = "PLC";
+
+ // Target creature loses all abilities and becomes 0/1 until end of turn.
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent());
+ this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn));
+ this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn));
+ }
+
+ public Ovinize(final Ovinize card) {
+ super(card);
+ }
+
+ @Override
+ public Ovinize copy() {
+ return new Ovinize(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java b/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java
index ebb54e10c31..7330a1cdcbc 100644
--- a/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java
+++ b/Mage.Sets/src/mage/sets/planarchaos/RoilingHorror.java
@@ -105,9 +105,14 @@ class RoilingHorrorTriggeredAbility extends TriggeredAbilityImpl {
return new RoilingHorrorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_REMOVED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return EventType.COUNTER_REMOVED.equals(event.getType()) && event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
+ return event.getData().equals(CounterType.TIME.getName()) && event.getTargetId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/planechase/Fertilid.java b/Mage.Sets/src/mage/sets/planechase/Fertilid.java
new file mode 100644
index 00000000000..6a3a8489195
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/planechase/Fertilid.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.planechase;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class Fertilid extends mage.sets.commander.Fertilid {
+
+ public Fertilid(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 72;
+ this.expansionSetCode = "HOP";
+ }
+
+ public Fertilid(final Fertilid card) {
+ super(card);
+ }
+
+ @Override
+ public Fertilid copy() {
+ return new Fertilid(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/planechase/LivingHive.java b/Mage.Sets/src/mage/sets/planechase/LivingHive.java
new file mode 100644
index 00000000000..1b502f6e2eb
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/planechase/LivingHive.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.planechase;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class LivingHive extends mage.sets.mirrodin.LivingHive {
+
+ public LivingHive(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 75;
+ this.expansionSetCode = "HOP";
+ }
+
+ public LivingHive(final LivingHive card) {
+ super(card);
+ }
+
+ @Override
+ public LivingHive copy() {
+ return new LivingHive(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java b/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java
index d97462eb7e4..77459d9cf1c 100644
--- a/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java
+++ b/Mage.Sets/src/mage/sets/planechase2012/PollenbrightWings.java
@@ -28,13 +28,6 @@
package mage.sets.planechase2012;
import java.util.UUID;
-
-import mage.constants.AttachmentType;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -46,9 +39,16 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.SaprolingToken;
import mage.target.TargetPermanent;
@@ -104,15 +104,18 @@ class PollenbrightWingsAbility extends TriggeredAbilityImpl {
return new PollenbrightWingsAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- game.getState().setValue(new StringBuilder("Damage_").append(getSourceId().toString()).toString(), new Integer(damageEvent.getAmount()));
- return true;
- }
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
+ game.getState().setValue(new StringBuilder("Damage_").append(getSourceId().toString()).toString(), new Integer(damageEvent.getAmount()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java b/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java
new file mode 100644
index 00000000000..5a43de13839
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/planeshift/PhyrexianScuta.java
@@ -0,0 +1,71 @@
+/*
+ * 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.planeshift;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.condition.common.KickedCondition;
+import mage.abilities.costs.common.PayLifeCost;
+import mage.abilities.effects.common.counter.AddCountersSourceEffect;
+import mage.abilities.keyword.KickerAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.counters.CounterType;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class PhyrexianScuta extends CardImpl {
+
+ public PhyrexianScuta(UUID ownerId) {
+ super(ownerId, 51, "Phyrexian Scuta", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}");
+ this.expansionSetCode = "PLS";
+ this.subtype.add("Zombie");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(3);
+
+ // Kicker-Pay 3 life.
+ this.addAbility(new KickerAbility(new PayLifeCost(3)));
+ // If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it.
+ this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(2)), KickedCondition.getInstance(),
+ true, "If Phyrexian Scuta was kicked, it enters the battlefield with two +1/+1 counters on it.", ""));
+ }
+
+ public PhyrexianScuta(final PhyrexianScuta card) {
+ super(card);
+ }
+
+ @Override
+ public PhyrexianScuta copy() {
+ return new PhyrexianScuta(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java b/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java
index b52321f3e03..d9f60ea27fc 100644
--- a/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java
+++ b/Mage.Sets/src/mage/sets/planeshift/PhyrexianTyranny.java
@@ -41,6 +41,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -83,18 +84,20 @@ class PhyrexianTyrannyTriggeredAbility extends TriggeredAbilityImpl {
public PhyrexianTyrannyTriggeredAbility copy() {
return new PhyrexianTyrannyTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DREW_CARD;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DREW_CARD) {
- for (Effect effect : this.getEffects()) {
- if (effect instanceof PhyrexianTyrannyEffect) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
+ for (Effect effect : this.getEffects()) {
+ if (effect instanceof PhyrexianTyrannyEffect) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
- return true;
}
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java b/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java
index cf386bea42c..571b76aae4a 100644
--- a/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java
+++ b/Mage.Sets/src/mage/sets/planeshift/ShiftingSky.java
@@ -32,12 +32,15 @@ import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.ChooseColorEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.Rarity;
+import mage.constants.SubLayer;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
@@ -48,7 +51,7 @@ import mage.players.Player;
/**
*
- * @author anonymous
+ * @author Luna Skyrise
*/
public class ShiftingSky extends CardImpl {
@@ -57,11 +60,10 @@ public class ShiftingSky extends CardImpl {
this.expansionSetCode = "PLS";
// As Shifting Sky enters the battlefield, choose a color.
- Ability ability = new EntersBattlefieldTriggeredAbility(new ChooseColorEffect(Outcome.Benefit));
- this.addAbility(ability);
- // All nonland permanents are the chosen color.
- Ability ability2 = new SimpleStaticAbility(Zone.BATTLEFIELD, new ShiftingSkyEffect());
- this.addAbility(ability2);
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new ChooseColorEffect(Outcome.Detriment)));
+
+ // All nonland permanents are the chosen color.
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ShiftingSkyEffect()));
}
public ShiftingSky(final ShiftingSky card) {
@@ -74,75 +76,42 @@ public class ShiftingSky extends CardImpl {
}
}
-class ShiftingSkyEffect extends OneShotEffect {
+class ShiftingSkyEffect extends ContinuousEffectImpl {
+
private static final FilterPermanent filter = new FilterPermanent("All nonland permanents");
static {
- filter.add(
- Predicates.not(
- new CardTypePredicate(CardType.LAND)
- )
- );
+ filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
}
-
+
public ShiftingSkyEffect() {
- super(Outcome.Benefit);
+ super(Duration.WhileOnBattlefield, Layer.ColorChangingEffects_5, SubLayer.NA, Outcome.Benefit);
staticText = "All nonland permanents are the chosen color";
}
- public ShiftingSkyEffect(final ShiftingSkyEffect effect) {
- super(effect);
- }
-
@Override
public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- Permanent permanent = game.getPermanent(source.getSourceId());
-
- if (player != null && permanent != null) {
+ Player controller = game.getPlayer(source.getControllerId());
+ if (controller != null) {
ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
-
if (color == null) {
return false;
}
-
- String colorString = color.toString();
-
- for (UUID playerId : player.getInRange()) {
- Player p = game.getPlayer(playerId);
- if (p != null) {
- for (Permanent chosen : game.getBattlefield().getAllActivePermanents(filter, playerId, game)) {
- setObject(chosen, colorString, game);
- }
- }
+ for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
+ perm.getColor(game).setColor(color);
}
return true;
}
return false;
}
-
+
@Override
public ShiftingSkyEffect copy() {
return new ShiftingSkyEffect(this);
}
- private void setObject(Permanent chosen, String colorString, Game game) {
- switch (colorString) {
- case "W":
- chosen.getColor(game).setWhite(true);
- break;
- case "B":
- chosen.getColor(game).setBlack(true);
- break;
- case "U":
- chosen.getColor(game).setBlue(true);
- break;
- case "G":
- chosen.getColor(game).setGreen(true);
- break;
- case "R":
- chosen.getColor(game).setRed(true);
- break;
- }
+ private ShiftingSkyEffect(ShiftingSkyEffect effect) {
+ super(effect);
}
+
}
diff --git a/Mage.Sets/src/mage/sets/planeshift/SinisterStrength.java b/Mage.Sets/src/mage/sets/planeshift/SinisterStrength.java
new file mode 100644
index 00000000000..56b6eda461f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/planeshift/SinisterStrength.java
@@ -0,0 +1,85 @@
+/*
+ * 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.planeshift;
+
+import java.util.UUID;
+import mage.ObjectColor;
+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.continuous.BoostEnchantedEffect;
+import mage.abilities.effects.common.continuous.SetCardColorAttachedEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.TargetPermanent;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SinisterStrength extends CardImpl {
+
+ public SinisterStrength(UUID ownerId) {
+ super(ownerId, 54, "Sinister Strength", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
+ this.expansionSetCode = "PLS";
+ this.subtype.add("Aura");
+
+ // Enchant creature
+ TargetPermanent auraTarget = new TargetCreaturePermanent();
+ this.getSpellAbility().addTarget(auraTarget);
+ this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
+ Ability ability = new EnchantAbility(auraTarget.getTargetName());
+ this.addAbility(ability);
+ // Enchanted creature gets +3/+1 and is black.
+ Effect effect = new BoostEnchantedEffect(3, 1);
+ effect.setText("Enchanted creature gets +3/+1");
+ ability = new SimpleStaticAbility(Zone.BATTLEFIELD, effect);
+ effect = new SetCardColorAttachedEffect(ObjectColor.BLACK, Duration.WhileOnBattlefield, AttachmentType.AURA);
+ effect.setText("and is black");
+ ability.addEffect(effect);
+ this.addAbility(ability);
+ }
+
+ public SinisterStrength(final SinisterStrength card) {
+ super(card);
+ }
+
+ @Override
+ public SinisterStrength copy() {
+ return new SinisterStrength(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/AlluringScent.java b/Mage.Sets/src/mage/sets/portal/AlluringScent.java
new file mode 100644
index 00000000000..9011d1b8343
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/AlluringScent.java
@@ -0,0 +1,61 @@
+/*
+ * 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.portal;
+
+import java.util.UUID;
+import mage.abilities.effects.common.combat.MustBeBlockedByAllTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author anonymous
+ */
+public class AlluringScent extends CardImpl {
+
+ public AlluringScent(UUID ownerId) {
+ super(ownerId, 61, "Alluring Scent", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{G}{G}");
+ this.expansionSetCode = "POR";
+
+ // All creatures able to block target creature this turn do so.
+ this.getSpellAbility().addEffect(new MustBeBlockedByAllTargetEffect(Duration.EndOfTurn));
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent());
+ }
+
+ public AlluringScent(final AlluringScent card) {
+ super(card);
+ }
+
+ @Override
+ public AlluringScent copy() {
+ return new AlluringScent(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/BeeSting.java b/Mage.Sets/src/mage/sets/portal/BeeSting.java
new file mode 100644
index 00000000000..7fd92df02bb
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/BeeSting.java
@@ -0,0 +1,60 @@
+/*
+ * 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.portal;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreatureOrPlayer;
+
+/**
+ *
+ * @author anonymous
+ */
+public class BeeSting extends CardImpl {
+
+ public BeeSting(UUID ownerId) {
+ super(ownerId, 83, "Bee Sting", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{G}");
+ this.expansionSetCode = "POR";
+
+ // Bee Sting deals 2 damage to target creature or player.
+ this.getSpellAbility().addEffect(new DamageTargetEffect(2));
+ this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
+ }
+
+ public BeeSting(final BeeSting card) {
+ super(card);
+ }
+
+ @Override
+ public BeeSting copy() {
+ return new BeeSting(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/CloudDragon.java b/Mage.Sets/src/mage/sets/portal/CloudDragon.java
new file mode 100644
index 00000000000..0f296f7deae
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/CloudDragon.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.portal;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class CloudDragon extends mage.sets.masterseditioniv.CloudDragon {
+
+ public CloudDragon(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 46;
+ this.expansionSetCode = "POR";
+ }
+
+ public CloudDragon(final CloudDragon card) {
+ super(card);
+ }
+
+ @Override
+ public CloudDragon copy() {
+ return new CloudDragon(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/FireImp.java b/Mage.Sets/src/mage/sets/portal/FireImp.java
new file mode 100644
index 00000000000..613ef39ba63
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/FireImp.java
@@ -0,0 +1,68 @@
+/*
+ * 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.portal;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FireImp extends CardImpl {
+
+ public FireImp(UUID ownerId) {
+ super(ownerId, 131, "Fire Imp", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
+ this.expansionSetCode = "POR";
+ this.subtype.add("Imp");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // When Fire Imp enters the battlefield, it deals 2 damage to target creature.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DamageTargetEffect(2), false);
+ ability.addTarget(new TargetCreaturePermanent());
+ this.addAbility(ability);
+ }
+
+ public FireImp(final FireImp card) {
+ super(card);
+ }
+
+ @Override
+ public FireImp copy() {
+ return new FireImp(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/FireTempest.java b/Mage.Sets/src/mage/sets/portal/FireTempest.java
new file mode 100644
index 00000000000..73a5edd2c58
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/FireTempest.java
@@ -0,0 +1,58 @@
+/*
+ * 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.portal;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DamageEverythingEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class FireTempest extends CardImpl {
+
+ public FireTempest(UUID ownerId) {
+ super(ownerId, 133, "Fire Tempest", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{R}{R}");
+ this.expansionSetCode = "POR";
+
+ // Fire Tempest deals 6 damage to each creature and each player.
+ this.getSpellAbility().addEffect(new DamageEverythingEffect(6));
+ }
+
+ public FireTempest(final FireTempest card) {
+ super(card);
+ }
+
+ @Override
+ public FireTempest copy() {
+ return new FireTempest(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/JungleLion.java b/Mage.Sets/src/mage/sets/portal/JungleLion.java
new file mode 100644
index 00000000000..96cc8628217
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/JungleLion.java
@@ -0,0 +1,63 @@
+/*
+ * 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.portal;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.CantBlockAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class JungleLion extends CardImpl {
+
+ public JungleLion(UUID ownerId) {
+ super(ownerId, 96, "Jungle Lion", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{G}");
+ this.expansionSetCode = "POR";
+ this.subtype.add("Cat");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Jungle Lion can't block.
+ this.addAbility(new CantBlockAbility());
+ }
+
+ public JungleLion(final JungleLion card) {
+ super(card);
+ }
+
+ @Override
+ public JungleLion copy() {
+ return new JungleLion(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/LavaFlow.java b/Mage.Sets/src/mage/sets/portal/LavaFlow.java
new file mode 100644
index 00000000000..90da5519b19
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/LavaFlow.java
@@ -0,0 +1,69 @@
+/*
+ * 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.portal;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.FilterPermanent;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.CardTypePredicate;
+import mage.target.Target;
+import mage.target.TargetPermanent;
+
+/**
+ *
+ * @author anonymous
+ */
+public class LavaFlow extends CardImpl {
+ private static final FilterPermanent filter = new FilterPermanent("creature or land");
+ static {
+ filter.add(Predicates.or(new CardTypePredicate(CardType.CREATURE), new CardTypePredicate(CardType.LAND)));
+ }
+
+ public LavaFlow(UUID ownerId) {
+ super(ownerId, 143, "Lava Flow", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{3}{R}{R}");
+ this.expansionSetCode = "POR";
+
+ // Destroy target creature or land.
+ this.getSpellAbility().addEffect(new DestroyTargetEffect());
+ Target target = new TargetPermanent(filter);
+ this.getSpellAbility().addTarget(target);
+ }
+
+ public LavaFlow(final LavaFlow card) {
+ super(card);
+ }
+
+ @Override
+ public LavaFlow copy() {
+ return new LavaFlow(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portal/MercenaryKnight.java b/Mage.Sets/src/mage/sets/portal/MercenaryKnight.java
new file mode 100644
index 00000000000..7aba7fa471e
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portal/MercenaryKnight.java
@@ -0,0 +1,69 @@
+/*
+ * 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.portal;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.costs.common.DiscardTargetCost;
+import mage.abilities.effects.common.SacrificeSourceUnlessPaysEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.common.FilterCreatureCard;
+import mage.target.common.TargetCardInHand;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class MercenaryKnight extends CardImpl {
+
+ public MercenaryKnight(UUID ownerId) {
+ super(ownerId, 22, "Mercenary Knight", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}");
+ this.expansionSetCode = "POR";
+ this.subtype.add("Human");
+ this.subtype.add("Mercenary");
+ this.subtype.add("Knight");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // When Mercenary Knight enters the battlefield, sacrifice it unless you discard a creature card.
+ this.addAbility(new EntersBattlefieldTriggeredAbility(new SacrificeSourceUnlessPaysEffect(new DiscardTargetCost(new TargetCardInHand(new FilterCreatureCard("a creature card"))))));
+ }
+
+ public MercenaryKnight(final MercenaryKnight card) {
+ super(card);
+ }
+
+ @Override
+ public MercenaryKnight copy() {
+ return new MercenaryKnight(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java b/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.java
new file mode 100644
index 00000000000..21362c14c5b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portalsecondage/AlluringScent.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.portalsecondage;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class AlluringScent extends mage.sets.portal.AlluringScent {
+
+ public AlluringScent(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 61;
+ this.expansionSetCode = "PO2";
+ }
+
+ public AlluringScent(final AlluringScent card) {
+ super(card);
+ }
+
+ @Override
+ public AlluringScent copy() {
+ return new AlluringScent(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java b/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.java
new file mode 100644
index 00000000000..46420f52aa4
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portalsecondage/BeeSting.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.portalsecondage;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class BeeSting extends mage.sets.portal.BeeSting {
+
+ public BeeSting(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 64;
+ this.expansionSetCode = "PO2";
+ }
+
+ public BeeSting(final BeeSting card) {
+ super(card);
+ }
+
+ @Override
+ public BeeSting copy() {
+ return new BeeSting(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java b/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java
new file mode 100644
index 00000000000..78317a733e3
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portalsecondage/IronhoofOx.java
@@ -0,0 +1,64 @@
+/*
+ * 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.portalsecondage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.effects.common.combat.CantBeBlockedByMoreThanOneSourceEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author anonymous
+ */
+public class IronhoofOx extends CardImpl {
+
+ public IronhoofOx(UUID ownerId) {
+ super(ownerId, 70, "Ironhoof Ox", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
+ this.expansionSetCode = "PO2";
+ this.subtype.add("Ox");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // Ironhoof Ox can't be blocked by more than one creature.
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByMoreThanOneSourceEffect()));
+ }
+
+ public IronhoofOx(final IronhoofOx card) {
+ super(card);
+ }
+
+ @Override
+ public IronhoofOx copy() {
+ return new IronhoofOx(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portalsecondage/OgreArsonist.java b/Mage.Sets/src/mage/sets/portalsecondage/OgreArsonist.java
new file mode 100644
index 00000000000..cb8e78b43f1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portalsecondage/OgreArsonist.java
@@ -0,0 +1,70 @@
+/*
+ * 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.portalsecondage;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.abilities.keyword.EchoAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.common.TargetLandPermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class OgreArsonist extends CardImpl {
+
+ public OgreArsonist(UUID ownerId) {
+ super(ownerId, 110, "Ogre Arsonist", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{R}");
+ this.expansionSetCode = "PO2";
+ this.subtype.add("Ogre");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(3);
+
+ // When Ogre Arsonist enters the battlefield, destroy target land.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
+ ability.addTarget(new TargetLandPermanent());
+ this.addAbility(ability);
+
+ }
+
+ public OgreArsonist(final OgreArsonist card) {
+ super(card);
+ }
+
+ @Override
+ public OgreArsonist copy() {
+ return new OgreArsonist(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/FireAmbush.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/FireAmbush.java
new file mode 100644
index 00000000000..336a88dc4ca
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/FireAmbush.java
@@ -0,0 +1,61 @@
+/*
+ * 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.portalthreekingdoms;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreatureOrPlayer;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FireAmbush extends CardImpl {
+
+ public FireAmbush(UUID ownerId) {
+ super(ownerId, 111, "Fire Ambush", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{1}{R}");
+ this.expansionSetCode = "PTK";
+
+ // Fire Ambush deals 3 damage to target creature or player.
+ this.getSpellAbility().addEffect(new DamageTargetEffect(3));
+ this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
+ }
+
+ public FireAmbush(final FireAmbush card) {
+ super(card);
+ }
+
+ @Override
+ public FireAmbush copy() {
+ return new FireAmbush(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/portalthreekingdoms/RavagingHorde.java b/Mage.Sets/src/mage/sets/portalthreekingdoms/RavagingHorde.java
new file mode 100644
index 00000000000..33c5af074f1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/portalthreekingdoms/RavagingHorde.java
@@ -0,0 +1,70 @@
+/*
+ * 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.portalthreekingdoms;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.DestroyTargetEffect;
+import mage.abilities.keyword.EchoAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.target.common.TargetLandPermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class RavagingHorde extends CardImpl {
+
+ public RavagingHorde(UUID ownerId) {
+ super(ownerId, 118, "Ravaging Horde", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{R}{R}");
+ this.expansionSetCode = "PTK";
+ this.subtype.add("Human");
+ this.subtype.add("Soldier");
+ this.power = new MageInt(3);
+ this.toughness = new MageInt(3);
+
+ // When Ravaging Horde enters the battlefield, destroy target land.
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
+ ability.addTarget(new TargetLandPermanent());
+ this.addAbility(ability);
+ }
+
+ public RavagingHorde(final RavagingHorde card) {
+ super(card);
+ }
+
+ @Override
+ public RavagingHorde copy() {
+ return new RavagingHorde(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/prereleaseevents/FalseProphet.java b/Mage.Sets/src/mage/sets/prereleaseevents/FalseProphet.java
new file mode 100644
index 00000000000..b288153460b
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/prereleaseevents/FalseProphet.java
@@ -0,0 +1,55 @@
+/*
+ * 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.prereleaseevents;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FalseProphet extends mage.sets.urzasdestiny.FalseProphet {
+
+ public FalseProphet(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 7;
+ this.expansionSetCode = "PTC";
+ this.rarity = Rarity.SPECIAL;
+ }
+
+ public FalseProphet(final FalseProphet card) {
+ super(card);
+ }
+
+ @Override
+ public FalseProphet copy() {
+ return new FalseProphet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java b/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java
index 1815f45eda4..20480a867c8 100644
--- a/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java
+++ b/Mage.Sets/src/mage/sets/ravnica/BelltowerSphinx.java
@@ -27,22 +27,22 @@
*/
package mage.sets.ravnica;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
* @author nantuko
*/
@@ -86,9 +86,14 @@ class BelltowerSphinxEffect extends TriggeredAbilityImpl {
return new BelltowerSphinxEffect(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
+ if (event.getTargetId().equals(this.sourceId)) {
UUID controller = game.getControllerId(event.getSourceId());
if (controller != null) {
Player player = game.getPlayer(controller);
diff --git a/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java b/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java
index fd5d9b39157..26741f9e704 100644
--- a/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java
+++ b/Mage.Sets/src/mage/sets/ravnica/BreathOfFury.java
@@ -28,29 +28,30 @@
package mage.sets.ravnica;
import java.util.UUID;
-import mage.cards.CardImpl;
-import mage.constants.Rarity;
-import mage.constants.CardType;
-import mage.target.TargetPermanent;
-import mage.target.common.TargetControlledCreaturePermanent;
-import mage.abilities.effects.common.AttachEffect;
-import mage.constants.Outcome;
import mage.abilities.Ability;
-import mage.abilities.keyword.EnchantAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.AttachEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TurnPhase;
import mage.constants.Zone;
-import mage.game.events.GameEvent;
+import mage.filter.common.FilterControlledCreaturePermanent;
+import mage.filter.predicate.permanent.CanBeEnchantedByPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
-import mage.abilities.effects.OneShotEffect;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
+import mage.game.turn.TurnMod;
import mage.players.Player;
import mage.target.Target;
-import mage.filter.common.FilterControlledCreaturePermanent;
-import mage.game.turn.TurnMod;
-import mage.constants.TurnPhase;
-import mage.filter.predicate.permanent.CanBeEnchantedByPredicate;
+import mage.target.TargetPermanent;
+import mage.target.common.TargetControlledCreaturePermanent;
/**
* @author duncant
*/
@@ -96,21 +97,24 @@ class BreathOfFuryAbility extends TriggeredAbilityImpl {
return new BreathOfFuryAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent enchantment = game.getPermanent(getSourceId());
- if (damageEvent.isCombatDamage() &&
- enchantment != null &&
- enchantment.getAttachedTo().equals(event.getSourceId())) {
- Permanent creature = game.getPermanent(enchantment.getAttachedTo());
- if (creature != null) {
- for (Effect effect : getEffects()) {
- effect.setValue("TriggeringCreatureId", creature.getId());
- }
- return true;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent enchantment = game.getPermanent(getSourceId());
+ if (damageEvent.isCombatDamage() &&
+ enchantment != null &&
+ enchantment.getAttachedTo().equals(event.getSourceId())) {
+ Permanent creature = game.getPermanent(enchantment.getAttachedTo());
+ if (creature != null) {
+ for (Effect effect : getEffects()) {
+ effect.setValue("TriggeringCreatureId", creature.getId());
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java
new file mode 100644
index 00000000000..4ab45ecce4c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/ravnica/FollowedFootsteps.java
@@ -0,0 +1,109 @@
+/*
+ * 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.ravnica;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.common.OnEventTriggeredAbility;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.AttachEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.permanent.Permanent;
+import mage.game.permanent.token.EmptyToken;
+import mage.target.TargetPermanent;
+import mage.target.common.TargetCreaturePermanent;
+import mage.util.CardUtil;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FollowedFootsteps extends CardImpl {
+
+ public FollowedFootsteps(UUID ownerId) {
+ super(ownerId, 51, "Followed Footsteps", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
+ this.expansionSetCode = "RAV";
+ this.subtype.add("Aura");
+
+ // Enchant creature
+ TargetPermanent auraTarget = new TargetCreaturePermanent();
+ this.getSpellAbility().addTarget(auraTarget);
+ this.getSpellAbility().addEffect(new AttachEffect(Outcome.Copy));
+ Ability ability = new EnchantAbility(auraTarget.getTargetName());
+ this.addAbility(ability);
+
+ // At the beginning of your upkeep, put a token that's a copy of enchanted creature onto the battlefield.
+ this.addAbility(new OnEventTriggeredAbility(GameEvent.EventType.UPKEEP_STEP_PRE, "beginning of your upkeep", new FollowedFootstepsEffect(), false));
+ }
+
+ public FollowedFootsteps(final FollowedFootsteps card) {
+ super(card);
+ }
+
+ @Override
+ public FollowedFootsteps copy() {
+ return new FollowedFootsteps(this);
+ }
+}
+
+class FollowedFootstepsEffect extends OneShotEffect {
+
+ public FollowedFootstepsEffect() {
+ super(Outcome.PutCreatureInPlay);
+ this.staticText = "You put a token onto the battlefield that's a copy of enchanted creature";
+ }
+
+ public FollowedFootstepsEffect(final FollowedFootstepsEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public FollowedFootstepsEffect copy() {
+ return new FollowedFootstepsEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Permanent enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());
+ Permanent target = game.getPermanentOrLKIBattlefield(enchantment.getAttachedTo());
+ if (target != null) {
+ EmptyToken token = new EmptyToken();
+ CardUtil.copyTo(token).from(target);
+ token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java b/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java
index a3790504e3e..8b31778fb04 100644
--- a/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java
+++ b/Mage.Sets/src/mage/sets/ravnica/TwilightDrover.java
@@ -43,6 +43,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
@@ -95,17 +96,20 @@ class TwilightDroverTriggeredAbility extends TriggeredAbilityImpl {
public TwilightDroverTriggeredAbility copy() {
return new TwilightDroverTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanentOrLKIBattlefield(targetId);
- if (permanent != null) {
- return permanent.getCardType().contains(CardType.CREATURE) && permanent instanceof PermanentToken;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanentOrLKIBattlefield(targetId);
+ if (permanent != null) {
+ return permanent.getCardType().contains(CardType.CREATURE) && permanent instanceof PermanentToken;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java b/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java
index b6aa841b69b..0540913d9b7 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/AshZealot.java
@@ -29,9 +29,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
@@ -39,9 +36,12 @@ import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.targetpointer.FixedTarget;
@@ -96,9 +96,14 @@ class AshZealotTriggeredAbility extends TriggeredAbilityImpl {
return new AshZealotTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.GRAVEYARD) {
+ if (event.getZone() == Zone.GRAVEYARD) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null) {
for (Effect effect : this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java b/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java
index a70782eca81..040d0822919 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/AzorsElocutors.java
@@ -28,12 +28,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Outcome;
-import mage.constants.TargetController;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -41,9 +35,15 @@ import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.counters.Counter;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -96,12 +96,14 @@ class AzorsElocutorsTriggeredAbility extends TriggeredAbilityImpl {
return new AzorsElocutorsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return event.getTargetId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java b/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java
index fb6f584b6cf..e09ca773fc1 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/ChronicFlooding.java
@@ -29,9 +29,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
@@ -39,10 +36,13 @@ import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -89,20 +89,23 @@ class ChronicFloodingAbility extends TriggeredAbilityImpl {
ChronicFloodingAbility(final ChronicFloodingAbility ability) {
super(ability);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent source = game.getPermanent(this.sourceId);
- if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
- Permanent attached = game.getPermanent(source.getAttachedTo());
- if (attached != null) {
-
- for (Effect e : getEffects()) {
- e.setTargetPointer(new FixedTarget(attached.getControllerId()));
- }
- return true;
+ Permanent source = game.getPermanent(this.sourceId);
+ if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
+ Permanent attached = game.getPermanent(source.getAttachedTo());
+ if (attached != null) {
+
+ for (Effect e : getEffects()) {
+ e.setTargetPointer(new FixedTarget(attached.getControllerId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java b/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java
index 340ece52494..aec0e7eb0fe 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/CrosstownCourier.java
@@ -28,19 +28,19 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.dynamicvalue.common.StaticValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -85,11 +85,15 @@ public class CrosstownCourier extends CardImpl {
return new CrosstownCourierTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && ((DamagedPlayerEvent) event).isCombatDamage()) {
- for (Effect effect:getEffects()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ for (Effect effect : getEffects()) {
if (effect instanceof PutLibraryIntoGraveTargetEffect) {
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
((PutLibraryIntoGraveTargetEffect) effect).setAmount(new StaticValue(event.getAmount()));
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java b/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java
index 32601942dde..86ef17515c0 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/DeathsPresence.java
@@ -29,16 +29,16 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledCreaturePermanent;
@@ -83,10 +83,14 @@ class DeathsPresenceTriggeredAbility extends TriggeredAbilityImpl {
return new DeathsPresenceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE
- && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
+ if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java b/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java
index c83780397b9..d28418b9095 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/GraveBetrayal.java
@@ -29,11 +29,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
@@ -44,12 +39,17 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.SubLayer;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -97,10 +97,14 @@ class GraveBetrayalTriggeredAbility extends TriggeredAbilityImpl {
return new GraveBetrayalTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE
- && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
+ if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && !permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java b/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java
index ece1c64a992..c0638aed100 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/JaceArchitectOfThought.java
@@ -31,19 +31,10 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Layer;
-import mage.constants.Outcome;
-import mage.constants.PhaseStep;
-import mage.constants.Rarity;
-import mage.constants.SubLayer;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
-import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
@@ -53,14 +44,19 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterCard;
import mage.filter.common.FilterNonlandCard;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
-import mage.game.turn.Step;
import mage.players.Player;
import mage.target.TargetCard;
import mage.target.common.TargetCardInExile;
@@ -118,15 +114,18 @@ class JaceArchitectOfThoughtDelayedTriggeredAbility extends DelayedTriggeredAbil
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
- if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
- for (Effect effect : getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- }
- return true;
+ if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
+ for (Effect effect : getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java
index 74623e0cfbe..570c89917f2 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/LobberCrew.java
@@ -29,11 +29,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.TargetController;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
@@ -42,8 +37,13 @@ import mage.abilities.effects.common.DamagePlayersEffect;
import mage.abilities.effects.common.UntapSourceEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -93,13 +93,16 @@ class LobberCrewTriggeredAbility extends TriggeredAbilityImpl {
return new LobberCrewTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) {
- return true;
- }
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) {
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java b/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java
index 3cdce461326..9982076c195 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/NecropolisRegent.java
@@ -28,9 +28,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
@@ -38,11 +35,14 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -93,18 +93,21 @@ class NecropolisRegentTriggeredAbility extends TriggeredAbilityImpl {
return new NecropolisRegentTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if (((DamagedPlayerEvent) event).isCombatDamage()) {
- Permanent creature = game.getPermanent(event.getSourceId());
- if (creature != null && creature.getControllerId().equals(controllerId)) {
- this.getEffects().clear();
- Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(event.getAmount()));
- effect.setTargetPointer(new FixedTarget(creature.getId()));
- this.addEffect(effect);
- return true;
- }
+ if (((DamagedPlayerEvent) event).isCombatDamage()) {
+ Permanent creature = game.getPermanent(event.getSourceId());
+ if (creature != null && creature.getControllerId().equals(controllerId)) {
+ this.getEffects().clear();
+ Effect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance(event.getAmount()));
+ effect.setTargetPointer(new FixedTarget(creature.getId()));
+ this.addEffect(effect);
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java
index 1bbf63022c7..a001e95d098 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/Pyroconvergence.java
@@ -29,15 +29,15 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.common.TargetCreatureOrPlayer;
@@ -81,15 +81,15 @@ class PyroconvergenceTriggeredAbility extends TriggeredAbilityImpl {
return new PyroconvergenceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId())) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isMulticolored() && event.getPlayerId().equals(getControllerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java b/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java
index 3032bf26c30..1d0e8b0be59 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/SearchTheCity.java
@@ -28,22 +28,22 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.game.turn.TurnMod;
@@ -125,10 +125,14 @@ class SearchTheCityTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST || event.getType() == EventType.LAND_PLAYED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if ((event.getType() == GameEvent.EventType.SPELL_CAST || event.getType() == GameEvent.EventType.LAND_PLAYED)
- && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
String cardName = "";
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
Spell spell = game.getStack().getSpell(event.getTargetId());
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java b/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java
index fc91274ff33..71d8f323641 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/ShriekingAffliction.java
@@ -29,17 +29,17 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -93,9 +93,14 @@ class ShriekingAfflictionTriggeredAbility extends TriggeredAbilityImpl {
return new ShriekingAfflictionTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player player = game.getPlayer(event.getPlayerId());
if (player != null && player.getHand().size() < 2) {
this.getEffects().clear();
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java b/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java
index 48f58783b3d..68a9d768ce0 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/SkymarkRoc.java
@@ -29,14 +29,13 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
@@ -44,6 +43,7 @@ import mage.filter.predicate.mageobject.ToughnessPredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreaturePermanent;
/**
@@ -87,9 +87,14 @@ class SkymarkRocAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
+ if (event.getSourceId().equals(this.getSourceId())) {
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls with toughness 2 or less");
UUID defenderId = game.getCombat().getDefendingPlayerId(sourceId, game);
filter.add(new ControllerIdPredicate(defenderId));
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java b/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java
index 4a89055ee60..18db391510f 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/TrostaniSelesnyasVoice.java
@@ -29,7 +29,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-import static javax.xml.bind.JAXBIntrospector.getValue;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -46,6 +45,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -93,19 +93,22 @@ class TrostaniSelesnyasVoiceTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent.getCardType().contains(CardType.CREATURE)
- && permanent.getControllerId().equals(this.controllerId)
- && event.getTargetId() != this.getSourceId()) {
- Effect effect = this.getEffects().get(0);
- // life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution)
- effect.setValue("lifeSource", event.getTargetId());
- effect.setValue("zoneChangeCounter", permanent.getZoneChangeCounter(game));
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent.getCardType().contains(CardType.CREATURE)
+ && permanent.getControllerId().equals(this.controllerId)
+ && event.getTargetId() != this.getSourceId()) {
+ Effect effect = this.getEffects().get(0);
+ // life is determined during resolution so it has to be retrieved there (e.g. Giant Growth before resolution)
+ effect.setValue("lifeSource", event.getTargetId());
+ effect.setValue("zoneChangeCounter", permanent.getZoneChangeCounter(game));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java b/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java
index 7b599f6b00e..cc804adcfad 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/VolatileRig.java
@@ -29,11 +29,6 @@ package mage.sets.returntoravnica;
import java.util.List;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -42,7 +37,11 @@ import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
import mage.constants.PhaseStep;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -107,6 +106,12 @@ class VolatileRigTriggeredAbility extends TriggeredAbilityImpl {
return new VolatileRigTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COMBAT_DAMAGE_STEP_POST
+ || event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
/*
diff --git a/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java b/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java
index 8ba32e31cf1..e04c58658c0 100644
--- a/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java
+++ b/Mage.Sets/src/mage/sets/returntoravnica/VraskaTheUnseen.java
@@ -28,11 +28,6 @@
package mage.sets.returntoravnica;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.*;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
@@ -46,13 +41,20 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.LoseGameTargetPlayerEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.SubLayer;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedPlaneswalkerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
-import mage.game.turn.Step;
import mage.target.common.TargetNonlandPermanent;
import mage.target.targetpointer.FixedTarget;
@@ -178,9 +180,13 @@ class VraskaTheUnseenTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER && ((DamagedPlaneswalkerEvent) event).isCombatDamage() && event.getTargetId() == sourceId) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ if (((DamagedPlaneswalkerEvent) event).isCombatDamage() && event.getTargetId() == sourceId) {
Permanent sourceOfDamage = game.getPermanent(event.getSourceId());
if (sourceOfDamage != null && sourceOfDamage.getCardType().contains(CardType.CREATURE)) {
Effect effect = this.getEffects().get(0);
diff --git a/Mage.Sets/src/mage/sets/revisededition/ErgRaiders.java b/Mage.Sets/src/mage/sets/revisededition/ErgRaiders.java
new file mode 100644
index 00000000000..d6419978e4f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/revisededition/ErgRaiders.java
@@ -0,0 +1,53 @@
+/*
+ * 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.revisededition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class ErgRaiders extends mage.sets.fourthedition.ErgRaiders {
+
+ public ErgRaiders(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 17;
+ this.expansionSetCode = "3ED";
+ }
+
+ public ErgRaiders(final ErgRaiders card) {
+ super(card);
+ }
+
+ @Override
+ public ErgRaiders copy() {
+ return new ErgRaiders(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/revisededition/Onulet.java b/Mage.Sets/src/mage/sets/revisededition/Onulet.java
new file mode 100644
index 00000000000..9289aa7ff50
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/revisededition/Onulet.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.revisededition;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author anonymous
+ */
+public class Onulet extends mage.sets.mastersedition.Onulet {
+
+ public Onulet(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 269;
+ this.expansionSetCode = "3ED";
+ this.rarity = Rarity.RARE;
+ }
+
+ public Onulet(final Onulet card) {
+ super(card);
+ }
+
+ @Override
+ public Onulet copy() {
+ return new Onulet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.java
new file mode 100644
index 00000000000..2dd68aefcc1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/revisededition/PhantasmalForces.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.revisededition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {
+
+ public PhantasmalForces(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 69;
+ this.expansionSetCode = "3ED";
+ }
+
+ public PhantasmalForces(final PhantasmalForces card) {
+ super(card);
+ }
+
+ @Override
+ public PhantasmalForces copy() {
+ return new PhantasmalForces(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java b/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.java
new file mode 100644
index 00000000000..08073719432
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/revisededition/SedgeTroll.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.revisededition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {
+
+ public SedgeTroll(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 173;
+ this.expansionSetCode = "3ED";
+ }
+
+ public SedgeTroll(final SedgeTroll card) {
+ super(card);
+ }
+
+ @Override
+ public SedgeTroll copy() {
+ return new SedgeTroll(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java
index e8d1a74c219..9c08a777ab5 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AncientStirrings.java
@@ -37,6 +37,7 @@ import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorlessPredicate;
import java.util.UUID;
+import mage.constants.Zone;
/**
* @author LevelX
@@ -54,10 +55,11 @@ public class AncientStirrings extends CardImpl {
super(ownerId, 174, "Ancient Stirrings", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{G}");
this.expansionSetCode = "ROE";
-
// Look at the top five cards of your library. You may reveal a colorless card from among them and put it into your hand.
// Then put the rest on the bottom of your library in any order. (Cards with no colored mana in their mana costs are colorless. Lands are also colorless.)
- this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, false));
+ this.getSpellAbility().addEffect(new LookLibraryAndPickControllerEffect(new StaticValue(5), false, new StaticValue(1), filter, Zone.LIBRARY,
+ false, true, false, Zone.HAND, true));
+
}
public AncientStirrings(final AncientStirrings card) {
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java
index 636e9e8de86..f7fb2a5a09a 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/AngelheartVial.java
@@ -28,24 +28,24 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-
-import mage.constants.Outcome;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.Ability;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.RemoveCountersSourceCost;
import mage.abilities.costs.common.TapSourceCost;
-import mage.abilities.common.SimpleActivatedAbility;
-import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.costs.mana.GenericManaCost;
-import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
-import mage.game.Game;
import mage.counters.CounterType;
+import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -94,12 +94,17 @@ class AngelheartVialTriggeredAbility extends TriggeredAbilityImpl {
return new AngelheartVialTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if ((event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.getControllerId()))) {
- this.getEffects().get(0).setValue("damageAmount", event.getAmount());
- return true;
- }
+ if (event.getTargetId().equals(this.getControllerId())) {
+ this.getEffects().get(0).setValue("damageAmount", event.getAmount());
+ return true;
+ }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java
index e8dbc4fd6d1..cc5dbffc11c 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/BanefulOmen.java
@@ -27,22 +27,23 @@
*/
package mage.sets.riseoftheeldrazi;
+import java.util.Set;
import java.util.UUID;
-import mage.constants.Zone;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.cards.CardImpl;
-import mage.abilities.TriggeredAbilityImpl;
-import mage.game.Game;
-import mage.game.events.GameEvent;
-import mage.abilities.effects.OneShotEffect;
-import mage.constants.Outcome;
import mage.abilities.Ability;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
+import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
-import java.util.Set;
/**
*
@@ -83,12 +84,14 @@ public class BanefulOmen extends CardImpl {
return new BanefulOmenTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java
index 854f7419668..98dbcb72f86 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/ContaminatedGround.java
@@ -28,10 +28,6 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -41,8 +37,13 @@ import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.continuous.BecomesBasicLandEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -93,18 +94,21 @@ class ContaminatedGroundAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent source = game.getPermanent(this.sourceId);
- if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
- Permanent attached = game.getPermanent(source.getAttachedTo());
- if (attached != null) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
- for (Effect e : getEffects()) {
- e.setTargetPointer(new FixedTarget(attached.getControllerId()));
- }
- return true;
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent source = game.getPermanent(this.sourceId);
+ if (source != null && source.getAttachedTo().equals(event.getTargetId())) {
+ Permanent attached = game.getPermanent(source.getAttachedTo());
+ if (attached != null) {
+
+ for (Effect e : getEffects()) {
+ e.setTargetPointer(new FixedTarget(attached.getControllerId()));
}
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java
index e91deb95bb9..bd4d6e4b53f 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/CurseOfWizardry.java
@@ -27,8 +27,7 @@
*/
package mage.sets.riseoftheeldrazi;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -37,17 +36,18 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
import mage.choices.ChoiceColor;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
* @author jeffwadsworth
*/
@@ -123,18 +123,21 @@ class CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility extends Trigger
return new CurseOfWizardryPlayerCastsSpellChosenColorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent curseOfWizardry = game.getPermanent(getSourceId());
if (curseOfWizardry != null) {
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(curseOfWizardry.getId() + "_color");
if (chosenColor != null) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).shares(chosenColor)) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && spell.getColor(game).shares(chosenColor)) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java
index c8141e042f8..11b0df213d7 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/EmrakulTheAeonsTorn.java
@@ -28,11 +28,6 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -44,11 +39,16 @@ import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorlessPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.game.turn.TurnMod;
import mage.players.Player;
@@ -106,15 +106,15 @@ class EmrakulTheAeonsTornOnCastAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = (Spell) game.getObject(event.getTargetId());
- if (this.getSourceId().equals(spell.getSourceId())) {
- return true;
- }
- }
- return false;
+ Spell spell = (Spell) game.getObject(event.getTargetId());
+ return this.getSourceId().equals(spell.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java
index b52ecc52b86..d01d66c5968 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GideonJura.java
@@ -38,6 +38,7 @@ import mage.MageObjectReference;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.common.EntersBattlefieldAbility;
+import mage.abilities.effects.Effect;
import mage.abilities.effects.RequirementEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureSourceEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
@@ -85,7 +86,9 @@ public class GideonJura extends CardImpl {
// 0: Until end of turn, Gideon Jura becomes a 6/6 Human Soldier creature that's still a planeswalker. Prevent all damage that would be dealt to him this turn.
LoyaltyAbility ability3 = new LoyaltyAbility(new BecomesCreatureSourceEffect(new GideonJuraToken(), "planeswalker", Duration.EndOfTurn), 0);
- ability3.addEffect(new PreventAllDamageToSourceEffect(Duration.EndOfTurn));
+ Effect effect = new PreventAllDamageToSourceEffect(Duration.EndOfTurn);
+ effect.setText("Prevent all damage that would be dealt to him this turn");
+ ability3.addEffect(effect);
this.addAbility(ability3);
}
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java
index 26920211183..9d26571ba2a 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/GravityWell.java
@@ -29,17 +29,23 @@ package mage.sets.riseoftheeldrazi;
import java.util.Iterator;
import java.util.UUID;
-
-import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
-import mage.cards.CardImpl;
-import mage.game.Game;
-import mage.game.events.GameEvent;
-import mage.game.permanent.Permanent;
-import mage.abilities.keyword.FlyingAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.SubLayer;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
+import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
/**
@@ -52,7 +58,6 @@ public class GravityWell extends CardImpl {
super(ownerId, 185, "Gravity Well", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}");
this.expansionSetCode = "ROE";
-
// Whenever a creature with flying attacks, it loses flying until end of turn.
this.addAbility(new GravityWellTriggeredAbility());
}
@@ -70,82 +75,86 @@ public class GravityWell extends CardImpl {
class GravityWellTriggeredAbility extends TriggeredAbilityImpl {
public GravityWellTriggeredAbility() {
- super(Zone.BATTLEFIELD, new GravityWellEffect());
+ super(Zone.BATTLEFIELD, new GravityWellEffect());
}
public GravityWellTriggeredAbility(final GravityWellTriggeredAbility ability) {
- super(ability);
+ super(ability);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED ) {
- Permanent attacker = game.getPermanent(event.getSourceId());
- if (attacker != null && attacker.getAbilities().contains(FlyingAbility.getInstance())) {
- for (Effect effect : getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getSourceId()));
- }
- return true;
+ Permanent attacker = game.getPermanent(event.getSourceId());
+ if (attacker != null && attacker.getAbilities().contains(FlyingAbility.getInstance())) {
+ for (Effect effect : getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
+ return true;
}
return false;
}
@Override
public String getRule() {
- return "Whenever a creature with flying attacks, " + super.getRule();
+ return "Whenever a creature with flying attacks, " + super.getRule();
}
@Override
public GravityWellTriggeredAbility copy() {
- return new GravityWellTriggeredAbility(this);
+ return new GravityWellTriggeredAbility(this);
}
}
class GravityWellEffect extends ContinuousEffectImpl {
public GravityWellEffect() {
- super(Duration.EndOfTurn, Outcome.LoseAbility);
- staticText = "it loses flying until end of turn";
+ super(Duration.EndOfTurn, Outcome.LoseAbility);
+ staticText = "it loses flying until end of turn";
}
public GravityWellEffect(final GravityWellEffect effect) {
- super(effect);
+ super(effect);
}
@Override
public GravityWellEffect copy() {
- return new GravityWellEffect(this);
+ return new GravityWellEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
- Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
- if (permanent != null) {
+ Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
+ if (permanent != null) {
switch (layer) {
case AbilityAddingRemovingEffects_6:
if (sublayer == SubLayer.NA) {
- for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) {
+ for (Iterator i = permanent.getAbilities().iterator(); i.hasNext();) {
Ability entry = i.next();
- if (entry.getId().equals(FlyingAbility.getInstance().getId()))
- i.remove();
- }
+ if (entry.getId().equals(FlyingAbility.getInstance().getId())) {
+ i.remove();
+ }
+ }
}
break;
}
return true;
}
- return false;
+ return false;
}
@Override
public boolean apply(Game game, Ability source) {
- return false;
+ return false;
}
@Override
public boolean hasLayer(Layer layer) {
- return layer == Layer.AbilityAddingRemovingEffects_6;
+ return layer == Layer.AbilityAddingRemovingEffects_6;
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java
index 0deac7c55b3..9271b8d212a 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LighthouseChronologist.java
@@ -28,9 +28,7 @@
package mage.sets.riseoftheeldrazi;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.Abilities;
import mage.abilities.AbilitiesImpl;
@@ -41,13 +39,15 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.LevelUpAbility;
import mage.abilities.keyword.LevelerCardBuilder;
import mage.cards.LevelerCard;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.turn.TurnMod;
-import java.util.UUID;
-
/**
*
* @author BetaSteward_at_googlemail.com, noxx
@@ -108,12 +108,14 @@ class LighthouseChronologistAbility extends TriggeredAbilityImpl {
return new LighthouseChronologistAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && !game.getActivePlayerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return !game.getActivePlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java
index d32ca3ab7c5..e51fb876413 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/LightmineField.java
@@ -29,17 +29,17 @@ package mage.sets.riseoftheeldrazi;
import java.util.List;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -82,12 +82,14 @@ class LightmineFieldTriggeredAbility extends TriggeredAbilityImpl {
return new LightmineFieldTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_ATTACKERS && !game.getCombat().getAttackers().isEmpty()) {
- return true;
- }
- return false;
+ return !game.getCombat().getAttackers().isEmpty();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java
index f4a47a2c246..7ed2d119c1d 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/MorticianBeetle.java
@@ -27,22 +27,21 @@
*/
package mage.sets.riseoftheeldrazi;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
+import java.util.UUID;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
-import java.util.UUID;
-
/**
*
* @author North
@@ -81,6 +80,11 @@ class PlayerSacrificesCreatureTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SACRIFICED_PERMANENT;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.SACRIFICED_PERMANENT) {
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java
index c609cfaca16..27d3eca54aa 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/NirkanaRevenant.java
@@ -28,25 +28,26 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-import mage.constants.Outcome;
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
-import mage.cards.CardImpl;
-import mage.abilities.costs.mana.ManaCostsImpl;
-import mage.abilities.effects.common.continuous.BoostSourceEffect;
-import mage.abilities.common.SimpleActivatedAbility;
-import mage.constants.Zone;
-import mage.constants.Duration;
-import mage.game.Game;
-import mage.game.events.GameEvent;
-import mage.game.permanent.Permanent;
-import mage.target.targetpointer.FixedTarget;
import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
-import mage.players.Player;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.continuous.BoostSourceEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
+import mage.game.permanent.Permanent;
+import mage.players.Player;
+import mage.target.targetpointer.FixedTarget;
/**
*
@@ -80,39 +81,42 @@ public class NirkanaRevenant extends CardImpl {
}
}
- class NirkanaRevenantTriggeredAbility extends TriggeredAbilityImpl {
+class NirkanaRevenantTriggeredAbility extends TriggeredAbilityImpl {
public NirkanaRevenantTriggeredAbility() {
- super(Zone.BATTLEFIELD, new NirkanaRevenantEffect());
+ super(Zone.BATTLEFIELD, new NirkanaRevenantEffect());
}
public NirkanaRevenantTriggeredAbility(final NirkanaRevenantTriggeredAbility ability) {
- super(ability);
+ super(ability);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA ) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- if (permanent == null) {
- permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
- }
- if (permanent != null && permanent.getSubtype().contains("Swamp") && permanent.getControllerId().equals(this.controllerId)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
- return true;
- }
- }
- return false;
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ if (permanent == null) {
+ permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
+ }
+ if (permanent != null && permanent.getSubtype().contains("Swamp") && permanent.getControllerId().equals(this.controllerId)) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
+ return true;
+ }
+ return false;
}
@Override
public NirkanaRevenantTriggeredAbility copy() {
- return new NirkanaRevenantTriggeredAbility(this);
+ return new NirkanaRevenantTriggeredAbility(this);
}
@Override
public String getRule() {
- return "Whenever you tap a Swamp for mana, add B to your mana pool (in addition to the mana the land produces).";
+ return "Whenever you tap a Swamp for mana, add {B} to your mana pool.";
}
}
@@ -138,8 +142,6 @@ class NirkanaRevenantEffect extends OneShotEffect {
@Override
public NirkanaRevenantEffect copy() {
- return new NirkanaRevenantEffect(this);
+ return new NirkanaRevenantEffect(this);
}
}
-
-
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java
index 33e4def384f..cb8fabc54a3 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/PawnOfUlamog.java
@@ -28,14 +28,14 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -87,9 +87,13 @@ class PawnOfUlamogTriggeredAbility extends TriggeredAbilityImpl {
return new PawnOfUlamogTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
UUID targetId = event.getTargetId();
MageObject card = game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
if (card != null && card instanceof Permanent && !(card instanceof PermanentToken)) {
@@ -104,7 +108,6 @@ class PawnOfUlamogTriggeredAbility extends TriggeredAbilityImpl {
return true;
}
}
- }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java
index 14afa729600..34d9bd0719c 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RaidBombardment.java
@@ -28,15 +28,15 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -80,9 +80,14 @@ class RaidBombardmentTriggeredAbility extends TriggeredAbilityImpl {
return new RaidBombardmentTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && game.getActivePlayerId().equals(this.controllerId) ) {
+ if (game.getActivePlayerId().equals(this.controllerId) ) {
Permanent attacker = game.getPermanent(event.getSourceId());
if (attacker != null) {
if (attacker.getPower().getValue() <= 2) {
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java
index 30d39552110..cf2796dfc5a 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RapaciousOne.java
@@ -28,14 +28,14 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
@@ -86,10 +86,14 @@ class RapaciousOneTriggeredAbility extends TriggeredAbilityImpl {
return new RapaciousOneTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
this.getEffects().clear();
this.addEffect(new CreateTokenEffect(new EldraziSpawnToken(), event.getAmount()));
return true;
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java
index 2f3f445d5f6..2f8202380d3 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/RenegadeDoppelganger.java
@@ -28,19 +28,20 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import mage.util.functions.EmptyApplyToPermanent;
@@ -89,9 +90,14 @@ class RenegadeDoppelgangerTriggeredAbility extends TriggeredAbilityImpl {
return new RenegadeDoppelgangerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && !event.getTargetId().equals(this.getSourceId())) {
+ if (!event.getTargetId().equals(this.getSourceId())) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) {
for (Effect effect : this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java
index 45efa75b0a4..5daad05f235 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/SnakeUmbra.java
@@ -32,6 +32,7 @@ import java.util.UUID;
import mage.constants.*;
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.DealsDamageToOpponentTriggeredAbility;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
@@ -54,7 +55,6 @@ public class SnakeUmbra extends CardImpl {
this.expansionSetCode = "ROE";
this.subtype.add("Aura");
-
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
@@ -63,11 +63,14 @@ public class SnakeUmbra extends CardImpl {
this.addAbility(ability);
// Enchanted creature gets +1/+1
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield)));
+ ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
// and has "Whenever this creature deals damage to an opponent, you may draw a card."
Ability gainedAbility = new DealsDamageToOpponentTriggeredAbility(new DrawCardSourceControllerEffect(1), true);
- this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA)));
+ Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
+ effect.setText("and has \"Whenever this creature deals damage to an opponent, you may draw a card.\"");
+ ability.addEffect(effect);
+ this.addAbility(ability);
// Totem armor
this.addAbility(new TotemArmorAbility());
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java
index 0d3da8ef6b8..cbf82ffea26 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/UlamogTheInfiniteGyre.java
@@ -96,15 +96,15 @@ class UlamogTheInfiniteGyreDestroyOnCastAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if ( event.getType() == EventType.SPELL_CAST ) {
- Spell spell = (Spell)game.getObject(event.getTargetId());
- if ( this.getSourceId().equals(spell.getSourceId())) {
- return true;
- }
- }
- return false;
+ Spell spell = (Spell) game.getObject(event.getTargetId());
+ return this.getSourceId().equals(spell.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java
index 9c7ba35b6b1..307633b212a 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/Vengevine.java
@@ -29,15 +29,15 @@
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.WatcherScope;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToBattlefieldEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.WatcherScope;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -88,9 +88,14 @@ class VengevineAbility extends TriggeredAbilityImpl {
return new VengevineAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) {
+ if (event.getPlayerId().equals(controllerId)) {
Watcher watcher = game.getState().getWatchers().get("CreatureCast", controllerId);
if (watcher != null && watcher.conditionMet()) {
return true;
diff --git a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java
index 4e1640d7dc7..a2f39bf1f69 100644
--- a/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java
+++ b/Mage.Sets/src/mage/sets/riseoftheeldrazi/WorldAtWar.java
@@ -27,25 +27,25 @@
*/
package mage.sets.riseoftheeldrazi;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.Set;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.ReboundAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
import mage.watchers.Watcher;
import mage.watchers.common.AttackedThisTurnWatcher;
-import java.util.Set;
-import java.util.UUID;
-
/**
* @author magenoxx_at_gmail.com
*/
@@ -124,6 +124,11 @@ class UntapDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new UntapDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.PHASE_CHANGED || event.getType() == EventType.COMBAT_PHASE_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java
index 0d469c9204b..10d84c5d417 100644
--- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java
+++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/EbonyOwlNetsuke.java
@@ -28,21 +28,16 @@
package mage.sets.saviorsofkamigawa;
import java.util.UUID;
-import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
-import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.Effect;
-import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
-import mage.constants.Outcome;
import mage.constants.Rarity;
-import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -85,10 +80,15 @@ class EbonyOwlNetsukeTriggeredAbility extends TriggeredAbilityImpl {
public EbonyOwlNetsukeTriggeredAbility copy() {
return new EbonyOwlNetsukeTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player player = game.getPlayer(event.getPlayerId());
if (player != null) {
for (Effect effect: getEffects() ) {
diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java
index a5bccc17851..51e2714c222 100644
--- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java
+++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/ErayoSoratamiAscendant.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.Token;
import mage.target.targetpointer.FixedTarget;
import mage.watchers.common.CastSpellLastTurnWatcher;
@@ -96,15 +97,15 @@ class ErayoSoratamiAscendantTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
- if (watcher != null && watcher.getAmountOfSpellsAllPlayersCastOnCurrentTurn() == 4) {
- return true;
- }
- }
- return false;
+ CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
+ return watcher != null && watcher.getAmountOfSpellsAllPlayersCastOnCurrentTurn() == 4;
}
@Override
@@ -141,18 +142,21 @@ class ErayosEssenceTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
- CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
- if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 1) {
- for (Effect effect : getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
- }
- }
+ if (game.getOpponents(getControllerId()).contains(event.getPlayerId())) {
+ CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get("CastSpellLastTurnWatcher");
+ if (watcher != null && watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 1) {
+ for (Effect effect : getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
+ }
+ return true;
+ }
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java
index fc8d11bbb3a..bb7d72fb0ae 100644
--- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java
+++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/KiyomaroFirstToStand.java
@@ -50,6 +50,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -109,18 +110,20 @@ class KiyomaroFirstToStandDealsDamageTriggeredAbility extends TriggeredAbilityIm
return new KiyomaroFirstToStandDealsDamageTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.DAMAGED_CREATURE)
- || event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER)
- || event.getType().equals(GameEvent.EventType.DAMAGED_PLANESWALKER)) {
- if (event.getSourceId().equals(this.getSourceId())) {
- for (Effect effect : this.getEffects()) {
- effect.setValue("damage", event.getAmount());
- }
- return true;
+ if (event.getSourceId().equals(this.getSourceId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setValue("damage", event.getAmount());
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java
index 02c7ded7a0f..7a1ccdf9675 100644
--- a/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java
+++ b/Mage.Sets/src/mage/sets/saviorsofkamigawa/PureIntentions.java
@@ -43,6 +43,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.StackObject;
import mage.target.targetpointer.FixedTarget;
@@ -84,10 +85,14 @@ class PureIntentionsAllTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) &&
- game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) &&
+ if (game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) &&
StackObject.class.isInstance(game.getObject(event.getSourceId()))) {
Card card = game.getCard(event.getTargetId());
if (card != null && card.getOwnerId().equals(getControllerId())) {
@@ -128,15 +133,16 @@ class PureIntentionsTriggeredAbility extends TriggeredAbilityImpl {
return new PureIntentionsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (GameEvent.EventType.DISCARDED_CARD.equals(event.getType()) &&
- game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) &&
+ return game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId())) &&
StackObject.class.isInstance(game.getObject(event.getSourceId())) &&
- event.getTargetId().equals(getSourceId())) {
- return true;
- }
- return false;
+ event.getTargetId().equals(getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java
index 703dc889763..ffc6aa8980b 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/CopperhornScout.java
@@ -29,15 +29,15 @@ package mage.sets.scarsofmirrodin;
import java.util.List;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -87,12 +87,14 @@ class CopperhornScoutTriggeredAbility extends TriggeredAbilityImpl {
return new CopperhornScoutTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
- return true;
- }
- return false;
+ return event.getSourceId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java
index c68c61942b4..16abfb1ebac 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/DissipationField.java
@@ -28,15 +28,15 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -80,9 +80,14 @@ class DissipationFieldAbility extends TriggeredAbilityImpl {
return new DissipationFieldAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getTargetId().equals(this.controllerId)) {
+ if (event.getTargetId().equals(this.controllerId)) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java
index 99aed7807b2..523bbbc51c7 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/EzurisArchers.java
@@ -28,10 +28,6 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
@@ -39,6 +35,10 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.keyword.ReachAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -83,13 +83,14 @@ class BlocksCreatureWithFlyingTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.BLOCKER_DECLARED && event.getSourceId().equals(this.getSourceId())
- && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId())) {
- return true;
- }
- return false;
+ return event.getSourceId().equals(this.getSourceId()) && game.getPermanent(event.getTargetId()).getAbilities().containsKey(FlyingAbility.getInstance().getId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java
index 85b12616967..8fbe362f197 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/FurnaceCelebration.java
@@ -28,16 +28,17 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreatureOrPlayer;
/**
@@ -80,12 +81,14 @@ class FurnaceCelebrationAbility extends TriggeredAbilityImpl {
return new FurnaceCelebrationAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SACRIFICED_PERMANENT;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT && event.getPlayerId().equals(this.getControllerId()) && !event.getTargetId().equals(sourceId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.getControllerId()) && !event.getTargetId().equals(sourceId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java
index 2a64e091632..0f12cba5cd3 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/GolemsHeart.java
@@ -29,14 +29,15 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -77,15 +78,15 @@ class GolemsHeartAbility extends TriggeredAbilityImpl {
return new GolemsHeartAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.CAST_SPELL;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getCardType().contains(CardType.ARTIFACT)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getCardType().contains(CardType.ARTIFACT);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java
index 61fe030a29d..d3c3290bba2 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/InfiltrationLens.java
@@ -28,18 +28,19 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -80,15 +81,18 @@ class EquippedBecomesBlockedTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.CREATURE_BLOCKED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.CREATURE_BLOCKED) {
- Permanent equipment = game.getPermanent(sourceId);
- if (equipment != null && equipment.getAttachedTo() != null) {
- Permanent equipped = game.getPermanent(equipment.getAttachedTo());
- if (equipped.getId().equals(event.getTargetId())) {
- return true;
- }
+ Permanent equipment = game.getPermanent(sourceId);
+ if (equipment != null && equipment.getAttachedTo() != null) {
+ Permanent equipped = game.getPermanent(equipment.getAttachedTo());
+ if (equipped.getId().equals(event.getTargetId())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java
index 02128386942..c9c727992b0 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/KothOfTheHammer.java
@@ -28,6 +28,7 @@
package mage.sets.scarsofmirrodin;
+import java.util.UUID;
import mage.MageInt;
import mage.Mana;
import mage.abilities.Ability;
@@ -45,7 +46,14 @@ import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
-import mage.constants.*;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.SubLayer;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
@@ -57,8 +65,6 @@ import mage.game.permanent.token.Token;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetLandPermanent;
-import java.util.UUID;
-
/**
*
* @author Loki, North
@@ -121,7 +127,7 @@ class KothOfTheHammerToken extends Token {
class KothOfTheHammerEmblem extends Emblem {
// "Mountains you control have '{T}: This land deals 1 damage to target creature or player.'"
public KothOfTheHammerEmblem() {
- this.setName("EMBLEM: Kothe of the Hammer");
+ this.setName("EMBLEM: Koth of the Hammer");
this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new KothOfTheHammerThirdEffect()));
}
}
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java
index 13089d5f07d..40c1c6d4096 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LiegeOfTheTangle.java
@@ -30,14 +30,6 @@ package mage.sets.scarsofmirrodin;
import java.util.Iterator;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Layer;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.SubLayer;
-import mage.constants.Zone;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
@@ -46,11 +38,19 @@ import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Layer;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.SubLayer;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.target.Target;
@@ -100,16 +100,16 @@ class LiegeOfTheTangleTriggeredAbility extends TriggeredAbilityImpl {
return new LiegeOfTheTangleTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getId().equals(this.getSourceId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ return damageEvent.isCombatDamage() && p != null && p.getId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java
index 2dea0d04459..1da3f6b9b53 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/LivewireLash.java
@@ -28,11 +28,6 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-import mage.constants.AttachmentType;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
@@ -41,6 +36,11 @@ import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -90,9 +90,14 @@ class LivewireLashAbility extends TriggeredAbilityImpl {
return new LivewireLashAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED && event.getTargetId().equals(sourceId)) {
+ if (event.getTargetId().equals(sourceId)) {
if (game.getObject(event.getSourceId()) instanceof Spell) {
return true;
}
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java
index 53df62a3c52..b194cda67d5 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MimicVat.java
@@ -27,8 +27,7 @@
*/
package mage.sets.scarsofmirrodin;
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
@@ -41,20 +40,21 @@ import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.EmptyToken;
+import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
import mage.util.CardUtil;
-import java.util.UUID;
-import mage.players.Player;
-
/**
* @author nantuko
*/
@@ -98,31 +98,33 @@ class MimicVatTriggeredAbility extends TriggeredAbilityImpl {
return new MimicVatTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
-
- // make sure card is on battlefield
- UUID sourceCardId = getSourceId();
- if (game.getPermanent(sourceCardId) == null) {
- // or it is being removed
- if (game.getLastKnownInformation(sourceCardId, Zone.BATTLEFIELD) == null) {
- return false;
- }
+ // make sure card is on battlefield
+ UUID sourceCardId = getSourceId();
+ if (game.getPermanent(sourceCardId) == null) {
+ // or it is being removed
+ if (game.getLastKnownInformation(sourceCardId, Zone.BATTLEFIELD) == null) {
+ return false;
}
+ }
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- Permanent permanent = zEvent.getTarget();
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ Permanent permanent = zEvent.getTarget();
- if (permanent != null &&
- zEvent.getToZone() == Zone.GRAVEYARD &&
- zEvent.getFromZone() == Zone.BATTLEFIELD &&
- !(permanent instanceof PermanentToken) &&
- permanent.getCardType().contains(CardType.CREATURE)) {
+ if (permanent != null &&
+ zEvent.getToZone() == Zone.GRAVEYARD &&
+ zEvent.getFromZone() == Zone.BATTLEFIELD &&
+ !(permanent instanceof PermanentToken) &&
+ permanent.getCardType().contains(CardType.CREATURE)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
- return true;
- }
+ getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java
index c858186ec10..1f62917e78d 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MolderBeast.java
@@ -28,16 +28,15 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -81,17 +80,17 @@ class MolderBeastTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getFromZone() == Zone.BATTLEFIELD
- && zEvent.getToZone() == Zone.GRAVEYARD
- && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)) {
- return true;
- }
- }
- return false;
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ return zEvent.getFromZone() == Zone.BATTLEFIELD
+ && zEvent.getToZone() == Zone.GRAVEYARD
+ && zEvent.getTarget().getCardType().contains(CardType.ARTIFACT);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java
index 05767199d28..c364a6028ae 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/MoltenTailMasticore.java
@@ -46,6 +46,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetCreatureOrPlayer;
@@ -99,9 +100,14 @@ class MoltenTailMasticoreAbility extends TriggeredAbilityImpl {
return new MoltenTailMasticoreAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId);
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java
index b4b6ef5f52f..060d2c19887 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/NimDeathmantle.java
@@ -27,7 +27,7 @@
*/
package mage.sets.scarsofmirrodin;
-import mage.constants.*;
+import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -43,16 +43,21 @@ import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.IntimidateAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentToken;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-
/**
*
* @author nantuko
@@ -101,32 +106,34 @@ class NimDeathmantleTriggeredAbility extends TriggeredAbilityImpl {
return new NimDeathmantleTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
-
- // make sure card is on battlefield
- UUID sourceId = getSourceId();
- if (game.getPermanent(sourceId) == null) {
- // or it is being removed
- if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
- return false;
- }
+ // make sure card is on battlefield
+ UUID sourceId = getSourceId();
+ if (game.getPermanent(sourceId) == null) {
+ // or it is being removed
+ if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
+ return false;
}
+ }
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- Permanent permanent = zEvent.getTarget();
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ Permanent permanent = zEvent.getTarget();
- if (permanent != null &&
- permanent.getControllerId().equals(this.controllerId) &&
- zEvent.getToZone() == Zone.GRAVEYARD &&
- zEvent.getFromZone() == Zone.BATTLEFIELD &&
- !(permanent instanceof PermanentToken) &&
- permanent.getCardType().contains(CardType.CREATURE)) {
+ if (permanent != null
+ && permanent.getControllerId().equals(this.controllerId)
+ && zEvent.getToZone() == Zone.GRAVEYARD
+ && zEvent.getFromZone() == Zone.BATTLEFIELD
+ && !(permanent instanceof PermanentToken)
+ && permanent.getCardType().contains(CardType.CREATURE)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
- return true;
- }
+ getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java
index 82e3be572b5..13f7a9967b5 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/OgreGeargrabber.java
@@ -28,11 +28,6 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.TargetController;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
@@ -40,12 +35,18 @@ import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@@ -141,12 +142,14 @@ class OgreGeargrabberDelayedTriggeredAbility extends DelayedTriggeredAbility {
this.equipmentId = ability.equipmentId;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LOST_CONTROL;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LOST_CONTROL && event.getPlayerId().equals(controllerId) && event.getTargetId().equals(equipmentId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(controllerId) && event.getTargetId().equals(equipmentId);
}
@Override
public OgreGeargrabberDelayedTriggeredAbility copy() {
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java
index 0332d1c5eea..56486ccc836 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/PrecursorGolem.java
@@ -27,26 +27,26 @@
*/
package mage.sets.scarsofmirrodin;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
+import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
-import mage.game.Game;
-import mage.game.events.GameEvent;
-import mage.game.permanent.Permanent;
-import mage.game.stack.Spell;
-import mage.target.Target;
-
-import java.util.UUID;
-import mage.abilities.effects.common.CopySpellForEachItCouldTargetEffect;
import mage.filter.FilterInPlay;
import mage.filter.common.FilterCreaturePermanent;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
+import mage.game.permanent.Permanent;
import mage.game.permanent.token.GolemToken;
+import mage.game.stack.Spell;
+import mage.target.Target;
import mage.util.TargetAddress;
/**
@@ -94,15 +94,15 @@ class PrecursorGolemCopyTriggeredAbility extends TriggeredAbilityImpl {
return new PrecursorGolemCopyTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (checkSpell(spell, game)) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return checkSpell(spell, game);
}
private boolean checkSpell(Spell spell, Game game) {
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java
index 5c063b2fcfe..4c96874e071 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/RelicPutrescence.java
@@ -29,17 +29,16 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.counter.AddCountersControllerEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -93,14 +92,17 @@ class RelicPutrescenceAbility extends TriggeredAbilityImpl {
return new RelicPutrescenceAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TAPPED) {
- Permanent enchantment = game.getPermanent(sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- if (event.getTargetId().equals(enchantment.getAttachedTo())) {
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ if (event.getTargetId().equals(enchantment.getAttachedTo())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java
index c1a1fcbc87d..e29f9088ea9 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/SwordOfBodyAndMind.java
@@ -28,12 +28,9 @@
package mage.sets.scarsofmirrodin;
-import mage.constants.AttachmentType;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
+import java.util.UUID;
import mage.ObjectColor;
+import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
@@ -45,19 +42,22 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.WolfToken;
import mage.target.targetpointer.FixedTarget;
-import java.util.UUID;
-import mage.abilities.Ability;
-
/**
*
* @author Loki
@@ -117,17 +117,20 @@ class SwordOfBodyAndMindAbility extends TriggeredAbilityImpl {
return new SwordOfBodyAndMindAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java
index cb13e9a6900..0b2216e27f9 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/TunnelIgnus.java
@@ -31,24 +31,23 @@ package mage.sets.scarsofmirrodin;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
import mage.watchers.Watcher;
-import java.util.UUID;
-import mage.constants.WatcherScope;
-
/**
* @author Loki
*/
@@ -130,19 +129,21 @@ class TunnelIgnusTriggeredAbility extends TriggeredAbilityImpl {
return new TunnelIgnusTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent != null && permanent.getCardType().contains(CardType.LAND) && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) {
- TunnelIgnusWatcher watcher = (TunnelIgnusWatcher) game.getState().getWatchers().get("LandPlayedCount", this.controllerId);
- if (watcher != null && watcher.counts.get(permanent.getControllerId()) > 1) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
- }
- return true;
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent != null && permanent.getCardType().contains(CardType.LAND) && game.getOpponents(this.controllerId).contains(permanent.getControllerId())) {
+ TunnelIgnusWatcher watcher = (TunnelIgnusWatcher) game.getState().getWatchers().get("LandPlayedCount", this.controllerId);
+ if (watcher != null && watcher.counts.get(permanent.getControllerId()) > 1) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(permanent.getControllerId()));
}
- return false;
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java
index f9103782c4c..2182a3dd8a6 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VenserTheSojourner.java
@@ -30,11 +30,6 @@ package mage.sets.scarsofmirrodin;
import java.util.UUID;
import mage.MageObject;
-
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.LoyaltyAbility;
import mage.abilities.TriggeredAbilityImpl;
@@ -48,8 +43,12 @@ import mage.abilities.effects.common.ReturnFromExileEffect;
import mage.abilities.effects.common.combat.CantBeBlockedAllEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.filter.FilterSpell;
@@ -58,6 +57,7 @@ import mage.filter.predicate.other.OwnerPredicate;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
@@ -189,9 +189,14 @@ class VenserTheSojournerSpellCastTriggeredAbility extends TriggeredAbilityImpl {
this.rememberSource = ability.rememberSource;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && filter.match(spell, game)) {
if (rememberSource) {
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java
index 5b3de9f46b2..31a8376731a 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/VigilForTheLost.java
@@ -29,18 +29,18 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -83,10 +83,14 @@ class VigilForTheLostTriggeredAbility extends TriggeredAbilityImpl {
return new VigilForTheLostTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE &&
- ((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD &&
+ if (((ZoneChangeEvent)event).getToZone() == Zone.GRAVEYARD &&
((ZoneChangeEvent)event).getFromZone() == Zone.BATTLEFIELD) {
Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (p.getControllerId().equals(this.getControllerId()) && p.getCardType().contains(CardType.CREATURE)) {
diff --git a/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java b/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java
index 8df89f9a4b9..2ba1d92343f 100644
--- a/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java
+++ b/Mage.Sets/src/mage/sets/scarsofmirrodin/ViridianRevel.java
@@ -29,16 +29,16 @@
package mage.sets.scarsofmirrodin;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.players.Player;
@@ -81,9 +81,14 @@ class ViridianRevelTriggeredAbility extends TriggeredAbilityImpl {
return new ViridianRevelTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ if (((ZoneChangeEvent)event).isDiesEvent()) {
Card card = game.getCard(event.getTargetId());
Player controller = game.getPlayer(getControllerId());
if (controller != null && card != null && card.getCardType().contains(CardType.ARTIFACT)
diff --git a/Mage.Sets/src/mage/sets/scourge/ExtraArms.java b/Mage.Sets/src/mage/sets/scourge/ExtraArms.java
new file mode 100644
index 00000000000..b148cfeb158
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/scourge/ExtraArms.java
@@ -0,0 +1,77 @@
+/*
+ * 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.scourge;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.common.AttacksAttachedTriggeredAbility;
+import mage.abilities.effects.common.AttachEffect;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.keyword.EnchantAbility;
+import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.target.TargetPermanent;
+import mage.target.common.TargetCreatureOrPlayer;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class ExtraArms extends CardImpl {
+
+ public ExtraArms(UUID ownerId) {
+ super(ownerId, 92, "Extra Arms", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{R}");
+ this.expansionSetCode = "SCG";
+ this.subtype.add("Aura");
+
+ // Enchant creature
+ TargetPermanent auraTarget = new TargetCreaturePermanent();
+ this.getSpellAbility().addTarget(auraTarget);
+ this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
+ Ability ability = new EnchantAbility(auraTarget.getTargetName());
+ this.addAbility(ability);
+ // Whenever enchanted creature attacks, it deals 2 damage to target creature or player.
+ ability = new AttacksAttachedTriggeredAbility(new DamageTargetEffect(2), AttachmentType.AURA, false);
+ ability.addTarget(new TargetCreatureOrPlayer());
+ this.addAbility(ability);
+ }
+
+ public ExtraArms(final ExtraArms card) {
+ super(card);
+ }
+
+ @Override
+ public ExtraArms copy() {
+ return new ExtraArms(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java b/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java
index 8eefa287fe1..0ecc20afea8 100644
--- a/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java
+++ b/Mage.Sets/src/mage/sets/scourge/PyrostaticPillar.java
@@ -28,7 +28,6 @@
package mage.sets.scourge;
import java.util.UUID;
-
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
@@ -38,6 +37,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.targetpointer.FixedTarget;
@@ -83,16 +83,19 @@ class PyrostaticPillarTriggeredAbility extends TriggeredAbilityImpl {
return new PyrostaticPillarTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.SPELL_CAST){
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if(spell != null && spell.getConvertedManaCost() <= 3){
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && spell.getConvertedManaCost() <= 3){
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java b/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java
index c411bb82f41..efa1e86873c 100644
--- a/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java
+++ b/Mage.Sets/src/mage/sets/scourge/XantidSwarm.java
@@ -42,6 +42,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -91,9 +92,14 @@ class XantidSwarmTriggeredAbility extends TriggeredAbilityImpl {
return new XantidSwarmTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId())) {
+ if (event.getSourceId().equals(this.getSourceId())) {
UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game);
this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
return true;
diff --git a/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java b/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java
index ffd7cc6f5d0..ea9bcd7ade4 100644
--- a/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java
+++ b/Mage.Sets/src/mage/sets/seventhedition/AEtherFlash.java
@@ -38,6 +38,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -78,19 +79,22 @@ class AEtherFlashTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanent(targetId);
- if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
- if (getTargets().size() == 0) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(targetId));
- }
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanent(targetId);
+ if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
+ if (getTargets().size() == 0) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(targetId));
}
- return true;
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java b/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java
index f3c2fa96bf6..14f568597d3 100644
--- a/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java
+++ b/Mage.Sets/src/mage/sets/seventhedition/FinalFortune.java
@@ -38,6 +38,7 @@ import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.turn.TurnMod;
import mage.players.Player;
@@ -117,14 +118,14 @@ class FinalFortuneLoseDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new FinalFortuneLoseDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) {
- if (connectedTurnMod != null && connectedTurnMod.equals(game.getState().getTurnId())) {
- return true;
- }
- }
- return false;
+ return connectedTurnMod != null && connectedTurnMod.equals(game.getState().getTurnId());
}
public void setConnectedTurnMod(UUID connectedTurnMod) {
diff --git a/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java b/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java
index d2bd4b22835..b55edf8374b 100644
--- a/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java
+++ b/Mage.Sets/src/mage/sets/seventhedition/RelentlessAssault.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.TurnPhase;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
import mage.watchers.Watcher;
@@ -160,6 +161,12 @@ class RelentlessAssaultDelayedAddMainPhaseAbility extends DelayedTriggeredAbilit
return new RelentlessAssaultDelayedAddMainPhaseAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.PHASE_CHANGED
+ || event.getType() == EventType.COMBAT_PHASE_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.PHASE_CHANGED && this.connectedTurnMod.equals(event.getSourceId())) {
diff --git a/Mage.Sets/src/mage/sets/seventhedition/Rowen.java b/Mage.Sets/src/mage/sets/seventhedition/Rowen.java
index 0fb92631fdb..92ffd483ee6 100644
--- a/Mage.Sets/src/mage/sets/seventhedition/Rowen.java
+++ b/Mage.Sets/src/mage/sets/seventhedition/Rowen.java
@@ -39,6 +39,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -84,9 +85,14 @@ class RowenAbility extends TriggeredAbilityImpl {
return new RowenAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DREW_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
if (game.getActivePlayerId().equals(this.getControllerId()) && this.lastTriggeredTurn != game.getTurnNum()) {
Card card = game.getCard(event.getTargetId());
Player controller = game.getPlayer(this.getControllerId());
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java b/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java
index 5ba1bd8ef54..072db5ea809 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/AshenmoorLiege.java
@@ -107,9 +107,14 @@ class AshenmoorLiegeTriggeredAbility extends TriggeredAbilityImpl {
return new AshenmoorLiegeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED && event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
+ if (event.getTargetId().equals(this.getSourceId()) && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
return true;
}
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java b/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java
index 1f2c4b99845..e64a220bb48 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/DemigodOfRevenge.java
@@ -44,6 +44,7 @@ import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.NamePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -94,12 +95,14 @@ class DemigodOfRevengeTriggeredAbility extends TriggeredAbilityImpl {
return new DemigodOfRevengeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.SPELL_CAST) && event.getSourceId().equals(this.getSourceId())) {
- return true;
- }
- return false;
+ return event.getSourceId().equals(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java b/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java
index 0357616ac7f..43423eb386c 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/FlourishingDefenses.java
@@ -37,6 +37,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.ElfToken;
@@ -81,10 +82,14 @@ class FlourishingDefensesTriggeredAbility extends TriggeredAbilityImpl {
return new FlourishingDefensesTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTER_ADDED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.COUNTER_ADDED
- && event.getData().equals(CounterType.M1M1.getName())) {
+ if (event.getData().equals(CounterType.M1M1.getName())) {
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
if (permanent.getCardType().contains(CardType.CREATURE)) {
return true;
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java b/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java
index 7b4916bdfd5..e94e6b2e98e 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/GlamerSpinners.java
@@ -111,10 +111,11 @@ class GlamerSpinnersEffect extends OneShotEffect {
5/1/2008 You may target a permanent that has no Auras enchanting it.
5/1/2008 When the ability resolves, you choose the permanent that will be receiving the Auras. It can't be the targeted permanent, it must have the same controller as the targeted permanent, and it must be able to be enchanted by all the Auras attached to the targeted permanent. If you can't choose a permanent that meets all those criteria, the Auras won't move.
*/
- Boolean passed = true;
- Permanent targetPermanent = game.getPermanent(source.getFirstTarget());
+ Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
- if (targetPermanent != null) {
+ Permanent sourcePermanent = (Permanent) source.getSourceObject(game);
+ if (targetPermanent != null && controller != null && sourcePermanent != null) {
+ Boolean passed = true;
FilterPermanent filterChoice = new FilterPermanent("a different permanent with the same controller as the target to attach the enchantments to");
filterChoice.add(new ControllerIdPredicate(targetPermanent.getControllerId()));
filterChoice.add(Predicates.not(new PermanentIdPredicate(targetPermanent.getId())));
@@ -122,11 +123,10 @@ class GlamerSpinnersEffect extends OneShotEffect {
Target chosenPermanentToAttachAuras = new TargetPermanent(filterChoice);
chosenPermanentToAttachAuras.setNotTarget(true);
- LinkedList auras = new LinkedList();
+ LinkedList auras = new LinkedList<>();
auras.addAll(targetPermanent.getAttachments());
- if (controller != null
- && controller.choose(Outcome.Neutral, chosenPermanentToAttachAuras, source.getSourceId(), game)) {
+ if (controller.choose(Outcome.Neutral, chosenPermanentToAttachAuras, source.getSourceId(), game)) {
Permanent permanentToAttachAuras = game.getPermanent(chosenPermanentToAttachAuras.getFirstTarget());
if (permanentToAttachAuras != null) {
for (UUID auraId : auras) {
@@ -148,7 +148,7 @@ class GlamerSpinnersEffect extends OneShotEffect {
}
}
if (passed) {
- LinkedList aurasToAttach = new LinkedList();
+ LinkedList aurasToAttach = new LinkedList<>();
aurasToAttach.addAll(auras);
for (UUID auraId : aurasToAttach) {
@@ -158,10 +158,12 @@ class GlamerSpinnersEffect extends OneShotEffect {
}
return true;
}
+ game.informPlayers(sourcePermanent.getLogName() + ": No enchantments were moved from the target permanent.");
}
}
+ return true;
}
- game.informPlayers("Glamer Spinners: No enchantments were moved from the target permanent.");
+
return false;
}
}
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java b/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java
index 81864e22c2d..a94d495c56d 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/HollowbornBarghest.java
@@ -45,6 +45,7 @@ import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -124,9 +125,14 @@ class HollowbornBarghestTriggeredAbility extends TriggeredAbilityImpl {
return new HollowbornBarghestTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null && opponent.getHand().size() == 0) {
opponent.loseLife(2, game);
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java b/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java
index 2f1ec921331..d1f35cab7e8 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/RakingCanopy.java
@@ -38,6 +38,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -81,19 +82,22 @@ class RakingCanopyTriggeredAbility extends TriggeredAbilityImpl {
return new RakingCanopyTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
- Permanent attacker = game.getPermanent(event.getSourceId());
- if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) {
- return false;
- }
- if (event.getTargetId().equals(this.getControllerId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(attacker.getId()));
- }
- return true;
+ Permanent attacker = game.getPermanent(event.getSourceId());
+ if (attacker == null || !attacker.getAbilities().contains(FlyingAbility.getInstance())) {
+ return false;
+ }
+ if (event.getTargetId().equals(this.getControllerId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(attacker.getId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java b/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java
index 0900ed73daa..d4167644912 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/SpitefulVisions.java
@@ -28,9 +28,6 @@
package mage.sets.shadowmoor;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfDrawTriggeredAbility;
@@ -38,10 +35,13 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DrawCardTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -83,9 +83,14 @@ class SpitefulVisionsTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DREW_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DREW_CARD && event.getPlayerId() != null) {
+ if (event.getPlayerId() != null) {
for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
diff --git a/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java b/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java
index 7528a7e2917..fc2dcde3187 100644
--- a/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java
+++ b/Mage.Sets/src/mage/sets/shadowmoor/TowerAbove.java
@@ -45,6 +45,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
@@ -127,10 +128,14 @@ class TowerAboveTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED
- && event.getSourceId().equals(this.getSourceId())) {
+ if (event.getSourceId().equals(this.getSourceId())) {
this.getTargets().clear();
TargetCreaturePermanent target = new TargetCreaturePermanent();
this.addTarget(target);
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java b/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java
index fb9757e95e2..ee4e35dfd6d 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/AngelicBenediction.java
@@ -28,13 +28,13 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.TapTargetEffect;
import mage.abilities.keyword.ExaltedAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -82,9 +82,14 @@ class AngelicBenedictionTriggeredAbility extends TriggeredAbilityImpl {
return new AngelicBenedictionTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId)) {
+ if (game.getActivePlayerId().equals(this.controllerId)) {
if (game.getCombat().attacksAlone()) {
return true;
}
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java b/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java
index ac3646c87cf..ac0a0ca696c 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/BattlegraceAngel.java
@@ -96,9 +96,14 @@ class BattlegraceAngelAbility extends TriggeredAbilityImpl {
return new BattlegraceAngelAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) {
+ if (game.getActivePlayerId().equals(this.controllerId) ) {
if (game.getCombat().attacksAlone()) {
for (Effect effect: this.getEffects()) {
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java
index 93c64d92bb1..a025c8c109b 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/CradleOfVitality.java
@@ -28,15 +28,15 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -88,9 +88,14 @@ class CradleOfVitalityGainLifeTriggeredAbility extends TriggeredAbilityImpl {
return new CradleOfVitalityGainLifeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.GAINED_LIFE && event.getPlayerId().equals(this.controllerId)) {
+ if (event.getPlayerId().equals(this.controllerId)) {
this.getEffects().get(0).setValue("amount", event.getAmount());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java b/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java
index 9029908afa2..6f11a6e1fa3 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/Drumhunter.java
@@ -28,19 +28,20 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -95,6 +96,11 @@ class DrumHunterTriggeredAbility extends TriggeredAbilityImpl {
return new DrumHunterTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java b/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java
index 71f96db6773..c1fa5e7a721 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/ExuberantFirestoker.java
@@ -28,19 +28,20 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.TargetPlayer;
/**
@@ -97,12 +98,14 @@ class ExuberantFirestokerTriggeredAbility extends TriggeredAbilityImpl {
return new ExuberantFirestokerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java b/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java
index d7615f200e1..56944a32e1c 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/Manaplasm.java
@@ -28,18 +28,18 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.InfoEffect;
import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Duration;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.targetpointer.FixedTarget;
@@ -85,17 +85,20 @@ class ManaplasmAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getControllerId().equals(controllerId)) {
- this.getEffects().remove(0);
- int x = spell.getConvertedManaCost();
- this.addEffect(new BoostSourceEffect(x,x, Duration.EndOfTurn));
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && spell.getControllerId().equals(controllerId)) {
+ this.getEffects().remove(0);
+ int x = spell.getConvertedManaCost();
+ this.addEffect(new BoostSourceEffect(x,x, Duration.EndOfTurn));
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java b/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java
index 14f2cd93a5a..5bb12e51f6b 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/MemoryErosion.java
@@ -28,15 +28,15 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.PutLibraryIntoGraveTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.targetpointer.FixedTarget;
@@ -78,14 +78,17 @@ class SpellCastTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && game.getOpponents(this.getControllerId()).contains(spell.getControllerId())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && game.getOpponents(this.getControllerId()).contains(spell.getControllerId())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java b/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java
index e340be7c793..d409f300f14 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/MightyEmergence.java
@@ -28,23 +28,23 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.Filter;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -88,19 +88,22 @@ class MightyEmergenceTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanent(targetId);
- if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
- if (getTargets().size() == 0) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(targetId));
- }
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanent(targetId);
+ if (filter.match(permanent, getSourceId(), getControllerId(), game)) {
+ if (getTargets().size() == 0) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(targetId));
}
- return true;
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java b/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java
index 581a1106ec0..80f01f08aa5 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/PrinceOfThralls.java
@@ -28,10 +28,6 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -40,9 +36,13 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -91,19 +91,22 @@ class PrinceOfThrallsTriggeredAbility extends TriggeredAbilityImpl {
return new PrinceOfThrallsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
- if (zEvent.getToZone() == Zone.GRAVEYARD) {
- if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
- Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (game.getOpponents(this.getControllerId()).contains(permanent.getControllerId())) {
- for (Effect effect : getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getToZone() == Zone.GRAVEYARD) {
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
+ Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (game.getOpponents(this.getControllerId()).contains(permanent.getControllerId())) {
+ for (Effect effect : getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java b/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java
index c9f169b29f6..971e1eee26e 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/QuietusSpike.java
@@ -28,11 +28,6 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-import mage.constants.AttachmentType;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -43,9 +38,15 @@ import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.DeathtouchAbility;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.AttachmentType;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -94,17 +95,20 @@ class QuietusSpikeTriggeredAbility extends TriggeredAbilityImpl {
return new QuietusSpikeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java
index 9fd2d5a7039..feb186fc1f5 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/RafiqOfTheMany.java
@@ -95,9 +95,14 @@ class RafiqOfTheManyAbility extends TriggeredAbilityImpl {
return new RafiqOfTheManyAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_ATTACKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) {
+ if (game.getActivePlayerId().equals(this.controllerId) ) {
if (game.getCombat().attacksAlone()) {
for (Effect effect: this.getEffects()) {
effect.setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java b/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java
index aa1d7aa00d2..f9000f459ea 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/Skeletonize.java
@@ -28,11 +28,6 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.Ability;
@@ -44,6 +39,11 @@ import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -123,15 +123,18 @@ class SkeletonizeDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new SkeletonizeDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.ZONE_CHANGE)) {
- ZoneChangeEvent zce = (ZoneChangeEvent) event;
- if (zce.isDiesEvent()) {
- DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", this.getSourceId());
- if (watcher != null) {
- return watcher.wasDamaged(zce.getTarget(), game);
- }
+ ZoneChangeEvent zce = (ZoneChangeEvent) event;
+ if (zce.isDiesEvent()) {
+ DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get("DamagedByWatcher", this.getSourceId());
+ if (watcher != null) {
+ return watcher.wasDamaged(zce.getTarget(), game);
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java b/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java
index 096f447de3c..48981e3b3e1 100644
--- a/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java
+++ b/Mage.Sets/src/mage/sets/shardsofalara/SunseedNurturer.java
@@ -28,19 +28,20 @@
package mage.sets.shardsofalara;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.mana.ColorlessManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.Filter;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.mageobject.PowerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -95,12 +96,14 @@ class SunseedNurturerTriggeredAbility extends TriggeredAbilityImpl {
return new SunseedNurturerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/starter1999/AlluringScent.java b/Mage.Sets/src/mage/sets/starter1999/AlluringScent.java
new file mode 100644
index 00000000000..a9596f50154
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/starter1999/AlluringScent.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.starter1999;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class AlluringScent extends mage.sets.portal.AlluringScent {
+
+ public AlluringScent(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 124;
+ this.expansionSetCode = "S99";
+ }
+
+ public AlluringScent(final AlluringScent card) {
+ super(card);
+ }
+
+ @Override
+ public AlluringScent copy() {
+ return new AlluringScent(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/starter1999/FireTempest.java b/Mage.Sets/src/mage/sets/starter1999/FireTempest.java
new file mode 100644
index 00000000000..dc65152b60f
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/starter1999/FireTempest.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.starter1999;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class FireTempest extends mage.sets.portal.FireTempest {
+
+ public FireTempest(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 97;
+ this.expansionSetCode = "S99";
+ }
+
+ public FireTempest(final FireTempest card) {
+ super(card);
+ }
+
+ @Override
+ public FireTempest copy() {
+ return new FireTempest(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java b/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java
index 1183e47a5f0..b210f4313cf 100644
--- a/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java
+++ b/Mage.Sets/src/mage/sets/stronghold/HornOfGreed.java
@@ -36,6 +36,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -77,13 +78,15 @@ class HornOfGreedAbility extends TriggeredAbilityImpl {
return new HornOfGreedAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LAND_PLAYED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LAND_PLAYED) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
- return true;
- }
- return false;
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java b/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java
index 0e9c8f527c2..2d4aec7bcc8 100644
--- a/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java
+++ b/Mage.Sets/src/mage/sets/stronghold/Overgrowth.java
@@ -41,6 +41,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -94,18 +95,21 @@ class OvergrowthTriggeredAbility extends TriggeredManaAbility {
return new OvergrowthTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent enchantment = game.getPermanent(this.getSourceId());
- if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
- if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
- Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
- if (enchanted != null) {
- getEffects().get(0).setTargetPointer(new FixedTarget(enchanted.getControllerId()));
- return true;
- }
+ if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
+ Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
+ if (enchanted != null) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(enchanted.getControllerId()));
+ return true;
}
- }
+ }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/stronghold/SacredGround.java b/Mage.Sets/src/mage/sets/stronghold/SacredGround.java
index d10fc0980db..6b14762daee 100644
--- a/Mage.Sets/src/mage/sets/stronghold/SacredGround.java
+++ b/Mage.Sets/src/mage/sets/stronghold/SacredGround.java
@@ -28,8 +28,6 @@
package mage.sets.stronghold;
import java.util.UUID;
-
-import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
import mage.cards.CardImpl;
@@ -38,9 +36,9 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
-import mage.game.stack.StackObject;
import mage.target.targetpointer.FixedTarget;
/**
@@ -83,10 +81,14 @@ class SacredGroundTriggeredAbility extends TriggeredAbilityImpl {
return new SacredGroundTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (GameEvent.EventType.ZONE_CHANGE.equals(event.getType()) &&
- game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) {
+ if (game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) {
ZoneChangeEvent zce = (ZoneChangeEvent) event;
if (Zone.BATTLEFIELD.equals(zce.getFromZone()) && Zone.GRAVEYARD.equals(zce.getToZone())) {
Permanent targetPermanent = zce.getTarget();
diff --git a/Mage.Sets/src/mage/sets/stronghold/TidalWarrior.java b/Mage.Sets/src/mage/sets/stronghold/TidalWarrior.java
new file mode 100644
index 00000000000..56a850505f8
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/stronghold/TidalWarrior.java
@@ -0,0 +1,72 @@
+/*
+ * 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.stronghold;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.effects.common.continuous.BecomesBasicLandTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.common.TargetLandPermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class TidalWarrior extends CardImpl {
+
+ public TidalWarrior(UUID ownerId) {
+ super(ownerId, 47, "Tidal Warrior", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{U}");
+ this.expansionSetCode = "STH";
+ this.subtype.add("Merfolk");
+ this.subtype.add("Warrior");
+ this.power = new MageInt(1);
+ this.toughness = new MageInt(1);
+
+ // {tap}: Target land becomes an Island until end of turn.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new BecomesBasicLandTargetEffect(Duration.EndOfTurn, "Island"), new TapSourceCost());
+ ability.addTarget(new TargetLandPermanent());
+ this.addAbility(ability);
+ }
+
+ public TidalWarrior(final TidalWarrior card) {
+ super(card);
+ }
+
+ @Override
+ public TidalWarrior copy() {
+ return new TidalWarrior(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java b/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java
index 0c4f7ab0647..fe9b995e0d0 100644
--- a/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java
+++ b/Mage.Sets/src/mage/sets/stronghold/WallOfEssence.java
@@ -41,6 +41,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
/**
@@ -88,10 +89,14 @@ class WallOfEssenceTriggeredAbility extends TriggeredAbilityImpl {
return new WallOfEssenceTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)
- && ((DamagedCreatureEvent)event).isCombatDamage() ) {
+ if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent)event).isCombatDamage() ) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java b/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java
index eedb00ce94d..31c7159c47f 100644
--- a/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java
+++ b/Mage.Sets/src/mage/sets/tempestremastered/CoffinQueen.java
@@ -36,7 +36,6 @@ import mage.abilities.common.SkipUntapOptionalAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
-import mage.abilities.effects.common.CreateDelayedTriggeredAbilityEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.cards.CardImpl;
@@ -48,6 +47,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInGraveyard;
import mage.target.targetpointer.FixedTarget;
@@ -130,6 +130,12 @@ class CoffinQueenDelayedTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LOST_CONTROL
+ || event.getType() == EventType.UNTAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
diff --git a/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java b/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java
index 1cbf2dcdd8e..95ff8787b10 100644
--- a/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java
+++ b/Mage.Sets/src/mage/sets/tempestremastered/Spellshock.java
@@ -37,6 +37,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
import mage.target.targetpointer.FixedTarget;
@@ -81,16 +82,19 @@ class SpellshockTriggeredAbility extends TriggeredAbilityImpl {
return new SpellshockTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.SPELL_CAST){
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if(spell != null){
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
- return true;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null){
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java b/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java
index 903774db9c5..84c284b0f12 100644
--- a/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java
+++ b/Mage.Sets/src/mage/sets/tempestremastered/WallOfSouls.java
@@ -41,6 +41,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetOpponent;
@@ -91,10 +92,14 @@ class WallOfSoulsTriggeredAbility extends TriggeredAbilityImpl {
return new WallOfSoulsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)
- && ((DamagedCreatureEvent)event).isCombatDamage() ) {
+ if (event.getTargetId().equals(this.sourceId) && ((DamagedCreatureEvent)event).isCombatDamage()) {
this.getEffects().get(0).setValue("damage", event.getAmount());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java
index 2d01c26e37f..c518a21d95d 100644
--- a/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java
+++ b/Mage.Sets/src/mage/sets/tenthedition/AngelsFeather.java
@@ -29,12 +29,12 @@
package mage.sets.tenthedition;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -78,15 +78,15 @@ class AngelsFeatherAbility extends TriggeredAbilityImpl {
return new AngelsFeatherAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isWhite()) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isWhite();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java b/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.java
new file mode 100644
index 00000000000..5971c0c184c
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/tenthedition/DreambornMuse.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.tenthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class DreambornMuse extends mage.sets.legions.DreambornMuse {
+
+ public DreambornMuse(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 82;
+ this.expansionSetCode = "10E";
+ }
+
+ public DreambornMuse(final DreambornMuse card) {
+ super(card);
+ }
+
+ @Override
+ public DreambornMuse copy() {
+ return new DreambornMuse(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java b/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.java
new file mode 100644
index 00000000000..83ff3259f95
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/tenthedition/ElvishBerserker.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.tenthedition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author ilcartographer
+ */
+public class ElvishBerserker extends mage.sets.ninthedition.ElvishBerserker {
+
+ public ElvishBerserker(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 260;
+ this.expansionSetCode = "10E";
+ }
+
+ public ElvishBerserker(final ElvishBerserker card) {
+ super(card);
+ }
+
+ @Override
+ public ElvishBerserker copy() {
+ return new ElvishBerserker(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java b/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java
index 81e51ec0539..147a190ad41 100644
--- a/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java
+++ b/Mage.Sets/src/mage/sets/tenthedition/KrakensEye.java
@@ -29,12 +29,12 @@
package mage.sets.tenthedition;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -78,15 +78,15 @@ class KrakensEyeAbility extends TriggeredAbilityImpl {
return new KrakensEyeAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isBlue()) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isBlue();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java b/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java
index e248728b5f7..056443e3b01 100644
--- a/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java
+++ b/Mage.Sets/src/mage/sets/tenthedition/MantisEngine.java
@@ -53,7 +53,11 @@ public class MantisEngine extends CardImpl {
this.subtype.add("Insect");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
+
+ // {2}: Mantis Engine gains flying until end of turn. (It can't be blocked except by creatures with flying or reach.)
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2)));
+
+ // {2}: Mantis Engine gains first strike until end of turn. (It deals combat damage before creatures without first strike.)
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn), new GenericManaCost(2)));
}
diff --git a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java
index 171234edc7c..0f7b676328e 100644
--- a/Mage.Sets/src/mage/sets/tenthedition/Megrim.java
+++ b/Mage.Sets/src/mage/sets/tenthedition/Megrim.java
@@ -29,15 +29,15 @@
package mage.sets.tenthedition;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetOpponent;
/**
@@ -65,6 +65,7 @@ public class Megrim extends CardImpl {
}
class MergimTriggeredAbility extends TriggeredAbilityImpl {
+
MergimTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(2));
this.addTarget(new TargetOpponent());
@@ -79,9 +80,14 @@ class MergimTriggeredAbility extends TriggeredAbilityImpl {
return new MergimTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DISCARDED_CARD && game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.getControllerId()).contains(event.getPlayerId())) {
this.getTargets().get(0).add(event.getPlayerId(), game);
return true;
}
diff --git a/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java b/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java
index 31b2ff02519..b60b2957449 100644
--- a/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java
+++ b/Mage.Sets/src/mage/sets/tenthedition/WurmsTooth.java
@@ -29,12 +29,12 @@
package mage.sets.tenthedition;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -78,15 +78,15 @@ class WurmsToothAbility extends TriggeredAbilityImpl {
return new WurmsToothAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isGreen()) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isGreen();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/thedark/Venom.java b/Mage.Sets/src/mage/sets/thedark/Venom.java
index 385cbe0be98..42eb58e7165 100644
--- a/Mage.Sets/src/mage/sets/thedark/Venom.java
+++ b/Mage.Sets/src/mage/sets/thedark/Venom.java
@@ -28,10 +28,6 @@
package mage.sets.thedark;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
@@ -40,8 +36,13 @@ import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@@ -57,7 +58,6 @@ public class Venom extends CardImpl {
this.expansionSetCode = "DRK";
this.subtype.add("Aura");
-
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
@@ -94,28 +94,31 @@ class VenomTriggeredAbility extends TriggeredAbilityImpl {
return new VenomTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent blocker = game.getPermanent(event.getSourceId());
- Permanent blocked = game.getPermanent(event.getTargetId());
- Permanent enchantment = game.getPermanent(this.getSourceId());
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- Permanent enchantedCreature = game.getPermanent(enchantment.getAttachedTo());
- if (enchantedCreature != null) {
- if (blocker != null && blocker != enchantedCreature
- && !blocker.getSubtype().contains("Wall")
- && blocked == enchantedCreature) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
- return true;
- }
- if (blocker != null && blocker == enchantedCreature
- && !blocked.getSubtype().contains("Wall")) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
- return true;
- }
- }
- }
+ Permanent blocker = game.getPermanent(event.getSourceId());
+ Permanent blocked = game.getPermanent(event.getTargetId());
+ Permanent enchantment = game.getPermanent(this.getSourceId());
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ Permanent enchantedCreature = game.getPermanent(enchantment.getAttachedTo());
+ if (enchantedCreature != null) {
+ if (blocker != null && blocker != enchantedCreature
+ && !blocker.getSubtype().contains("Wall")
+ && blocked == enchantedCreature) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getId()));
+ return true;
+ }
+ if (blocker != null && blocker == enchantedCreature
+ && !blocked.getSubtype().contains("Wall")) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(blocked.getId()));
+ return true;
+ }
+ }
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java b/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java
index ceed96023e6..71e9cff04bb 100644
--- a/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java
+++ b/Mage.Sets/src/mage/sets/theros/BidentOfThassa.java
@@ -30,7 +30,6 @@ package mage.sets.theros;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
@@ -44,6 +43,7 @@ import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -91,14 +91,17 @@ class BidentOfThassaTriggeredAbility extends TriggeredAbilityImpl {
return new BidentOfThassaTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
- if (((DamagedPlayerEvent) event).isCombatDamage()) {
- Permanent creature = game.getPermanent(event.getSourceId());
- if (creature != null && creature.getControllerId().equals(controllerId)) {
- return true;
- }
+ if (((DamagedPlayerEvent) event).isCombatDamage()) {
+ Permanent creature = game.getPermanent(event.getSourceId());
+ if (creature != null && creature.getControllerId().equals(controllerId)) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java b/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java
index 519b16ce3d6..0490ccd43a1 100644
--- a/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java
+++ b/Mage.Sets/src/mage/sets/theros/FlamespeakerAdept.java
@@ -86,12 +86,14 @@ class ScryTriggeredAbility extends TriggeredAbilityImpl {
return new ScryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SCRY;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(EventType.SCRY) && event.getPlayerId().equals(this.getControllerId())) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.getControllerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java b/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java
index 013fa387eed..6878692be27 100644
--- a/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java
+++ b/Mage.Sets/src/mage/sets/theros/RescueFromTheUnderworld.java
@@ -27,6 +27,7 @@
*/
package mage.sets.theros;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.Mode;
@@ -37,11 +38,16 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSpellEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
-import mage.constants.*;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.Target;
@@ -49,8 +55,6 @@ import mage.target.common.TargetCardInGraveyard;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetControlledCreaturePermanent;
-import java.util.UUID;
-
/**
*
* Once you announce you’re casting Rescue from the Underworld, no player may attempt to
@@ -187,9 +191,14 @@ class RescueFromTheUnderworldDelayedTriggeredAbility extends DelayedTriggeredAbi
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId);
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java b/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java
index 6b92d1cc051..f3a2973349f 100644
--- a/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java
+++ b/Mage.Sets/src/mage/sets/theros/ThassasEmissary.java
@@ -40,7 +40,7 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
-import mage.game.events.DamagedPlayerEvent;
+import mage.game.events.DamagedEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
@@ -92,9 +92,14 @@ class ThassasEmissaryTriggeredAbility extends TriggeredAbilityImpl {
return new ThassasEmissaryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DAMAGED_PLAYER && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (((DamagedEvent) event).isCombatDamage()) {
if (event.getSourceId().equals(this.sourceId)) {
return true;
}
diff --git a/Mage.Sets/src/mage/sets/theros/TimeToFeed.java b/Mage.Sets/src/mage/sets/theros/TimeToFeed.java
index 8af58c918db..4fdc3304cb5 100644
--- a/Mage.Sets/src/mage/sets/theros/TimeToFeed.java
+++ b/Mage.Sets/src/mage/sets/theros/TimeToFeed.java
@@ -47,6 +47,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.Target;
@@ -149,9 +150,14 @@ class TimeToFeedDiesTriggeredAbility extends DelayedTriggeredAbility {
return new TimeToFeedDiesTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ if (((ZoneChangeEvent) event).isDiesEvent()) {
if (event.getTargetId().equals(watchedCreatureId)) {
Permanent creature = (Permanent) game.getLastKnownInformation(watchedCreatureId, Zone.BATTLEFIELD);
if (creature.getZoneChangeCounter(game) == this.zoneChangeCounter) {
diff --git a/Mage.Sets/src/mage/sets/theros/TritonTactics.java b/Mage.Sets/src/mage/sets/theros/TritonTactics.java
index 4abfcddef92..f58b2966609 100644
--- a/Mage.Sets/src/mage/sets/theros/TritonTactics.java
+++ b/Mage.Sets/src/mage/sets/theros/TritonTactics.java
@@ -49,6 +49,7 @@ import mage.constants.WatcherScope;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
@@ -145,9 +146,14 @@ class TritonTacticsTriggeredAbility extends DelayedTriggeredAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_COMBAT_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java b/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java
index 3bccc6bf0f8..3afdd8d5ce6 100644
--- a/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java
+++ b/Mage.Sets/src/mage/sets/timeshifted/EssenceSliver.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -88,18 +89,20 @@ class DealsDamageAllTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE
- || event.getType() == GameEvent.EventType.DAMAGED_PLAYER
- || event.getType() == GameEvent.EventType.DAMAGED_PLANESWALKER) {
- Permanent creature = game.getPermanent(event.getSourceId());
- if (creature != null && creature.hasSubtype("Sliver")) {
- for (Effect effect : this.getEffects()) {
- effect.setValue("damage", event.getAmount());
- }
- return true;
- }
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE
+ || event.getType() == EventType.DAMAGED_PLAYER
+ || event.getType() == EventType.DAMAGED_PLANESWALKER;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent creature = game.getPermanent(event.getSourceId());
+ if (creature != null && creature.hasSubtype("Sliver")) {
+ for (Effect effect : this.getEffects()) {
+ effect.setValue("damage", event.getAmount());
+ }
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java
index c59d4e01187..e9f1a93b72f 100644
--- a/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java
+++ b/Mage.Sets/src/mage/sets/timeshifted/GrinningTotem.java
@@ -52,6 +52,7 @@ import mage.constants.Zone;
import mage.game.ExileZone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetOpponent;
@@ -194,9 +195,14 @@ class GrinningTotemDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new GrinningTotemDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getActivePlayerId().equals(this.getControllerId());
+ return game.getActivePlayerId().equals(this.getControllerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java
index 39aa3d2541f..c2868996632 100644
--- a/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java
+++ b/Mage.Sets/src/mage/sets/timeshifted/IcatianJavelineers.java
@@ -34,7 +34,7 @@ import mage.constants.Rarity;
*
* @author fireshoes
*/
-public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers {
+public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 {
public IcatianJavelineers(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java b/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java
index 282bb67dd00..a95ba8ee2da 100644
--- a/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java
+++ b/Mage.Sets/src/mage/sets/timeshifted/SolkanarTheSwampKing.java
@@ -28,17 +28,17 @@
package mage.sets.timeshifted;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.SwampwalkAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -87,20 +87,19 @@ class SolkanarTheSwampKingAbility extends TriggeredAbilityImpl {
return new SolkanarTheSwampKingAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isBlack()) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isBlack();
}
@Override
public String getRule() {
return "Whenever a player casts a black spell, you gain 1 life.";
}
-
}
diff --git a/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java b/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java
index 9cbcd3812c5..1d87783773b 100644
--- a/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java
+++ b/Mage.Sets/src/mage/sets/timespiral/GauntletOfPower.java
@@ -53,6 +53,7 @@ import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SupertypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ManaEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -145,41 +146,44 @@ class TapForManaAllTriggeredAbility extends TriggeredManaAbility {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED_FOR_MANA) {
- Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
- if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) {
- ManaEvent mEvent = (ManaEvent) event;
- ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color");
- if (color != null) {
- Mana mana = mEvent.getMana();
- boolean colorFits = false;
- if (color.isBlack() && mana.getBlack() > 0) {
- colorFits = true;
- } else if (color.isBlue() && mana.getBlue() > 0) {
- colorFits = true;
- } else if (color.isGreen() && mana.getGreen() > 0) {
- colorFits = true;
- } else if (color.isWhite() && mana.getWhite() > 0) {
- colorFits = true;
- } else if (color.isRed() && mana.getRed() > 0) {
- colorFits = true;
- }
- if (colorFits) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
- for (Effect effect : getEffects()) {
- effect.setValue("mana", mEvent.getMana());
- }
- switch (setTargetPointer) {
- case PERMANENT:
- getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
- break;
- case PLAYER:
- getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
- break;
- }
- return true;
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
+ if (permanent != null && filter.match(permanent, getSourceId(), getControllerId(), game)) {
+ ManaEvent mEvent = (ManaEvent) event;
+ ObjectColor color = (ObjectColor) game.getState().getValue(getSourceId() + "_color");
+ if (color != null) {
+ Mana mana = mEvent.getMana();
+ boolean colorFits = false;
+ if (color.isBlack() && mana.getBlack() > 0) {
+ colorFits = true;
+ } else if (color.isBlue() && mana.getBlue() > 0) {
+ colorFits = true;
+ } else if (color.isGreen() && mana.getGreen() > 0) {
+ colorFits = true;
+ } else if (color.isWhite() && mana.getWhite() > 0) {
+ colorFits = true;
+ } else if (color.isRed() && mana.getRed() > 0) {
+ colorFits = true;
+ }
+ if (colorFits) {
+
+ for (Effect effect : getEffects()) {
+ effect.setValue("mana", mEvent.getMana());
}
+ switch (setTargetPointer) {
+ case PERMANENT:
+ getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getId()));
+ break;
+ case PLAYER:
+ getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
+ break;
+ }
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/timespiral/GoblinSkycutter.java b/Mage.Sets/src/mage/sets/timespiral/GoblinSkycutter.java
new file mode 100644
index 00000000000..5f5e114a8e6
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/timespiral/GoblinSkycutter.java
@@ -0,0 +1,83 @@
+/*
+ * 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.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.SacrificeSourceCost;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.effects.common.continuous.LoseAbilityTargetEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.mageobject.AbilityPredicate;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class GoblinSkycutter extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with flying");
+
+ static {
+ filter.add(new AbilityPredicate(FlyingAbility.class));
+ }
+
+ public GoblinSkycutter(UUID ownerId) {
+ super(ownerId, 159, "Goblin Skycutter", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
+ this.expansionSetCode = "TSP";
+ this.subtype.add("Goblin");
+ this.subtype.add("Warrior");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(1);
+
+ // Sacrifice Goblin Skycutter: Goblin Skycutter deals 2 damage to target creature with flying. That creature loses flying until end of turn.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(2), new SacrificeSourceCost());
+ ability.addEffect(new LoseAbilityTargetEffect(FlyingAbility.getInstance(), Duration.EndOfTurn));
+ ability.addTarget(new TargetCreaturePermanent(filter));
+ this.addAbility(ability);
+ }
+
+ public GoblinSkycutter(final GoblinSkycutter card) {
+ super(card);
+ }
+
+ @Override
+ public GoblinSkycutter copy() {
+ return new GoblinSkycutter(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java b/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java
index bfee4df16fd..31806f9f5a6 100644
--- a/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java
+++ b/Mage.Sets/src/mage/sets/timespiral/HarmonicSliver.java
@@ -33,7 +33,7 @@ import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.MageInt;
-import mage.abilities.Ability;
+import mage.abilities.TriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.common.DestroyTargetEffect;
@@ -64,7 +64,7 @@ public class HarmonicSliver extends CardImpl {
this.toughness = new MageInt(1);
// All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment."
- Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
+ TriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
TargetPermanent target = new TargetPermanent(new FilterArtifactOrEnchantmentPermanent());
ability.addTarget(target);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(
diff --git a/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java b/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java
index fc878f375c9..b94593b84ca 100644
--- a/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java
+++ b/Mage.Sets/src/mage/sets/timespiral/NorinTheWary.java
@@ -41,6 +41,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -85,14 +86,15 @@ class NorinTheWaryTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST
+ || event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- switch(event.getType()) {
- case SPELL_CAST:
- case ATTACKER_DECLARED:
- return true;
- }
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java b/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java
index 7893c69d3ce..40c612225b4 100644
--- a/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java
+++ b/Mage.Sets/src/mage/sets/timespiral/ParadoxHaze.java
@@ -40,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod;
import mage.game.turn.UpkeepStep;
@@ -96,18 +97,21 @@ class ParadoxHazeTriggeredAbility extends TriggeredAbilityImpl {
public ParadoxHazeTriggeredAbility copy() {
return new ParadoxHazeTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- Permanent permanent = game.getPermanent(this.sourceId);
- if (permanent != null) {
- Player player = game.getPlayer(permanent.getAttachedTo());
- if (player != null && game.getActivePlayerId().equals(player.getId()) && lastTriggerTurnNumber != game.getTurnNum()) {
- lastTriggerTurnNumber = game.getTurnNum();
- this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
- return true;
- }
+ Permanent permanent = game.getPermanent(this.sourceId);
+ if (permanent != null) {
+ Player player = game.getPlayer(permanent.getAttachedTo());
+ if (player != null && game.getActivePlayerId().equals(player.getId()) && lastTriggerTurnNumber != game.getTurnNum()) {
+ lastTriggerTurnNumber = game.getTurnNum();
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java b/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java
index f1f87c4dca7..ef34134f210 100644
--- a/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java
+++ b/Mage.Sets/src/mage/sets/timespiral/SaffiEriksdotter.java
@@ -44,6 +44,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.target.Target;
import mage.target.common.TargetCreaturePermanent;
@@ -130,11 +131,16 @@ class SaffiEriksdotterDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new SaffiEriksdotterDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
+ if (((ZoneChangeEvent) event).isDiesEvent()) {
if (fixedTarget.getFirst(game, this).equals(event.getTargetId())) {
- if(this.getControllerId().equals(event.getPlayerId())){
+ if (this.getControllerId().equals(event.getPlayerId())){
return true;
}
}
diff --git a/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java
new file mode 100644
index 00000000000..725eb972356
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/timespiral/SengirNosferatu.java
@@ -0,0 +1,146 @@
+/*
+ * 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.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.ExileSourceCost;
+import mage.abilities.costs.common.SacrificeSourceCost;
+import mage.abilities.costs.mana.ManaCostsImpl;
+import mage.abilities.effects.Effect;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.CreateTokenEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.Card;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.FilterCard;
+import mage.filter.predicate.mageobject.NamePredicate;
+import mage.game.Game;
+import mage.game.permanent.token.Token;
+import mage.players.Player;
+import mage.target.Target;
+import mage.target.common.TargetCardInExile;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SengirNosferatu extends CardImpl {
+
+ public SengirNosferatu(UUID ownerId) {
+ super(ownerId, 128, "Sengir Nosferatu", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
+ this.expansionSetCode = "TSP";
+ this.subtype.add("Vampire");
+ this.power = new MageInt(4);
+ this.toughness = new MageInt(4);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // {1}{B}, Exile Sengir Nosferatu: Put a 1/2 black Bat creature token with flying onto the battlefield. It has "{1}{B}, Sacrifice this creature: Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control."
+ Effect effect = new CreateTokenEffect(new SengirNosferatuBatToken(), 1);
+ effect.setText("Put a 1/2 black Bat creature token with flying onto the battlefield. It has \"{1}{B}, Sacrifice this creature: Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control.\"");
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}"));
+ ability.addCost(new ExileSourceCost());
+ this.addAbility(ability);
+ }
+
+ public SengirNosferatu(final SengirNosferatu card) {
+ super(card);
+ }
+
+ @Override
+ public SengirNosferatu copy() {
+ return new SengirNosferatu(this);
+ }
+}
+
+class SengirNosferatuBatToken extends Token {
+
+ SengirNosferatuBatToken() {
+ super("Bat", "1/2 black Bat creature token with flying");
+ cardType.add(CardType.CREATURE);
+ color.setBlack(true);
+ subtype.add("Bat");
+ power = new MageInt(1);
+ toughness = new MageInt(2);
+ this.addAbility(FlyingAbility.getInstance());
+ ReturnSengirNosferatuEffect effect = new ReturnSengirNosferatuEffect();
+ effect.setText("Return an exiled card named Sengir Nosferatu to the battlefield under its owner's control.");
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new ManaCostsImpl("{1}{B}"));
+ ability.addCost(new SacrificeSourceCost());
+ this.addAbility(ability);
+ }
+}
+
+class ReturnSengirNosferatuEffect extends OneShotEffect {
+
+ private static final FilterCard filter = new FilterCard("exiled card named Sengir Nosferatu");
+
+ static {
+ filter.add(new NamePredicate("Sengir Nosferatu"));
+ }
+
+ public ReturnSengirNosferatuEffect() {
+ super(Outcome.Benefit);
+ }
+
+ public ReturnSengirNosferatuEffect(final ReturnSengirNosferatuEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public ReturnSengirNosferatuEffect copy() {
+ return new ReturnSengirNosferatuEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ UUID controllerId = source.getControllerId();
+ Target target = new TargetCardInExile(filter);
+ target.setNotTarget(true);
+ if(!target.canChoose(source.getSourceId(), controllerId, game)) {
+ return false;
+ }
+ Player player = game.getPlayer(controllerId);
+ if(player != null) {
+ player.chooseTarget(Outcome.PutCreatureInPlay, target, source, game);
+ Card card = game.getCard(target.getTargets().get(0));
+ if(card != null) {
+ return card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
+ }
+ }
+ return false;
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/timespiral/SpiketailDrakeling.java b/Mage.Sets/src/mage/sets/timespiral/SpiketailDrakeling.java
new file mode 100644
index 00000000000..68b414e1ef1
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/timespiral/SpiketailDrakeling.java
@@ -0,0 +1,75 @@
+/*
+ * 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.MageInt;
+import mage.abilities.Ability;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.costs.common.SacrificeSourceCost;
+import mage.abilities.costs.mana.GenericManaCost;
+import mage.abilities.effects.common.CounterUnlessPaysEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.target.TargetSpell;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SpiketailDrakeling extends CardImpl {
+
+ public SpiketailDrakeling(UUID ownerId) {
+ super(ownerId, 80, "Spiketail Drakeling", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
+ this.expansionSetCode = "TSP";
+ this.subtype.add("Drake");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // Sacrifice Spiketail Drakeling: Counter target spell unless its controller pays {2}.
+ Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CounterUnlessPaysEffect(new GenericManaCost(2)), new SacrificeSourceCost()); ability.addTarget(new TargetSpell());
+ this.addAbility(ability);
+
+ }
+
+ public SpiketailDrakeling(final SpiketailDrakeling card) {
+ super(card);
+ }
+
+ @Override
+ public SpiketailDrakeling copy() {
+ return new SpiketailDrakeling(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/timespiral/SpriteNoble.java b/Mage.Sets/src/mage/sets/timespiral/SpriteNoble.java
new file mode 100644
index 00000000000..325cae7b656
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/timespiral/SpriteNoble.java
@@ -0,0 +1,83 @@
+/*
+ * 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.MageInt;
+import mage.abilities.common.SimpleActivatedAbility;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.costs.common.TapSourceCost;
+import mage.abilities.effects.common.continuous.BoostControlledEffect;
+import mage.abilities.keyword.FlyingAbility;
+import mage.abilities.keyword.FlyingAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.filter.common.FilterCreaturePermanent;
+import mage.filter.predicate.mageobject.AbilityPredicate;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class SpriteNoble extends CardImpl {
+
+ private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("Creatures you control with flying");
+
+ static {
+ filter.add(new AbilityPredicate(FlyingAbility.class));
+ }
+
+ public SpriteNoble(UUID ownerId) {
+ super(ownerId, 81, "Sprite Noble", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{U}{U}");
+ this.expansionSetCode = "TSP";
+ this.subtype.add("Faerie");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // Flying
+ this.addAbility(FlyingAbility.getInstance());
+ // Other creatures you control with flying get +0/+1.
+ this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(0, 1, Duration.WhileOnBattlefield, filter, true)));
+ // {tap}: Other creatures you control with flying get +1/+0 until end of turn.
+ this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 0, Duration.EndOfTurn, filter, true),
+ new TapSourceCost()));
+ }
+
+ public SpriteNoble(final SpriteNoble card) {
+ super(card);
+ }
+
+ @Override
+ public SpriteNoble copy() {
+ return new SpriteNoble(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java b/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java
index aef854c4204..e1495a01e1c 100644
--- a/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java
+++ b/Mage.Sets/src/mage/sets/timespiral/StuffyDoll.java
@@ -28,10 +28,6 @@
package mage.sets.timespiral;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -42,8 +38,13 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageSelfEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPlayer;
@@ -132,9 +133,14 @@ class StuffyDollTriggeredAbility extends TriggeredAbilityImpl {
return new StuffyDollTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
+ if (event.getTargetId().equals(this.sourceId)) {
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
return true;
}
diff --git a/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java b/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java
index 12ce53027ff..26395fa7c3a 100644
--- a/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java
+++ b/Mage.Sets/src/mage/sets/timespiral/TeferiMageOfZhalfir.java
@@ -131,7 +131,14 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl {
if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) {
game.getState().addOtherAbility(card, FlashAbility.getInstance());
}
- }
+ }
+ // commander in command zone
+ if (controller.getCommanderId() != null && game.getState().getZone(controller.getCommanderId()).equals(Zone.COMMAND)) {
+ Card card = game.getCard(controller.getCommanderId());
+ if (card.getCardType().contains(CardType.CREATURE)) {
+ game.getState().addOtherAbility(card, FlashAbility.getInstance());
+ }
+ }
return true;
}
return false;
diff --git a/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java b/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.java
new file mode 100644
index 00000000000..bfcfed29b27
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/unlimitededition/PhantasmalForces.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.unlimitededition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class PhantasmalForces extends mage.sets.fourthedition.PhantasmalForces {
+
+ public PhantasmalForces(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 68;
+ this.expansionSetCode = "2ED";
+ }
+
+ public PhantasmalForces(final PhantasmalForces card) {
+ super(card);
+ }
+
+ @Override
+ public PhantasmalForces copy() {
+ return new PhantasmalForces(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java b/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.java
new file mode 100644
index 00000000000..4469f488942
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/unlimitededition/SedgeTroll.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.unlimitededition;
+
+import java.util.UUID;
+
+/**
+ *
+ * @author anonymous
+ */
+public class SedgeTroll extends mage.sets.masterseditioniv.SedgeTroll {
+
+ public SedgeTroll(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 173;
+ this.expansionSetCode = "2ED";
+ }
+
+ public SedgeTroll(final SedgeTroll card) {
+ super(card);
+ }
+
+ @Override
+ public SedgeTroll copy() {
+ return new SedgeTroll(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java b/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java
index cd409b970ad..98b093c7212 100644
--- a/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java
+++ b/Mage.Sets/src/mage/sets/urzasdestiny/AetherSting.java
@@ -28,15 +28,16 @@
package mage.sets.urzasdestiny;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -79,10 +80,14 @@ class AetherStingTriggeredAbility extends TriggeredAbilityImpl {
return new AetherStingTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST
- && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Card card = game.getCard(event.getSourceId());
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/FalseProphet.java b/Mage.Sets/src/mage/sets/urzasdestiny/FalseProphet.java
new file mode 100644
index 00000000000..aa5f554acac
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/urzasdestiny/FalseProphet.java
@@ -0,0 +1,66 @@
+/*
+ * 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.urzasdestiny;
+
+import java.util.UUID;
+import mage.MageInt;
+import mage.abilities.common.DiesTriggeredAbility;
+import mage.abilities.effects.common.ExileAllEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.filter.common.FilterCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class FalseProphet extends CardImpl {
+
+ public FalseProphet(UUID ownerId) {
+ super(ownerId, 6, "False Prophet", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
+ this.expansionSetCode = "UDS";
+ this.subtype.add("Human");
+ this.subtype.add("Cleric");
+ this.power = new MageInt(2);
+ this.toughness = new MageInt(2);
+
+ // When False Prophet dies, exile all creatures.
+ this.addAbility(new DiesTriggeredAbility(new ExileAllEffect(new FilterCreaturePermanent())));
+ }
+
+ public FalseProphet(final FalseProphet card) {
+ super(card);
+ }
+
+ @Override
+ public FalseProphet copy() {
+ return new FalseProphet(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java
index 4e1dc26126c..ad9be7781fd 100644
--- a/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java
+++ b/Mage.Sets/src/mage/sets/urzasdestiny/PhyrexianNegator.java
@@ -29,19 +29,20 @@ package mage.sets.urzasdestiny;
import java.util.UUID;
import mage.MageInt;
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.dynamicvalue.common.StaticValue;
+import mage.abilities.effects.common.SacrificeEffect;
import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Rarity;
-import mage.abilities.TriggeredAbilityImpl;
-import mage.abilities.dynamicvalue.common.StaticValue;
-import mage.abilities.effects.common.SacrificeEffect;
-import mage.players.Player;
-import mage.target.targetpointer.FixedTarget;
import mage.constants.Zone;
-import mage.game.events.GameEvent;
import mage.filter.FilterPermanent;
import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
+import mage.players.Player;
+import mage.target.targetpointer.FixedTarget;
/**
*
* @author fireshoes
@@ -85,10 +86,15 @@ class PhyrexianNegatorTriggeredAbility extends TriggeredAbilityImpl {
public PhyrexianNegatorTriggeredAbility copy() {
return new PhyrexianNegatorTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.sourceId)) {
+ if (event.getTargetId().equals(this.sourceId)) {
UUID controller = game.getControllerId(event.getTargetId());
if (controller != null) {
Player player = game.getPlayer(controller);
diff --git a/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java b/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java
index d94ad90e34e..1edf03ea2da 100644
--- a/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java
+++ b/Mage.Sets/src/mage/sets/urzasdestiny/RayneAcademyChancellor.java
@@ -87,20 +87,23 @@ class RayneAcademyChancellorTriggeredAbility extends TriggeredAbilityImpl {
public RayneAcademyChancellorTriggeredAbility copy() {
return new RayneAcademyChancellorTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.TARGETED) {
- Player controller = game.getPlayer(this.getControllerId());
- Player targetter = game.getPlayer(event.getPlayerId());
- if (controller != null && targetter != null && !controller.getId().equals(targetter.getId())) {
- if (event.getTargetId().equals(controller.getId())) {
- return true;
- }
- Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
- if (permanent != null && this.getControllerId().equals(permanent.getControllerId())) {
- return true;
- }
+ Player controller = game.getPlayer(this.getControllerId());
+ Player targetter = game.getPlayer(event.getPlayerId());
+ if (controller != null && targetter != null && !controller.getId().equals(targetter.getId())) {
+ if (event.getTargetId().equals(controller.getId())) {
+ return true;
+ }
+ Permanent permanent = game.getPermanentOrLKIBattlefield(event.getTargetId());
+ if (permanent != null && this.getControllerId().equals(permanent.getControllerId())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java b/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java
index 6d284d86f59..7096f318a4d 100644
--- a/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java
+++ b/Mage.Sets/src/mage/sets/urzaslegacy/MemoryJar.java
@@ -29,10 +29,6 @@ package mage.sets.urzaslegacy;
import java.util.Iterator;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
@@ -44,6 +40,9 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -97,7 +96,7 @@ class MemoryJarEffect extends OneShotEffect {
public boolean apply(Game game, Ability source)
{
Cards cards = new CardsImpl();
- //Exil hand
+ //Exile hand
for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null)
@@ -197,12 +196,14 @@ class MemoryJarDelayedTriggeredAbility extends DelayedTriggeredAbility {
return new MemoryJarDelayedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.END_TURN_STEP_PRE) {
- return true;
- }
- return false;
+ return true;
}
diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java b/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java
index c65884d1698..d1ecb036de3 100644
--- a/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java
+++ b/Mage.Sets/src/mage/sets/urzaslegacy/NoMercy.java
@@ -28,16 +28,16 @@
package mage.sets.urzaslegacy;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -51,7 +51,6 @@ public class NoMercy extends CardImpl {
super(ownerId, 56, "No Mercy", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}{B}");
this.expansionSetCode = "ULG";
-
// Whenever a creature deals damage to you, destroy it.
this.addAbility(new NoMercyTriggeredAbility());
}
@@ -64,31 +63,33 @@ public class NoMercy extends CardImpl {
public NoMercy copy() {
return new NoMercy(this);
}
-
+
public class NoMercyTriggeredAbility extends TriggeredAbilityImpl {
- public NoMercyTriggeredAbility()
- {
+
+ public NoMercyTriggeredAbility() {
super(Zone.BATTLEFIELD, new DestroyTargetEffect());
}
-
+
public NoMercyTriggeredAbility(final NoMercyTriggeredAbility ability) {
super(ability);
}
-
+
@Override
public NoMercyTriggeredAbility copy() {
- return new NoMercyTriggeredAbility(this);
+ return new NoMercyTriggeredAbility(this);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getPlayerId().equals(this.getControllerId())) {
-
+ if (event.getPlayerId().equals(this.getControllerId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
- if(permanent != null && permanent.getCardType().contains(CardType.CREATURE))
- {
- for(Effect effect : this.getEffects())
- {
+ if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
+ for (Effect effect : this.getEffects()) {
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
}
return true;
@@ -96,10 +97,11 @@ public class NoMercy extends CardImpl {
}
return false;
}
+
@Override
public String getRule() {
return "Whenever a creature deals damage to you, destroy it";
}
-
+
}
}
diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java b/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java
index b0e4770c0c6..4b79443702e 100644
--- a/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java
+++ b/Mage.Sets/src/mage/sets/urzaslegacy/Rivalry.java
@@ -28,18 +28,18 @@
package mage.sets.urzaslegacy;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -87,17 +87,19 @@ class RivalryTriggeredAbility extends TriggeredAbilityImpl {
return new RivalryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE) {
- if (getTargets().size() == 0) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
- }
+ if (getTargets().size() == 0) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
- return true;
}
- return false;
+ return true;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java b/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java
index cc19a3ba8ea..874b130fcc6 100644
--- a/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java
+++ b/Mage.Sets/src/mage/sets/urzaslegacy/Scrapheap.java
@@ -28,17 +28,18 @@
package mage.sets.urzaslegacy;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
@@ -89,33 +90,27 @@ class ScrapheapTriggeredAbility extends TriggeredAbilityImpl {
super(Zone.BATTLEFIELD, new GainLifeEffect(1));
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
-
-
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && permanent.getOwnerId().equals(this.getControllerId())) {
-
if (filter.match(permanent, sourceId, controllerId, game)) {
return true;
}
-
}
}
- }
return false;
}
-
-
@Override
public String getRule() {
return "Whenever an artifact or enchantment is put into your graveyard from the battlefield, you gain 1 life.";
}
-
-
-
}
diff --git a/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java b/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java
index 84c1d1371e4..cdf0bf19e0e 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/Bereavement.java
@@ -28,14 +28,15 @@
package mage.sets.urzassaga;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -80,9 +81,14 @@ class BereavementTriggeredAbility extends TriggeredAbilityImpl {
return new BereavementTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ if (((ZoneChangeEvent)event).isDiesEvent()) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getColor(game).isGreen()) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
diff --git a/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java b/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java
index 8d9e96a1433..7b6794af6d4 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/CarpetOfFlowers.java
@@ -45,6 +45,7 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetOpponent;
@@ -77,12 +78,10 @@ public class CarpetOfFlowers extends CardImpl {
class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl {
-
public CarpetOfFlowersTriggeredAbility() {
super(Zone.BATTLEFIELD, new CarpetOfFlowersEffect(), true);
this.addChoice(new ChoiceColor());
this.addTarget(new TargetOpponent());
-
}
public CarpetOfFlowersTriggeredAbility(final CarpetOfFlowersTriggeredAbility ability) {
@@ -94,11 +93,15 @@ class CarpetOfFlowersTriggeredAbility extends TriggeredAbilityImpl {
return new CarpetOfFlowersTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.PRECOMBAT_MAIN_PHASE_PRE
+ || event.getType() == EventType.POSTCOMBAT_MAIN_PHASE_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- return (event.getType() == GameEvent.EventType.PRECOMBAT_MAIN_PHASE_PRE
- || event.getType() == GameEvent.EventType.POSTCOMBAT_MAIN_PHASE_PRE)
- && event.getPlayerId().equals(this.controllerId);
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java b/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java
index 7ed0e911167..b4fa8743697 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/DiabolicServitude.java
@@ -47,6 +47,7 @@ import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.targetpointer.FixedTarget;
@@ -131,9 +132,14 @@ class DiabolicServitudeCreatureDiesTriggeredAbility extends TriggeredAbilityImpl
return new DiabolicServitudeCreatureDiesTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
+ if (((ZoneChangeEvent)event).isDiesEvent()) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
Object object = game.getState().getValue(getSourceId().toString() + "returnedCreature");
if ((object instanceof MageObjectReference) && ((MageObjectReference)object).refersTo(zEvent.getTarget(), game)) {
diff --git a/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java b/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java
index 5de2da03f66..488fa3ab478 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/Fecundity.java
@@ -50,7 +50,6 @@ public class Fecundity extends CardImpl {
super(ownerId, 251, "Fecundity", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
this.expansionSetCode = "USG";
-
// Whenever a creature dies, that creature's controller may draw a card.
this.addAbility(new DiesCreatureTriggeredAbility(new FecundityEffect(), false, false, true));
}
diff --git a/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java b/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java
index d04f5289298..f77cfd2fb80 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/FertileGround.java
@@ -28,10 +28,8 @@
package mage.sets.urzassaga;
import java.util.UUID;
-import mage.Mana;
import mage.abilities.Ability;
import mage.abilities.effects.common.AddManaAnyColorAttachedControllerEffect;
-import mage.abilities.effects.common.AddManaToManaPoolTargetControllerEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.mana.TriggeredManaAbility;
@@ -42,6 +40,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -90,9 +89,13 @@ class FertileGroundTriggeredAbility extends TriggeredManaAbility {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED_FOR_MANA;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if(event.getType() == GameEvent.EventType.TAPPED_FOR_MANA){
Permanent enchantment = game.getPermanent(this.getSourceId());
if (enchantment != null && event.getSourceId().equals(enchantment.getAttachedTo())) {
Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
@@ -101,7 +104,6 @@ class FertileGroundTriggeredAbility extends TriggeredManaAbility {
return true;
}
}
- }
return false;
}
diff --git a/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java b/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java
index 2c40cec9c20..f4f44011f6f 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/GoblinLackey.java
@@ -28,20 +28,21 @@
package mage.sets.urzassaga;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
@@ -88,13 +89,15 @@ class GoblinLackeyTriggeredAbility extends TriggeredAbilityImpl {
return new GoblinLackeyTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && game.getOpponents(this.getControllerId()).contains(event.getTargetId())) {
- return true;
- }
- return false;
+ return event.getSourceId().equals(this.sourceId)
+ && game.getOpponents(this.getControllerId()).contains(event.getTargetId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/urzassaga/Humble.java b/Mage.Sets/src/mage/sets/urzassaga/Humble.java
new file mode 100644
index 00000000000..6e6642d65bc
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/urzassaga/Humble.java
@@ -0,0 +1,64 @@
+/*
+ * 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.urzassaga;
+
+import java.util.UUID;
+import mage.abilities.effects.common.continuous.LoseAllAbilitiesTargetEffect;
+import mage.abilities.effects.common.continuous.SetPowerToughnessTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Humble extends CardImpl {
+
+ public Humble(UUID ownerId) {
+ super(ownerId, 18, "Humble", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
+ this.expansionSetCode = "USG";
+
+ // Target creature loses all abilities and becomes 0/1 until end of turn.
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent());
+ this.getSpellAbility().addEffect(new LoseAllAbilitiesTargetEffect(Duration.EndOfTurn));
+ this.getSpellAbility().addEffect(new SetPowerToughnessTargetEffect(0, 1, Duration.EndOfTurn));
+ }
+
+ public Humble(final Humble card) {
+ super(card);
+ }
+
+ @Override
+ public Humble copy() {
+ return new Humble(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java b/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java
index f5fcb1bdd76..3f944b98a29 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/SpreadingAlgae.java
@@ -28,9 +28,6 @@
package mage.sets.urzassaga;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.PutIntoGraveFromBattlefieldSourceTriggeredAbility;
@@ -40,12 +37,15 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetLandPermanent;
@@ -108,15 +108,18 @@ class SpreadingAlgaeTriggeredAbility extends TriggeredAbilityImpl {
return new SpreadingAlgaeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent enchant = game.getPermanent(sourceId);
- if (enchant != null && enchant.getAttachedTo() != null) {
- if (event.getTargetId().equals(enchant.getAttachedTo())) {
- getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo()));
- return true;
- }
+ Permanent enchant = game.getPermanent(sourceId);
+ if (enchant != null && enchant.getAttachedTo() != null) {
+ if (event.getTargetId().equals(enchant.getAttachedTo())) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/urzassaga/Symbiosis.java b/Mage.Sets/src/mage/sets/urzassaga/Symbiosis.java
new file mode 100644
index 00000000000..36f382eaba4
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/urzassaga/Symbiosis.java
@@ -0,0 +1,62 @@
+/*
+ * 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.urzassaga;
+
+import java.util.UUID;
+import mage.abilities.effects.common.continuous.BoostTargetEffect;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreaturePermanent;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Symbiosis extends CardImpl {
+
+ public Symbiosis(UUID ownerId) {
+ super(ownerId, 275, "Symbiosis", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{G}");
+ this.expansionSetCode = "USG";
+
+ // Two target creatures each get +2/+2 until end of turn.
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent(2));
+ this.getSpellAbility().addEffect(new BoostTargetEffect(2, 2, Duration.EndOfTurn));
+ }
+
+ public Symbiosis(final Symbiosis card) {
+ super(card);
+ }
+
+ @Override
+ public Symbiosis copy() {
+ return new Symbiosis(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java b/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java
index 095bc4a333c..73d17f664ca 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/ThranQuarry.java
@@ -28,17 +28,17 @@
package mage.sets.urzassaga;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.mana.AnyColorManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -83,15 +83,15 @@ class ThranQuarryTriggeredAbility extends TriggeredAbilityImpl {
return new ThranQuarryTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE) {
- FilterCreaturePermanent filter = new FilterCreaturePermanent();
- if (!game.getBattlefield().contains(filter, controllerId, 1, game)) {
- return true;
- }
- }
- return false;
+ FilterCreaturePermanent filter = new FilterCreaturePermanent();
+ return !game.getBattlefield().contains(filter, controllerId, 1, game);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java b/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java
index 98192bb6e63..59620af5cea 100644
--- a/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java
+++ b/Mage.Sets/src/mage/sets/urzassaga/TitaniasChosen.java
@@ -30,12 +30,12 @@ package mage.sets.urzassaga;
import java.util.UUID;
import mage.MageInt;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -87,15 +87,15 @@ class TitaniasChosenAbility extends TriggeredAbilityImpl {
return new TitaniasChosenAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isGreen()) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isGreen();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java b/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java
index bf7928bf32b..3739f406ec1 100644
--- a/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java
+++ b/Mage.Sets/src/mage/sets/vintagemasters/BragoKingEternal.java
@@ -40,7 +40,6 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledPermanent;
-import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.target.common.TargetControlledPermanent;
diff --git a/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java b/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java
index 8d891d3d838..c2aabdb54e0 100644
--- a/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java
+++ b/Mage.Sets/src/mage/sets/vintagemasters/HymnToTourach.java
@@ -34,7 +34,7 @@ import mage.constants.Rarity;
*
* @author LevelX2
*/
-public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach {
+public class HymnToTourach extends mage.sets.fallenempires.HymnToTourach1 {
public HymnToTourach(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java
new file mode 100644
index 00000000000..d94e06339c3
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/vintagemasters/KaerveksTorch.java
@@ -0,0 +1,118 @@
+/*
+ * 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.vintagemasters;
+
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.SpellAbility;
+import mage.abilities.common.SimpleStaticAbility;
+import mage.abilities.dynamicvalue.common.ManacostVariableValue;
+import mage.abilities.effects.common.DamageTargetEffect;
+import mage.abilities.effects.common.cost.CostModificationEffectImpl;
+import mage.abilities.keyword.FlashbackAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.CostModificationType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.target.Target;
+import mage.target.Targets;
+import mage.target.common.TargetCreatureOrPlayer;
+import mage.util.CardUtil;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class KaerveksTorch extends CardImpl {
+
+ public KaerveksTorch(UUID ownerId) {
+ super(ownerId, 175, "Kaervek's Torch", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{X}{R}");
+ this.expansionSetCode = "VMA";
+
+ // As long as Kaervek's Torch is on the stack, spells that target it cost {2} more to cast.
+ this.addAbility(new SimpleStaticAbility(Zone.STACK, new KaerveksTorchCostIncreaseEffect()));
+ // Kaervek's Torch deals X damage to target creature or player.
+ this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue()));
+ this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
+ }
+
+ public KaerveksTorch(final KaerveksTorch card) {
+ super(card);
+ }
+
+ @Override
+ public KaerveksTorch copy() {
+ return new KaerveksTorch(this);
+ }
+}
+
+class KaerveksTorchCostIncreaseEffect extends CostModificationEffectImpl {
+
+ KaerveksTorchCostIncreaseEffect() {
+ super(Duration.WhileOnStack, Outcome.Benefit, CostModificationType.INCREASE_COST);
+ staticText = "Spells that target {this} cost {2} more to cast";
+ }
+
+ KaerveksTorchCostIncreaseEffect(KaerveksTorchCostIncreaseEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source, Ability abilityToModify) {
+ CardUtil.increaseCost(abilityToModify, 2);
+ return true;
+ }
+
+ @Override
+ public boolean applies(Ability abilityToModify, Ability source, Game game) {
+ if(abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility)
+ {
+ for(UUID modeId: abilityToModify.getModes().getSelectedModes()) {
+ abilityToModify.getModes().setActiveMode(modeId);
+ for(Target target: abilityToModify.getTargets()) {
+ for(UUID id: target.getTargets()) {
+ if(id.equals(source.getSourceObject(game).getId())) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ @Override
+ public KaerveksTorchCostIncreaseEffect copy() {
+ return new KaerveksTorchCostIncreaseEffect(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java b/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java
index 8c08e541eed..ad1d7340d19 100644
--- a/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java
+++ b/Mage.Sets/src/mage/sets/vintagemasters/MarchesaTheBlackRose.java
@@ -50,6 +50,7 @@ import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -107,10 +108,14 @@ class MarchesaTheBlackRoseTriggeredAbility extends TriggeredAbilityImpl {
return new MarchesaTheBlackRoseTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ZONE_CHANGE
- && ((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
+ if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null &&
diff --git a/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java b/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java
index c58c72fd7bd..77362f43213 100644
--- a/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java
+++ b/Mage.Sets/src/mage/sets/vintagemasters/ScourgeOfTheThrone.java
@@ -36,7 +36,6 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.UntapAllControllerEffect;
import mage.abilities.keyword.DethroneAbility;
import mage.abilities.keyword.FlyingAbility;
-import mage.cards.Card;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@@ -70,7 +69,7 @@ public class ScourgeOfTheThrone extends CardImpl {
// Dethrone (Whenever this creature attacks the player with the most life or tied for most life, put a +1/+1 counter on it.)
this.addAbility(new DethroneAbility());
// Whenever Scourge of the Throne attacks for the first time each turn, if it's attacking the player with the most life or tied for most life, untap all attacking creatures. After this phase, there is an additional combat phase.
- Ability ability = new ScourgeOfTheThroneAttacksTriggeredAbility(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(),"untap all creatures you control"), false);
+ Ability ability = new ScourgeOfTheThroneAttacksTriggeredAbility(new UntapAllControllerEffect(new FilterControlledCreaturePermanent(), "untap all creatures you control"), false);
ability.addEffect(new AdditionalCombatPhaseEffect());
this.addAbility(ability);
}
@@ -108,7 +107,7 @@ class ScourgeOfTheThroneAttacksTriggeredAbility extends TriggeredAbilityImpl {
Player controller = game.getPlayer(getControllerId());
if (attackedPlayer != null && controller != null) {
int mostLife = Integer.MIN_VALUE;
- for (UUID playerId: controller.getInRange()) {
+ for (UUID playerId : controller.getInRange()) {
Player player = game.getPlayer(playerId);
if (player != null) {
if (player.getLife() > mostLife) {
@@ -122,53 +121,58 @@ class ScourgeOfTheThroneAttacksTriggeredAbility extends TriggeredAbilityImpl {
return false;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) {
- Integer amountAttacks = (Integer) game.getState().getValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game));
- if (amountAttacks == null || amountAttacks.intValue() < 1) {
- if (amountAttacks == null) {
- amountAttacks = new Integer(1);
- } else {
- ++amountAttacks;
- }
- game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game), amountAttacks);
- return true;
- }
- }
- return false;
+ if (event.getSourceId().equals(this.getSourceId())) {
+ Integer amountAttacks = (Integer) game.getState().getValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game));
+ if (amountAttacks == null || amountAttacks.intValue() < 1) {
+ if (amountAttacks == null) {
+ amountAttacks = new Integer(1);
+ } else {
+ ++amountAttacks;
+ }
+ game.getState().setValue(CardUtil.getCardZoneString("amountAttacks", getSourceId(), game), amountAttacks);
+ return true;
+ }
+ }
+ return false;
}
@Override
public String getRule() {
- return "Whenever {this} attacks for the first time each turn, if it's attacking the player with the most life or tied for most life, " + super.getRule();
+ return "Whenever {this} attacks for the first time each turn, if it's attacking the player with the most life or tied for most life, " + super.getRule();
}
@Override
public ScourgeOfTheThroneAttacksTriggeredAbility copy() {
- return new ScourgeOfTheThroneAttacksTriggeredAbility(this);
+ return new ScourgeOfTheThroneAttacksTriggeredAbility(this);
}
}
class AdditionalCombatPhaseEffect extends OneShotEffect {
public AdditionalCombatPhaseEffect() {
- super(Outcome.Benefit);
- staticText = "After this phase, there is an additional combat phase";
+ super(Outcome.Benefit);
+ staticText = "After this phase, there is an additional combat phase";
}
public AdditionalCombatPhaseEffect(final AdditionalCombatPhaseEffect effect) {
- super(effect);
+ super(effect);
}
@Override
public AdditionalCombatPhaseEffect copy() {
- return new AdditionalCombatPhaseEffect(this);
+ return new AdditionalCombatPhaseEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
- game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
- return true;
+ game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
+ return true;
}
}
diff --git a/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java b/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java
index 5ef23730e24..b6b24c31bb4 100644
--- a/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java
+++ b/Mage.Sets/src/mage/sets/vintagemasters/SpinalGraft.java
@@ -42,6 +42,7 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@@ -95,17 +96,20 @@ class SpinalGraftTriggeredAbility extends TriggeredAbilityImpl {
public SpinalGraftTriggeredAbility copy() {
return new SpinalGraftTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TARGETED;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TARGETED) {
- Permanent enchantment = game.getPermanent(sourceId);
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- UUID enchanted = enchantment.getAttachedTo();
- if (event.getTargetId().equals(enchanted)) {
- getEffects().get(0).setTargetPointer(new FixedTarget(enchanted));
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ UUID enchanted = enchantment.getAttachedTo();
+ if (event.getTargetId().equals(enchanted)) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(enchanted));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/visions/Necromancy.java b/Mage.Sets/src/mage/sets/visions/Necromancy.java
index 3c4b60e43d5..0525df83ffc 100644
--- a/Mage.Sets/src/mage/sets/visions/Necromancy.java
+++ b/Mage.Sets/src/mage/sets/visions/Necromancy.java
@@ -59,6 +59,7 @@ import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.PermanentIdPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
@@ -151,16 +152,19 @@ class CastAtInstantTimeTriggeredAbility extends TriggeredAbilityImpl {
return new CastAtInstantTimeTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
// The sacrifice occurs only if you cast it using its own ability. If you cast it using some other
// effect (for instance, if it gained flash from Vedalken Orrery), then it won't be sacrificed.
// CHECK
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getSourceId().equals(getSourceId())) {
- return !(game.isMainPhase() && game.getActivePlayerId().equals(event.getPlayerId()) && game.getStack().size() == 1);
- }
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && spell.getSourceId().equals(getSourceId())) {
+ return !(game.isMainPhase() && game.getActivePlayerId().equals(event.getPlayerId()) && game.getStack().size() == 1);
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/weatherlight/Disrupt.java b/Mage.Sets/src/mage/sets/weatherlight/Disrupt.java
new file mode 100644
index 00000000000..2e32076e0b4
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/weatherlight/Disrupt.java
@@ -0,0 +1,55 @@
+/*
+ * 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.weatherlight;
+
+import java.util.UUID;
+import mage.constants.Rarity;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class Disrupt extends mage.sets.invasion.Disrupt {
+
+ public Disrupt(UUID ownerId) {
+ super(ownerId);
+ this.cardNumber = 37;
+ this.expansionSetCode = "WTH";
+ this.rarity = Rarity.COMMON;
+ }
+
+ public Disrupt(final Disrupt card) {
+ super(card);
+ }
+
+ @Override
+ public Disrupt copy() {
+ return new Disrupt(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java b/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java
index 9e2dee19ebd..055cd377682 100644
--- a/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java
+++ b/Mage.Sets/src/mage/sets/weatherlight/GoblinVandal.java
@@ -46,6 +46,7 @@ import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.TargetPermanent;
@@ -101,20 +102,23 @@ class GoblinVandalTriggeredAbility extends TriggeredAbilityImpl {
return new GoblinVandalTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DECLARED_BLOCKERS;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DECLARED_BLOCKERS) {
- Permanent sourcePermanent = game.getPermanent(getSourceId());
- if (sourcePermanent.isAttacking()) {
- for (CombatGroup combatGroup: game.getCombat().getGroups()) {
- if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) {
- UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
- FilterPermanent filter = new FilterArtifactPermanent();
- filter.add(new ControllerIdPredicate(defendingPlayerId));
- Target target = new TargetPermanent(filter);
- this.addTarget(target);
- return true;
- }
+ Permanent sourcePermanent = game.getPermanent(getSourceId());
+ if (sourcePermanent.isAttacking()) {
+ for (CombatGroup combatGroup: game.getCombat().getGroups()) {
+ if (combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(getSourceId())) {
+ UUID defendingPlayerId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
+ FilterPermanent filter = new FilterArtifactPermanent();
+ filter.add(new ControllerIdPredicate(defendingPlayerId));
+ Target target = new TargetPermanent(filter);
+ this.addTarget(target);
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java b/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java
new file mode 100644
index 00000000000..3728ecb59e9
--- /dev/null
+++ b/Mage.Sets/src/mage/sets/weatherlight/GuidedStrike.java
@@ -0,0 +1,73 @@
+/*
+ * 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.weatherlight;
+
+import java.util.UUID;
+import mage.abilities.effects.common.DrawCardSourceControllerEffect;
+import mage.abilities.effects.common.continuous.BoostTargetEffect;
+import mage.abilities.effects.Effect;
+import mage.abilities.keyword.FirstStrikeAbility;
+import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Rarity;
+import mage.target.common.TargetCreaturePermanent;
+import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
+
+/**
+ *
+ * @author LoneFox
+
+ */
+public class GuidedStrike extends CardImpl {
+
+ public GuidedStrike(UUID ownerId) {
+ super(ownerId, 132, "Guided Strike", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
+ this.expansionSetCode = "WTH";
+
+ // Target creature gets +1/+0 and gains first strike until end of turn.
+ this.getSpellAbility().addTarget(new TargetCreaturePermanent(0, 1));
+ Effect effect = new BoostTargetEffect(1, 0, Duration.EndOfTurn);
+ effect.setText("Target creature gets +1/+0");
+ this.getSpellAbility().addEffect(effect);
+ effect = new GainAbilityTargetEffect(FirstStrikeAbility.getInstance(), Duration.EndOfTurn);
+ effect.setText("and gains first strike until end of turn");
+ this.getSpellAbility().addEffect(effect);
+ // Draw a card.
+ this.getSpellAbility().addEffect(new DrawCardSourceControllerEffect(1));
+ }
+
+ public GuidedStrike(final GuidedStrike card) {
+ super(card);
+ }
+
+ @Override
+ public GuidedStrike copy() {
+ return new GuidedStrike(this);
+ }
+}
diff --git a/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java b/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java
index 3a35b6b1e19..8ac3bdf798e 100644
--- a/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java
+++ b/Mage.Sets/src/mage/sets/worldwake/AmuletOfVigor.java
@@ -28,15 +28,16 @@
package mage.sets.worldwake;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.UntapTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.targetpointer.FixedTarget;
@@ -76,16 +77,19 @@ class AmuletOfVigorTriggeredAbility extends TriggeredAbilityImpl {
return new AmuletOfVigorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent p = game.getPermanent(event.getTargetId());
- if (p != null && p.isTapped() && p.getControllerId().equals(this.controllerId)) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ Permanent p = game.getPermanent(event.getTargetId());
+ if (p != null && p.isTapped() && p.getControllerId().equals(this.controllerId)) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java b/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java
index fb6b00709c6..b7130eab48b 100644
--- a/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java
+++ b/Mage.Sets/src/mage/sets/worldwake/ArchonOfRedemption.java
@@ -28,9 +28,6 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -38,10 +35,13 @@ import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -88,20 +88,23 @@ class ArchonOfRedemptionTriggeredAbility extends TriggeredAbilityImpl {
return new ArchonOfRedemptionTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- UUID targetId = event.getTargetId();
- Permanent permanent = game.getPermanent(targetId);
- if (permanent.getControllerId().equals(this.controllerId)
- && permanent.getCardType().contains(CardType.CREATURE)
- && (targetId.equals(this.getSourceId())
- || (permanent.getAbilities().contains(FlyingAbility.getInstance()) && !targetId.equals(this.getSourceId())))) {
- for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getTargetId()));
- }
- return true;
+ UUID targetId = event.getTargetId();
+ Permanent permanent = game.getPermanent(targetId);
+ if (permanent.getControllerId().equals(this.controllerId)
+ && permanent.getCardType().contains(CardType.CREATURE)
+ && (targetId.equals(this.getSourceId())
+ || (permanent.getAbilities().contains(FlyingAbility.getInstance()) && !targetId.equals(this.getSourceId())))) {
+ for (Effect effect : this.getEffects()) {
+ effect.setTargetPointer(new FixedTarget(event.getTargetId()));
}
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java b/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java
index d9ae21d721e..0a776c393d7 100644
--- a/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java
+++ b/Mage.Sets/src/mage/sets/worldwake/BloodhuskRitualist.java
@@ -34,8 +34,6 @@ import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
-import mage.abilities.condition.common.KickedCondition;
-import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.dynamicvalue.common.MultikickerCount;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.abilities.keyword.MultikickerAbility;
@@ -61,10 +59,7 @@ public class BloodhuskRitualist extends CardImpl {
this.addAbility(new MultikickerAbility("{B}"));
// When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked.
- Ability ability = new ConditionalTriggeredAbility(
- new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(new MultikickerCount())),
- KickedCondition.getInstance(),
- "");
+ Ability ability = new EntersBattlefieldTriggeredAbility(new DiscardTargetEffect(new MultikickerCount()));
ability.addTarget(new TargetOpponent());
this.addAbility(ability);
}
diff --git a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java
index 039cd486a62..bb646a302af 100644
--- a/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java
+++ b/Mage.Sets/src/mage/sets/worldwake/BrinkOfDisaster.java
@@ -28,21 +28,21 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.targetpointer.FixedTarget;
@@ -101,15 +101,18 @@ class EnchantedBecomesTappedTriggeredAbility extends TriggeredAbilityImpl {
return new EnchantedBecomesTappedTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.TAPPED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.TAPPED) {
- Permanent enchant = game.getPermanent(sourceId);
- if (enchant != null && enchant.getAttachedTo() != null) {
- if (event.getTargetId().equals(enchant.getAttachedTo())) {
- getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo()));
- return true;
- }
+ Permanent enchant = game.getPermanent(sourceId);
+ if (enchant != null && enchant.getAttachedTo() != null) {
+ if (event.getTargetId().equals(enchant.getAttachedTo())) {
+ getEffects().get(0).setTargetPointer(new FixedTarget(enchant.getAttachedTo()));
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java
index 12d98026bf5..3679a0f0c9b 100644
--- a/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java
+++ b/Mage.Sets/src/mage/sets/worldwake/HammerOfRuin.java
@@ -29,11 +29,6 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
@@ -41,12 +36,17 @@ import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.effects.common.continuous.BoostEquippedEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
@@ -96,20 +96,23 @@ class HammerOfRuinTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- FilterPermanent filter = new FilterPermanent("Equipment that player controls");
- filter.add(new SubtypePredicate("Equipment"));
- filter.add(new ControllerIdPredicate(event.getPlayerId()));
- filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getLogName());
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
- this.getTargets().clear();
- this.addTarget(new TargetPermanent(filter));
- return true;
- }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
+ FilterPermanent filter = new FilterPermanent("Equipment that player controls");
+ filter.add(new SubtypePredicate("Equipment"));
+ filter.add(new ControllerIdPredicate(event.getPlayerId()));
+ filter.setMessage("creature controlled by " + game.getPlayer(event.getTargetId()).getLogName());
+
+ this.getTargets().clear();
+ this.addTarget(new TargetPermanent(filter));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java b/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java
index 4a762bce956..77c41706614 100644
--- a/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java
+++ b/Mage.Sets/src/mage/sets/worldwake/KalastriaHighborn.java
@@ -27,15 +27,16 @@
*/
package mage.sets.worldwake;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
+import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -43,8 +44,6 @@ import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.TargetPlayer;
-import java.util.UUID;
-
/**
*
* @author maurer.it_at_gmail.com
@@ -91,14 +90,16 @@ class KalastriaHighbornTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if ( event.getType() == EventType.ZONE_CHANGE ) {
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
// ayrat: make sure Kalastria Highborn is on battlefield
- UUID sourceId = getSourceId();
- if (game.getPermanent(sourceId) == null) {
+ if (game.getPermanent(this.getSourceId()) == null) {
// or it is being removed
- if (game.getLastKnownInformation(sourceId, Zone.BATTLEFIELD) == null) {
+ if (game.getLastKnownInformation(this.getSourceId(), Zone.BATTLEFIELD) == null) {
return false;
}
}
@@ -106,16 +107,11 @@ class KalastriaHighbornTriggeredAbility extends TriggeredAbilityImpl {
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
Permanent permanent = zEvent.getTarget();
- if (permanent != null &&
+ return permanent != null &&
zEvent.getToZone() == Zone.GRAVEYARD &&
zEvent.getFromZone() == Zone.BATTLEFIELD &&
(permanent.getControllerId().equals(this.getControllerId()) &&
- permanent.hasSubtype("Vampire") || permanent.getId().equals(this.getSourceId())))
- {
- return true;
- }
- }
- return false;
+ permanent.hasSubtype("Vampire") || permanent.getId().equals(this.getSourceId()));
}
@Override
diff --git a/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java b/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java
index 851dfe2e561..347d2cc3cda 100644
--- a/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java
+++ b/Mage.Sets/src/mage/sets/worldwake/KazuulTyrantOfTheCliffs.java
@@ -28,9 +28,6 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -38,10 +35,13 @@ import mage.abilities.costs.Cost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
import mage.constants.Outcome;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.players.Player;
@@ -92,17 +92,19 @@ class KazuulTyrantOfTheCliffsTriggeredAbility extends TriggeredAbilityImpl {
return new KazuulTyrantOfTheCliffsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
- Permanent attacker = game.getPermanent(event.getSourceId());
- Player defender = game.getPlayer(event.getTargetId());
- Player you = game.getPlayer(controllerId);
- if (attacker.getControllerId() != you.getId()
- && defender == you) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(attacker.getControllerId()));
- return true;
- }
+ Permanent attacker = game.getPermanent(event.getSourceId());
+ Player defender = game.getPlayer(event.getTargetId());
+ Player you = game.getPlayer(controllerId);
+ if (attacker.getControllerId() != you.getId() && defender == you) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(attacker.getControllerId()));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java
index 9e46e536a43..3b4e0eabd7f 100644
--- a/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java
+++ b/Mage.Sets/src/mage/sets/worldwake/KorFirewalker.java
@@ -29,19 +29,20 @@
package mage.sets.worldwake;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.ObjectColor;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.stack.Spell;
/**
@@ -96,15 +97,15 @@ class KorFirewalkerAbility extends TriggeredAbilityImpl {
return new KorFirewalkerAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getColor(game).isRed()) {
- return true;
- }
- }
- return false;
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ return spell != null && spell.getColor(game).isRed();
}
@Override
diff --git a/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java b/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java
index af06de30b30..673cb6f0617 100644
--- a/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java
+++ b/Mage.Sets/src/mage/sets/worldwake/PerimeterCaptain.java
@@ -28,18 +28,18 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.keyword.DefenderAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
@@ -84,14 +84,17 @@ class PerimeterCaptainTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.BLOCKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
- Permanent creature = game.getPermanent(event.getSourceId());
- if (creature != null) {
- if (creature.getControllerId().equals(this.getControllerId()) && creature.getAbilities().contains(DefenderAbility.getInstance())) {
- return true;
- }
+ Permanent creature = game.getPermanent(event.getSourceId());
+ if (creature != null) {
+ if (creature.getControllerId().equals(this.getControllerId()) && creature.getAbilities().contains(DefenderAbility.getInstance())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java b/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java
index bb0c4500441..6d45d2c7d5e 100644
--- a/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java
+++ b/Mage.Sets/src/mage/sets/worldwake/QuestForTheNihilStone.java
@@ -28,15 +28,14 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -88,12 +87,14 @@ class QuestForTheNihilStoneTriggeredAbility extends TriggeredAbilityImpl {
return new QuestForTheNihilStoneTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DISCARDED_CARD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.DISCARDED_CARD && game.getOpponents(controllerId).contains(event.getPlayerId())) {
- return true;
- }
- return false;
+ return game.getOpponents(controllerId).contains(event.getPlayerId());
}
@Override
@@ -117,6 +118,11 @@ class QuestForTheNihilStoneTriggeredAbility2 extends TriggeredAbilityImpl {
return new QuestForTheNihilStoneTriggeredAbility2(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent quest = game.getPermanent(super.getSourceId());
@@ -124,7 +130,7 @@ class QuestForTheNihilStoneTriggeredAbility2 extends TriggeredAbilityImpl {
Permanent questLKI = (Permanent) game.getLastKnownInformation(super.getSourceId(), Zone.BATTLEFIELD);
quest = questLKI;
}
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && game.getOpponents(controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
Player opponent = game.getPlayer(event.getPlayerId());
if (opponent != null
&& opponent.getHand().size() == 0
diff --git a/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java b/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java
index 9699ac73805..0a35620815e 100644
--- a/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java
+++ b/Mage.Sets/src/mage/sets/worldwake/QuestForUlasTemple.java
@@ -28,8 +28,6 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
@@ -38,12 +36,18 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
@@ -131,12 +135,14 @@ class QuestForUlasTempleTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.END_TURN_STEP_PRE)) {
- Permanent quest = game.getPermanent(super.getSourceId());
- return quest != null && quest.getCounters().getCount(CounterType.QUEST) >= 3;
- }
- return false;
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
+ @Override
+public boolean checkTrigger(GameEvent event, Game game) {
+ Permanent quest = game.getPermanent(super.getSourceId());
+ return quest != null && quest.getCounters().getCount(CounterType.QUEST) >= 3;
}
@Override
diff --git a/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java b/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java
index 00283f78fe0..a8fcaefca2c 100644
--- a/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java
+++ b/Mage.Sets/src/mage/sets/worldwake/RumblingAftershocks.java
@@ -28,21 +28,21 @@
package mage.sets.worldwake;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.TargetController;
-import mage.constants.Zone;
-import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.TargetController;
+import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
import mage.players.Player;
@@ -98,21 +98,23 @@ class RumblingAftershocksTriggeredAbility extends TriggeredAbilityImpl {
}
@Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST) {
- Spell spell = game.getStack().getSpell(event.getTargetId());
- if (spell != null && spell.getControllerId().equals(controllerId)) {
- int damageAmount = 0;
- for (Ability ability: (Abilities) spell.getAbilities()) {
- if (ability instanceof KickerAbility) {
- damageAmount += ((KickerAbility) ability).getKickedCounter(game);
- }
- }
- if (damageAmount > 0) {
- this.getEffects().get(0).setValue("damageAmount", new Integer(damageAmount));
- return true;
- }
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.SPELL_CAST;
+ }
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ Spell spell = game.getStack().getSpell(event.getTargetId());
+ if (spell != null && spell.getControllerId().equals(controllerId)) {
+ int damageAmount = 0;
+ for (Ability ability: spell.getAbilities()) {
+ if (ability instanceof KickerAbility) {
+ damageAmount += ((KickerAbility) ability).getKickedCounter(game, spell.getSpellAbility());
+ }
+ }
+ if (damageAmount > 0) {
+ this.getEffects().get(0).setValue("damageAmount", damageAmount);
+ return true;
}
}
return false;
@@ -144,15 +146,15 @@ class RumblingAftershocksDealDamageEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
Integer damageAmount = (Integer) this.getValue("damageAmount");
- if (player != null && damageAmount.intValue() > 0) {
+ if (player != null && damageAmount > 0) {
Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
if (targetPlayer != null) {
- targetPlayer.damage(damageAmount.intValue(), source.getSourceId(), game, false, true);
+ targetPlayer.damage(damageAmount, source.getSourceId(), game, false, true);
return true;
}
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) {
- permanent.damage(damageAmount.intValue(), source.getSourceId(), game, false, true);
+ permanent.damage(damageAmount, source.getSourceId(), game, false, true);
return true;
}
}
diff --git a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java
index c5b2b73ac36..2cccea80098 100644
--- a/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java
+++ b/Mage.Sets/src/mage/sets/worldwake/SearingBlaze.java
@@ -96,24 +96,18 @@ class SearingBlazeEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
- Watcher watcher = game.getState().getWatchers().get("LandPlayed", source.getControllerId());
+ LandfallWatcher watcher = (LandfallWatcher) game.getState().getWatchers().get("LandPlayed");
Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget());
Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
- if (watcher != null && watcher.conditionMet()) {
- if (player != null) {
- player.damage(3, source.getSourceId(), game, false, true);
- }
- if (creature != null) {
- creature.damage(3, source.getSourceId(), game, false, true);
- }
+ int damage = 1;
+ if (watcher != null && watcher.landPlayed(source.getControllerId())) {
+ damage = 3;
}
- else {
- if (player != null) {
- player.damage(1, source.getSourceId(), game, false, true);
- }
- if (creature != null) {
- creature.damage(1, source.getSourceId(), game, false, true);
- }
+ if (player != null) {
+ player.damage(damage, source.getSourceId(), game, false, true);
+ }
+ if (creature != null) {
+ creature.damage(damage, source.getSourceId(), game, false, true);
}
return true;
}
@@ -143,7 +137,7 @@ class SearingBlazeTarget extends TargetPermanent {
@Override
public Set possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
Set availablePossibleTargets = super.possibleTargets(sourceId, sourceControllerId, game);
- Set possibleTargets = new HashSet();
+ Set possibleTargets = new HashSet<>();
MageObject object = game.getObject(sourceId);
if (object instanceof StackObject) {
UUID playerId = ((StackObject)object).getStackAbility().getFirstTarget();
diff --git a/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java b/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java
index 2a4d6737def..ff4e630dbe9 100644
--- a/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java
+++ b/Mage.Sets/src/mage/sets/worldwake/SlaveringNulls.java
@@ -28,20 +28,20 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.discard.DiscardTargetEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterControlledLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.targetpointer.FixedTarget;
@@ -96,10 +96,14 @@ class SlaveringNullsTriggeredAbility extends TriggeredAbilityImpl {
return new SlaveringNullsTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && ((DamagedPlayerEvent) event).isCombatDamage()) {
+ if (event.getSourceId().equals(this.sourceId) && ((DamagedPlayerEvent) event).isCombatDamage()) {
if (game.getBattlefield().countAll(filter, controllerId, game) > 0) {
Permanent slaveringNulls = game.getPermanent(event.getSourceId());
Player player = game.getPlayer(event.getTargetId());
diff --git a/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java b/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java
index 6645440db61..6767e5affff 100644
--- a/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java
+++ b/Mage.Sets/src/mage/sets/worldwake/StrengthOfTheTajuru.java
@@ -54,8 +54,6 @@ public class StrengthOfTheTajuru extends CardImpl {
super(ownerId, 113, "Strength of the Tajuru", Rarity.RARE, new CardType[]{CardType.INSTANT}, "{X}{G}{G}");
this.expansionSetCode = "WWK";
-
-
// Multikicker (You may pay an additional {1} any number of times as you cast this spell.)
this.addAbility(new MultikickerAbility("{1}"));
diff --git a/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java b/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java
index f3e07b654b3..792062bd19f 100644
--- a/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java
+++ b/Mage.Sets/src/mage/sets/worldwake/TalusPaladin.java
@@ -28,11 +28,6 @@
package mage.sets.worldwake;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Duration;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -40,12 +35,17 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterControlledPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
@@ -101,18 +101,21 @@ class TalusPaladinTriggeredAbility extends TriggeredAbilityImpl {
public TalusPaladinTriggeredAbility copy() {
return new TalusPaladinTriggeredAbility(this);
}
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent ally = game.getPermanent(event.getTargetId());
- if (ally != null) {
- if (ally.hasSubtype("Ally")
- && ally.getControllerId().equals(this.getControllerId())) {
- if (event.getTargetId().equals(this.getSourceId())
- || event.getTargetId().equals(ally.getId())) {
- return true;
- }
+ Permanent ally = game.getPermanent(event.getTargetId());
+ if (ally != null) {
+ if (ally.hasSubtype("Ally")
+ && ally.getControllerId().equals(this.getControllerId())) {
+ if (event.getTargetId().equals(this.getSourceId())
+ || event.getTargetId().equals(ally.getId())) {
+ return true;
}
}
}
diff --git a/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java b/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java
index dab3bbbc363..c70e020699e 100644
--- a/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java
+++ b/Mage.Sets/src/mage/sets/wpngateway/IcatianJavelineers.java
@@ -34,7 +34,7 @@ import mage.constants.Rarity;
*
* @author fireshoes
*/
-public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers {
+public class IcatianJavelineers extends mage.sets.fallenempires.IcatianJavelineers1 {
public IcatianJavelineers(UUID ownerId) {
super(ownerId);
diff --git a/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java b/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java
index f2a9cbaa96c..1d58f3eca48 100644
--- a/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java
+++ b/Mage.Sets/src/mage/sets/zendikar/BladeOfTheBloodchief.java
@@ -28,17 +28,16 @@
package mage.sets.zendikar;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.EquipAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
@@ -52,7 +51,7 @@ import mage.game.permanent.Permanent;
*/
public class BladeOfTheBloodchief extends CardImpl {
- public BladeOfTheBloodchief ( UUID ownerId ) {
+ public BladeOfTheBloodchief(UUID ownerId) {
super(ownerId, 196, "Blade of the Bloodchief", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{1}");
this.expansionSetCode = "ZEN";
this.getSubtype().add("Equipment");
@@ -76,25 +75,28 @@ class BladeOfTheBloodChiefTriggeredAbility extends TriggeredAbilityImpl {
private static final String text = "Whenever a creature dies, put a +1/+1 counter on equipped "
+ "creature. If equipped creature is a Vampire, put two +1/+1 counters on it instead.";
- BladeOfTheBloodChiefTriggeredAbility ( ) {
+ BladeOfTheBloodChiefTriggeredAbility() {
super(Zone.BATTLEFIELD, new BladeOfTheBloodchiefEffect());
}
- BladeOfTheBloodChiefTriggeredAbility ( final BladeOfTheBloodChiefTriggeredAbility ability ) {
+ BladeOfTheBloodChiefTriggeredAbility(final BladeOfTheBloodChiefTriggeredAbility ability) {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ZONE_CHANGE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if ( event.getType() == EventType.ZONE_CHANGE ) {
- ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
- if ( zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD ) {
- Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
- if (p != null && p.getCardType().contains(CardType.CREATURE)) {
- Permanent enchantment = game.getPermanent(getSourceId());
- if (enchantment != null && enchantment.getAttachedTo() != null) {
- return true;
- }
+ ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
+ if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
+ Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
+ if (p != null && p.getCardType().contains(CardType.CREATURE)) {
+ Permanent enchantment = game.getPermanent(getSourceId());
+ if (enchantment != null && enchantment.getAttachedTo() != null) {
+ return true;
}
}
}
@@ -114,11 +116,11 @@ class BladeOfTheBloodChiefTriggeredAbility extends TriggeredAbilityImpl {
class BladeOfTheBloodchiefEffect extends OneShotEffect {
- BladeOfTheBloodchiefEffect ( ) {
+ BladeOfTheBloodchiefEffect() {
super(Outcome.BoostCreature);
}
- BladeOfTheBloodchiefEffect ( final BladeOfTheBloodchiefEffect ability ) {
+ BladeOfTheBloodchiefEffect(final BladeOfTheBloodchiefEffect ability) {
super(ability);
}
@@ -128,10 +130,9 @@ class BladeOfTheBloodchiefEffect extends OneShotEffect {
if (enchantment != null && enchantment.getAttachedTo() != null) {
Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature != null) {
- if ( creature.hasSubtype("Vampire") ) {
+ if (creature.hasSubtype("Vampire")) {
creature.addCounters(CounterType.P1P1.createInstance(2), game);
- }
- else {
+ } else {
creature.addCounters(CounterType.P1P1.createInstance(), game);
}
}
diff --git a/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java b/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java
index f017bba3d9b..ec453fe9372 100644
--- a/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java
+++ b/Mage.Sets/src/mage/sets/zendikar/BloodSeeker.java
@@ -28,18 +28,19 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.targetpointer.FixedTarget;
/**
@@ -72,6 +73,7 @@ public class BloodSeeker extends CardImpl {
}
class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl {
+
BloodSeekerTriggeredAbility() {
super(Zone.BATTLEFIELD, new LoseLifeTargetEffect(1), true);
}
@@ -85,14 +87,19 @@ class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl {
return new BloodSeekerTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
+ if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent) event;
Card card = zEvent.getTarget();
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
for (Effect effect : this.getEffects()) {
- effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
+ effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
}
return true;
}
@@ -104,4 +111,4 @@ class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() {
return "Whenever a creature enters the battlefield under an opponent's control, you may have that player lose 1 life.";
}
-}
\ No newline at end of file
+}
diff --git a/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java b/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java
index 5dfe4bbde0d..a4fc1945330 100644
--- a/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java
+++ b/Mage.Sets/src/mage/sets/zendikar/CelestialMantle.java
@@ -29,8 +29,6 @@
package mage.sets.zendikar;
import java.util.UUID;
-
-import mage.constants.*;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleStaticAbility;
@@ -40,9 +38,15 @@ import mage.abilities.effects.common.UntapAllLandsControllerEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Duration;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
@@ -96,16 +100,16 @@ class CelestialMantleAbility extends TriggeredAbilityImpl {
return new CelestialMantleAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event instanceof DamagedPlayerEvent) {
- DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
- Permanent p = game.getPermanent(event.getSourceId());
- if (damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId())) {
- return true;
- }
- }
- return false;
+ DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
+ Permanent p = game.getPermanent(event.getSourceId());
+ return damageEvent.isCombatDamage() && p != null && p.getAttachments().contains(this.getSourceId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java b/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java
index 8a72b543e52..85e33e70ec8 100644
--- a/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java
+++ b/Mage.Sets/src/mage/sets/zendikar/CosisTrickster.java
@@ -28,16 +28,17 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -82,12 +83,14 @@ class CosisTricksterTriggeredAbility extends TriggeredAbilityImpl {
return new CosisTricksterTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.LIBRARY_SHUFFLED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.LIBRARY_SHUFFLED && game.getOpponents(controllerId).contains(event.getPlayerId())) {
- return true;
- }
- return false;
+ return game.getOpponents(controllerId).contains(event.getPlayerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/zendikar/Electropotence.java b/Mage.Sets/src/mage/sets/zendikar/Electropotence.java
index 3444242e8d5..dd00e4e9215 100644
--- a/Mage.Sets/src/mage/sets/zendikar/Electropotence.java
+++ b/Mage.Sets/src/mage/sets/zendikar/Electropotence.java
@@ -28,18 +28,19 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
@@ -81,15 +82,18 @@ class ElectropotenceTriggeredAbility extends TriggeredAbilityImpl {
super(ability);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)
- && permanent.getControllerId().equals(this.controllerId)) {
- this.getEffects().get(0).setValue("damageSource", event.getTargetId());
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)
+ && permanent.getControllerId().equals(this.controllerId)) {
+ this.getEffects().get(0).setValue("damageSource", event.getTargetId());
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java
index 24025221f21..96294e0af59 100644
--- a/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java
+++ b/Mage.Sets/src/mage/sets/zendikar/EmeriaTheSkyRuin.java
@@ -27,23 +27,23 @@
*/
package mage.sets.zendikar;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
+import java.util.UUID;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTappedAbility;
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.common.FilterLandPermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCardInYourGraveyard;
-import java.util.UUID;
-
/**
*
* @author North
@@ -95,12 +95,14 @@ class EmeriaTheSkyRuinTriggeredAbility extends TriggeredAbilityImpl {
return new EmeriaTheSkyRuinTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java
index ffe3e4e5b5a..8f07a34ec05 100644
--- a/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java
+++ b/Mage.Sets/src/mage/sets/zendikar/GoblinGuide.java
@@ -29,10 +29,6 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
@@ -44,6 +40,10 @@ import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.Cards;
import mage.cards.CardsImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
@@ -101,9 +101,14 @@ class GoblinGuideTriggeredAbility extends TriggeredAbilityImpl {
this.text = ability.text;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ATTACKER_DECLARED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ATTACKER_DECLARED && event.getSourceId().equals(this.getSourceId()) ) {
+ if (event.getSourceId().equals(this.getSourceId()) ) {
UUID defenderId = game.getCombat().getDefendingPlayerId(getSourceId(), game);
if (defenderId != null) {
for (Effect effect :this.getEffects()) {
diff --git a/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java b/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java
index 6bf1a7ce352..91fc8f24195 100644
--- a/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java
+++ b/Mage.Sets/src/mage/sets/zendikar/IonaShieldOfEmeria.java
@@ -35,11 +35,10 @@ import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
-import mage.abilities.effects.OneShotEffect;
+import mage.abilities.effects.common.ChooseColorEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
-import mage.choices.ChoiceColor;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
@@ -47,9 +46,6 @@ import mage.constants.Rarity;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
-import mage.game.permanent.Permanent;
-import mage.players.Player;
-import mage.util.CardUtil;
/**
*
@@ -70,7 +66,7 @@ public class IonaShieldOfEmeria extends CardImpl {
this.addAbility(FlyingAbility.getInstance());
// As Iona, Shield of Emeria enters the battlefield, choose a color.
- this.addAbility(new AsEntersBattlefieldAbility(new IonaShieldOfEmeriaChooseColorEffect()));
+ this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Benefit)));
// Your opponents can't cast spells of the chosen color.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new IonaShieldOfEmeriaReplacementEffect()));
@@ -87,39 +83,6 @@ public class IonaShieldOfEmeria extends CardImpl {
}
}
-class IonaShieldOfEmeriaChooseColorEffect extends OneShotEffect {
-
- public IonaShieldOfEmeriaChooseColorEffect() {
- super(Outcome.Detriment);
- staticText = "choose a color";
- }
-
- public IonaShieldOfEmeriaChooseColorEffect(final IonaShieldOfEmeriaChooseColorEffect effect) {
- super(effect);
- }
-
- @Override
- public boolean apply(Game game, Ability source) {
- Player player = game.getPlayer(source.getControllerId());
- Permanent permanent = game.getPermanent(source.getSourceId());
- if (player != null && permanent != null) {
- ChoiceColor colorChoice = new ChoiceColor();
- if (player.choose(Outcome.Detriment, colorChoice, game)) {
- game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + colorChoice.getChoice());
- game.getState().setValue(permanent.getId() + "_color", colorChoice.getColor());
- permanent.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + colorChoice.getColor().getDescription()), game);
- }
- return true;
- }
- return false;
- }
-
- @Override
- public IonaShieldOfEmeriaChooseColorEffect copy() {
- return new IonaShieldOfEmeriaChooseColorEffect(this);
- }
-}
-
class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifyingEffectImpl {
IonaShieldOfEmeriaReplacementEffect() {
@@ -150,6 +113,7 @@ class IonaShieldOfEmeriaReplacementEffect extends ContinuousRuleModifyingEffectI
public boolean applies(GameEvent event, Ability source, Game game) {
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId()) ) {
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
+ // spell is not on the stack yet, so we have to check the card
Card card = game.getCard(event.getSourceId());
if (chosenColor != null && card != null && card.getColor(game).contains(chosenColor)) {
return true;
diff --git a/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java b/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java
index 1e94eea0de7..2721b3b5b36 100644
--- a/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java
+++ b/Mage.Sets/src/mage/sets/zendikar/LullmageMentor.java
@@ -30,10 +30,6 @@ package mage.sets.zendikar;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -42,7 +38,10 @@ import mage.abilities.costs.common.TapTargetCost;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
import mage.constants.WatcherScope;
+import mage.constants.Zone;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.SubtypePredicate;
@@ -111,16 +110,16 @@ class LullmageMentorTriggeredAbility extends TriggeredAbilityImpl {
return new LullmageMentorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.COUNTERED;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.COUNTERED) {
- CastedSpellsWithSpellTarget watcher = (CastedSpellsWithSpellTarget) game.getState().getWatchers().get("CastedSpellsWithSpellTarget");
- UUID controllerIdCounter = watcher.getControllerSpell(event.getSourceId(), event.getTargetId());
- if (controllerIdCounter != null && controllerIdCounter.equals(controllerId)) {
- return true;
- }
- }
- return false;
+ CastedSpellsWithSpellTarget watcher = (CastedSpellsWithSpellTarget) game.getState().getWatchers().get("CastedSpellsWithSpellTarget");
+ UUID controllerIdCounter = watcher.getControllerSpell(event.getSourceId(), event.getTargetId());
+ return controllerIdCounter != null && controllerIdCounter.equals(controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java b/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java
index 953489a3b37..5464750d433 100644
--- a/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java
+++ b/Mage.Sets/src/mage/sets/zendikar/LuminarchAscension.java
@@ -28,10 +28,6 @@
package mage.sets.zendikar;
import java.util.UUID;
-
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
@@ -42,9 +38,13 @@ import mage.abilities.decorator.ConditionalTriggeredAbility;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.token.AngelToken;
import mage.watchers.common.PlayerLostLifeWatcher;
@@ -53,17 +53,16 @@ import mage.watchers.common.PlayerLostLifeWatcher;
* @author jeffwadsworth
*/
public class LuminarchAscension extends CardImpl {
-
+
private String rule = "At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on Luminarch Ascension. (Damage causes loss of life.)";
-
+
public LuminarchAscension(UUID ownerId) {
super(ownerId, 25, "Luminarch Ascension", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
this.expansionSetCode = "ZEN";
-
// At the beginning of each opponent's end step, if you didn't lose life this turn, you may put a quest counter on Luminarch Ascension.
this.addAbility(new ConditionalTriggeredAbility(new LuminarchAscensionTriggeredAbility(), YouLostNoLifeThisTurnCondition.getInstance(), rule, true));
-
+
// {1}{W}: Put a 4/4 white Angel creature token with flying onto the battlefield. Activate this ability only if Luminarch Ascension has four or more quest counters on it.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CreateTokenEffect(new AngelToken()), new ManaCostsImpl("{1}{W}"));
ability.addCost(new SourceHasCountersCost(4, CounterType.QUEST));
@@ -82,29 +81,30 @@ public class LuminarchAscension extends CardImpl {
class LuminarchAscensionTriggeredAbility extends TriggeredAbilityImpl {
- public LuminarchAscensionTriggeredAbility() {
- super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true);
- }
-
- public LuminarchAscensionTriggeredAbility(LuminarchAscensionTriggeredAbility ability) {
- super(ability);
- }
-
- @Override
- public LuminarchAscensionTriggeredAbility copy() {
- return new LuminarchAscensionTriggeredAbility(this);
- }
-
- @Override
- public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.END_TURN_STEP_PRE
- && game.getOpponents(controllerId).contains(event.getPlayerId())) {
- return true;
- }
- return false;
- }
+ public LuminarchAscensionTriggeredAbility() {
+ super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true);
}
+ public LuminarchAscensionTriggeredAbility(LuminarchAscensionTriggeredAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public LuminarchAscensionTriggeredAbility copy() {
+ return new LuminarchAscensionTriggeredAbility(this);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.END_TURN_STEP_PRE;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ return game.getOpponents(controllerId).contains(event.getPlayerId());
+ }
+}
+
class SourceHasCountersCost extends CostImpl {
private final int counters;
@@ -156,4 +156,3 @@ class YouLostNoLifeThisTurnCondition implements Condition {
return false;
}
}
-
diff --git a/Mage.Sets/src/mage/sets/zendikar/MireBlight.java b/Mage.Sets/src/mage/sets/zendikar/MireBlight.java
index c041d792628..9a6b87ebc59 100644
--- a/Mage.Sets/src/mage/sets/zendikar/MireBlight.java
+++ b/Mage.Sets/src/mage/sets/zendikar/MireBlight.java
@@ -28,18 +28,19 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
@@ -92,15 +93,18 @@ class MireBlightTriggeredAbility extends TriggeredAbilityImpl {
return new MireBlightTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- Permanent enchantment = game.getPermanent(sourceId);
- UUID targetId = event.getTargetId();
- if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
- this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
- return true;
- }
+ Permanent enchantment = game.getPermanent(sourceId);
+ UUID targetId = event.getTargetId();
+ if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
+ this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
+ return true;
}
return false;
}
diff --git a/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java b/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java
index f26ed4dfbe8..d2289b99f48 100644
--- a/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java
+++ b/Mage.Sets/src/mage/sets/zendikar/PunishingFire.java
@@ -28,17 +28,18 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DoIfCostPaid;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.target.common.TargetCreatureOrPlayer;
/**
@@ -84,12 +85,14 @@ class PunishingFireTriggeredAbility extends TriggeredAbilityImpl {
return new PunishingFireTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.GAINED_LIFE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.GAINED_LIFE && game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
- return true;
- }
- return false;
+ return game.getOpponents(this.controllerId).contains(event.getPlayerId());
}
@Override
diff --git a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java
index dc5f38f7122..55898b1d78c 100644
--- a/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java
+++ b/Mage.Sets/src/mage/sets/zendikar/PyromancerAscension.java
@@ -38,14 +38,10 @@ import mage.constants.CardType;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.counters.CounterType;
-import mage.filter.FilterSpell;
-import mage.filter.predicate.Predicates;
-import mage.filter.predicate.mageobject.CardTypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.game.stack.Spell;
-import mage.target.TargetSpell;
import mage.target.targetpointer.FixedTarget;
/**
@@ -58,9 +54,9 @@ public class PyromancerAscension extends CardImpl {
super(ownerId, 143, "Pyromancer Ascension", Rarity.RARE, new CardType[] { CardType.ENCHANTMENT }, "{1}{R}");
this.expansionSetCode = "ZEN";
-
// Whenever you cast an instant or sorcery spell that has the same name as a card in your graveyard, you may put a quest counter on Pyromancer Ascension.
this.addAbility(new PyromancerAscensionQuestTriggeredAbility());
+
// Whenever you cast an instant or sorcery spell while Pyromancer Ascension has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy.
this.addAbility(new PyromancerAscensionCopyTriggeredAbility());
}
@@ -91,9 +87,14 @@ class PyromancerAscensionQuestTriggeredAbility extends TriggeredAbilityImpl {
return new PyromancerAscensionQuestTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (isControlledInstantOrSorcery(spell)) {
Card sourceCard = game.getCard(spell.getSourceId());
@@ -138,10 +139,15 @@ class PyromancerAscensionCopyTriggeredAbility extends TriggeredAbilityImpl {
public PyromancerAscensionCopyTriggeredAbility copy() {
return new PyromancerAscensionCopyTriggeredAbility(this);
}
-
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.SPELL_CAST;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(this.getControllerId())) {
+ if (event.getPlayerId().equals(this.getControllerId())) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (isControlledInstantOrSorcery(spell)) {
Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId());
diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java b/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java
index 1045a048dcb..3ac853b0e97 100644
--- a/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java
+++ b/Mage.Sets/src/mage/sets/zendikar/QuestForPureFlame.java
@@ -44,6 +44,7 @@ import mage.constants.Zone;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
/**
*
@@ -89,10 +90,14 @@ class QuestForPureFlameTriggeredAbility extends TriggeredAbilityImpl {
return new QuestForPureFlameTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType().equals(GameEvent.EventType.DAMAGED_PLAYER)
- && game.getOpponents(getControllerId()).contains(event.getTargetId())) {
+ if (game.getOpponents(getControllerId()).contains(event.getTargetId())) {
return getControllerId().equals(game.getControllerId(event.getSourceId()));
}
return false;
diff --git a/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java b/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java
index 28cf04f0e75..ad819ef5df1 100644
--- a/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java
+++ b/Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java
@@ -42,6 +42,7 @@ import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.DamagedCreatureEvent;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
@@ -92,17 +93,20 @@ class QuestForTheGembladesTriggeredAbility extends TriggeredAbilityImpl {
return new QuestForTheGembladesTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_CREATURE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
- if (((DamagedCreatureEvent) event).isCombatDamage()) {
- Permanent permanent = game.getPermanent(event.getSourceId());
- if (permanent == null) {
- permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
- }
- if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) {
- return true;
- }
+ if (((DamagedCreatureEvent) event).isCombatDamage()) {
+ Permanent permanent = game.getPermanent(event.getSourceId());
+ if (permanent == null) {
+ permanent = (Permanent) game.getLastKnownInformation(event.getSourceId(), Zone.BATTLEFIELD);
+ }
+ if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getControllerId().equals(this.getControllerId())) {
+ return true;
}
}
return false;
diff --git a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java
index 7488dfa2e17..70ca2dd1154 100644
--- a/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java
+++ b/Mage.Sets/src/mage/sets/zendikar/ScuteMob.java
@@ -29,13 +29,13 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterLandPermanent;
import mage.game.Game;
@@ -86,12 +86,14 @@ class ScuteMobAbility extends TriggeredAbilityImpl {
return new ScuteMobAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.UPKEEP_STEP_PRE;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.UPKEEP_STEP_PRE && event.getPlayerId().equals(this.controllerId)) {
- return true;
- }
- return false;
+ return event.getPlayerId().equals(this.controllerId);
}
@Override
diff --git a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java
index 62172cb3070..a689e538717 100644
--- a/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java
+++ b/Mage.Sets/src/mage/sets/zendikar/ValakutTheMoltenPinnacle.java
@@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
-
package mage.sets.zendikar;
import java.util.UUID;
@@ -85,7 +84,7 @@ public class ValakutTheMoltenPinnacle extends CardImpl {
class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl {
- ValakutTheMoltenPinnacleTriggeredAbility () {
+ ValakutTheMoltenPinnacleTriggeredAbility() {
super(Zone.BATTLEFIELD, new DamageTargetEffect(3), true);
this.addTarget(new TargetCreatureOrPlayer());
}
@@ -99,18 +98,22 @@ class ValakutTheMoltenPinnacleTriggeredAbility extends TriggeredAbilityImpl {
return game.getBattlefield().count(ValakutTheMoltenPinnacle.filter, getSourceId(), getControllerId(), game) > 5;
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.ENTERS_THE_BATTLEFIELD;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) {
- Permanent permanent = game.getPermanent(event.getTargetId());
- if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) {
- if(permanent.hasSubtype("Mountain")){
- return true;
- }
+ Permanent permanent = game.getPermanent(event.getTargetId());
+ if (permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) {
+ if (permanent.hasSubtype("Mountain")) {
+ return true;
}
}
return false;
}
+
@Override
public ValakutTheMoltenPinnacleTriggeredAbility copy() {
return new ValakutTheMoltenPinnacleTriggeredAbility(this);
diff --git a/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java b/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java
index ef559cc7065..8179345ad2d 100644
--- a/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java
+++ b/Mage.Sets/src/mage/sets/zendikar/WarrenInstigator.java
@@ -28,10 +28,6 @@
package mage.sets.zendikar;
import java.util.UUID;
-import mage.constants.CardType;
-import mage.constants.Outcome;
-import mage.constants.Rarity;
-import mage.constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@@ -39,10 +35,15 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.DoubleStrikeAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
+import mage.constants.CardType;
+import mage.constants.Outcome;
+import mage.constants.Rarity;
+import mage.constants.Zone;
import mage.filter.common.FilterCreatureCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
+import mage.game.events.GameEvent.EventType;
import mage.players.Player;
import mage.target.common.TargetCardInHand;
@@ -90,13 +91,15 @@ class WarrenInstigatorTriggeredAbility extends TriggeredAbilityImpl {
return new WarrenInstigatorTriggeredAbility(this);
}
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == EventType.DAMAGED_PLAYER;
+ }
+
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER && event.getSourceId().equals(this.sourceId)
- && game.getOpponents(this.getControllerId()).contains(event.getTargetId())) {
- return true;
- }
- return false;
+ return event.getSourceId().equals(this.sourceId)
+ && game.getOpponents(this.getControllerId()).contains(event.getTargetId());
}
@Override
diff --git a/Mage.Stats/pom.xml b/Mage.Stats/pom.xml
index 99fed80daa7..c95eae15158 100644
--- a/Mage.Stats/pom.xml
+++ b/Mage.Stats/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
org.mage
diff --git a/Mage.Tests/CommanderDuel_UW.dck b/Mage.Tests/CommanderDuel_UW.dck
new file mode 100644
index 00000000000..795b083a073
--- /dev/null
+++ b/Mage.Tests/CommanderDuel_UW.dck
@@ -0,0 +1,70 @@
+NAME:Geoff's Daxos of Meletis
+1 [THS:58] Ordeal of Thassa
+1 [5ED:388] Mana Vault
+1 [THS:14] Gift of Immortality
+1 [PC2:12] Spirit Mantle
+1 [M13:36] Sublime Archangel
+1 [M13:206] Gilded Lotus
+1 [M11:5] Armored Ascension
+1 [ALA:27] Sigiled Paladin
+1 [ALA:26] Sighted-Caste Sorcerer
+1 [CON:2] Asha's Favor
+1 [M14:210] Fireshrieker
+1 [GTC:17] Holy Mantle
+1 [CHK:65] Hinder
+1 [DGM:96] Render Silent
+1 [M13:74] Tricks of the Trade
+1 [ISD:229] Mask of Avacyn
+1 [GPT:28] Infiltrator's Magemark
+14 [THS:234] Island
+1 [CMD:261] Sol Ring
+1 [THS:25] Ordeal of Heliod
+1 [5DN:131] Helm of Kaldra
+1 [M12:24] Lifelink
+1 [AVR:50] Elgaud Shieldmate
+19 [THS:230] Plains
+1 [M14:23] Indestructibility
+1 [M14:5] Archangel of Thune
+1 [CMD:265] Azorius Chancery
+1 [ARB:3] Ethercaste Knight
+1 [ARB:1] Ardent Plea
+1 [M13:18] Guardians of Akrasa
+1 [CMD:40] Brainstorm
+1 [UDS:139] Thran Dynamo
+1 [M12:219] Swiftfoot Boots
+1 [THS:39] Aqueous Form
+1 [M13:6] Aven Squire
+1 [MMA:25] Path to Exile
+1 [M13:4] Angelic Benediction
+1 [CMD:253] Lightning Greaves
+1 [SHM:150] Steel of the Godhead
+1 [M13:225] Glacial Fortress
+1 [10E:40] Serra's Embrace
+1 [JUD:31] Unquestioned Authority
+1 [M13:221] Cathedral of War
+1 [RTR:9] Ethereal Armor
+1 [DDL:27] Battle Mastery
+1 [DDL:24] Bonds of Faith
+1 [ISD:53] Dissipate
+1 [DKA:148] Executioner's Hood
+1 [DIS:159] Azorius Signet
+1 [GTC:37] Hands of Binding
+1 [PC2:112] Quietus Spike
+1 [MRD:144] Banshee's Blade
+1 [AVR:36] Silverblade Paladin
+1 [PC2:115] Whispersilk Cloak
+1 [M12:73] Ponder
+1 [M13:29] Rhox Faithmender
+1 [ALA:1] Akrasan Squire
+1 [M13:213] Ring of Thune
+1 [UDS:46] Sigil of Sleep
+1 [M13:211] Ring of Evos Isle
+1 [RTR:241] Hallowed Fountain
+1 [7ED:67] Counterspell
+1 [ISD:49] Curiosity
+1 [SOM:229] Seachrome Coast
+1 [PC2:10] Mammoth Umbra
+1 [MBS:104] Darksteel Plate
+1 [M13:21] Knight of Glory
+1 [M13:22] Oblivion Ring
+SB: 1 [THS:191] Daxos of Meletis
diff --git a/Mage.Tests/pom.xml b/Mage.Tests/pom.xml
index 0384cada3c8..7333ecf8f2d 100644
--- a/Mage.Tests/pom.xml
+++ b/Mage.Tests/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
mage-tests
diff --git a/Mage.Tests/src/test/java/org/mage/test/AI/basic/CostModificationTest.java b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CostModificationTest.java
new file mode 100644
index 00000000000..82c1889c081
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/AI/basic/CostModificationTest.java
@@ -0,0 +1,64 @@
+/*
+ * 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 org.mage.test.AI.basic;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBaseAI;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class CostModificationTest extends CardTestPlayerBaseAI {
+
+ /**
+ * There seems to be a problem when playing Fluctuator against Computer.
+ * Once played, I am stuck at "Waiting for Computer" forever...
+ */
+ @Test
+ public void testFluctuator() {
+ addCard(Zone.HAND, playerA, "Silvercoat Lion");
+ // Destroy all artifacts, creatures, and enchantments.
+ // Cycling ({3}, Discard this card: Draw a card.)
+ addCard(Zone.HAND, playerA, "Akroma's Vengeance");
+
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
+ // Cycling abilities you activate cost you up to {2} less to activate.
+ addCard(Zone.BATTLEFIELD, playerA, "Fluctuator");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertGraveyardCount(playerA, "Akroma's Vengeance", 1);
+ assertPermanentCount(playerA, "Silvercoat Lion", 1);
+ }
+
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java
index 3b87ec843a1..9864c33cfdb 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/activated/ReturnToHandTest.java
@@ -27,7 +27,6 @@
*/
package org.mage.test.cards.abilities.activated;
-import mage.abilities.keyword.BloodthirstAbility;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import org.junit.Test;
@@ -74,5 +73,46 @@ public class ReturnToHandTest extends CardTestPlayerBase {
}
+ /**
+ * Return from graveyard to hand if you play a swamp
+ */
+ @Test
+ public void VeilbornGhoulTest1() {
+ // Veilborn Ghoul can't block.
+ // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
+ addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
+ addCard(Zone.HAND, playerA, "Swamp");
+
+ playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Swamp");
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+
+ execute();
+
+ assertPermanentCount(playerA, "Swamp", 1);
+ assertHandCount(playerA, "Veilborn Ghoul", 1);
+
+ }
+ /**
+ * Return from graveyard to hand if you play a non swamp land but Urborg, Tomb of Yawgmoth is in play
+ */
+ @Test
+ public void VeilbornGhoulTest2() {
+ // Veilborn Ghoul can't block.
+ // Whenever a Swamp enters the battlefield under your control, you may return Veilborn Ghoul from your graveyard to your hand.
+ addCard(Zone.GRAVEYARD, playerA, "Veilborn Ghoul");
+ addCard(Zone.HAND, playerA, "Flood Plain");
+
+ // Each land is a Swamp in addition to its other land types.
+ addCard(Zone.BATTLEFIELD, playerA, "Urborg, Tomb of Yawgmoth", 1);
+
+ playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Flood Plain");
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+
+ execute();
+
+ assertPermanentCount(playerA, "Flood Plain", 1);
+ assertHandCount(playerA, "Veilborn Ghoul", 1);
+
+ }
-}
\ No newline at end of file
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/ScytheOfTheWretchedTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/ScytheOfTheWretchedTest.java
new file mode 100644
index 00000000000..06bc16cf28d
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/equipped/ScytheOfTheWretchedTest.java
@@ -0,0 +1,185 @@
+/*
+ * 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 org.mage.test.cards.abilities.equipped;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import mage.game.permanent.Permanent;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class ScytheOfTheWretchedTest extends CardTestPlayerBase {
+
+ /**
+ * Test that the creature taht died returns to battlefield under your control
+ * if the previous equiped creature does not die
+ */
+ @Test
+ public void testEquipAlive() {
+ addCard(Zone.BATTLEFIELD, playerA, "Soulmender", 1);
+
+ addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
+ // Equipped creature gets +2/+2.
+ // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature.
+ // Equip {4}
+ addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
+
+ activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
+
+ attack(2, playerB, "Silvercoat Lion");
+ block(2, playerA, "Soulmender", "Silvercoat Lion");
+
+ setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 20);
+
+ assertPermanentCount(playerA, "Soulmender", 0);
+ assertPermanentCount(playerB, "Soulmender", 1);
+ assertPowerToughness(playerB, "Soulmender", 3, 3);
+
+ assertPowerToughness(playerB, "Silvercoat Lion", 2, 2);
+
+ Permanent silvercoatLion = getPermanent("Silvercoat Lion", playerB.getId());
+ Assert.assertTrue("Silvercoat Lion may not have any attachments", silvercoatLion.getAttachments().isEmpty());
+ }
+ /**
+ * Test that the creature that died returns to battlefield under your control
+ * if the previous equiped creature does die after equipment is removed
+ */
+ @Test
+ public void testEquipDied() {
+ addCard(Zone.BATTLEFIELD, playerA, "Oreskos Swiftclaw", 1); // 3/1
+
+ addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
+ // Equipped creature gets +2/+2.
+ // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature.
+ // Equip {4}
+ addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
+
+ activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
+
+ attack(2, playerB, "Silvercoat Lion");
+ block(2, playerA, "Oreskos Swiftclaw", "Silvercoat Lion");
+
+ setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 20);
+
+ assertPermanentCount(playerA, "Oreskos Swiftclaw", 0);
+ assertPermanentCount(playerB, "Oreskos Swiftclaw", 1);
+ assertPowerToughness(playerB, "Oreskos Swiftclaw", 5, 3);
+
+ assertGraveyardCount(playerB, "Silvercoat Lion", 1);
+ }
+
+ /**
+ * Test that the creature that died returns to battlefield under your control
+ * if the previous equiped creature does die already in combat
+ */
+ @Test
+ public void testEquipDiedInCombat() {
+ addCard(Zone.BATTLEFIELD, playerA, "Serra Angel", 1); // 4/4
+
+ addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
+ // Equipped creature gets +2/+2.
+ // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature.
+ // Equip {4}
+ addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
+
+ activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
+
+ attack(2, playerB, "Silvercoat Lion");
+ block(2, playerA, "Serra Angel", "Silvercoat Lion");
+
+ setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 20);
+
+ assertPermanentCount(playerA, "Serra Angel", 0);
+ assertPermanentCount(playerB, "Serra Angel", 1);
+ assertPowerToughness(playerB, "Serra Angel", 6, 6);
+
+ assertGraveyardCount(playerB, "Silvercoat Lion", 1);
+ }
+
+
+ /**
+ * Test that the creature that died returns to battlefield under your control
+ * if the previous equiped creature does die already in combat and the equipment was destroyed meanwhile
+ */
+ @Test
+ public void testEquipDiedInCombat2() {
+ addCard(Zone.BATTLEFIELD, playerA, "Serra Angel", 1); // 4/4
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
+ addCard(Zone.HAND, playerA, "Disenchant", 1);
+
+ addCard(Zone.BATTLEFIELD, playerB, "Plains", 4);
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion");
+ // Equipped creature gets +2/+2.
+ // Whenever a creature dealt damage by equipped creature this turn dies, return that card to the battlefield under your control. Attach Scythe of the Wretched to that creature.
+ // Equip {4}
+ addCard(Zone.BATTLEFIELD, playerB, "Scythe of the Wretched");
+
+ activateAbility(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Equip {4}", "Silvercoat Lion");
+
+ attack(2, playerB, "Silvercoat Lion");
+ block(2, playerA, "Serra Angel", "Silvercoat Lion");
+
+ castSpell(2, PhaseStep.COMBAT_DAMAGE, playerA, "Disenchant", "Scythe of the Wretched", "Whenever a creature dealt damage");
+
+ setStopAt(2, PhaseStep.POSTCOMBAT_MAIN);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 20);
+
+ assertGraveyardCount(playerA, "Disenchant", 1);
+ assertGraveyardCount(playerB, "Scythe of the Wretched", 1);
+
+ assertPermanentCount(playerA, "Serra Angel", 0);
+ assertPermanentCount(playerB, "Serra Angel", 1);
+ assertPowerToughness(playerB, "Serra Angel", 4, 4);
+
+ assertGraveyardCount(playerB, "Silvercoat Lion", 1);
+ }
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java
index f9dcd57ecdd..146a5eb9256 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/DiscardTest.java
@@ -25,7 +25,6 @@
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
-
package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
@@ -37,16 +36,14 @@ import org.mage.test.serverside.base.CardTestPlayerBase;
*
* @author LevelX2
*/
-
public class DiscardTest extends CardTestPlayerBase {
- /*
- * If Rest in Peace is in play, every card going to the graveyard goes to exile instead.
- * If a card is discarded while Rest in Peace is on the battlefield, abilities that function
- * when a card is discarded (such as madness) still work, even though that card never reaches
- * a graveyard.
- */
-
+ /*
+ * If Rest in Peace is in play, every card going to the graveyard goes to exile instead.
+ * If a card is discarded while Rest in Peace is on the battlefield, abilities that function
+ * when a card is discarded (such as madness) still work, even though that card never reaches
+ * a graveyard.
+ */
@Test
public void testRestInPeaceAndCycle() {
@@ -67,4 +64,26 @@ public class DiscardTest extends CardTestPlayerBase {
assertHandCount(playerA, 1); // the card drawn by Cycling
}
-}
\ No newline at end of file
+ /**
+ * With Bazaar of Baghdad, if you use it when you have no cards in hand, you
+ * draw 2, it asks for you to discard 3, but you can't. So the game can't
+ * progress and you lose on time.
+ */
+ @Test
+ public void testBazaarOfBaghdad() {
+ // {T}: Draw two cards, then discard three cards.
+ addCard(Zone.BATTLEFIELD, playerA, "Bazaar of Baghdad", 1);
+
+ activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Draw two cards, then discard three cards");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 20);
+
+ assertHandCount(playerA, 0);
+ assertGraveyardCount(playerA, 2);
+
+ }
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java
index e3786359193..52dff9e173a 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/FlashbackTest.java
@@ -75,4 +75,50 @@ public class FlashbackTest extends CardTestPlayerBase {
assertExileCount("Fracturing Gust", 1);
}
+ /**
+ * My opponent put Iona on the battlefield using Unburial Rites, but my game
+ * log didn't show me the color he has chosen.
+ *
+ */
+ @Test
+ public void testUnburialRites() {
+ addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 8);
+ // Return target creature card from your graveyard to the battlefield.
+ // Flashback {3}{W}
+ addCard(Zone.HAND, playerA, "Unburial Rites", 1); // Sorcery - {4}{B}
+
+ // Flying
+ // As Iona, Shield of Emeria enters the battlefield, choose a color.
+ // Your opponents can't cast spells of the chosen color.
+ addCard(Zone.GRAVEYARD, playerA, "Iona, Shield of Emeria");
+
+ // As Lurebound Scarecrow enters the battlefield, choose a color.
+ // When you control no permanents of the chosen color, sacrifice Lurebound Scarecrow.
+ addCard(Zone.GRAVEYARD, playerA, "Lurebound Scarecrow"); // Enchantment - {2}{U}
+
+ addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
+ addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
+
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Unburial Rites", "Iona, Shield of Emeria");
+ setChoice(playerA, "Red");
+
+ activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Flashback {3}{W}");
+ addTarget(playerA, "Lurebound Scarecrow");
+ setChoice(playerA, "White");
+
+ castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
+
+ setStopAt(1, PhaseStep.END_TURN);
+ execute();
+
+ assertPermanentCount(playerA, "Iona, Shield of Emeria", 1);
+ assertPermanentCount(playerA, "Lurebound Scarecrow", 1);
+
+ assertHandCount(playerB, "Lightning Bolt", 1);
+
+ assertExileCount("Unburial Rites", 1);
+ }
+
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java
index 8744f4f5a28..162211c664d 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/KickerTest.java
@@ -31,6 +31,7 @@ package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
import mage.counters.CounterType;
+import org.junit.Assert;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@@ -203,4 +204,92 @@ public class KickerTest extends CardTestPlayerBase {
assertLife(playerB, 20);
}
+
+ /**
+ * Bloodhusk Ritualist's discard trigger does nothing if the Ritualist leaves the battlefield before the trigger resolves.
+ */
+ @Test
+ public void testBloodhuskRitualist() {
+ addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
+ addCard(Zone.HAND, playerB, "Lightning Bolt");
+ addCard(Zone.HAND, playerB, "Fireball", 2);
+
+ addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
+ addCard(Zone.HAND, playerA, "Bloodhusk Ritualist", 1); // 2/2 {2}{B}
+
+ // Multikicker (You may pay an additional {B} any number of times as you cast this spell.)
+ // When Bloodhusk Ritualist enters the battlefield, target opponent discards a card for each time it was kicked.
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Bloodhusk Ritualist");
+ setChoice(playerA, "Yes"); // 2 x Multikicker
+ setChoice(playerA, "Yes");
+ setChoice(playerA, "No");
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", "Bloodhusk Ritualist");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ Assert.assertEquals("All mana has to be used","[]", playerA.getManaAvailable(currentGame).toString());
+ assertGraveyardCount(playerB, "Lightning Bolt", 1);
+ assertGraveyardCount(playerA, "Bloodhusk Ritualist", 1);
+ assertGraveyardCount(playerB, "Fireball", 2);
+
+ assertHandCount(playerB, 0);
+ }
+
+ /**
+ * Test and/or kicker costs
+ */
+ @Test
+ public void testSunscapeBattlemage1() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
+
+ // Kicker {1}{G} and/or {2}{U}
+ // When {this} enters the battlefield, if it was kicked with its {1}{G} kicker, destroy target creature with flying.
+ // When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, draw two cards.
+ addCard(Zone.HAND, playerA, "Sunscape Battlemage", 1); // 2/2 {2}{W}
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sunscape Battlemage");
+ setChoice(playerA, "No"); // no {1}{G}
+ setChoice(playerA, "Yes"); // but {2}{U}
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Sunscape Battlemage", 1);
+ assertHandCount(playerA, 2);
+ }
+
+
+ /**
+ * Test and/or kicker costs
+ */
+ @Test
+ public void testSunscapeBattlemage2() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 3);
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 3);
+ addCard(Zone.BATTLEFIELD, playerA, "Forest", 2);
+
+
+ // Kicker {1}{G} and/or {2}{U}
+ // When {this} enters the battlefield, if it was kicked with its {1}{G} kicker, destroy target creature with flying.
+ // When {this} enters the battlefield, if it was kicked with its {2}{U} kicker, draw two cards.
+ addCard(Zone.HAND, playerA, "Sunscape Battlemage", 1); // 2/2 {2}{W}
+
+ addCard(Zone.BATTLEFIELD, playerB, "Birds of Paradise", 2);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sunscape Battlemage");
+ addTarget(playerA, "Birds of Paradise");
+ setChoice(playerA, "Yes"); // no {1}{G}
+ setChoice(playerA, "Yes"); // but {2}{U}
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertGraveyardCount(playerB, "Birds of Paradise", 1);
+ assertPermanentCount(playerA, "Sunscape Battlemage", 1);
+ assertHandCount(playerA, 2);
+ }
+
+
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java
index ef5349b9ae8..5e3b1b177cc 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/LandfallTest.java
@@ -111,5 +111,93 @@ public class LandfallTest extends CardTestPlayerBase {
assertLife(playerB, 20);
}
-
+
+ /**
+ * Searing Blaze's landfall doesn't appear to be working. My opponent played
+ * a mountain, then played searing blaze targeting my Tasigur, the Golden
+ * Fang. It only dealt 1 damage to me, where it should've dealt 3, because
+ * my opponent had played a land.
+ */
+ @Test
+ public void testSearingBlaze() {
+ // Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls.
+ // Landfall - If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead.
+ addCard(Zone.HAND, playerA, "Searing Blaze",1);
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain",1);
+ addCard(Zone.HAND, playerA, "Mountain");
+
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
+
+
+ playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Mountain");
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Searing Blaze");
+
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Mountain", 2);
+ assertGraveyardCount(playerA, "Searing Blaze" , 1);
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 17);
+
+ assertGraveyardCount(playerB, "Silvercoat Lion" , 1);
+
+ }
+
+ @Test
+ public void testGroundswellWithoutLandfall() {
+ // Target creature gets +2/+2 until end of turn.
+ //Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
+ addCard(Zone.HAND, playerB, "Groundswell",1);
+ addCard(Zone.BATTLEFIELD, playerB, "Forest",1);
+
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
+
+ attack(2, playerB, "Silvercoat Lion");
+ castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
+
+
+ setStopAt(2, PhaseStep.END_COMBAT);
+ execute();
+
+ assertPermanentCount(playerB, "Forest", 1);
+ assertGraveyardCount(playerB, "Groundswell" , 1);
+
+ assertPermanentCount(playerB, "Silvercoat Lion" , 1);
+ assertPowerToughness(playerB, "Silvercoat Lion", 4, 4);
+
+ assertLife(playerA, 16); // 2 + 4
+ assertLife(playerB, 20);
+ }
+
+ @Test
+ public void testGroundswellWithLandfall() {
+ // Target creature gets +2/+2 until end of turn.
+ //Landfall - If you had a land enter the battlefield under your control this turn, that creature gets +4/+4 until end of turn instead.
+ addCard(Zone.HAND, playerB, "Groundswell",1);
+ addCard(Zone.HAND, playerB, "Forest");
+
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
+
+
+ playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Forest");
+ attack(2, playerB, "Silvercoat Lion");
+ castSpell(2, PhaseStep.DECLARE_ATTACKERS, playerB, "Groundswell", "Silvercoat Lion");
+
+
+ setStopAt(2, PhaseStep.END_COMBAT);
+ execute();
+
+ assertPermanentCount(playerB, "Forest", 1);
+ assertGraveyardCount(playerB, "Groundswell" , 1);
+
+ assertPermanentCount(playerB, "Silvercoat Lion" , 1);
+ assertPowerToughness(playerB, "Silvercoat Lion", 6, 6);
+
+ assertLife(playerA, 14); // 2 + 4
+ assertLife(playerB, 20);
+ }
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java
new file mode 100644
index 00000000000..6eff8eaae26
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/SpliceOnArcaneTest.java
@@ -0,0 +1,144 @@
+/*
+ * 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 org.mage.test.cards.abilities.keywords;
+
+import mage.abilities.keyword.HasteAbility;
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class SpliceOnArcaneTest extends CardTestPlayerBase {
+
+ /**
+ * Test that it works to cast Through the Breach
+ * by slicing it on an arcane spell
+ *
+ */
+ @Test
+ public void testSpliceThroughTheBreach() {
+
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
+ // Sorcery - Arcane {R}
+ // Lava Spike deals 3 damage to target player.
+ addCard(Zone.HAND, playerA, "Lava Spike",1);
+ // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step.
+ // Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.)
+ addCard(Zone.HAND, playerA, "Through the Breach",1);
+ addCard(Zone.HAND, playerA, "Silvercoat Lion",1);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB);
+ setChoice(playerA, "Silvercoat Lion");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 17);
+
+ assertGraveyardCount(playerA, "Lava Spike", 1);
+ assertHandCount(playerA, "Through the Breach", 1);
+ assertPermanentCount(playerA, "Silvercoat Lion", 1);
+ assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
+ Assert.assertEquals("All available mana has to be used", 0, playerA.getManaAvailable(currentGame).size());
+ }
+
+ @Test
+ public void testSpliceTorrentOfStone() {
+
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
+ // Sorcery - Arcane {R}
+ // Lava Spike deals 3 damage to target player.
+ addCard(Zone.HAND, playerA, "Lava Spike",1);
+ // Torrent of Stone deals 4 damage to target creature.
+ // Splice onto Arcane-Sacrifice two Mountains. (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.)
+ addCard(Zone.HAND, playerA, "Torrent of Stone",1);
+
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion",1);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lava Spike", playerB);
+ addTarget(playerA, "Silvercoat Lion");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 17);
+
+ assertGraveyardCount(playerA, "Lava Spike", 1);
+ assertHandCount(playerA, "Torrent of Stone", 1);
+ assertGraveyardCount(playerB, "Silvercoat Lion", 1);
+ assertPermanentCount(playerA, "Mountain", 0);
+ Assert.assertEquals("No more mana available", "[]", playerA.getManaAvailable(currentGame).toString());
+ }
+ /**
+ * Nourishing Shoal's interaction with Splicing Through the Breach is
+ * bugged. You should still need to pay 2RR as an additional cost, which is
+ * not affected by the alternate casting method of Shoal, but you are able
+ * to Splice it for free. This is a very relevant bug right now due to the
+ * appearance of the deck over the weekend, and it makes the deck absurdly
+ * powerful.
+ */
+ @Test
+ public void testSpliceThroughTheBreach2() {
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain", 4);
+ // You may exile a green card with converted mana cost X from your hand rather than pay Nourishing Shoal's mana cost.
+ // You gain X life.
+ addCard(Zone.HAND, playerA, "Nourishing Shoal",1);
+ addCard(Zone.HAND, playerA, "Giant Growth",1);
+ // You may put a creature card from your hand onto the battlefield. That creature gains haste. Sacrifice that creature at the beginning of the next end step.
+ // Splice onto Arcane {2}{R}{R} (As you cast an Arcane spell, you may reveal this card from your hand and pay its splice cost. If you do, add this card's effects to that spell.)
+ addCard(Zone.HAND, playerA, "Through the Breach",1);
+ addCard(Zone.HAND, playerA, "Silvercoat Lion",1);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nourishing Shoal");
+ setChoice(playerA, "Yes");
+ setChoice(playerA, "Silvercoat Lion");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertLife(playerA, 21);
+ assertLife(playerB, 20);
+
+ assertGraveyardCount(playerA, "Nourishing Shoal", 1);
+ assertHandCount(playerA, "Through the Breach", 1);
+ assertPermanentCount(playerA, "Silvercoat Lion", 1);
+ assertAbility(playerA, "Silvercoat Lion", HasteAbility.getInstance(), true);
+
+ Assert.assertEquals("All available mana has to be used","[]", playerA.getManaAvailable(currentGame).toString());
+ }
+
+
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java
index 9157c8dfa34..6caa1dcf763 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/StormTest.java
@@ -30,6 +30,7 @@ package org.mage.test.cards.abilities.keywords;
import mage.constants.PhaseStep;
import mage.constants.Zone;
+import mage.counters.CounterType;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@@ -163,5 +164,39 @@ public class StormTest extends CardTestPlayerBase {
assertLife(playerB, 16); // 3 (Lightning Bolt) + 1 from Storm copied Grapeshot
}
-
+
+ /**
+ * I provide a game log fo the issue with storm mentioned earlier. I guess Pyromancer Ascension is a culprit.
+ *
+ *
+ */
+ @Test
+ public void testStormAndPyromancerAscension() {
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain", 5);
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
+ // Whenever you cast an instant or sorcery spell that has the same name as a card in your graveyard, you may put a quest counter on Pyromancer Ascension.
+ // Whenever you cast an instant or sorcery spell while Pyromancer Ascension has two or more quest counters on it, you may copy that spell. You may choose new targets for the copy.
+ addCard(Zone.BATTLEFIELD, playerA, "Pyromancer Ascension", 1);
+ // Grapeshot deals 1 damage to target creature or player. - Sorcery {1}{R}
+ // Storm (When you cast this spell, copy it for each spell cast before it this turn. You may choose new targets for the copies.)
+ addCard(Zone.LIBRARY, playerA, "Grapeshot", 2);
+ skipInitShuffling();
+ // Look at the top two cards of your library. Put one of them into your hand and the other on the bottom of your library.
+ addCard(Zone.HAND, playerA, "Sleight of Hand");
+ addCard(Zone.HAND, playerA, "Shock", 3);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Sleight of Hand");
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", playerB);
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", "targetPlayer=PlayerB", "Shock", StackClause.WHILE_NOT_ON_STACK);
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Shock", "targetPlayer=PlayerB", "Shock", StackClause.WHILE_NOT_ON_STACK);
+ castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Grapeshot", playerB);
+
+ setStopAt(1, PhaseStep.END_TURN);
+ execute();
+
+ assertGraveyardCount(playerA, "Shock", 3);
+ assertGraveyardCount(playerA, "Grapeshot", 1);
+ assertCounterCount("Pyromancer Ascension", CounterType.QUEST, 2);
+ assertLife(playerB, 8); // 6 from the Shocks + 5 from Grapeshot + 1 from Pyromancer Ascencsion copy
+ }
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java
new file mode 100644
index 00000000000..1aa83fc7929
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/keywords/TransformTest.java
@@ -0,0 +1,68 @@
+/*
+ * 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 org.mage.test.cards.abilities.keywords;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import mage.counters.CounterType;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class TransformTest extends CardTestPlayerBase{
+
+ @Test
+ public void NissaVastwoodSeerTest() {
+
+ addCard(Zone.LIBRARY, playerA, "Forest");
+
+ addCard(Zone.BATTLEFIELD, playerA, "Forest", 6);
+ // When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.
+ // Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.
+
+ addCard(Zone.HAND, playerA, "Nissa, Vastwood Seer");
+
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Nissa, Vastwood Seer");
+ playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Forest");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Forest", 7);
+
+ assertPermanentCount(playerA, "Nissa, Vastwood Seer", 0);
+ assertPermanentCount(playerA, "Nissa, Sage Animist", 1);
+ assertCounterCount("Nissa, Sage Animist", CounterType.LOYALTY, 3);
+ }
+
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java
new file mode 100644
index 00000000000..ecd169b3272
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/AddingCountersToPermanentsTest.java
@@ -0,0 +1,72 @@
+/*
+ * 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 org.mage.test.cards.abilities.oneshot.counter;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class AddingCountersToPermanentsTest extends CardTestPlayerBase {
+
+ @Test
+ public void testBlackSunsZenith() {
+ addCard(Zone.BATTLEFIELD, playerA, "Swamp", 4);
+ addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
+ addCard(Zone.BATTLEFIELD, playerA, "Witch's Familiar", 1);
+
+ // Put X -1/-1 counters on each creature. Shuffle Black Sun's Zenith into its owner's library.
+ addCard(Zone.HAND, playerA, "Black Sun's Zenith", 1);
+
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
+ addCard(Zone.BATTLEFIELD, playerB, "Witch's Familiar", 1);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Black Sun's Zenith");
+ setChoice(playerA, "X=2");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertGraveyardCount(playerA, "Silvercoat Lion", 1);
+ assertGraveyardCount(playerB, "Silvercoat Lion", 1);
+
+ assertPermanentCount(playerA, "Witch's Familiar", 1);
+ assertPowerToughness(playerA, "Witch's Familiar", 0, 1);
+
+ assertPermanentCount(playerB, "Witch's Familiar", 1);
+ assertPowerToughness(playerB, "Witch's Familiar", 0, 1);
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java
new file mode 100644
index 00000000000..8e687a50e95
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counter/MovingCounterTest.java
@@ -0,0 +1,80 @@
+/*
+ * 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 org.mage.test.cards.abilities.oneshot.counter;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class MovingCounterTest extends CardTestPlayerBase {
+
+ /**
+ * I'm having an issue when using Bioshift to move only a portion of
+ * counters to another creature. When I attempt to do this, it moves all of
+ * the counters (and in some cases with my Simic deck) kills the creature.
+ */
+ @Test
+ public void testCantBeCounteredNormal() {
+ addCard(Zone.BATTLEFIELD, playerA, "Forest", 6);
+ addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
+
+ // Move any number of +1/+1 counters from target creature onto another target creature with the same controller.
+ addCard(Zone.HAND, playerA, "Bioshift", 1);
+
+ // Protean Hydra enters the battlefield with X +1/+1 counters on it.
+ // If damage would be dealt to Protean Hydra, prevent that damage and remove that many +1/+1 counters from it.
+ // Whenever a +1/+1 counter is removed from Protean Hydra, put two +1/+1 counters on it at the beginning of the next end step.
+ addCard(Zone.HAND, playerA, "Protean Hydra", 1);
+
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Protean Hydra");
+ setChoice(playerA, "X=4");
+ castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Bioshift", "Protean Hydra^Silvercoat Lion");
+ setChoice(playerA, "X=2");
+
+ setStopAt(2, PhaseStep.UPKEEP);
+ execute();
+
+ assertGraveyardCount(playerA, "Bioshift", 1);
+
+ assertPermanentCount(playerA, "Silvercoat Lion", 1);
+ assertPowerToughness(playerA, "Silvercoat Lion", 4, 4); // added 2 counters
+
+ assertPermanentCount(playerA, "Protean Hydra", 1);
+ assertPowerToughness(playerA, "Protean Hydra", 6, 6); // started with 4, removed 2, added 4 at end = 6
+
+
+ }
+
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java
new file mode 100644
index 00000000000..1481997f5af
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/abilities/oneshot/counterspell/CounterspellTest.java
@@ -0,0 +1,80 @@
+/*
+ * 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 org.mage.test.cards.abilities.oneshot.counterspell;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class CounterspellTest extends CardTestPlayerBase {
+
+ /**
+ It looks like Boom//Bust can't be countered (although it says it's countered in the log).
+
+ Code: Select all
+ 13:10: Benno casts Boom [8ce] targeting Mountain [4c8] Island [80c]
+ 13:10: Benno casts Counterspell [2b7] targeting Boom [8ce]
+ 13:10: Benno puts Boom [8ce] from stack into his or her graveyard
+ 13:10: Boom is countered by Counterspell [2b7]
+ 13:10: Benno puts Counterspell [2b7] from stack into his or her graveyard
+ 13:10: Mountain [4c8] was destroyed
+ 13:10: Island [80c] was destroyed
+ */
+
+ @Test
+ public void testCounterSplitSpell() {
+ // Boom - Sorcery {1}{R}
+ // Destroy target land you control and target land you don't control.
+ addCard(Zone.HAND, playerA, "Boom // Bust");
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain", 2);
+
+ addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
+ addCard(Zone.HAND, playerB, "Counterspell");
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Boom", "Mountain^Island");
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Counterspell", "Boom");
+
+ setStopAt(1, PhaseStep.END_TURN);
+ execute();
+
+ assertGraveyardCount(playerA, "Boom // Bust", 1);
+ assertGraveyardCount(playerB, "Counterspell", 1);
+
+ assertPermanentCount(playerA, "Mountain", 2);
+ assertPermanentCount(playerB, "Island", 2);
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 20);
+ }
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java
index 4628fd55c10..69bd3a726a7 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/conditional/twofaced/TwoFacedCardEffectsTest.java
@@ -18,6 +18,12 @@ public class TwoFacedCardEffectsTest extends CardTestPlayerBase {
*/
@Test
public void testEffectTurnedOffOnTransform() {
+ // Other Human creatures you control get +1/+1.
+ // At the beginning of each upkeep, if no spells were cast last turn, transform Mayor of Avabruck.
+ // Howlpack Alpha (transformed side) ----------------
+ // Each other creature you control that's a Werewolf or a Wolf gets +1/+1.
+ // At the beginning of your end step, put a 2/2 green Wolf creature token onto the battlefield.
+ // At the beginning of each upkeep, if a player cast two or more spells last turn, transform Howlpack Alpha.
addCard(Zone.BATTLEFIELD, playerA, "Mayor of Avabruck");
addCard(Zone.BATTLEFIELD, playerA, "Wolfir Avenger");
addCard(Zone.BATTLEFIELD, playerA, "Elite Inquisitor");
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java
new file mode 100644
index 00000000000..3e5cd7ae3ce
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/continuous/SerraAscendantTest.java
@@ -0,0 +1,94 @@
+/*
+ * 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 org.mage.test.cards.continuous;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class SerraAscendantTest extends CardTestPlayerBase {
+
+ /**
+ * The game goes on; he plays his Serra Ascendant on turn one, passes the
+ * turn, you play your newly unbanned Wild Nacatl with a Stomping Ground and
+ * also pass the turn. On turn 2, he casts a Martyr of Sands and sacrifices
+ * it, revealing 3 white cards to gain 9 life and end up at 29. He goes to
+ * the combat phase, declares Serra as an attacker, and you happily block
+ * him, thinking that this is such a bad move from him. After the damage is
+ * dealt, the Serra is still there, bigger than ever.
+ */
+ @Test
+ public void testSilence() {
+ addCard(Zone.HAND, playerA, "Plains", 2);
+ // As long as you have 30 or more life, Serra Ascendant gets +5/+5 and has flying.
+ addCard(Zone.HAND, playerA, "Serra Ascendant");
+ // {1}, Reveal X white cards from your hand, Sacrifice Martyr of Sands: You gain three times X life.
+ addCard(Zone.HAND, playerA, "Martyr of Sands");
+ addCard(Zone.HAND, playerA, "Silvercoat Lion",3);
+
+ addCard(Zone.HAND, playerB, "Stomping Ground", 1);
+ addCard(Zone.HAND, playerB, "Wild Nacatl", 1);
+
+ playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Plains");
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Serra Ascendant");
+
+ playLand(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Stomping Ground");
+ setChoice(playerB, "Yes");
+ castSpell(2, PhaseStep.PRECOMBAT_MAIN, playerB, "Wild Nacatl");
+
+ playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Plains");
+ castSpell(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Martyr of Sands");
+ activateAbility(3, PhaseStep.PRECOMBAT_MAIN, playerA, "{1},You may reveal X white cards from your hand");
+ setChoice(playerA,"X=3");
+
+ attack(3, playerA, "Serra Ascendant");
+ block(3, playerB, "Wild Nacatl", "Serra Ascendant");
+
+ setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
+
+ execute();
+
+ assertGraveyardCount(playerA, "Martyr of Sands", 1);
+
+ assertLife(playerB, 18);
+ assertLife(playerA, 30);
+
+ assertPermanentCount(playerB, "Wild Nacatl", 1);
+
+ assertPermanentCount(playerA, "Serra Ascendant", 1);
+ assertPowerToughness(playerA, "Serra Ascendant", 6, 6);
+
+ }
+
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java
new file mode 100644
index 00000000000..460ac83b825
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/PhyrexianMetamorphTest.java
@@ -0,0 +1,210 @@
+/*
+ * 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 org.mage.test.cards.copy;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class PhyrexianMetamorphTest extends CardTestPlayerBase {
+
+
+ @Test
+ public void testCopyCreature() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 5);
+
+ // You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
+ addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP}
+ addCard(Zone.HAND, playerA, "Cloudshift");
+
+ //Flying
+ // Vanishing 3 (This permanent enters the battlefield with three time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)
+ // When Aven Riftwatcher enters the battlefield or leaves the battlefield, you gain 2 life.
+ addCard(Zone.BATTLEFIELD, playerB, "Aven Riftwatcher"); // 2/3
+
+ // When Ponyback Brigade enters the battlefield or is turned face up, put three 1/1 red Goblin creature tokens onto the battlefield.
+ addCard(Zone.BATTLEFIELD, playerB, "Ponyback Brigade"); // 2/2
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph");
+ setChoice(playerA, "Aven Riftwatcher");
+
+ castSpell(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "Cloudshift", "Aven Riftwatcher");
+ setChoice(playerA, "Ponyback Brigade");
+
+ setStopAt(1, PhaseStep.END_TURN);
+ execute();
+
+ assertLife(playerA, 24);
+ assertLife(playerB, 20);
+
+ assertGraveyardCount(playerA, "Cloudshift", 1);
+
+ assertPermanentCount(playerA, "Ponyback Brigade", 1);
+ assertPermanentCount(playerA, "Goblin", 3);
+
+ }
+
+ /**
+ * An opponent cast Phyrexian Metamorph and cloned another opponent's
+ * Maelstrom Wanderer(his Commander). The first opponent then dealt combat
+ * damage with Brago, King Eternal and chose to flicker several permanents,
+ * including the Phyrexian Metamorph/Maelstrom Wanderer, but he was not able
+ * to choose a new creature to clone when the Phyrexian Metamorph re-entered
+ * the battlefield.
+ */
+
+ @Test
+ public void testFlickerWithBrago() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
+
+ // You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
+ addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP}
+
+ // Flying
+ // When Brago, King Eternal deals combat damage to a player, exile any number of target nonland permanents you control, then return those cards to the battlefield under their owner's control.
+ addCard(Zone.BATTLEFIELD, playerA, "Brago, King Eternal"); // 2/4
+
+ // Creatures you control have haste.
+ // Cascade, cascade
+ addCard(Zone.BATTLEFIELD, playerB, "Maelstrom Wanderer"); // 7/5
+ // When Ponyback Brigade enters the battlefield or is turned face up, put three 1/1 red Goblin creature tokens onto the battlefield.
+ addCard(Zone.BATTLEFIELD, playerB, "Ponyback Brigade"); // 2/2
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph");
+ setChoice(playerA, "Maelstrom Wanderer");
+
+ attack(3, playerA, "Brago, King Eternal");
+ addTarget(playerA, "Maelstrom Wanderer");
+ setChoice(playerA, "Ponyback Brigade");
+
+ setStopAt(3, PhaseStep.END_COMBAT);
+ execute();
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 18);
+
+ assertPermanentCount(playerA, "Ponyback Brigade", 1);
+ assertPermanentCount(playerA, "Goblin", 3);
+
+ }
+
+ /**
+ * I had a Harmonic Sliver, my opponent played Phyrexian Metamorph copying
+ * it. The resulting copy only had one instance of the artifact-enchantment
+ * destroying ability, where it should have had two of them and triggered
+ * twice (the Metamorph might have nothing to do with this)
+ */
+ @Test
+ public void testHarmonicSliver() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
+
+ // You may have Phyrexian Metamorph enter the battlefield as a copy of any artifact or creature on the battlefield, except it's an artifact in addition to its other types.
+ addCard(Zone.HAND, playerA, "Phyrexian Metamorph"); // {3}{UP}
+
+ addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 1);
+ addCard(Zone.BATTLEFIELD, playerB, "Kitesail", 1);
+ // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment."
+ addCard(Zone.BATTLEFIELD, playerB, "Harmonic Sliver"); // 2/4
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Phyrexian Metamorph");
+ setChoice(playerA, "Harmonic Sliver");
+ addTarget(playerA, "Alloy Myr");
+ addTarget(playerA, "Kitesail");
+
+ setStopAt(1, PhaseStep.END_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Harmonic Sliver", 1);
+
+ assertGraveyardCount(playerB, "Alloy Myr", 1);
+ assertGraveyardCount(playerB, "Kitesail", 1);
+
+ }
+
+ /**
+ * If a Harmonic Sliver enters the battlefield
+ * the controller has to destroy one artifacts or enchantments
+ */
+ @Test
+ public void testHarmonicSliverNative1() {
+ addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
+
+ // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment."
+ addCard(Zone.HAND, playerA, "Harmonic Sliver");
+
+ addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 2); // 2/2
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Harmonic Sliver");
+
+ setStopAt(1, PhaseStep.END_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Harmonic Sliver", 1);
+
+ assertGraveyardCount(playerB, "Alloy Myr", 1);
+
+ }
+
+ /**
+ * If a Harmonic Sliver enters the battlefield and there is already one on the battlefield
+ * the controller has to destroy two artifacts or enchantments
+ */
+ @Test
+ public void testHarmonicSliverNative2() {
+ addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
+
+ addCard(Zone.HAND, playerA, "Harmonic Sliver");
+
+ addCard(Zone.BATTLEFIELD, playerB, "Alloy Myr", 1);
+ addCard(Zone.BATTLEFIELD, playerB, "Kitesail", 1);
+ // All Slivers have "When this permanent enters the battlefield, destroy target artifact or enchantment."
+ addCard(Zone.BATTLEFIELD, playerB, "Harmonic Sliver"); // 2/4
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Harmonic Sliver");
+ addTarget(playerA, "Alloy Myr");
+ addTarget(playerA, "Kitesail");
+
+ setStopAt(1, PhaseStep.END_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Harmonic Sliver", 1);
+
+ assertGraveyardCount(playerB, "Alloy Myr", 1);
+ assertGraveyardCount(playerB, "Kitesail", 1);
+
+ }
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java
new file mode 100644
index 00000000000..5ef499da439
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/copy/TheMimeoplasmTest.java
@@ -0,0 +1,97 @@
+/*
+ * 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 org.mage.test.cards.copy;
+
+import mage.abilities.keyword.FlyingAbility;
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import mage.game.permanent.Permanent;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class TheMimeoplasmTest extends CardTestPlayerBase {
+
+ /**
+ * I cast either Phyrexian Metamorph or Phantasmal Image and copied The
+ * Mimeoplasm which was copying a Primeval Titan, but my clone became
+ * another Mimeoplasm, so it exiled two creatures from graveyards and cloned
+ * one of those instead.
+ *
+ * Copying cards that are copy of other cards copies the original, rather
+ * than the copy.
+ * To wit, when The Mimeoplasm is out (and lets say is a copy of Elvish
+ * Mystic), and someone then plays Clone choosing to enter as the cloned
+ * Elvish Mystic, they are incorrectly getting The Mimeoplasm instead.
+ *
+ */
+ @Test
+ public void testCloneMimeoplasm() {
+ // As The Mimeoplasm enters the battlefield, you may exile two creature cards from graveyards.
+ // If you do, it enters the battlefield as a copy of one of those cards with a number of additional +1/+1 counters on it equal to the power of the other card.
+ addCard(Zone.HAND, playerA, "The Mimeoplasm", 1); // {2}{G}{U}{B}
+
+ addCard(Zone.HAND, playerA, "Clone", 1); // {3}{U}
+
+ addCard(Zone.GRAVEYARD, playerB, "Silvercoat Lion", 1); // 2/2
+ addCard(Zone.GRAVEYARD, playerB, "Aven Riftwatcher", 1); // 2/3
+
+ addCard(Zone.BATTLEFIELD, playerA, "Forest", 1);
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 7);
+ addCard(Zone.BATTLEFIELD, playerA, "Swamp", 1);
+
+
+ castSpell(1,PhaseStep.PRECOMBAT_MAIN, playerA, "The Mimeoplasm");
+ setChoice(playerA, "Aven Riftwatcher");
+ setChoice(playerA, "Silvercoat Lion");
+
+ castSpell(1,PhaseStep.PRECOMBAT_MAIN, playerA, "Clone");
+ setChoice(playerA, "Aven Riftwatcher");
+
+
+ setStopAt(1, PhaseStep.END_TURN);
+ execute();
+
+ assertHandCount(playerA, "Clone", 0);
+
+ assertLife(playerA, 24);
+ assertLife(playerB, 20);
+
+ assertPermanentCount(playerA, "Aven Riftwatcher", 2);
+ assertPowerToughness(playerA, "Aven Riftwatcher", 4, 5);
+ assertPowerToughness(playerA, "Aven Riftwatcher", 2, 3);
+
+ assertGraveyardCount(playerB, 0);
+
+
+ }
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java
index 479e09910a9..a2d26ce8ee9 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/restriction/CantAttackTest.java
@@ -66,6 +66,31 @@ public class CantAttackTest extends CardTestPlayerBase {
assertLife(playerB, 14); // 4 + 2
}
+
+ @Test
+ public void testAttackHarborSerpent() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 2);
+ addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion"); // 2/2
+ addCard(Zone.BATTLEFIELD, playerA, "Harbor Serpent"); // 5/5
+ addCard(Zone.HAND, playerA, "Island");
+
+ addCard(Zone.BATTLEFIELD, playerB, "Island", 2);
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion"); // 2/2
+ addCard(Zone.BATTLEFIELD, playerB, "Harbor Serpent"); // 5/5
+
+ attack(2, playerB, "Harbor Serpent");
+ attack(2, playerB, "Silvercoat Lion");
+ playLand(3, PhaseStep.PRECOMBAT_MAIN, playerA, "Island");
+ attack(3, playerA, "Harbor Serpent");
+ attack(3, playerA, "Silvercoat Lion");
+
+ setStopAt(3, PhaseStep.POSTCOMBAT_MAIN);
+ execute();
+
+ assertLife(playerB, 13);
+ assertLife(playerA, 18);
+ }
+
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulFoundryTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulFoundryTest.java
new file mode 100644
index 00000000000..326e36c81ce
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/single/SoulFoundryTest.java
@@ -0,0 +1,67 @@
+/*
+ * 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 org.mage.test.cards.single;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class SoulFoundryTest extends CardTestPlayerBase {
+
+ /**
+ * Soul Foundry imprinted with Bloodline Keeper costs 8 colorless mana to
+ * use the ability instead of 4 (the converted mana cost of Bloodline
+ * Keeper).
+ */
+ @Test
+ public void testBloodlineKeeper() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 8);
+ // Imprint - When Soul Foundry enters the battlefield, you may exile a creature card from your hand.
+ // {X}, {T}: Put a token that's a copy of the exiled card onto the battlefield. X is the converted mana cost of that card.
+ addCard(Zone.HAND, playerA, "Soul Foundry"); // {4}
+ addCard(Zone.HAND, playerA, "Bloodline Keeper");
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Soul Foundry");
+ setChoice(playerA, "Yes");
+ activateAbility(1, PhaseStep.POSTCOMBAT_MAIN, playerA, "{X},{T}: Put a token");
+
+ setStopAt(1, PhaseStep.END_TURN);
+ execute();
+
+ assertPermanentCount(playerA, "Soul Foundry", 1);
+
+ assertExileCount("Bloodline Keeper", 1);
+ assertPermanentCount(playerA, "Bloodline Keeper", 1);
+ }
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/PossibilityStormTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/PossibilityStormTest.java
new file mode 100644
index 00000000000..6501fbf2ab9
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/PossibilityStormTest.java
@@ -0,0 +1,95 @@
+/*
+ * 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 org.mage.test.cards.triggers;
+
+
+import mage.cards.Card;
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class PossibilityStormTest extends CardTestPlayerBase {
+
+ /**
+ * There's currently a bug with Possibility Storm and Zoetic Cavern. The way
+ * it's supposed to work is the P. Storm trigger exiles Zoetic Cavern and
+ * then uses last known information about the spell to determine the type of
+ * card the trigger is looking for(creature in this instance). Instead it's
+ * basing the type solely off what's printed on the card. What happened to
+ * me earlier was the trigger skipped right over an Emrakul and then
+ * revealed a Flooded Strand. I was prompted whether or not I wanted to
+ * "cast" Flooded Strand without paying it's cost. Eventually I clicked yes
+ * and it produced a Game Error that resulted in rollback. I recreated the
+ * error against an AI opponent and copied the code. Can't actually post it
+ * because the filter on this site claims it makes my post look too
+ * "spammy". Here's a screenshot of it instead(in spoiler tag).
+ */
+
+ @Test
+ public void TestWithZoeticCavern() {
+ addCard(Zone.BATTLEFIELD, playerA, "Swamp", 3);
+ // Whenever a player casts a spell from his or her hand, that player exiles it, then exiles cards from
+ // the top of his or her library until he or she exiles a card that shares a card type with it. That
+ // player may cast that card without paying its mana cost. Then he or she puts all cards exiled with
+ // Possibility Storm on the bottom of his or her library in a random order.
+ addCard(Zone.BATTLEFIELD, playerA, "Possibility Storm", 2);
+
+ // {T}: Add {1} to your mana pool.
+ // Morph {2}
+ addCard(Zone.HAND, playerA, "Zoetic Cavern");
+
+ addCard(Zone.LIBRARY, playerA, "Silvercoat Lion");
+ skipInitShuffling();
+
+ playLand(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Zoetic Cavern");
+ setChoice(playerA, "Yes");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Zoetic Cavern", 0);
+
+ boolean zoeticCavernInLibrary = false;
+ for (Card card: playerA.getLibrary().getCards(currentGame)) {
+ if (card.getName().equals("Zoetic Cavern")) {
+ zoeticCavernInLibrary = true;
+ }
+ }
+ Assert.assertEquals("Zoetic Cavern has to be in the library", true, zoeticCavernInLibrary);
+
+ assertPermanentCount(playerA, "Silvercoat Lion", 1);
+
+ }
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java
index 7884d15402b..083a1936058 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/SpellskiteTest.java
@@ -113,4 +113,45 @@ public class SpellskiteTest extends CardTestPlayerBase {
}
+ /**
+ * Spellskite fails to redirect Cryptic Command on itself
+ */
+ @Test
+ public void testSpellskite() {
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 4);
+ // Choose two -
+ // Counter target spell;
+ // or return target permanent to its owner's hand;
+ // or tap all creatures your opponents control;
+ // or draw a card.
+ addCard(Zone.HAND, playerA, "Cryptic Command");
+
+ addCard(Zone.BATTLEFIELD, playerB, "Spellskite", 1);
+ addCard(Zone.BATTLEFIELD, playerB, "Silvercoat Lion", 1);
+ addCard(Zone.BATTLEFIELD, playerB, "Mountain", 1);
+ addCard(Zone.BATTLEFIELD, playerB, "Island", 1);
+ addCard(Zone.HAND, playerB, "Lightning Bolt", 1);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerB, "Lightning Bolt", playerA);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Cryptic Command", "mode=1Lightning Bolt^mode=2Silvercoat Lion", "Lightning Bolt");
+ setModeChoice(playerA, "1"); // Counter target spell
+ setModeChoice(playerA, "2"); // return target permanent to its owner's hand
+
+ activateAbility(1, PhaseStep.PRECOMBAT_MAIN, playerB, "{UP}: Change a target of target spell or ability to {this}.", "Cryptic Command");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertGraveyardCount(playerB, "Lightning Bolt", 1);
+
+ assertGraveyardCount(playerA, "Cryptic Command", 1);
+
+ assertHandCount(playerB, "Spellskite", 1);
+ assertPermanentCount(playerB, "Silvercoat Lion", 1);
+
+ assertLife(playerA, 20);
+ assertLife(playerB, 20);
+
+ }
}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java
index e344f493414..c1f2238dfb1 100644
--- a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/WorldgorgerDragonTest.java
@@ -7,6 +7,7 @@ package org.mage.test.cards.triggers;
import mage.constants.PhaseStep;
import mage.constants.Zone;
+import org.junit.Ignore;
import org.junit.Test;
import org.mage.test.serverside.base.CardTestPlayerBase;
@@ -116,4 +117,73 @@ public class WorldgorgerDragonTest extends CardTestPlayerBase {
}
+ /**
+ * v9: Worldgorger Dragon + Animate Dead is still acting up (yey complex rules interactions!).
+ * The first time you return Animate Dead from Worldgorger's exile, it works like it's supposed
+ * to. You have to pick a creature, and it brings it back. But if you pick Worldgorger Dragon
+ * again, it allows you to not pick a creature, and regardless of whether you choose to skip or pick
+ * a different creature, it always returns the first creature you picked. Kind of hard to explain,
+ * but here's how to reproduce:
+ *
+ * 1) Cast Animate Dead, targeting Worldgorger Dragon
+ * 2) Worldgorger Dragon will exile Animate Dead, killing the dragon and returning the permanents
+ * 3) Select Worldgorger again
+ * 4) Step 2 repeats
+ * 5) Attempt to select a different creature. Worldgorger Dragon is returned instead.
+ *
+ */
+ @Test
+ @Ignore
+ public void testWithAnimateDeadDifferentTargets() {
+ addCard(Zone.BATTLEFIELD, playerA, "Swamp", 2);
+
+ // When Worldgorger Dragon enters the battlefield, exile all other permanents you control.
+ // When Worldgorger Dragon leaves the battlefield, return the exiled cards to the battlefield under their owners' control.
+ addCard(Zone.GRAVEYARD, playerA, "Worldgorger Dragon", 1);
+
+ addCard(Zone.GRAVEYARD, playerA, "Silvercoat Lion", 1);
+ // When Animate Dead enters the battlefield, if it's on the battlefield, it loses "enchant creature card in a graveyard"
+ // and gains "enchant creature put onto the battlefield with Animate Dead." Return enchanted creature card to the battlefield
+ // under your control and attach Animate Dead to it. When Animate Dead leaves the battlefield, that creature's controller sacrifices it.
+ addCard(Zone.HAND, playerA, "Animate Dead");
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain", 3);
+ // Instant {X}{R}{R}
+ // Volcanic Geyser deals X damage to target creature or player.
+ addCard(Zone.HAND, playerA, "Volcanic Geyser", 1);
+ // When Staunch Defenders enters the battlefield, you gain 4 life.
+ addCard(Zone.BATTLEFIELD, playerA, "Staunch Defenders", 1);
+
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Animate Dead", "Worldgorger Dragon");
+ addTarget(playerA, "Worldgorger Dragon");
+ addTarget(playerA, "Worldgorger Dragon");
+ addTarget(playerA, "Silvercoat Lion");
+
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+ activateManaAbility(1, PhaseStep.PRECOMBAT_MAIN, playerA, "{T}: Add {R}");
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Volcanic Geyser", playerB, 9);
+ setChoice(playerA, "X=7");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertGraveyardCount(playerA, "Worldgorger Dragon", 1);
+ assertPermanentCount(playerA, "Silvercoat Lion", 1);
+
+ assertLife(playerA, 24);
+ assertLife(playerB, 11);
+
+ assertGraveyardCount(playerA, "Volcanic Geyser", 1);
+
+
+ }
+
}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/FecundityTest.java b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/FecundityTest.java
new file mode 100644
index 00000000000..cf68ca2549e
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/cards/triggers/dies/FecundityTest.java
@@ -0,0 +1,65 @@
+package org.mage.test.cards.triggers.dies;
+
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestPlayerBase;
+
+/*
+ * 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.
+ */
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class FecundityTest extends CardTestPlayerBase {
+
+ /**
+ *
+ */
+ @Test
+ public void testOpponentDrawsACard() {
+ addCard(Zone.BATTLEFIELD, playerA, "Silvercoat Lion", 1);
+ addCard(Zone.BATTLEFIELD, playerA, "Mountain", 1);
+ addCard(Zone.HAND, playerA, "Lightning Bolt", 1);
+ // Whenever a creature dies, that creature's controller may draw a card.
+ addCard(Zone.BATTLEFIELD, playerB, "Fecundity", 1);
+
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Lightning Bolt", "Silvercoat Lion");
+
+ setStopAt(1, PhaseStep.BEGIN_COMBAT);
+ execute();
+
+ assertGraveyardCount(playerA, "Lightning Bolt", 1);
+ assertGraveyardCount(playerA, "Silvercoat Lion", 1);
+
+ assertHandCount(playerA, 1);
+ }
+
+}
diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java
index 33bbc816b54..6af9e08c961 100644
--- a/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java
+++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/CastCommanderTest.java
@@ -38,7 +38,7 @@ import org.mage.test.serverside.base.CardTestCommanderDuelBase;
*/
public class CastCommanderTest extends CardTestCommanderDuelBase {
@Test
- public void testFirstAbility() {
+ public void testCastCommander() {
addCard(Zone.BATTLEFIELD, playerA, "Swamp", 5);
castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Ob Nixilis of the Black Oath");
@@ -50,5 +50,5 @@ public class CastCommanderTest extends CardTestCommanderDuelBase {
assertLife(playerB, 40);
assertPermanentCount(playerA, "Ob Nixilis of the Black Oath", 1);
- }
+ }
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java b/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java
new file mode 100644
index 00000000000..08c03b60468
--- /dev/null
+++ b/Mage.Tests/src/test/java/org/mage/test/commander/duel/TeferiMageOfZhalfirTest.java
@@ -0,0 +1,98 @@
+/*
+ * 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 org.mage.test.commander.duel;
+
+
+import java.io.FileNotFoundException;
+import mage.constants.PhaseStep;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.GameException;
+import org.junit.Assert;
+import org.junit.Test;
+import org.mage.test.serverside.base.CardTestCommanderDuelBase;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class TeferiMageOfZhalfirTest extends CardTestCommanderDuelBase {
+
+ @Override
+ protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
+ setDecknamePlayerA("CommanderDuel_UW.dck"); // Commander = Daxos of Meletis
+ return super.createNewGameAndPlayers();
+ }
+
+ @Test
+ public void castCommanderWithFlash() {
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 2);
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
+
+ addCard(Zone.BATTLEFIELD, playerA, "Teferi, Mage of Zhalfir");
+
+ castSpell(1, PhaseStep.BEGIN_COMBAT, playerA, "Daxos of Meletis");
+ setStopAt(1, PhaseStep.END_COMBAT);
+ execute();
+
+ assertPermanentCount(playerA, "Daxos of Meletis", 1);
+
+ }
+
+ @Test
+ public void testCommanderDamage() {
+ addCard(Zone.BATTLEFIELD, playerA, "Plains", 6);
+ addCard(Zone.BATTLEFIELD, playerA, "Island", 1);
+ // Enchant creature
+ // Enchanted creature gets +4/+4, has flying and first strike, and is an Angel in addition to its other types.
+ // When enchanted creature dies, return Angelic Destiny to its owner's hand.
+ addCard(Zone.HAND, playerA, "Angelic Destiny");
+
+ addCard(Zone.BATTLEFIELD, playerA, "Teferi, Mage of Zhalfir");
+
+ // Daxos of Meletis can't be blocked by creatures with power 3 or greater.
+ // Whenever Daxos of Meletis deals combat damage to a player, exile the top card of that player's library. You gain life equal to that card's converted mana cost. Until end of turn, you may cast that card and you may spend mana as though it were mana of any color to cast it.
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Daxos of Meletis");
+ castSpell(1, PhaseStep.PRECOMBAT_MAIN, playerA, "Angelic Destiny","Daxos of Meletis");
+
+ attack(3, playerA, "Daxos of Meletis");
+ attack(5, playerA, "Daxos of Meletis");
+ attack(7, playerA, "Daxos of Meletis");
+ attack(9, playerA, "Daxos of Meletis");
+
+ setStopAt(9, PhaseStep.POSTCOMBAT_MAIN);
+ execute();
+
+ assertPermanentCount(playerA, "Daxos of Meletis", 1);
+ assertPowerToughness(playerA, "Daxos of Meletis", 6, 6);
+
+ Assert.assertEquals("Player A has won because of commander damage", true, playerA.hasWon());
+ Assert.assertEquals("Player A has lost because of commander damage", true, playerB.hasLost());
+ }
+}
\ No newline at end of file
diff --git a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java
index 4f99f385689..be7c65487a0 100644
--- a/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java
+++ b/Mage.Tests/src/test/java/org/mage/test/player/TestPlayer.java
@@ -29,6 +29,7 @@ package org.mage.test.player;
import java.io.Serializable;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -91,6 +92,7 @@ import mage.target.TargetPermanent;
import mage.target.TargetPlayer;
import mage.target.TargetSource;
import mage.target.TargetSpell;
+import mage.target.common.TargetCardInGraveyard;
import mage.target.common.TargetCardInHand;
import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetCreaturePermanentAmount;
@@ -604,17 +606,53 @@ public class TestPlayer implements Player {
}
}
}
+ if (target instanceof TargetCardInGraveyard) {
+ TargetCardInGraveyard targetCardInGraveyard = ((TargetCardInGraveyard) target);
+ Set possibleTargets = new HashSet<>();
+ for(UUID playerId: this.getInRange()) {
+ Player player = game.getPlayer(playerId);
+ if (player != null) {
+ possibleTargets.addAll(player.getGraveyard());
+ }
+ }
+
+ for (String choose2 : choices) {
+ String[] targetList = choose2.split("\\^");
+ boolean targetFound = false;
+ for (UUID targetId : possibleTargets) {
+ MageObject targetObject = game.getObject(targetId);
+ if (targetObject != null) {
+ for (String targetName : targetList) {
+ if (targetObject.getName().equals(targetName)) {
+ List alreadyTargetted = targetCardInGraveyard.getTargets();
+ if (targetCardInGraveyard.canTarget(targetObject.getId(), game)) {
+ if (alreadyTargetted != null && !alreadyTargetted.contains(targetObject.getId())) {
+ targetCardInGraveyard.add(targetObject.getId(), game);
+ choices.remove(choose2);
+ targetFound = true;
+ }
+ }
+ }
+ }
+ if (targetFound && targetCardInGraveyard.isChosen()) {
+ choices.remove(choose2);
+ return true;
+ }
+ }
+ }
+ }
+ }
if (target instanceof TargetSource) {
Set possibleTargets;
TargetSource t = ((TargetSource) target);
possibleTargets = t.possibleTargets(sourceId, computerPlayer.getId(), game);
- for (UUID targetId : possibleTargets) {
- MageObject targetObject = game.getObject(targetId);
- if (targetObject != null) {
- for (String choose2 : choices) {
- String[] targetList = choose2.split("\\^");
- boolean targetFound = false;
- for (String targetName : targetList) {
+ for (String choose2 : choices) {
+ String[] targetList = choose2.split("\\^");
+ boolean targetFound = false;
+ for (String targetName : targetList) {
+ for (UUID targetId : possibleTargets) {
+ MageObject targetObject = game.getObject(targetId);
+ if (targetObject != null) {
if (targetObject.getName().equals(targetName)) {
List alreadyTargetted = target.getTargets();
if (t.canTarget(targetObject.getId(), game)) {
diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java
index c31449aa0e8..df244f549d7 100644
--- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java
+++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestCommanderDuelBase.java
@@ -42,12 +42,18 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl;
public abstract class CardTestCommanderDuelBase extends CardTestPlayerAPIImpl {
+ public CardTestCommanderDuelBase() {
+ super();
+ this.deckNameA = "CommanderDuel.dck";
+ this.deckNameB = "CommanderDuel.dck";
+ }
+
@Override
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
Game game = new CommanderDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 40);
- playerA = createPlayer(game, playerA, "PlayerA","CommanderDuel.dck");
- playerB = createPlayer(game, playerB, "PlayerB","CommanderDuel.dck");
+ playerA = createPlayer(game, playerA, "PlayerA",deckNameA);
+ playerB = createPlayer(game, playerB, "PlayerB",deckNameB);
return game;
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java
index e3435c3d3f4..5c92e590068 100644
--- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java
+++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/CardTestPlayerBase.java
@@ -15,12 +15,17 @@ import org.mage.test.serverside.base.impl.CardTestPlayerAPIImpl;
*/
public abstract class CardTestPlayerBase extends CardTestPlayerAPIImpl {
+ public CardTestPlayerBase() {
+ deckNameA = "RB Aggro.dck";
+ deckNameB = "RB Aggro.dck";
+ }
+
@Override
protected Game createNewGameAndPlayers() throws GameException, FileNotFoundException {
Game game = new TwoPlayerDuel(MultiplayerAttackOption.LEFT, RangeOfInfluence.ONE, 0, 20);
- playerA = createPlayer(game, playerA, "PlayerA");
- playerB = createPlayer(game, playerB, "PlayerB");
+ playerA = createPlayer(game, playerA, "PlayerA", deckNameA);
+ playerB = createPlayer(game, playerB, "PlayerB", deckNameB);
return game;
}
diff --git a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java
index dc059ca7cf6..8b910600cb8 100644
--- a/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java
+++ b/Mage.Tests/src/test/java/org/mage/test/serverside/base/impl/CardTestPlayerAPIImpl.java
@@ -44,6 +44,9 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
protected GameOptions gameOptions;
+ protected String deckNameA;
+ protected String deckNameB;
+
protected enum ExpectedType {
TURN_NUMBER,
RESULT,
@@ -1009,6 +1012,14 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
player.addTarget("targetPlayer="+targetPlayer.getName());
}
+ public void setDecknamePlayerA(String deckname) {
+ deckNameA = deckname;
+ }
+
+ public void setDecknamePlayerB(String deckname) {
+ deckNameB = deckname;
+ }
+
protected void skipInitShuffling() {
gameOptions.skipInitShuffling = true;
}
diff --git a/Mage.Updater/pom.xml b/Mage.Updater/pom.xml
index 62b47116dc5..296591999f9 100644
--- a/Mage.Updater/pom.xml
+++ b/Mage.Updater/pom.xml
@@ -5,7 +5,7 @@
mage-root
org.mage
- 1.4.0
+ 1.4.1
4.0.0
diff --git a/Mage/pom.xml b/Mage/pom.xml
index b29479975df..a7336af347f 100644
--- a/Mage/pom.xml
+++ b/Mage/pom.xml
@@ -7,7 +7,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
mage
diff --git a/Mage/src/mage/MageObjectReference.java b/Mage/src/mage/MageObjectReference.java
index b406030eb94..8242aff19ad 100644
--- a/Mage/src/mage/MageObjectReference.java
+++ b/Mage/src/mage/MageObjectReference.java
@@ -69,7 +69,11 @@ public class MageObjectReference implements Comparable, Ser
if (mageObject != null) {
this.zoneChangeCounter = mageObject.getZoneChangeCounter(game);
} else {
- throw new IllegalArgumentException("The provided sourceId is not connected to an object in the game");
+ if (game.getPlayerList().contains(sourceId)) {
+ this.zoneChangeCounter = 0;
+ } else {
+ throw new IllegalArgumentException("The provided sourceId is not connected to an object in the game");
+ }
}
}
diff --git a/Mage/src/mage/abilities/AbilityImpl.java b/Mage/src/mage/abilities/AbilityImpl.java
index f9847aa8b7e..bfc6bcd22bd 100644
--- a/Mage/src/mage/abilities/AbilityImpl.java
+++ b/Mage/src/mage/abilities/AbilityImpl.java
@@ -247,7 +247,7 @@ public abstract class AbilityImpl implements Ability {
return false;
}
game.applyEffects();
-
+
/* 20130201 - 601.2b
* If the spell is modal the player announces the mode choice (see rule 700.2).
*/
@@ -299,7 +299,7 @@ public abstract class AbilityImpl implements Ability {
// A player can't apply two alternative methods of casting or two alternative costs to a single spell.
if (!activateAlternateOrAdditionalCosts(sourceObject, noMana, controller, game)){
if (getAbilityType().equals(AbilityType.SPELL)
- && ((SpellAbility) this).getSpellAbilityType().equals(SpellAbilityType.LAND_ALTERNATE)) {
+ && ((SpellAbility) this).getSpellAbilityType().equals(SpellAbilityType.FACE_DOWN_CREATURE)) {
return false;
}
}
@@ -329,7 +329,7 @@ public abstract class AbilityImpl implements Ability {
// and/or zones become the target of a spell trigger at this point; they'll wait to be put on
// the stack until the spell has finished being cast.)
- if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already TriggeredAbilities.checkTriggers()
+ if (sourceObject != null && !this.getAbilityType().equals(AbilityType.TRIGGERED)) { // triggered abilities check this already in playerImpl.triggerAbility
sourceObject.adjustTargets(this, game);
}
if (getTargets().size() > 0 && getTargets().chooseTargets(getEffects().get(0).getOutcome(), this.controllerId, this, game) == false) {
diff --git a/Mage/src/mage/abilities/TriggeredAbilityImpl.java b/Mage/src/mage/abilities/TriggeredAbilityImpl.java
index d38ae09362e..c07195414b8 100644
--- a/Mage/src/mage/abilities/TriggeredAbilityImpl.java
+++ b/Mage/src/mage/abilities/TriggeredAbilityImpl.java
@@ -79,10 +79,10 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
}
// TODO: Implement for all TriggeredAbilities so this default method can be removed
- @Override
+ /*@Override
public boolean checkEventType(GameEvent event, Game game) {
return true;
- }
+ }*/
@Override
public boolean resolve(Game game) {
diff --git a/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java b/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java
new file mode 100644
index 00000000000..adb4be894b1
--- /dev/null
+++ b/Mage/src/mage/abilities/common/AttacksEachCombatStaticAbility.java
@@ -0,0 +1,33 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.abilities.common;
+
+import mage.abilities.StaticAbility;
+import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect;
+import mage.constants.Duration;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class AttacksEachCombatStaticAbility extends StaticAbility {
+
+ public AttacksEachCombatStaticAbility() {
+ super(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield, true));
+ }
+
+ public AttacksEachCombatStaticAbility(AttacksEachCombatStaticAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public AttacksEachCombatStaticAbility copy() {
+ return new AttacksEachCombatStaticAbility(this);
+ }
+
+}
diff --git a/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java b/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java
index 19951542b6a..7e5d27f7cd4 100644
--- a/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java
+++ b/Mage/src/mage/abilities/common/AttacksEachTurnStaticAbility.java
@@ -32,6 +32,7 @@ import mage.constants.Duration;
import mage.constants.Zone;
import mage.abilities.StaticAbility;
import mage.abilities.effects.common.combat.AttacksIfAbleSourceEffect;
+import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
@@ -41,6 +42,7 @@ public class AttacksEachTurnStaticAbility extends StaticAbility {
public AttacksEachTurnStaticAbility() {
super(Zone.BATTLEFIELD, new AttacksIfAbleSourceEffect(Duration.WhileOnBattlefield));
+ addWatcher(new AttackedThisTurnWatcher());
}
public AttacksEachTurnStaticAbility(AttacksEachTurnStaticAbility ability) {
diff --git a/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java b/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java
new file mode 100644
index 00000000000..58926ccb9b0
--- /dev/null
+++ b/Mage/src/mage/abilities/common/EndOfCombatTriggeredAbility.java
@@ -0,0 +1,48 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.abilities.common;
+
+import mage.abilities.TriggeredAbilityImpl;
+import mage.abilities.effects.Effect;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class EndOfCombatTriggeredAbility extends TriggeredAbilityImpl {
+
+ public EndOfCombatTriggeredAbility(Effect effect, boolean optional) {
+ super(Zone.BATTLEFIELD, effect, optional);
+ }
+
+ public EndOfCombatTriggeredAbility(final EndOfCombatTriggeredAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public EndOfCombatTriggeredAbility copy() {
+ return new EndOfCombatTriggeredAbility(this);
+ }
+
+ @Override
+ public boolean checkEventType(GameEvent event, Game game) {
+ return event.getType() == GameEvent.EventType.END_COMBAT_STEP_PRE;
+ }
+
+ @Override
+ public boolean checkTrigger(GameEvent event, Game game) {
+ return true;
+ }
+
+ @Override
+ public String getRule() {
+ return "At the end of combat, " + super.getRule();
+ }
+}
\ No newline at end of file
diff --git a/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java b/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java
index 6c825961335..1c2d203d2c9 100644
--- a/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java
+++ b/Mage/src/mage/abilities/condition/common/CardsInOpponentGraveCondition.java
@@ -13,7 +13,7 @@ import java.util.UUID;
* @author Loki
*/
public class CardsInOpponentGraveCondition implements Condition {
- private int value;
+ private final int value;
public CardsInOpponentGraveCondition(int value) {
this.value = value;
diff --git a/Mage/src/mage/abilities/condition/common/KickedCondition.java b/Mage/src/mage/abilities/condition/common/KickedCondition.java
index 88491bdb5dc..02c9cfec31b 100644
--- a/Mage/src/mage/abilities/condition/common/KickedCondition.java
+++ b/Mage/src/mage/abilities/condition/common/KickedCondition.java
@@ -59,7 +59,7 @@ public class KickedCondition implements Condition {
if (card != null) {
for (Ability ability: card.getAbilities()) {
if (ability instanceof KickerAbility) {
- if(((KickerAbility) ability).isKicked(game)) {
+ if(((KickerAbility) ability).isKicked(game, source, "")) {
return true;
}
}
diff --git a/Mage/src/mage/abilities/condition/common/KickedCostCondition.java b/Mage/src/mage/abilities/condition/common/KickedCostCondition.java
index 0add305c721..2a11646d850 100644
--- a/Mage/src/mage/abilities/condition/common/KickedCostCondition.java
+++ b/Mage/src/mage/abilities/condition/common/KickedCostCondition.java
@@ -24,17 +24,9 @@ public class KickedCostCondition implements Condition {
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
- KickerAbility kickerAbility = null;
for (Ability ability: card.getAbilities()) {
if (ability instanceof KickerAbility) {
- kickerAbility = (KickerAbility) ability;
- }
- }
- if (kickerAbility != null) {
- for (OptionalAdditionalCost cost: kickerAbility.getKickerCosts()) {
- if (cost.getText(true).equals(kickerCostText)) {
- return cost.isActivated();
- }
+ return ((KickerAbility) ability).isKicked(game, source, kickerCostText);
}
}
}
diff --git a/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java b/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java
index dfb0f89be91..efb94d0c482 100644
--- a/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java
+++ b/Mage/src/mage/abilities/condition/common/OpponentControlsPermanentCondition.java
@@ -28,31 +28,29 @@
package mage.abilities.condition.common;
+import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
-import mage.constants.TargetController;
import mage.filter.FilterPermanent;
-import mage.filter.predicate.permanent.ControllerPredicate;
+import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
/**
- *
+ * Checks if one opponent (each opponent is checked on its own) fulfills
+ * the defined condition of controlling the defined number of permanents.
+ *
* @author LevelX2
*/
public class OpponentControlsPermanentCondition implements Condition {
public static enum CountType { MORE_THAN, FEWER_THAN, EQUAL_TO };
+
private FilterPermanent filter;
- private Condition condition;
private CountType type;
private int count;
/**
- * Applies a filter and delegates creation to
- * {@link #ControlsPermanent(mage.filter.FilterPermanent, mage.abilities.condition.common.ControlsPermanent.CountType, int)}
- * with {@link CountType#MORE_THAN}, and 0.
- *
* @param filter
*/
public OpponentControlsPermanentCondition(FilterPermanent filter) {
@@ -74,46 +72,33 @@ public class OpponentControlsPermanentCondition implements Condition {
this.count = count;
}
- /**
- * Applies a filter, a {@link CountType}, and count to permanents on the
- * battlefield and calls the decorated condition to see if it
- * {@link #apply(mage.game.Game, mage.abilities.Ability) applies}
- * as well. This will force both conditions to apply for this to be true.
- *
- * @param filter
- * @param type
- * @param count
- * @param conditionToDecorate
- */
- public OpponentControlsPermanentCondition ( FilterPermanent filter, CountType type, int count, Condition conditionToDecorate ) {
- this(filter, type, count);
- this.condition = conditionToDecorate;
- }
-
@Override
public boolean apply(Game game, Ability source) {
- boolean conditionApplies = false;
-
- FilterPermanent localFilter = filter.copy();
- localFilter.add(new ControllerPredicate(TargetController.OPPONENT));
-
- switch ( this.type ) {
- case FEWER_THAN:
- conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) < this.count;
- break;
- case MORE_THAN:
- conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) > this.count;
- break;
- case EQUAL_TO:
- conditionApplies = game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) == this.count;
- break;
+ boolean conditionApplies = false;
+ for(UUID opponentId :game.getOpponents(source.getControllerId())) {
+ FilterPermanent localFilter = filter.copy();
+ localFilter.add(new ControllerIdPredicate(opponentId));
+ switch ( this.type ) {
+ case FEWER_THAN:
+ if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) < this.count) {
+ conditionApplies = true;
+ break;
+ }
+ case MORE_THAN:
+ if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) > this.count) {
+ conditionApplies = true;
+ break;
+ }
+ break;
+ case EQUAL_TO:
+ if (game.getBattlefield().count(localFilter, source.getSourceId(), source.getControllerId(), game) == this.count) {
+ conditionApplies = true;
+ break;
+ }
+ break;
+ }
+
}
-
- //If a decorated condition exists, check it as well and apply them together.
- if ( this.condition != null ) {
- conditionApplies = conditionApplies && this.condition.apply(game, source);
- }
-
return conditionApplies;
}
diff --git a/Mage/src/mage/abilities/condition/common/SourceDealtDamageCondition.java b/Mage/src/mage/abilities/condition/common/SourceDealtDamageCondition.java
new file mode 100644
index 00000000000..0a4f7044e12
--- /dev/null
+++ b/Mage/src/mage/abilities/condition/common/SourceDealtDamageCondition.java
@@ -0,0 +1,37 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.abilities.condition.common;
+
+import mage.abilities.Ability;
+import mage.abilities.condition.Condition;
+import mage.game.Game;
+import mage.watchers.common.DamageDoneWatcher;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class SourceDealtDamageCondition implements Condition {
+ private final int value;
+
+ public SourceDealtDamageCondition(int value) {
+ this.value = value;
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ DamageDoneWatcher watcher = (DamageDoneWatcher) game.getState().getWatchers().get("DamageDone");
+ return watcher != null && watcher.damageDone(source.getSourceId(), source.getSourceObjectZoneChangeCounter(), game) >= value;
+ }
+
+ @Override
+ public String toString() {
+ return "{this} has dealt " + value + " or more damage this turn" ;
+ }
+
+
+}
\ No newline at end of file
diff --git a/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java b/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java
new file mode 100644
index 00000000000..fd8a29207cb
--- /dev/null
+++ b/Mage/src/mage/abilities/condition/common/SpellMasteryCondition.java
@@ -0,0 +1,53 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.abilities.condition.common;
+
+import mage.abilities.Ability;
+import mage.abilities.condition.Condition;
+import mage.constants.CardType;
+import mage.filter.FilterCard;
+import mage.filter.predicate.Predicates;
+import mage.filter.predicate.mageobject.CardTypePredicate;
+import mage.game.Game;
+import mage.players.Player;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class SpellMasteryCondition implements Condition {
+
+ private static final FilterCard filter = new FilterCard();
+
+ static {
+ filter.add(Predicates.or(new CardTypePredicate(CardType.INSTANT), new CardTypePredicate(CardType.SORCERY)));
+ }
+
+ private static SpellMasteryCondition fInstance = null;
+
+ public static SpellMasteryCondition getInstance() {
+ if (fInstance == null) {
+ fInstance = new SpellMasteryCondition();
+ }
+ return fInstance;
+ }
+
+ private SpellMasteryCondition() {}
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player player = game.getPlayer(source.getControllerId());
+ return player != null && player.getGraveyard().count(filter, game) >= 2;
+ }
+
+ @Override
+ public String toString() {
+ return "there are two or more instant and/or sorcery cards in your graveyard";
+ }
+
+
+}
\ No newline at end of file
diff --git a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java
index 28ba0af2cd9..5a4cae21da6 100644
--- a/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java
+++ b/Mage/src/mage/abilities/decorator/ConditionalTriggeredAbility.java
@@ -1,5 +1,6 @@
package mage.abilities.decorator;
+import mage.MageObject;
import mage.abilities.TriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.condition.Condition;
@@ -74,4 +75,21 @@ public class ConditionalTriggeredAbility extends TriggeredAbilityImpl {
return ability.getEffects();
}
+ @Override
+ public MageObject getSourceObjectIfItStillExists(Game game) {
+ return ability.getSourceObjectIfItStillExists(game);
+ }
+
+ @Override
+ public MageObject getSourceObject(Game game) {
+ return ability.getSourceObject(game);
+ }
+
+
+
+ @Override
+ public int getSourceObjectZoneChangeCounter() {
+ return ability.getSourceObjectZoneChangeCounter();
+ }
+
}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java
new file mode 100644
index 00000000000..27bab074560
--- /dev/null
+++ b/Mage/src/mage/abilities/dynamicvalue/common/CardsInTargetPlayerHandCount.java
@@ -0,0 +1,34 @@
+package mage.abilities.dynamicvalue.common;
+
+import mage.abilities.Ability;
+import mage.abilities.dynamicvalue.DynamicValue;
+import mage.abilities.effects.Effect;
+import mage.game.Game;
+import mage.players.Player;
+
+/**
+ *
+ * @author cbrianhill
+ */
+public class CardsInTargetPlayerHandCount implements DynamicValue {
+
+ @Override
+ public int calculate(Game game, Ability sourceAbility, Effect effect) {
+ Player player = game.getPlayer(effect.getTargetPointer().getFirst(game, sourceAbility));
+ if (player != null) {
+ return player.getHand().size();
+ }
+ return 0;
+ }
+
+ @Override
+ public DynamicValue copy() {
+ return new CardsInTargetPlayerHandCount();
+ }
+
+ @Override
+ public String getMessage() {
+ return "cards in target player's hand";
+ }
+
+}
diff --git a/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java b/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java
index 7ad2b93eebb..d52f265e435 100644
--- a/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java
+++ b/Mage/src/mage/abilities/dynamicvalue/common/MultikickerCount.java
@@ -50,7 +50,7 @@ public class MultikickerCount implements DynamicValue {
if (card != null) {
for (Ability ability: card.getAbilities()) {
if (ability instanceof KickerAbility) {
- count += ((KickerAbility) ability).getKickedCounter(game);
+ count += ((KickerAbility) ability).getKickedCounter(game, source);
}
}
}
diff --git a/Mage/src/mage/abilities/effects/ContinuousEffect.java b/Mage/src/mage/abilities/effects/ContinuousEffect.java
index 6f925dc48f6..5f6987ab47c 100644
--- a/Mage/src/mage/abilities/effects/ContinuousEffect.java
+++ b/Mage/src/mage/abilities/effects/ContinuousEffect.java
@@ -61,4 +61,7 @@ public interface ContinuousEffect extends Effect {
void newId();
@Override
ContinuousEffect copy();
+
+ boolean isTemporary();
+ void setTemporary(boolean temporary);
}
diff --git a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java
index ce4342d5b6a..a3603203321 100644
--- a/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java
+++ b/Mage/src/mage/abilities/effects/ContinuousEffectImpl.java
@@ -68,7 +68,8 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
protected boolean discarded = false; // for manual effect discard
protected boolean affectedObjectsSet = false;
protected List affectedObjectList = new ArrayList<>();
-
+ protected boolean temporary = false;
+
// until your next turn
protected int startingTurn;
protected UUID startingControllerId;
@@ -96,6 +97,7 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
this.discarded = effect.discarded;
this.affectedObjectsSet = effect.affectedObjectsSet;
this.affectedObjectList.addAll(effect.affectedObjectList);
+ this.temporary = effect.temporary;
this.startingTurn = effect.startingTurn;
this.startingControllerId = effect.startingControllerId;
}
@@ -234,4 +236,18 @@ public abstract class ContinuousEffectImpl extends EffectImpl implements Continu
return affectedObjectList;
}
+ /**
+ * Returns the status if the effect is temporary added to the ContinuousEffects
+ * @return
+ */
+ @Override
+ public boolean isTemporary() {
+ return temporary;
+ }
+
+ @Override
+ public void setTemporary(boolean temporary) {
+ this.temporary = temporary;
+ }
+
}
diff --git a/Mage/src/mage/abilities/effects/ContinuousEffects.java b/Mage/src/mage/abilities/effects/ContinuousEffects.java
index 0b2c1fbe43b..9cc59829286 100644
--- a/Mage/src/mage/abilities/effects/ContinuousEffects.java
+++ b/Mage/src/mage/abilities/effects/ContinuousEffects.java
@@ -939,6 +939,7 @@ public class ContinuousEffects implements Serializable {
*/
public void addEffect(ContinuousEffect effect, UUID sourceId, Ability source) {
if (!(source instanceof MageSingleton)) { // because MageSingletons may never be removed by removing the temporary effecs they are not added to the temporaryEffects to prevent this
+ effect.setTemporary(true);
Set abilities = temporaryEffects.get(effect);
if (abilities == null) {
abilities = new HashSet<>();
diff --git a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java
index a30192d886e..92dbfa7aa0d 100644
--- a/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java
+++ b/Mage/src/mage/abilities/effects/EntersBattlefieldEffect.java
@@ -95,21 +95,14 @@ public class EntersBattlefieldEffect extends ReplacementEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
- if (event.getType() == EventType.ENTERS_THE_BATTLEFIELD) {
- if (event.getTargetId().equals(source.getSourceId())) {
- if (condition == null || condition.apply(game, source)) {
- return true;
- }
+ if (event.getTargetId().equals(source.getSourceId())) {
+ if (condition == null || condition.apply(game, source)) {
+ return true;
}
}
return false;
}
- @Override
- public boolean apply(Game game, Ability source) {
- return false;
- }
-
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
if (optional) {
diff --git a/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java b/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java
index ff5d4cee3c7..76c84fba229 100644
--- a/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java
+++ b/Mage/src/mage/abilities/effects/common/ChooseColorEffect.java
@@ -35,6 +35,7 @@ import mage.constants.Outcome;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
+import mage.util.CardUtil;
/**
*
@@ -64,10 +65,10 @@ public class ChooseColorEffect extends OneShotEffect {
}
}
if (!game.isSimulation()) {
- game.informPlayers(new StringBuilder(permanent.getLogName()).append(": ").append(controller.getLogName()).append(" has chosen ").append(choice.getChoice()).toString());
+ game.informPlayers(permanent.getLogName()+": "+controller.getLogName()+" has chosen "+choice.getChoice());
}
game.getState().setValue(source.getSourceId() + "_color", choice.getColor());
- permanent.addInfo("chosen color", "Chosen color: " + choice.getColor().getDescription() + "", game);
+ permanent.addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen color: " + choice.getChoice()), game);
return true;
}
return false;
diff --git a/Mage/src/mage/abilities/effects/common/CopyEffect.java b/Mage/src/mage/abilities/effects/common/CopyEffect.java
index bbb1d6ba0ba..9d1194fda2a 100644
--- a/Mage/src/mage/abilities/effects/common/CopyEffect.java
+++ b/Mage/src/mage/abilities/effects/common/CopyEffect.java
@@ -40,6 +40,7 @@ import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
+import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.PermanentCard;
@@ -56,6 +57,7 @@ public class CopyEffect extends ContinuousEffectImpl {
* Object we copy from
*/
private MageObject target;
+
private UUID sourceId;
private ApplyToPermanent applier;
@@ -65,7 +67,7 @@ public class CopyEffect extends ContinuousEffectImpl {
public CopyEffect(Duration duration, MageObject target, UUID sourceId) {
super(duration, Layer.CopyEffects_1, SubLayer.NA, Outcome.BecomeCreature);
- this.target = target;
+ this.target = target;
this.sourceId = sourceId;
}
@@ -79,23 +81,24 @@ public class CopyEffect extends ContinuousEffectImpl {
@Override
public void init(Ability source, Game game) {
super.init(source, game);
- if (affectedObjectsSet) {
- affectedObjectList.add(new MageObjectReference(sourceId, game));
+ if (!(target instanceof Permanent) && (target instanceof Card)) {
+ this.target = new PermanentCard((Card)target, source.getControllerId(), game);
}
+ affectedObjectList.add(new MageObjectReference(getSourceId(), game));
}
@Override
public boolean apply(Game game, Ability source) {
- Permanent permanent;
- if (affectedObjectsSet) {
- permanent = affectedObjectList.get(0).getPermanent(game);
- } else {
- permanent = game.getPermanent(this.sourceId);
- }
+ Permanent permanent = affectedObjectList.get(0).getPermanent(game);
if (permanent == null) {
- discard();
- return false;
+ permanent = (Permanent) game.getLastKnownInformation(getSourceId(), Zone.BATTLEFIELD, source.getSourceObjectZoneChangeCounter());
+ // As long as the permanent is still in the LKI continue to copy to get triggered abilities to TriggeredAbilites for dies events.
+ if (permanent == null) {
+ discard();
+ return false;
+ }
}
+ permanent.setCopy(true);
permanent.setName(target.getName());
permanent.getColor(game).setColor(target.getColor(game));
permanent.getManaCost().clear();
@@ -134,9 +137,7 @@ public class CopyEffect extends ContinuousEffectImpl {
} else if (target instanceof PermanentToken || target instanceof Card) {
permanent.setCardNumber(((Card) target).getCardNumber());
permanent.setExpansionSetCode(((Card) target).getExpansionSetCode());
- }
-
- permanent.setCopy(true);
+ }
return true;
}
diff --git a/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java b/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java
index 2037ef3833e..6d02c2cb8e0 100644
--- a/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java
+++ b/Mage/src/mage/abilities/effects/common/CopyTargetSpellEffect.java
@@ -69,8 +69,9 @@ public class CopyTargetSpellEffect extends OneShotEffect {
if (activateMessage.startsWith(" casts ")) {
activateMessage = activateMessage.substring(6);
}
- if (!game.isSimulation())
- game.informPlayers(player.getLogName() + " copies " + activateMessage);
+ if (!game.isSimulation()) {
+ game.informPlayers(player.getLogName() + activateMessage);
+ }
return true;
}
return false;
diff --git a/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java
new file mode 100644
index 00000000000..3e6bd508bb4
--- /dev/null
+++ b/Mage/src/mage/abilities/effects/common/ExileAndReturnTransformedSourceEffect.java
@@ -0,0 +1,55 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.abilities.effects.common;
+
+import mage.MageObject;
+import mage.abilities.Ability;
+import mage.abilities.effects.OneShotEffect;
+import mage.abilities.keyword.TransformAbility;
+import mage.cards.Card;
+import mage.constants.Outcome;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.players.Player;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class ExileAndReturnTransformedSourceEffect extends OneShotEffect {
+
+ public static enum Gender { MALE, FEMAL };
+
+ public ExileAndReturnTransformedSourceEffect(Gender gender) {
+ super(Outcome.Benefit);
+ this.staticText = "exile {this}, then return " + (gender.equals(Gender.MALE) ? "him":"her")
+ + " to the battlefield transformed under" + (gender.equals(Gender.MALE) ? "his":"her")+ " owner's control";
+ }
+
+ public ExileAndReturnTransformedSourceEffect(final ExileAndReturnTransformedSourceEffect effect) {
+ super(effect);
+ }
+
+ @Override
+ public ExileAndReturnTransformedSourceEffect copy() {
+ return new ExileAndReturnTransformedSourceEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ MageObject sourceObject = source.getSourceObjectIfItStillExists(game);
+ Player controller = game.getPlayer(source.getControllerId());
+ if (sourceObject != null && controller != null) {
+ Card card = (Card) sourceObject;
+ if (controller.moveCards(card, Zone.BATTLEFIELD, Zone.EXILED, source, game)) {
+ game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
+ controller.putOntoBattlefieldWithInfo(card, game, Zone.EXILED, source.getSourceId());
+ }
+ }
+ return true;
+ }
+}
diff --git a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java
index ef4b9ae1bfa..47b4322115a 100644
--- a/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java
+++ b/Mage/src/mage/abilities/effects/common/ShuffleSpellEffect.java
@@ -35,6 +35,7 @@ import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
+import mage.game.stack.Spell;
import mage.players.Player;
/**
@@ -58,12 +59,15 @@ public class ShuffleSpellEffect extends OneShotEffect implements MageSingleton {
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
if (controller != null) {
- Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard();
- if (spellCard != null) {
- Player owner = game.getPlayer(spellCard.getOwnerId());
- if (owner != null) {
- controller.moveCardToLibraryWithInfo(spellCard, source.getSourceId(), game, Zone.STACK, true, true);
- owner.shuffleLibrary(game);
+ Spell spell = game.getStack().getSpell(source.getSourceId());
+ if (spell != null) {
+ Card spellCard = spell.getCard();
+ if (spellCard != null) {
+ Player owner = game.getPlayer(spellCard.getOwnerId());
+ if (owner != null) {
+ controller.moveCardToLibraryWithInfo(spellCard, source.getSourceId(), game, Zone.STACK, true, true);
+ owner.shuffleLibrary(game);
+ }
}
}
return true;
diff --git a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java
index 104d3bdfe04..4390a891a11 100644
--- a/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java
+++ b/Mage/src/mage/abilities/effects/common/combat/AttacksIfAbleSourceEffect.java
@@ -33,6 +33,7 @@ import mage.abilities.Ability;
import mage.abilities.effects.RequirementEffect;
import mage.game.Game;
import mage.game.permanent.Permanent;
+import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
@@ -40,18 +41,25 @@ import mage.game.permanent.Permanent;
*/
public class AttacksIfAbleSourceEffect extends RequirementEffect {
+ boolean eachCombat;
+
public AttacksIfAbleSourceEffect(Duration duration) {
+ this(duration, false);
+ }
+
+ public AttacksIfAbleSourceEffect(Duration duration, boolean eachCombat) {
super(duration);
+ this.eachCombat = eachCombat;
if (this.duration == Duration.EndOfTurn) {
- staticText = "{this} attacks this turn if able";
- }
- else {
- staticText = "{this} attacks each turn if able";
+ staticText = "{this} attacks " + (eachCombat ? "each combat" :"this turn") + " if able";
+ } else {
+ staticText = "{this} attacks each " + (eachCombat ? "combat" :"turn") + " if able";
}
}
public AttacksIfAbleSourceEffect(final AttacksIfAbleSourceEffect effect) {
super(effect);
+ this.eachCombat = effect.eachCombat;
}
@Override
@@ -61,7 +69,14 @@ public class AttacksIfAbleSourceEffect extends RequirementEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
- return permanent.getId().equals(source.getSourceId());
+ if (permanent.getId().equals(source.getSourceId())) {
+ if (eachCombat) {
+ return true;
+ }
+ AttackedThisTurnWatcher watcher = (AttackedThisTurnWatcher)game.getState().getWatchers().get("AttackedThisTurn");
+ return watcher != null && !watcher.getAttackedThisTurnCreatures().contains(permanent.getId());
+ }
+ return false;
}
@Override
diff --git a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java
index 134bae46168..39316525853 100644
--- a/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continuous/BecomesBasicLandTargetEffect.java
@@ -59,6 +59,7 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
protected boolean chooseLandType;
protected ArrayList landTypes = new ArrayList();
+ protected boolean loseOther; // loses all other abilities, card types, and creature types
public BecomesBasicLandTargetEffect(Duration duration) {
this(duration, true, new String[0]);
@@ -69,10 +70,15 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
}
public BecomesBasicLandTargetEffect(Duration duration, boolean chooseLandType, String... landNames) {
+ this(duration, chooseLandType, true, landNames);
+ }
+
+ public BecomesBasicLandTargetEffect(Duration duration, boolean chooseLandType, boolean loseOther, String... landNames) {
super(duration, Outcome.Detriment);
this.landTypes.addAll(Arrays.asList(landNames));
this.chooseLandType = chooseLandType;
this.staticText = setText();
+ this.loseOther = loseOther;
}
@@ -105,6 +111,19 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
this.discard();
}
}
+
+ if(!loseOther) {
+ for (UUID targetPermanent : targetPointer.getTargets(game, source)) {
+ Permanent land = game.getPermanent(targetPermanent);
+ if (land != null) {
+ for(String type : land.getSubtype()) {
+ if(!landTypes.contains(type)) {
+ landTypes.add(type);
+ }
+ }
+ }
+ }
+ }
}
@Override
@@ -116,16 +135,22 @@ public class BecomesBasicLandTargetEffect extends ContinuousEffectImpl {
case AbilityAddingRemovingEffects_6:
land.removeAllAbilities(source.getSourceId(), game);
for (String landType : landTypes) {
- if (landType.equals("Swamp")) {
- land.addAbility(new BlackManaAbility(), source.getSourceId(), game);
- } else if (landType.equals("Mountain")) {
- land.addAbility(new RedManaAbility(), source.getSourceId(), game);
- } else if (landType.equals("Forest")) {
- land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
- } else if (landType.equals("Island")) {
- land.addAbility(new BlueManaAbility(), source.getSourceId(), game);
- } else if (landType.equals("Plains")) {
- land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
+ switch (landType) {
+ case "Swamp":
+ land.addAbility(new BlackManaAbility(), source.getSourceId(), game);
+ break;
+ case "Mountain":
+ land.addAbility(new RedManaAbility(), source.getSourceId(), game);
+ break;
+ case "Forest":
+ land.addAbility(new GreenManaAbility(), source.getSourceId(), game);
+ break;
+ case "Island":
+ land.addAbility(new BlueManaAbility(), source.getSourceId(), game);
+ break;
+ case "Plains":
+ land.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
+ break;
}
}
break;
diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java
index 6ed437d0891..77b9483002c 100644
--- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAllEffect.java
@@ -80,6 +80,7 @@ public class GainAbilityAllEffect extends ContinuousEffectImpl {
public GainAbilityAllEffect(final GainAbilityAllEffect effect) {
super(effect);
this.ability = effect.ability.copy();
+ ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
this.filter = effect.filter.copy();
this.excludeSource = effect.excludeSource;
}
diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java
index cdbc829cbbe..6a0509da83d 100644
--- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityAttachedEffect.java
@@ -80,6 +80,7 @@ public class GainAbilityAttachedEffect extends ContinuousEffectImpl {
public GainAbilityAttachedEffect(final GainAbilityAttachedEffect effect) {
super(effect);
this.ability = effect.ability.copy();
+ ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
this.attachmentType = effect.attachmentType;
this.fixedTarget = effect.fixedTarget;
}
diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java
index 7f7b4c49e78..686b7f0a525 100644
--- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityPairedEffect.java
@@ -54,6 +54,7 @@ public class GainAbilityPairedEffect extends ContinuousEffectImpl {
public GainAbilityPairedEffect(final GainAbilityPairedEffect effect) {
super(effect);
this.ability = effect.ability.copy();
+ ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
}
@Override
@@ -68,7 +69,7 @@ public class GainAbilityPairedEffect extends ContinuousEffectImpl {
Permanent paired = game.getPermanent(permanent.getPairedCard());
if (paired != null) {
permanent.addAbility(ability, game);
- paired.addAbility(ability, source.getSourceId(), game);
+ paired.addAbility(ability, source.getSourceId(), game, false);
return true;
}
}
diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java
index cd691be7fe4..81fc17c970c 100644
--- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilitySourceEffect.java
@@ -80,6 +80,7 @@ public class GainAbilitySourceEffect extends ContinuousEffectImpl implements Sou
public GainAbilitySourceEffect(final GainAbilitySourceEffect effect) {
super(effect);
this.ability = effect.ability.copy();
+ ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
this.onCard = effect.onCard;
}
diff --git a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java
index d8635ef0f26..404c0476d7f 100644
--- a/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continuous/GainAbilityTargetEffect.java
@@ -77,6 +77,7 @@ public class GainAbilityTargetEffect extends ContinuousEffectImpl {
public GainAbilityTargetEffect(final GainAbilityTargetEffect effect) {
super(effect);
this.ability = effect.ability.copy();
+ ability.newId(); // This is needed if the effect is copied e.g. by a clone so the ability can be added multiple times to permanents
this.onCard = effect.onCard;
this.durationPhaseStep = effect.durationPhaseStep;
this.durationPlayerId = effect.durationPlayerId;
diff --git a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java
index 7d60332c1d3..add455f4b14 100644
--- a/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java
+++ b/Mage/src/mage/abilities/effects/common/continuous/SetPowerToughnessSourceEffect.java
@@ -36,8 +36,8 @@ import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
-import mage.constants.Zone;
import mage.game.Game;
+import mage.game.permanent.Permanent;
/**
*
@@ -76,12 +76,16 @@ public class SetPowerToughnessSourceEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
- MageObject mageObject = game.getObject(source.getSourceId());
+ MageObject mageObject = game.getObject(source.getSourceId());
if (mageObject == null) {
if (duration.equals(Duration.Custom)) {
discard();
}
return false;
+ } else if (isTemporary()) { // it's somehow w
+ if (!(mageObject instanceof Permanent)) {
+ return false;
+ }
}
if (amount != null) {
int value = amount.calculate(game, source, this);
diff --git a/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java b/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java
index 363012453c2..b85e47bf840 100644
--- a/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java
+++ b/Mage/src/mage/abilities/effects/common/counter/ProliferateEffect.java
@@ -87,7 +87,7 @@ public class ProliferateEffect extends OneShotEffect {
choices.add(counter.getName());
}
choice.setChoices(choices);
- choice.setMessage("Choose a counter to proliferate (" + permanent.getName() + ")");
+ choice.setMessage("Choose a counter to proliferate (" + permanent.getIdName() + ")");
controller.choose(Outcome.Benefit, choice, game);
for (Counter counter : permanent.getCounters().values()) {
if (counter.getName().equals(choice.getChoice())) {
diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java
index 01014677be6..6776adcc8ea 100644
--- a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java
+++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayEffect.java
@@ -45,8 +45,8 @@ import mage.target.common.TargetCardInLibrary;
*/
public class SearchLibraryPutInPlayEffect extends SearchEffect {
- private boolean tapped;
- private boolean forceShuffle;
+ protected boolean tapped;
+ protected boolean forceShuffle;
public SearchLibraryPutInPlayEffect(TargetCardInLibrary target) {
this(target, false, true, Outcome.PutCardInPlay);
diff --git a/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java
new file mode 100644
index 00000000000..74cf05fbe9f
--- /dev/null
+++ b/Mage/src/mage/abilities/effects/common/search/SearchLibraryPutInPlayTargetPlayerEffect.java
@@ -0,0 +1,119 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.abilities.effects.common.search;
+
+import java.util.List;
+import java.util.UUID;
+import mage.abilities.Ability;
+import mage.abilities.effects.SearchEffect;
+import mage.cards.Card;
+import mage.constants.Outcome;
+import mage.constants.Zone;
+import mage.game.Game;
+import mage.players.Player;
+import mage.target.common.TargetCardInLibrary;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class SearchLibraryPutInPlayTargetPlayerEffect extends SearchEffect {
+
+ protected boolean tapped;
+ protected boolean forceShuffle;
+
+ public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target) {
+ this(target, false, true, Outcome.PutCardInPlay);
+ }
+
+ public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped) {
+ this(target, tapped, true, Outcome.PutCardInPlay);
+ }
+
+ public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle) {
+ this(target, tapped, forceShuffle, Outcome.PutCardInPlay);
+ }
+
+ public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, Outcome outcome) {
+ this(target, tapped, true, outcome);
+ }
+
+ public SearchLibraryPutInPlayTargetPlayerEffect(TargetCardInLibrary target, boolean tapped, boolean forceShuffle, Outcome outcome) {
+ super(target, outcome);
+ this.tapped = tapped;
+ this.forceShuffle = forceShuffle;
+ setText();
+ }
+
+ public SearchLibraryPutInPlayTargetPlayerEffect(final SearchLibraryPutInPlayTargetPlayerEffect effect) {
+ super(effect);
+ this.tapped = effect.tapped;
+ this.forceShuffle = effect.forceShuffle;
+ }
+
+ @Override
+ public SearchLibraryPutInPlayTargetPlayerEffect copy() {
+ return new SearchLibraryPutInPlayTargetPlayerEffect(this);
+ }
+
+ @Override
+ public boolean apply(Game game, Ability source) {
+ Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
+ if (player != null) {
+ if (player.searchLibrary(target, game)) {
+ if (target.getTargets().size() > 0) {
+ for (UUID cardId: target.getTargets()) {
+ Card card = player.getLibrary().getCard(cardId, game);
+ if (card != null) {
+ player.putOntoBattlefieldWithInfo(card, game, Zone.LIBRARY, source.getSourceId(), tapped);
+ }
+ }
+ }
+ player.shuffleLibrary(game);
+ return true;
+ }
+
+ if (forceShuffle) {
+ player.shuffleLibrary(game);
+ }
+ }
+
+ return false;
+ }
+
+ private void setText() {
+ StringBuilder sb = new StringBuilder();
+ sb.append("target player searches his or her library for ");
+ if (target.getNumberOfTargets() == 0 && target.getMaxNumberOfTargets() > 0) {
+ if ( target.getMaxNumberOfTargets() == Integer.MAX_VALUE ) {
+ sb.append("any number of ").append(" ");
+ }
+ else {
+ sb.append("up to ").append(target.getMaxNumberOfTargets()).append(" ");
+ }
+ sb.append(target.getTargetName()).append(" and put them onto the battlefield");
+ }
+ else {
+ sb.append("a ").append(target.getTargetName()).append(" and put it onto the battlefield");
+ }
+ if (tapped) {
+ sb.append(" tapped");
+ }
+ if (forceShuffle) {
+ sb.append(". Then that player shuffles his or her library");
+ }
+ else {
+ sb.append(". If that player does, he or she shuffles his or her library");
+ }
+ staticText = sb.toString();
+ }
+
+ public List getTargets() {
+ return target.getTargets();
+ }
+
+}
diff --git a/Mage/src/mage/abilities/keyword/CantBlockAloneAttachedEffect.java b/Mage/src/mage/abilities/keyword/CantBlockAloneAttachedEffect.java
deleted file mode 100644
index 06b01440a2a..00000000000
--- a/Mage/src/mage/abilities/keyword/CantBlockAloneAttachedEffect.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package mage.abilities.keyword;
-
-/**
- *
- * @author ludwig.hirth
- */
-public class CantBlockAloneAttachedEffect {
-
-}
diff --git a/Mage/src/mage/abilities/keyword/HauntAbility.java b/Mage/src/mage/abilities/keyword/HauntAbility.java
index 76e3ebc6f09..d9e276b1ec7 100644
--- a/Mage/src/mage/abilities/keyword/HauntAbility.java
+++ b/Mage/src/mage/abilities/keyword/HauntAbility.java
@@ -40,7 +40,6 @@ import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.events.GameEvent;
-import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
diff --git a/Mage/src/mage/abilities/keyword/KickerAbility.java b/Mage/src/mage/abilities/keyword/KickerAbility.java
index fef48ffa24d..6828e26a060 100644
--- a/Mage/src/mage/abilities/keyword/KickerAbility.java
+++ b/Mage/src/mage/abilities/keyword/KickerAbility.java
@@ -28,9 +28,11 @@
package mage.abilities.keyword;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
+import java.util.Map;
import mage.abilities.Ability;
import mage.abilities.SpellAbility;
import mage.abilities.StaticAbility;
@@ -42,7 +44,7 @@ import mage.abilities.costs.OptionalAdditionalSourceCosts;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.costs.mana.VariableManaCost;
-import mage.cards.Card;
+import mage.constants.AbilityType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
@@ -87,12 +89,12 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
protected static final String KICKER_REMINDER_MANA = "(You may pay an additional {cost} as you cast this spell.)";
protected static final String KICKER_REMINDER_COST = "(You may {cost} in addition to any other costs as you cast this spell.)";
+ protected Map activations = new HashMap<>(); // zoneChangeCounter, activations
+
protected String keywordText;
protected String reminderText;
protected List kickerCosts = new LinkedList<>();
private int xManaValue = 0;
- // needed to reset kicked status, if card changes zone after casting it
- private int zoneChangeCounter = 0;
public KickerAbility(String manaString) {
this(KICKER_KEYWORD, KICKER_REMINDER_MANA);
@@ -118,7 +120,7 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
this.keywordText = ability.keywordText;
this.reminderText = ability.reminderText;
this.xManaValue = ability.xManaValue;
- this.zoneChangeCounter = ability.zoneChangeCounter;
+ this.activations.putAll(ability.activations);
}
@@ -143,35 +145,24 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
for (OptionalAdditionalCost cost: kickerCosts) {
cost.reset();
}
- zoneChangeCounter = 0;
}
public int getXManaValue() {
return xManaValue;
}
- public int getKickedCounter(Game game) {
- if (isKicked(game)) {
- int counter = 0;
- for (OptionalAdditionalCost cost: kickerCosts) {
- counter += cost.getActivateCount();
- }
- return counter;
+ public int getKickedCounter(Game game, Ability source) {
+ String key = getActivationKey(source, "", game);
+ if (activations.containsKey(key)) {
+ return activations.get(key);
}
return 0;
}
- public boolean isKicked(Game game) {
- Card card = game.getCard(sourceId);
- // kicked status counts only if card not changed zone since it was kicked
- if (card != null && card.getZoneChangeCounter(game) <= zoneChangeCounter +1) {
- for (OptionalAdditionalCost cost: kickerCosts) {
- if(cost.isActivated()) {
- return true;
- }
- }
- } else {
- this.resetKicker();
+ public boolean isKicked(Game game, Ability source, String costText) {
+ String key = getActivationKey(source, costText, game);
+ if (activations.containsKey(key)) {
+ return activations.get(key) > 0;
}
return false;
}
@@ -180,19 +171,26 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
return kickerCosts;
}
- private void activateKicker(OptionalAdditionalCost kickerCost, Game game) {
- kickerCost.activate();
- // remember zone change counter
- if (zoneChangeCounter == 0) {
- Card card = game.getCard(getSourceId());
- if (card != null) {
- zoneChangeCounter = card.getZoneChangeCounter(game);
- } else {
- throw new IllegalArgumentException("Kicker source card not found");
- }
+ private void activateKicker(OptionalAdditionalCost kickerCost, Ability source, Game game) {
+ int amount = 1;
+ String key = getActivationKey(source, kickerCost.getText(true), game);
+ if (activations.containsKey(key)) {
+ amount += activations.get(key);
}
+ activations.put(key, amount);
}
+ private String getActivationKey(Ability source, String costText, Game game) {
+ int zcc = source.getSourceObjectZoneChangeCounter();
+ if (source.getSourceObjectZoneChangeCounter() == 0) {
+ zcc = game.getState().getZoneChangeCounter(source.getSourceId());
+ }
+ if (zcc > 0 && (source.getAbilityType().equals(AbilityType.TRIGGERED) || source.getAbilityType().equals(AbilityType.STATIC))) {
+ --zcc;
+ }
+ return String.valueOf(zcc) + ((kickerCosts.size() > 1) ? costText :"");
+ }
+
@Override
public void addOptionalAdditionalCosts(Ability ability, Game game) {
if (ability instanceof SpellAbility) {
@@ -208,8 +206,8 @@ public class KickerAbility extends StaticAbility implements OptionalAdditionalSo
times = Integer.toString(activatedCount + 1) + (activatedCount == 0 ? " time ":" times ");
}
if (kickerCost.canPay(ability, sourceId, controllerId, game) &&
- player.chooseUse(Outcome.Benefit, new StringBuilder("Pay ").append(times).append(kickerCost.getText(false)).append(" ?").toString(), game)) {
- this.activateKicker(kickerCost, game);
+ player.chooseUse(Outcome.Benefit, "Pay " + times + kickerCost.getText(false) + " ?", game)) {
+ this.activateKicker(kickerCost, ability, game);
for (Iterator it = ((Costs) kickerCost).iterator(); it.hasNext();) {
Cost cost = (Cost) it.next();
if (cost instanceof ManaCostsImpl) {
diff --git a/Mage/src/mage/abilities/keyword/MenaceAbility.java b/Mage/src/mage/abilities/keyword/MenaceAbility.java
new file mode 100644
index 00000000000..cad29e9ab9f
--- /dev/null
+++ b/Mage/src/mage/abilities/keyword/MenaceAbility.java
@@ -0,0 +1,38 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.abilities.keyword;
+
+import mage.abilities.Ability;
+import mage.abilities.StaticAbility;
+import mage.abilities.effects.common.combat.CantBeBlockedByMoreThanOneSourceEffect;
+import mage.abilities.effects.common.combat.CantBeBlockedByOneEffect;
+import mage.constants.Zone;
+
+/**
+ *
+ * @author LevelX2
+ */
+public class MenaceAbility extends StaticAbility {
+
+ public MenaceAbility() {
+ super(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2));
+ }
+
+ public MenaceAbility(MenaceAbility ability) {
+ super(ability);
+ }
+
+ @Override
+ public Ability copy() {
+ return new MenaceAbility(this);
+ }
+
+ @Override
+ public String getRule() {
+ return "Menace (This creature can't be blocked except by two or more creatures.)";
+ }
+
+}
diff --git a/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java b/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java
index 92d7ee0474c..06d6c201bf1 100644
--- a/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java
+++ b/Mage/src/mage/abilities/keyword/SpliceOntoArcaneAbility.java
@@ -38,7 +38,6 @@ import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.SpliceCardEffectImpl;
import mage.cards.Card;
-import mage.cards.CardsImpl;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SpellAbilityType;
@@ -105,12 +104,12 @@ import mage.players.Player;
public class SpliceOntoArcaneAbility extends SimpleStaticAbility {
private static final String KEYWORD_TEXT = "Splice onto Arcane";
- private Costs spliceCosts = new CostsImpl();
+ private Costs spliceCosts = new CostsImpl<>();
private boolean nonManaCosts = false;
public SpliceOntoArcaneAbility(String manaString) {
super(Zone.HAND, new SpliceOntoArcaneEffect());
- spliceCosts.add(new ManaCostsImpl(manaString));
+ spliceCosts.add(new ManaCostsImpl<>(manaString));
}
public SpliceOntoArcaneAbility(Cost cost) {
@@ -144,7 +143,6 @@ public class SpliceOntoArcaneAbility extends SimpleStaticAbility {
}
}
-
class SpliceOntoArcaneEffect extends SpliceCardEffectImpl {
public SpliceOntoArcaneEffect() {
@@ -156,8 +154,6 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl {
super(effect);
}
-
-
@Override
public SpliceOntoArcaneEffect copy() {
return new SpliceOntoArcaneEffect(this);
@@ -175,12 +171,7 @@ class SpliceOntoArcaneEffect extends SpliceCardEffectImpl {
splicedAbility.setSourceId(abilityToModify.getSourceId());
spell.addSpellAbility(splicedAbility);
for (Iterator it = ((SpliceOntoArcaneAbility) source).getSpliceCosts().iterator(); it.hasNext();) {
- Cost cost = (Cost) it.next();
- if (cost instanceof ManaCostsImpl) {
- spell.getSpellAbility().getManaCostsToPay().add((ManaCostsImpl) cost.copy());
- } else {
- spell.getSpellAbility().getCosts().add(cost.copy());
- }
+ spell.getSpellAbility().getCosts().add(((Cost) it.next()).copy());
}
}
return true;
diff --git a/Mage/src/mage/abilities/keyword/StormAbility.java b/Mage/src/mage/abilities/keyword/StormAbility.java
index 10377a0b1f9..df0352dece5 100644
--- a/Mage/src/mage/abilities/keyword/StormAbility.java
+++ b/Mage/src/mage/abilities/keyword/StormAbility.java
@@ -69,8 +69,8 @@ public class StormAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
- if (event.getSourceId().equals(this.sourceId)) {
- StackObject spell = game.getStack().getStackObject(this.sourceId);
+ if (event.getSourceId().equals(getSourceId())) {
+ StackObject spell = game.getStack().getStackObject(getSourceId());
if (spell instanceof Spell) {
for (Effect effect : this.getEffects()) {
effect.setValue("StormSpell", spell);
@@ -108,7 +108,7 @@ class StormEffect extends OneShotEffect {
Spell spell = (Spell) this.getValue("StormSpell");
if (spell != null) {
if (!game.isSimulation()) {
- game.informPlayers("Storm: " + spell.getName() + " will be copied " + stormCount + " time" + (stormCount > 1 ?"s":""));
+ game.informPlayers("Storm: " + spell.getLogName() + " will be copied " + stormCount + " time" + (stormCount > 1 ?"s":""));
}
for (int i = 0; i < stormCount; i++) {
Spell copy = spell.copySpell();
diff --git a/Mage/src/mage/abilities/keyword/TransformAbility.java b/Mage/src/mage/abilities/keyword/TransformAbility.java
index 9b01d319c02..1d36731553d 100644
--- a/Mage/src/mage/abilities/keyword/TransformAbility.java
+++ b/Mage/src/mage/abilities/keyword/TransformAbility.java
@@ -44,6 +44,9 @@ public class TransformAbility extends SimpleStaticAbility {
public static final String NO_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if no spells were cast last turn, transform {this}.";
public static final String TWO_OR_MORE_SPELLS_TRANSFORM_RULE = "At the beginning of each upkeep, if a player cast two or more spells last turn, transform {this}.";
+ // this state value controlls if a permanent enters the battlefield already transformed
+ public static final String VALUE_KEY_ENTER_TRANSFORMED = "EnterTransformed";
+
public TransformAbility() {
super(Zone.BATTLEFIELD, new TransformEffect());
}
diff --git a/Mage/src/mage/cards/CardImpl.java b/Mage/src/mage/cards/CardImpl.java
index b656ae3bf29..8f9f4ee18a6 100644
--- a/Mage/src/mage/cards/CardImpl.java
+++ b/Mage/src/mage/cards/CardImpl.java
@@ -359,6 +359,12 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
break;
case STACK:
StackObject stackObject = game.getStack().getSpell(getId());
+ if (stackObject == null && (this instanceof SplitCard)) { // handle if half od Split cast is on the stack
+ stackObject = game.getStack().getSpell(((SplitCard)this).getLeftHalfCard().getId());
+ if (stackObject == null) {
+ stackObject = game.getStack().getSpell(((SplitCard)this).getRightHalfCard().getId());
+ }
+ }
if (stackObject != null) {
game.getStack().remove(stackObject);
}
diff --git a/Mage/src/mage/cards/repository/CardRepository.java b/Mage/src/mage/cards/repository/CardRepository.java
index c9ae81aa612..587634b3871 100644
--- a/Mage/src/mage/cards/repository/CardRepository.java
+++ b/Mage/src/mage/cards/repository/CardRepository.java
@@ -58,9 +58,9 @@ public enum CardRepository {
private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE";
private static final String VERSION_ENTITY_NAME = "card";
// raise this if db structure was changed
- private static final long CARD_DB_VERSION = 38;
+ private static final long CARD_DB_VERSION = 39;
// raise this if new cards were added to the server
- private static final long CARD_CONTENT_VERSION = 17;
+ private static final long CARD_CONTENT_VERSION = 20;
private final Random random = new Random();
private Dao cardDao;
diff --git a/Mage/src/mage/cards/repository/ExpansionRepository.java b/Mage/src/mage/cards/repository/ExpansionRepository.java
index 5fb202231b4..6f2e118bec5 100644
--- a/Mage/src/mage/cards/repository/ExpansionRepository.java
+++ b/Mage/src/mage/cards/repository/ExpansionRepository.java
@@ -26,8 +26,8 @@ public enum ExpansionRepository {
private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE";
private static final String VERSION_ENTITY_NAME = "expansion";
- private static final long EXPANSION_DB_VERSION = 4;
- private static final long EXPANSION_CONTENT_VERSION = 7;
+ private static final long EXPANSION_DB_VERSION = 5;
+ private static final long EXPANSION_CONTENT_VERSION = 8;
private Dao expansionDao;
diff --git a/Mage/src/mage/constants/SpellAbilityType.java b/Mage/src/mage/constants/SpellAbilityType.java
index 70af522434f..881fdf06a6c 100644
--- a/Mage/src/mage/constants/SpellAbilityType.java
+++ b/Mage/src/mage/constants/SpellAbilityType.java
@@ -7,7 +7,7 @@ package mage.constants;
public enum SpellAbilityType {
BASE("Basic SpellAbility"),
BASE_ALTERNATE("Basic SpellAbility Alternate"), // used for Overload, Flashback to know they must be handled as Alternate casting costs
- LAND_ALTERNATE("Basic SpellAbility Alternate Land"), // used for Lands with Morph to cast as Face Down creature
+ FACE_DOWN_CREATURE("Face down creature"), // used for Lands with Morph to cast as Face Down creature
SPLIT("Split SpellAbility"),
SPLIT_FUSED("Split SpellAbility"),
SPLIT_LEFT("LeftSplit SpellAbility"),
diff --git a/Mage/src/mage/counters/CounterType.java b/Mage/src/mage/counters/CounterType.java
index 00e2fe3b4bf..e446016fa61 100644
--- a/Mage/src/mage/counters/CounterType.java
+++ b/Mage/src/mage/counters/CounterType.java
@@ -53,6 +53,7 @@ public enum CounterType {
FADE("fade"),
FATE("fate"),
FEATHER("feather"),
+ FLOOD("flood"),
FUSE("fuse"),
HATCHLING("hatchling"),
HOOFPRINT("hoofprint"),
diff --git a/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java b/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java
index d8ad11777f9..fc9bb9edbfc 100644
--- a/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java
+++ b/Mage/src/mage/filter/common/FilterCreatureForCombatBlock.java
@@ -29,10 +29,7 @@
package mage.filter.common;
import mage.constants.AsThoughEffectType;
-import mage.filter.predicate.ObjectPlayer;
-import mage.filter.predicate.ObjectPlayerPredicate;
import mage.filter.predicate.Predicate;
-import mage.game.Controllable;
import mage.game.Game;
import mage.game.permanent.Permanent;
diff --git a/Mage/src/mage/game/CardAttribute.java b/Mage/src/mage/game/CardAttribute.java
index 95b4659ab7d..49cbf8dce27 100644
--- a/Mage/src/mage/game/CardAttribute.java
+++ b/Mage/src/mage/game/CardAttribute.java
@@ -21,6 +21,14 @@ public class CardAttribute implements Serializable {
public CardAttribute(Card card) {
color = card.getColor(null).copy();
}
+
+ public CardAttribute(CardAttribute cardAttribute) {
+ this.color = cardAttribute.color;
+ }
+
+ public CardAttribute copy() {
+ return new CardAttribute(this);
+ }
public ObjectColor getColor() {
return color;
diff --git a/Mage/src/mage/game/Game.java b/Mage/src/mage/game/Game.java
index 3743aae59c4..40c78f0512f 100644
--- a/Mage/src/mage/game/Game.java
+++ b/Mage/src/mage/game/Game.java
@@ -253,7 +253,7 @@ public interface Game extends MageItem, Serializable {
Card copyCard(Card cardToCopy, Ability source, UUID newController);
void addTriggeredAbility(TriggeredAbility ability);
- void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility);
+ UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility);
void applyEffects();
boolean checkStateAndTriggered();
void playPriority(UUID activePlayerId, boolean resuming);
diff --git a/Mage/src/mage/game/GameCommanderImpl.java b/Mage/src/mage/game/GameCommanderImpl.java
index 4a12851b2e2..92fbac34254 100644
--- a/Mage/src/mage/game/GameCommanderImpl.java
+++ b/Mage/src/mage/game/GameCommanderImpl.java
@@ -56,8 +56,10 @@ import mage.watchers.common.CommanderInfoWatcher;
public abstract class GameCommanderImpl extends GameImpl {
+ static boolean CHECK_COMMANDER_DAMAGE = true;
+
private final Map mulliganedCards = new HashMap<>();
- private final Set commanderCombatWatcher = new HashSet<>();
+ // private final Set commanderCombatWatcher = new HashSet<>();
protected boolean alsoHand; // replace commander going to hand
protected boolean alsoLibrary; // replace commander going to library
@@ -91,9 +93,8 @@ public abstract class GameCommanderImpl extends GameImpl {
ability.addEffect(new CommanderCostModification(commander.getId()));
ability.addEffect(new CommanderManaReplacementEffect(player.getId(), CardUtil.getColorIdentity(commander)));
getState().setValue(commander.getId() + "_castCount", 0);
- CommanderInfoWatcher watcher = new CommanderInfoWatcher(commander.getId(), true);
+ CommanderInfoWatcher watcher = new CommanderInfoWatcher(commander.getId(), CHECK_COMMANDER_DAMAGE);
getState().getWatchers().add(watcher);
- this.commanderCombatWatcher.add(watcher);
watcher.addCardInfoToCommander(this);
}
}
@@ -185,12 +186,13 @@ public abstract class GameCommanderImpl extends GameImpl {
*/
@Override
protected boolean checkStateBasedActions() {
- for (CommanderInfoWatcher damageWatcher: commanderCombatWatcher) {
+ for (Player player: getPlayers().values()) {
+ CommanderInfoWatcher damageWatcher = (CommanderInfoWatcher) getState().getWatchers().get("CommanderCombatDamageWatcher", player.getCommanderId());
for(Map.Entry entrySet : damageWatcher.getDamageToPlayer().entrySet()){
if (entrySet.getValue() > 20) {
- Player player = getPlayer(entrySet.getKey());
- if (player != null && player.isInGame()){
- player.lost(this);
+ Player opponent = getPlayer(entrySet.getKey());
+ if (opponent != null && player.isInGame()){
+ opponent.lost(this);
}
}
}
diff --git a/Mage/src/mage/game/GameImpl.java b/Mage/src/mage/game/GameImpl.java
index 23561b34258..49aa03847d3 100644
--- a/Mage/src/mage/game/GameImpl.java
+++ b/Mage/src/mage/game/GameImpl.java
@@ -122,6 +122,7 @@ import mage.watchers.Watchers;
import mage.watchers.common.BlockedAttackerWatcher;
import mage.watchers.common.BloodthirstWatcher;
import mage.watchers.common.CastSpellLastTurnWatcher;
+import mage.watchers.common.DamageDoneWatcher;
import mage.watchers.common.MorbidWatcher;
import mage.watchers.common.PlayerDamagedBySourceWatcher;
import mage.watchers.common.PlayerLostLifeWatcher;
@@ -912,6 +913,7 @@ public abstract class GameImpl implements Game, Serializable {
watchers.add(new SoulbondWatcher());
watchers.add(new PlayerLostLifeWatcher());
watchers.add(new BlockedAttackerWatcher());
+ watchers.add(new DamageDoneWatcher());
//20100716 - 103.5
for (UUID playerId: state.getPlayerList(startingPlayerId)) {
@@ -1144,6 +1146,7 @@ public abstract class GameImpl implements Game, Serializable {
int bookmark = 0;
clearAllBookmarks();
try {
+ applyEffects();
while (!isPaused() && !gameOver(null) && !this.getTurn().isEndTurnRequested()) {
if (!resuming) {
state.getPlayers().resetPassed();
@@ -1383,11 +1386,12 @@ public abstract class GameImpl implements Game, Serializable {
}
@Override
- public void addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) {
+ public UUID addDelayedTriggeredAbility(DelayedTriggeredAbility delayedAbility) {
DelayedTriggeredAbility newAbility = delayedAbility.copy();
newAbility.newId();
newAbility.init(this);
state.addDelayedTriggeredAbility(newAbility);
+ return newAbility.getId();
}
/**
diff --git a/Mage/src/mage/game/GameState.java b/Mage/src/mage/game/GameState.java
index ebfdc555a19..83236ef4e69 100644
--- a/Mage/src/mage/game/GameState.java
+++ b/Mage/src/mage/game/GameState.java
@@ -171,6 +171,9 @@ public class GameState implements Serializable, Copyable {
for (Map.Entry entry: state.cardState.entrySet()) {
cardState.put(entry.getKey(), entry.getValue().copy());
}
+ for (Map.Entry entry: state.cardAttribute.entrySet()) {
+ cardAttribute.put(entry.getKey(), entry.getValue().copy());
+ }
this.zoneChangeCounter.putAll(state.zoneChangeCounter);
this.copiedCards.putAll(state.copiedCards);
this.permanentOrderNumber = state.permanentOrderNumber;
@@ -208,6 +211,7 @@ public class GameState implements Serializable, Copyable {
this.zones = state.zones;
this.simultaneousEvents = state.simultaneousEvents;
this.cardState = state.cardState;
+ this.cardAttribute = state.cardAttribute;
this.zoneChangeCounter = state.zoneChangeCounter;
this.copiedCards = state.copiedCards;
this.permanentOrderNumber = state.permanentOrderNumber;
diff --git a/Mage/src/mage/game/combat/Combat.java b/Mage/src/mage/game/combat/Combat.java
index b70442fc7e4..e5d281763cd 100644
--- a/Mage/src/mage/game/combat/Combat.java
+++ b/Mage/src/mage/game/combat/Combat.java
@@ -247,7 +247,9 @@ public class Combat implements Serializable, Copyable {
for (Ability ability : entry.getValue()) {
UUID defenderId = effect.mustAttackDefender(ability, game);
if (defenderId != null) {
- defendersForcedToAttack.add(defenderId);
+ if (defenders.contains(defenderId)) {
+ defendersForcedToAttack.add(defenderId);
+ }
}
break;
}
diff --git a/Mage/src/mage/game/permanent/PermanentCard.java b/Mage/src/mage/game/permanent/PermanentCard.java
index c6994cb72ed..af54c92b1dc 100644
--- a/Mage/src/mage/game/permanent/PermanentCard.java
+++ b/Mage/src/mage/game/permanent/PermanentCard.java
@@ -33,6 +33,7 @@ import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
+import mage.abilities.keyword.TransformAbility;
import mage.cards.Card;
import mage.cards.LevelerCard;
import mage.constants.Zone;
@@ -65,6 +66,13 @@ public class PermanentCard extends PermanentImpl {
if (card instanceof LevelerCard) {
maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters();
}
+ if (canTransform()) {
+ if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId()) != null) {
+ game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + getId(), null);
+ setTransformed(true);
+ TransformAbility.transform(this, getSecondCardFace(), game);
+ }
+ }
}
public PermanentCard(final PermanentCard permanent) {
diff --git a/Mage/src/mage/game/stack/Spell.java b/Mage/src/mage/game/stack/Spell.java
index bbb1ef01d8f..2ae5dd56c79 100644
--- a/Mage/src/mage/game/stack/Spell.java
+++ b/Mage/src/mage/game/stack/Spell.java
@@ -372,6 +372,11 @@ public class Spell extends StackObjImpl implements Card {
@Override
public List getCardType() {
+ if (this.getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.FACE_DOWN_CREATURE)) {
+ List cardTypes = new ArrayList<>();
+ cardTypes.add(CardType.CREATURE);
+ return cardTypes;
+ }
if (this.getSpellAbility() instanceof BestowAbility) {
List cardTypes = new ArrayList<>();
cardTypes.addAll(card.getCardType());
diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java
index a9fb708017f..65228de1e6b 100644
--- a/Mage/src/mage/players/PlayerImpl.java
+++ b/Mage/src/mage/players/PlayerImpl.java
@@ -209,21 +209,20 @@ public abstract class PlayerImpl implements Player, Serializable {
protected Set playersUnderYourControl = new HashSet<>();
protected Set usersAllowedToSeeHandCards = new HashSet<>();
- protected boolean requestsAllowedToSeeHandCards = true;
protected List attachments = new ArrayList<>();
protected boolean topCardRevealed = false;
// 800.4i When a player leaves the game, any continuous effects with durations that last until that player's next turn
- // or until a specific point in that turn will last until that turn would have begun.
+ // or until a specific point in that turn will last until that turn would have begun.
// They neither expire immediately nor last indefinitely.
protected boolean reachedNextTurnAfterLeaving = false;
// indicates that the spell with the set sourceId can be cast with an alternate mana costs (can also be no mana costs)
protected UUID castSourceIdWithAlternateMana;
protected ManaCosts castSourceIdManaCosts;
-
+
// indicates that the player is in mana payment phase
protected boolean payManaMode = false;
@@ -369,7 +368,7 @@ public abstract class PlayerImpl implements Player, Serializable {
this.canPaySacrificeCost = player.canPaySacrificeCost();
this.loseByZeroOrLessLife = player.canLoseByZeroOrLessLife();
this.canPlayCardsFromGraveyard = player.canPlayCardsFromGraveyard();
- this.alternativeSourceCosts.addAll(player.getAlternativeSourceCosts());
+ this.alternativeSourceCosts.addAll(player.getAlternativeSourceCosts());
this.topCardRevealed = player.isTopCardRevealed();
this.playersUnderYourControl.clear();
@@ -444,7 +443,7 @@ public abstract class PlayerImpl implements Player, Serializable {
this.payManaMode = false;
this.setLife(game.getLife(), game);
this.setReachedNextTurnAfterLeaving(false);
-
+
this.castSourceIdWithAlternateMana = null;
this.castSourceIdManaCosts = null;
}
@@ -575,7 +574,7 @@ public abstract class PlayerImpl implements Player, Serializable {
/**
* returns true if the player has the control itself - false if the player is controlled by another player
- * @return
+ * @return
*/
@Override
public boolean isGameUnderControl() {
@@ -704,11 +703,14 @@ public abstract class PlayerImpl implements Player, Serializable {
if (random) {
for (int i = 0; i < amount; i++) {
Card card = this.getHand().getRandom(game);
- discardedCards.add(card);
- discard(card, source, game);
+ if(card != null) {
+ discardedCards.add(card);
+ discard(card, source, game);
+ }
}
} else {
- TargetDiscard target = new TargetDiscard(amount, amount, new FilterCard(CardUtil.numberToText(amount, "a") + " card" + (amount > 1 ? "s" : "")), playerId);
+ int possibleAmount = Math.min(getHand().size(), amount);
+ TargetDiscard target = new TargetDiscard(possibleAmount, possibleAmount, new FilterCard(CardUtil.numberToText(possibleAmount, "a") + " card" + (possibleAmount > 1 ? "s" : "")), playerId);
choose(Outcome.Discard, target, source == null ? null : source.getSourceId(), game);
for (UUID cardId : target.getTargets()) {
Card card = this.getHand().get(cardId, game);
@@ -802,7 +804,7 @@ public abstract class PlayerImpl implements Player, Serializable {
attachedToPlayer.removeAttachment(permanent, game);
}
}
-
+
}
if (permanent.getPairedCard() != null) {
Permanent pairedCard = game.getPermanent(permanent.getPairedCard());
@@ -876,7 +878,7 @@ public abstract class PlayerImpl implements Player, Serializable {
while (isInGame() && cards.size() > 1) {
this.choose(Outcome.Neutral, cards, target, game);
UUID targetObjectId = target.getFirstTarget();
- cards.remove(targetObjectId);
+ cards.remove(targetObjectId);
moveObjectToLibrary(targetObjectId, source.getSourceId(), game, true, false);
target.clearChosen();
}
@@ -917,7 +919,7 @@ public abstract class PlayerImpl implements Player, Serializable {
return castSourceIdManaCosts;
}
-
+
@Override
public boolean isInPayManaMode() {
return payManaMode;
@@ -947,7 +949,7 @@ public abstract class PlayerImpl implements Player, Serializable {
spellAbility.getManaCosts().add(alternateCosts.copy());
spellAbility.getManaCostsToPay().clear();
spellAbility.getManaCostsToPay().add(alternateCosts.copy());
- }
+ }
}
setCastSourceIdWithAlternateMana(null, null);
if (spell.activate(game, noMana)) {
@@ -987,7 +989,7 @@ public abstract class PlayerImpl implements Player, Serializable {
}
}
if (found) {
- SpellAbility spellAbility = new SpellAbility(null, "", game.getState().getZone(card.getId()), SpellAbilityType.LAND_ALTERNATE);
+ SpellAbility spellAbility = new SpellAbility(null, "", game.getState().getZone(card.getId()), SpellAbilityType.FACE_DOWN_CREATURE);
spellAbility.setControllerId(this.getId());
spellAbility.setSourceId(card.getId());
if (cast(spellAbility, game, false)) {
@@ -1528,7 +1530,7 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public String getLogName() {
- return GameLog.getColoredPlayerName(name);
+ return GameLog.getColoredPlayerName(name);
}
@Override
@@ -1669,11 +1671,11 @@ public abstract class PlayerImpl implements Player, Serializable {
sourceControllerId = ((Spell) source).getControllerId();
} else if (source instanceof Card) {
sourceAbilities = ((Card) source).getAbilities(game);
- sourceControllerId = ((Card) source).getOwnerId();
+ sourceControllerId = ((Card) source).getOwnerId();
} else if (source instanceof CommandObject){
sourceControllerId = ((CommandObject) source).getControllerId();
sourceAbilities = ((CommandObject) source).getAbilities();
- }
+ }
} else {
sourceAbilities = ((Permanent) source).getAbilities(game);
sourceControllerId = ((Permanent) source).getControllerId();
@@ -2426,7 +2428,7 @@ public abstract class PlayerImpl implements Player, Serializable {
if (game.getContinuousEffects().asThough(card.getId(), AsThoughEffectType.PLAY_FROM_NON_HAND_ZONE, this.getId(), game)) {
for (Ability ability : card.getAbilities()) {
if (ability.getZone().match(Zone.HAND)) {
- ability.setControllerId(this.getId()); // controller must be set for case owner != caster
+ ability.setControllerId(this.getId()); // controller must be set for case owner != caster
if (ability instanceof ActivatedAbility) {
if (((ActivatedAbility) ability).canActivate(playerId, game)) {
playable.add(ability);
@@ -2537,7 +2539,7 @@ public abstract class PlayerImpl implements Player, Serializable {
* @return
*/
private boolean shouldSkipGettingPlayable(Game game) {
- if (game.getStep() == null) { // happens at the start of the game
+ if (game.getStep() == null) { // happens at the start of the game
return true;
}
for (Entry phaseStep : silentPhaseSteps.entrySet()) {
@@ -2838,19 +2840,31 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public boolean moveCards(Cards cards, Zone fromZone, Zone toZone, Ability source, Game game) {
ArrayList cardList = new ArrayList<>();
- cardList.addAll(cards.getCards(game));
+ for (UUID cardId: cards) {
+ if (fromZone.equals(Zone.BATTLEFIELD)) {
+ Permanent permanent = game.getPermanent(cardId);
+ if (permanent != null) {
+ cardList.add(permanent);
+ }
+ } else {
+ Card card = game.getCard(cardId);
+ if (card != null) {
+ cardList.add(card);
+ }
+ }
+ }
return moveCards(cardList, fromZone, toZone, source, game);
}
-
+
@Override
public boolean moveCards(Card card, Zone fromZone, Zone toZone, Ability source, Game game) {
ArrayList cardList = new ArrayList<>();
if (card != null) {
cardList.add(card);
}
- return moveCards(cardList, fromZone, toZone, source, game);
+ return moveCards(cardList, fromZone, toZone, source, game);
}
-
+
@Override
public boolean moveCards(List cards, Zone fromZone, Zone toZone, Ability source, Game game) {
if (cards.isEmpty()) {
@@ -2858,13 +2872,13 @@ public abstract class PlayerImpl implements Player, Serializable {
}
game.fireEvent(new ZoneChangeGroupEvent(cards, source == null ? null : source.getSourceId(), this.getId(), fromZone, toZone));
switch(toZone) {
- case EXILED:
+ case EXILED:
boolean result = false;
for(Card card: cards) {
result |= moveCardToExileWithInfo(card, null, "", source == null ? null : source.getSourceId(), game, fromZone, true);
}
- return result;
- case GRAVEYARD:
+ return result;
+ case GRAVEYARD:
return moveCardsToGraveyardWithInfo(cards, source, game, fromZone);
case HAND:
result = false;
@@ -2874,9 +2888,9 @@ public abstract class PlayerImpl implements Player, Serializable {
return result;
default:
throw new UnsupportedOperationException("to Zone not supported yet");
- }
+ }
}
-
+
@Override
public boolean moveCardToHandWithInfo(Card card, UUID sourceId, Game game, Zone fromZone) {
return this.moveCardToHandWithInfo(card, sourceId, game, fromZone, true);
@@ -2898,7 +2912,7 @@ public abstract class PlayerImpl implements Player, Serializable {
default:
sb.append(fromZone != null ? new StringBuilder(" from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(" ") : "");
break;
- }
+ }
sb.append(card.getOwnerId().equals(this.getId()) ? "into his or her hand" : "into its owner's hand");
game.informPlayers(sb.toString());
}
@@ -2906,10 +2920,10 @@ public abstract class PlayerImpl implements Player, Serializable {
}
return result;
}
-
+
@Override
public boolean moveCardsToGraveyardWithInfo(List allCards, Ability source, Game game, Zone fromZone) {
- boolean result = true;
+ boolean result = true;
UUID sourceId = source == null ? null : source.getSourceId();
while (!allCards.isEmpty()) {
// identify cards from one owner
@@ -2934,19 +2948,21 @@ public abstract class PlayerImpl implements Player, Serializable {
if (choosingPlayer == null) {
continue;
}
- boolean chooseOrder = true;
- if (cards.size() > 2) {
- chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral, "Would you like to choose the order the cards go to graveyard?", game);
+ boolean chooseOrder = false;
+ if (userData.askMoveToGraveOrder()) {
+ if (cards.size() > 3) {
+ chooseOrder = choosingPlayer.chooseUse(Outcome.Neutral, "Would you like to choose the order the cards go to graveyard?", game);
+ }
}
if (chooseOrder) {
TargetCard target = new TargetCard(fromZone, new FilterCard("card to put on the top of your graveyard (last one chosen will be topmost)"));
target.setRequired(true);
while (choosingPlayer.isInGame() && cards.size() > 1) {
choosingPlayer.chooseTarget(Outcome.Neutral, cards, target, source, game);
- UUID targetObjectId = target.getFirstTarget();
+ UUID targetObjectId = target.getFirstTarget();
Card card = cards.get(targetObjectId, game);
- cards.remove(targetObjectId);
- if (card != null) {
+ cards.remove(targetObjectId);
+ if (card != null) {
result &= choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone);
}
target.clearChosen();
@@ -2959,11 +2975,11 @@ public abstract class PlayerImpl implements Player, Serializable {
result &= choosingPlayer.moveCardToGraveyardWithInfo(card, sourceId, game, fromZone);
}
}
- }
+ }
}
return result;
}
-
+
@Override
public boolean moveCardToGraveyardWithInfo(Card card, UUID sourceId, Game game, Zone fromZone) {
boolean result = false;
@@ -3045,7 +3061,7 @@ public abstract class PlayerImpl implements Player, Serializable {
public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped) {
return this.putOntoBattlefieldWithInfo(card, game, fromZone, sourceId, tapped, false);
}
-
+
@Override
public boolean putOntoBattlefieldWithInfo(Card card, Game game, Zone fromZone, UUID sourceId, boolean tapped, boolean facedown) {
boolean result = false;
@@ -3109,7 +3125,7 @@ public abstract class PlayerImpl implements Player, Serializable {
@Override
public boolean isRequestToShowHandCardsAllowed() {
- return userData.allowRequestShowHandCards();
+ return userData.isAllowRequestShowHandCards();
}
@Override
diff --git a/Mage/src/mage/players/net/UserData.java b/Mage/src/mage/players/net/UserData.java
index 72823bd53ea..101325ec660 100644
--- a/Mage/src/mage/players/net/UserData.java
+++ b/Mage/src/mage/players/net/UserData.java
@@ -16,10 +16,11 @@ public class UserData implements Serializable {
protected boolean confirmEmptyManaPool;
protected UserSkipPrioritySteps userSkipPrioritySteps;
protected String flagName;
+ protected boolean askMoveToGraveOrder;
public UserData(UserGroup userGroup, int avatarId, boolean showAbilityPickerForced,
boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps,
- String flagName) {
+ String flagName, boolean askMoveToGraveOrder) {
this.groupId = userGroup.getGroupId();
this.avatarId = avatarId;
this.showAbilityPickerForced = showAbilityPickerForced;
@@ -27,6 +28,7 @@ public class UserData implements Serializable {
this.userSkipPrioritySteps = userSkipPrioritySteps;
this.confirmEmptyManaPool = confirmEmptyManaPool;
this.flagName = flagName;
+ this.askMoveToGraveOrder = askMoveToGraveOrder;
}
public void setGroupId(int groupId) {
@@ -49,20 +51,16 @@ public class UserData implements Serializable {
return showAbilityPickerForced;
}
- public boolean isAllowRequestShowHandCards() {
- return allowRequestShowHandCards;
- }
-
public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
this.showAbilityPickerForced = showAbilityPickerForced;
}
- public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
- this.allowRequestShowHandCards = allowRequestShowHandCards;
+ public boolean isAllowRequestShowHandCards() {
+ return allowRequestShowHandCards;
}
- public boolean allowRequestShowHandCards() {
- return allowRequestShowHandCards;
+ public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
+ this.allowRequestShowHandCards = allowRequestShowHandCards;
}
public UserSkipPrioritySteps getUserSkipPrioritySteps() {
@@ -84,5 +82,13 @@ public class UserData implements Serializable {
public String getFlagName() {
return flagName;
}
+
+ public boolean askMoveToGraveOrder() {
+ return askMoveToGraveOrder;
+ }
+
+ public void setAskMoveToGraveOrder(boolean askMoveToGraveOrder) {
+ this.askMoveToGraveOrder = askMoveToGraveOrder;
+ }
}
diff --git a/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java b/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java
new file mode 100644
index 00000000000..b95a7a73142
--- /dev/null
+++ b/Mage/src/mage/watchers/common/AttackedThisCombatWatcher.java
@@ -0,0 +1,53 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.watchers.common;
+
+import java.util.HashSet;
+import java.util.Set;
+import mage.MageObjectReference;
+import mage.constants.WatcherScope;
+import mage.game.Game;
+import mage.game.events.GameEvent;
+import mage.watchers.Watcher;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class AttackedThisCombatWatcher extends Watcher {
+
+ public Set attackedThisTurnCreatures = new HashSet<>();
+
+ public AttackedThisCombatWatcher() {
+ super("AttackedThisCombat", WatcherScope.GAME);
+ }
+
+ public AttackedThisCombatWatcher(final AttackedThisCombatWatcher watcher) {
+ super(watcher);
+ this.attackedThisTurnCreatures.addAll(watcher.attackedThisTurnCreatures);
+ }
+
+ @Override
+ public void watch(GameEvent event, Game game) {
+ if (event.getType() == GameEvent.EventType.BEGIN_COMBAT_STEP_PRE) {
+ this.attackedThisTurnCreatures.clear();
+ }
+ if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
+ this.attackedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(),game));
+ }
+ }
+
+ public Set getAttackedThisTurnCreatures() {
+ return this.attackedThisTurnCreatures;
+ }
+
+ @Override
+ public AttackedThisCombatWatcher copy() {
+ return new AttackedThisCombatWatcher(this);
+ }
+
+}
diff --git a/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java b/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java
index be9dac03561..febd9d3eaa7 100644
--- a/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java
+++ b/Mage/src/mage/watchers/common/AttackedThisTurnWatcher.java
@@ -40,6 +40,7 @@ import mage.watchers.Watcher;
*/
public class AttackedThisTurnWatcher extends Watcher {
+ // TODO: use MageObjectReference instead of UUID
public Set attackedThisTurnCreatures = new HashSet<>();
public AttackedThisTurnWatcher() {
diff --git a/Mage/src/mage/watchers/common/DamageDoneWatcher.java b/Mage/src/mage/watchers/common/DamageDoneWatcher.java
new file mode 100644
index 00000000000..df94911ebc6
--- /dev/null
+++ b/Mage/src/mage/watchers/common/DamageDoneWatcher.java
@@ -0,0 +1,67 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package mage.watchers.common;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+import mage.MageObjectReference;
+import mage.constants.WatcherScope;
+import mage.game.Game;
+import mage.game.events.DamageEvent;
+import mage.game.events.GameEvent;
+import mage.watchers.Watcher;
+
+/**
+ *
+ * @author LevelX2
+ */
+
+public class DamageDoneWatcher extends Watcher {
+
+ // which object did how much damage during the turn
+ public Map damagingObjects = new HashMap<>();
+
+ public DamageDoneWatcher() {
+ super("DamageDone", WatcherScope.GAME);
+ }
+
+ public DamageDoneWatcher(final DamageDoneWatcher watcher) {
+ super(watcher);
+ this.damagingObjects.putAll(damagingObjects);
+ }
+
+ @Override
+ public DamageDoneWatcher copy() {
+ return new DamageDoneWatcher(this);
+ }
+
+ @Override
+ public void watch(GameEvent event, Game game) {
+ switch(event.getType()) {
+ case DAMAGED_CREATURE:
+ case DAMAGED_PLANESWALKER:
+ case DAMAGED_PLAYER:
+ {
+ MageObjectReference mor = new MageObjectReference(event.getSourceId(), game);
+ int count = damagingObjects.containsKey(mor) ? damagingObjects.get(mor) : 0;
+ damagingObjects.put(mor, count + event.getAmount());
+ }
+ }
+ }
+
+ @Override
+ public void reset() {
+ super.reset();
+ damagingObjects.clear();
+ }
+
+ public int damageDone(UUID objectId, int zoneChangeCounter, Game game) {
+ MageObjectReference mor = new MageObjectReference(objectId, zoneChangeCounter, game);
+ return damagingObjects.containsKey(mor) ? damagingObjects.get(mor) : 0;
+ }
+
+}
diff --git a/Utils/extract_in_wiki_format.pl b/Utils/extract_in_wiki_format.pl
old mode 100644
new mode 100755
diff --git a/Utils/gen-existing-cards-by-set.pl b/Utils/gen-existing-cards-by-set.pl
old mode 100644
new mode 100755
diff --git a/Utils/gen-list-implemented-cards-for-set.pl b/Utils/gen-list-implemented-cards-for-set.pl
old mode 100644
new mode 100755
diff --git a/Utils/gen-list-unimplemented-cards-for-set.pl b/Utils/gen-list-unimplemented-cards-for-set.pl
old mode 100644
new mode 100755
diff --git a/Utils/gen-simple-cards-by-set.pl b/Utils/gen-simple-cards-by-set.pl
old mode 100644
new mode 100755
diff --git a/Utils/keywords.txt b/Utils/keywords.txt
index 7c0e7fe9236..57945d8a0fa 100644
--- a/Utils/keywords.txt
+++ b/Utils/keywords.txt
@@ -37,6 +37,7 @@ Islandwalk|new|
Level up|cost|
Lifelink|instance|
Living weapon|new|
+Menace|new|
Miracle|cost|
Mountaincycling|cost|
Mountainwalk|new|
diff --git a/Utils/mtg-cards-data.txt b/Utils/mtg-cards-data.txt
index d5fe33b6dd9..00a8867a887 100644
--- a/Utils/mtg-cards-data.txt
+++ b/Utils/mtg-cards-data.txt
@@ -25522,71 +25522,71 @@ Garruk, Apex Predator|Media Inserts|104|Special|{5}{B}{G}|Planeswalker - Garruk|
Shamanic Revelation|Media Inserts|105|Special|{2}{G}{G}|Sorcery|||Draw a card for each creature you control.$Ferocious - You gain 4 life for each creature you control with power 4 or greater.|
Ojutai's Command|Media Inserts|106|Special|{2}{W}{U}|Instant|||Choose two - Return target creature card with converted mana cost 2 or less from your graveyard to the battlefield; or You gain 4 life; or Counter target creature spell; or Draw a card.|
Sultai|Media Inserts|999|Special|{{U}{B}{G}|Legendary Creature - Placeholder|2|2||
-Wood Elves|WPN Gateway|1|Special|{2}{G}|Creature — Elf Scout|1|1|When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.|
-Icatian Javelineers|WPN Gateway|2|Special|{W}|Creature — Human Soldier|1|1|Icatian Javelineers enters the battlefield with a javelin counter on it.${T}, Remove a javelin counter from Icatian Javelineers: Icatian Javelineers deals 1 damage to target creature or player.|
+Wood Elves|WPN Gateway|1|Special|{2}{G}|Creature — Elf Scout|1|1|When Wood Elves enters the battlefield, search your library for a Forest card and put that card onto the battlefield. Then shuffle your library.|
+Icatian Javelineers|WPN Gateway|2|Special|{W}|Creature — Human Soldier|1|1|Icatian Javelineers enters the battlefield with a javelin counter on it.${T}, Remove a javelin counter from Icatian Javelineers: Icatian Javelineers deals 1 damage to target creature or player.|
Fiery Temper|WPN Gateway|3|Special|{1}{R}{R}|Instant|||Fiery Temper deals 3 damage to target creature or player.$Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)|
Boomerang|WPN Gateway|4|Special|{U}{U}|Instant|||Return target permanent to its owner's hand.|
-Calciderm|WPN Gateway|5|Special|{2}{W}{W}|Creature — Beast|5|5|Shroud (This creature can't be the target of spells or abilities.)$Vanishing 4 (This permanent enters the battlefield with four time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)|
-Reckless Wurm|WPN Gateway|6|Special|{3}{R}{R}|Creature — Wurm|4|4|Trample$Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)|
-Yixlid Jailer|WPN Gateway|7|Special|{1}{B}|Creature — Zombie Wizard|2|1|Cards in graveyards lose all abilities.|
+Calciderm|WPN Gateway|5|Special|{2}{W}{W}|Creature — Beast|5|5|Shroud (This creature can't be the target of spells or abilities.)$Vanishing 4 (This permanent enters the battlefield with four time counters on it. At the beginning of your upkeep, remove a time counter from it. When the last is removed, sacrifice it.)|
+Reckless Wurm|WPN Gateway|6|Special|{3}{R}{R}|Creature — Wurm|4|4|Trample$Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)|
+Yixlid Jailer|WPN Gateway|7|Special|{1}{B}|Creature — Zombie Wizard|2|1|Cards in graveyards lose all abilities.|
Zoetic Cavern|WPN Gateway|8|Special||Land|||{T}: Add {1} to your mana pool.$Morph {2} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)|
-Llanowar Elves|WPN Gateway|9|Special|{G}|Creature — Elf Druid|1|1|{T}: Add {G} to your mana pool.|
-Mogg Fanatic|WPN Gateway|10|Special|{R}|Creature — Goblin|1|1|Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player.|
+Llanowar Elves|WPN Gateway|9|Special|{G}|Creature — Elf Druid|1|1|{T}: Add {G} to your mana pool.|
+Mogg Fanatic|WPN Gateway|10|Special|{R}|Creature — Goblin|1|1|Sacrifice Mogg Fanatic: Mogg Fanatic deals 1 damage to target creature or player.|
Mind Stone|WPN Gateway|11|Special|{2}|Artifact|||{T}: Add {1} to your mana pool.${1}, {T}, Sacrifice Mind Stone: Draw a card.|
-Dauntless Dourbark|WPN Gateway|12|Special|{3}{G}|Creature — Treefolk Warrior|*|*|Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control.$Dauntless Dourbark has trample as long as you control another Treefolk.|
+Dauntless Dourbark|WPN Gateway|12|Special|{3}{G}|Creature — Treefolk Warrior|*|*|Dauntless Dourbark's power and toughness are each equal to the number of Forests you control plus the number of Treefolk you control.$Dauntless Dourbark has trample as long as you control another Treefolk.|
Lava Axe|WPN Gateway|13|Special|{4}{R}|Sorcery|||Lava Axe deals 5 damage to target player.|
-Cenn's Tactician|WPN Gateway|14|Special|{W}|Creature — Kithkin Soldier|1|1|{W}, {T}: Put a +1/+1 counter on target Soldier creature.$Each creature you control with a +1/+1 counter on it can block an additional creature.|
-Oona's Blackguard|WPN Gateway|15|Special|{1}{B}|Creature — Faerie Rogue|1|1|Flying$Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it.$Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card.|
-Gravedigger|WPN Gateway|16|Special|{3}{B}|Creature — Zombie|2|2|When Gravedigger enters the battlefield, you may return target creature card from your graveyard to your hand.|
-Boggart Ram-Gang|WPN Gateway|17|Special|{RG}{RG}{RG}|Creature — Goblin Warrior|3|3|Haste$Wither (This deals damage to creatures in the form of -1/-1 counters.)|
-Wilt-Leaf Cavaliers|WPN Gateway|18|Special|{GW}{GW}{GW}|Creature — Elf Knight|3|4|Vigilance|
-Duergar Hedge-Mage|WPN Gateway|19|Special|{2}{RW}|Creature — Dwarf Shaman|2|2|When Duergar Hedge-Mage enters the battlefield, if you control two or more Mountains, you may destroy target artifact.$When Duergar Hedge-Mage enters the battlefield, if you control two or more Plains, you may destroy target enchantment.|
-Selkie Hedge-Mage|WPN Gateway|20|Special|{2}{GU}|Creature — Merfolk Wizard|2|2|When Selkie Hedge-Mage enters the battlefield, if you control two or more Forests, you may gain 3 life.$When Selkie Hedge-Mage enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand.|
-Sprouting Thrinax|WPN Gateway|21|Special|{B}{R}{G}|Creature — Lizard|3|3|When Sprouting Thrinax dies, put three 1/1 green Saproling creature tokens onto the battlefield.|
-Woolly Thoctar|WPN Gateway|22|Special|{W}{R}{G}|Creature — Beast|5|4||
+Cenn's Tactician|WPN Gateway|14|Special|{W}|Creature — Kithkin Soldier|1|1|{W}, {T}: Put a +1/+1 counter on target Soldier creature.$Each creature you control with a +1/+1 counter on it can block an additional creature.|
+Oona's Blackguard|WPN Gateway|15|Special|{1}{B}|Creature — Faerie Rogue|1|1|Flying$Each other Rogue creature you control enters the battlefield with an additional +1/+1 counter on it.$Whenever a creature you control with a +1/+1 counter on it deals combat damage to a player, that player discards a card.|
+Gravedigger|WPN Gateway|16|Special|{3}{B}|Creature — Zombie|2|2|When Gravedigger enters the battlefield, you may return target creature card from your graveyard to your hand.|
+Boggart Ram-Gang|WPN Gateway|17|Special|{RG}{RG}{RG}|Creature — Goblin Warrior|3|3|Haste$Wither (This deals damage to creatures in the form of -1/-1 counters.)|
+Wilt-Leaf Cavaliers|WPN Gateway|18|Special|{GW}{GW}{GW}|Creature — Elf Knight|3|4|Vigilance|
+Duergar Hedge-Mage|WPN Gateway|19|Special|{2}{RW}|Creature — Dwarf Shaman|2|2|When Duergar Hedge-Mage enters the battlefield, if you control two or more Mountains, you may destroy target artifact.$When Duergar Hedge-Mage enters the battlefield, if you control two or more Plains, you may destroy target enchantment.|
+Selkie Hedge-Mage|WPN Gateway|20|Special|{2}{GU}|Creature — Merfolk Wizard|2|2|When Selkie Hedge-Mage enters the battlefield, if you control two or more Forests, you may gain 3 life.$When Selkie Hedge-Mage enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand.|
+Sprouting Thrinax|WPN Gateway|21|Special|{B}{R}{G}|Creature — Lizard|3|3|When Sprouting Thrinax dies, put three 1/1 green Saproling creature tokens onto the battlefield.|
+Woolly Thoctar|WPN Gateway|22|Special|{W}{R}{G}|Creature — Beast|5|4||
Path to Exile|WPN Gateway|24|Special|{W}|Instant|||Exile target creature. Its controller may search his or her library for a basic land card, put that card onto the battlefield tapped, then shuffle his or her library.|
-Hellspark Elemental|WPN Gateway|25|Special|{1}{R}|Creature — Elemental|3|1|Trample, haste$At the beginning of the end step, sacrifice Hellspark Elemental.$Unearth {1}{R} ({1}{R}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)|
-Marisi's Twinclaws|WPN Gateway|26|Special|{2}{RW}{G}|Creature — Cat Warrior|2|4|Double strike|
+Hellspark Elemental|WPN Gateway|25|Special|{1}{R}|Creature — Elemental|3|1|Trample, haste$At the beginning of the end step, sacrifice Hellspark Elemental.$Unearth {1}{R} ({1}{R}: Return this card from your graveyard to the battlefield. It gains haste. Exile it at the beginning of the next end step or if it would leave the battlefield. Unearth only as a sorcery.)|
+Marisi's Twinclaws|WPN Gateway|26|Special|{2}{RW}{G}|Creature — Cat Warrior|2|4|Double strike|
Slave of Bolas|WPN Gateway|27|Special|{3}{UR}{B}|Sorcery|||Gain control of target creature. Untap that creature. It gains haste until end of turn. Sacrifice it at the beginning of the next end step.|
-Mycoid Shepherd|WPN Gateway|28|Special|{1}{W}{G}{G}|Creature — Fungus|5|4|Whenever Mycoid Shepherd or another creature you control with power 5 or greater dies, you may gain 5 life.|
-Naya Sojourners|WPN Gateway|29|Special|{2}{W}{R}{G}|Creature — Elf Shaman|5|3|When you cycle Naya Sojourners or it dies, you may put a +1/+1 counter on target creature.$Cycling {2}{G} ({2}{G}, Discard this card: Draw a card.)|
-Mind Control|WPN Gateway|30|Special|{3}{U}{U}|Enchantment — Aura|||Enchant creature$You control enchanted creature.|
+Mycoid Shepherd|WPN Gateway|28|Special|{1}{W}{G}{G}|Creature — Fungus|5|4|Whenever Mycoid Shepherd or another creature you control with power 5 or greater dies, you may gain 5 life.|
+Naya Sojourners|WPN Gateway|29|Special|{2}{W}{R}{G}|Creature — Elf Shaman|5|3|When you cycle Naya Sojourners or it dies, you may put a +1/+1 counter on target creature.$Cycling {2}{G} ({2}{G}, Discard this card: Draw a card.)|
+Mind Control|WPN Gateway|30|Special|{3}{U}{U}|Enchantment — Aura|||Enchant creature$You control enchanted creature.|
Rise from the Grave|WPN Gateway|31|Special|{4}{B}|Sorcery|||Put target creature card from a graveyard onto the battlefield under your control. That creature is a black Zombie in addition to its other colors and types.|
-Kor Duelist|WPN Gateway|32|Special|{W}|Creature — Kor Soldier|1|1|As long as Kor Duelist is equipped, it has double strike. (It deals both first-strike and regular combat damage.)|
-Vampire Nighthawk|WPN Gateway|33|Special|{1}{B}{B}|Creature — Vampire Shaman|2|3|Flying$Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$Lifelink (Damage dealt by this creature also causes you to gain that much life.)|
-Nissa's Chosen|WPN Gateway|34|Special|{G}{G}|Creature — Elf Warrior|2|3|If Nissa's Chosen would die, put it on the bottom of its owner's library instead.|
-Emeria Angel|WPN Gateway|35|Special|{2}{W}{W}|Creature — Angel|3|3|Flying$Landfall — Whenever a land enters the battlefield under your control, you may put a 1/1 white Bird creature token with flying onto the battlefield.|
-Kor Firewalker|WPN Gateway|36|Special|{W}{W}|Creature — Kor Soldier|2|2|Protection from red$Whenever a player casts a red spell, you may gain 1 life.|
-Leatherback Baloth|WPN Gateway|37|Special|{G}{G}{G}|Creature — Beast|4|5||
-Hada Freeblade|WPN Gateway|38|Special|{W}|Creature — Human Soldier Ally|0|1|Whenever Hada Freeblade or another Ally enters the battlefield under your control, you may put a +1/+1 counter on Hada Freeblade.|
-Kalastria Highborn|WPN Gateway|39|Special|{B}{B}|Creature — Vampire Shaman|2|2|Whenever Kalastria Highborn or another Vampire you control dies, you may pay {B}. If you do, target player loses 2 life and you gain 2 life.|
+Kor Duelist|WPN Gateway|32|Special|{W}|Creature — Kor Soldier|1|1|As long as Kor Duelist is equipped, it has double strike. (It deals both first-strike and regular combat damage.)|
+Vampire Nighthawk|WPN Gateway|33|Special|{1}{B}{B}|Creature — Vampire Shaman|2|3|Flying$Deathtouch (Any amount of damage this deals to a creature is enough to destroy it.)$Lifelink (Damage dealt by this creature also causes you to gain that much life.)|
+Nissa's Chosen|WPN Gateway|34|Special|{G}{G}|Creature — Elf Warrior|2|3|If Nissa's Chosen would die, put it on the bottom of its owner's library instead.|
+Emeria Angel|WPN Gateway|35|Special|{2}{W}{W}|Creature — Angel|3|3|Flying$Landfall — Whenever a land enters the battlefield under your control, you may put a 1/1 white Bird creature token with flying onto the battlefield.|
+Kor Firewalker|WPN Gateway|36|Special|{W}{W}|Creature — Kor Soldier|2|2|Protection from red$Whenever a player casts a red spell, you may gain 1 life.|
+Leatherback Baloth|WPN Gateway|37|Special|{G}{G}{G}|Creature — Beast|4|5||
+Hada Freeblade|WPN Gateway|38|Special|{W}|Creature — Human Soldier Ally|0|1|Whenever Hada Freeblade or another Ally enters the battlefield under your control, you may put a +1/+1 counter on Hada Freeblade.|
+Kalastria Highborn|WPN Gateway|39|Special|{B}{B}|Creature — Vampire Shaman|2|2|Whenever Kalastria Highborn or another Vampire you control dies, you may pay {B}. If you do, target player loses 2 life and you gain 2 life.|
Syphon Mind|WPN Gateway|40|Special|{3}{B}|Sorcery|||Each other player discards a card. You draw a card for each card discarded this way.|
-Pathrazer of Ulamog|WPN Gateway|46|Special|{11}|Creature — Eldrazi|9|9|Annihilator 3 (Whenever this creature attacks, defending player sacrifices three permanents.)$Pathrazer of Ulamog can't be blocked except by three or more creatures.|
+Pathrazer of Ulamog|WPN Gateway|46|Special|{11}|Creature — Eldrazi|9|9|Annihilator 3 (Whenever this creature attacks, defending player sacrifices three permanents.)$Pathrazer of Ulamog can't be blocked except by three or more creatures.|
Curse of Wizardry|WPN Gateway|47|Special|{2}{B}{B}|Enchantment|||As Curse of Wizardry enters the battlefield, choose a color.$Whenever a player casts a spell of the chosen color, that player loses 1 life.|
Staggershock|WPN Gateway|48|Special|{2}{R}|Instant|||Staggershock deals 2 damage to target creature or player.$Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)|
-Deathless Angel|WPN Gateway|49|Special|{4}{W}{W}|Creature — Angel|5|7|Flying${W}{W}: Target creature gains indestructible until end of turn.|
+Deathless Angel|WPN Gateway|49|Special|{4}{W}{W}|Creature — Angel|5|7|Flying${W}{W}: Target creature gains indestructible until end of turn.|
Fling|WPN Gateway|50|Special|{1}{R}|Instant|||As an additional cost to cast Fling, sacrifice a creature.$Fling deals damage equal to the sacrificed creature's power to target creature or player.|
-Sylvan Ranger|WPN Gateway|51|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.|
-Plague Stinger|WPN Gateway|59|Special|{1}{B}|Creature — Insect Horror|1|1|Flying$Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)|
+Sylvan Ranger|WPN Gateway|51|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.|
+Plague Stinger|WPN Gateway|59|Special|{1}{B}|Creature — Insect Horror|1|1|Flying$Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)|
Golem's Heart|WPN Gateway|60|Special|{2}|Artifact|||Whenever a player casts an artifact spell, you may gain 1 life.|
-Skinrender|WPN Gateway|63|Special|{2}{B}{B}|Creature — Zombie|3|3|When Skinrender enters the battlefield, put three -1/-1 counters on target creature.|
+Skinrender|WPN Gateway|63|Special|{2}{B}{B}|Creature — Zombie|3|3|When Skinrender enters the battlefield, put three -1/-1 counters on target creature.|
Master's Call|WPN Gateway|64|Special|{2}{W}|Instant|||Put two 1/1 colorless Myr artifact creature tokens onto the battlefield.|
-Plague Myr|WPN Gateway|65|Special|{2}|Artifact Creature — Myr|1|1|Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)${T}: Add {1} to your mana pool.|
-Signal Pest|WPN Gateway|66|Special|{1}|Artifact Creature — Pest|0|1|Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)$Signal Pest can't be blocked except by creatures with flying or reach.|
+Plague Myr|WPN Gateway|65|Special|{2}|Artifact Creature — Myr|1|1|Infect (This creature deals damage to creatures in the form of -1/-1 counters and to players in the form of poison counters.)${T}: Add {1} to your mana pool.|
+Signal Pest|WPN Gateway|66|Special|{1}|Artifact Creature — Pest|0|1|Battle cry (Whenever this creature attacks, each other attacking creature gets +1/+0 until end of turn.)$Signal Pest can't be blocked except by creatures with flying or reach.|
Fling|WPN Gateway|69|Special|{1}{R}|Instant|||As an additional cost to cast Fling, sacrifice a creature.$Fling deals damage equal to the sacrificed creature's power to target creature or player.|
-Sylvan Ranger|WPN Gateway|70|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.|
-Vault Skirge|WPN Gateway|71|Special|{1}{BP}|Artifact Creature — Imp|1|1|({BP} can be paid with either {B} or 2 life.)$Flying$Lifelink (Damage dealt by this creature also causes you to gain that much life.)|
-Maul Splicer|WPN Gateway|72|Special|{6}{G}|Creature — Human Artificer|1|1|When Maul Splicer enters the battlefield, put two 3/3 colorless Golem artifact creature tokens onto the battlefield.$Golem creatures you control have trample.|
+Sylvan Ranger|WPN Gateway|70|Special|{1}{G}|Creature — Elf Scout|1|1|When Sylvan Ranger enters the battlefield, you may search your library for a basic land card, reveal it, put it into your hand, then shuffle your library.|
+Vault Skirge|WPN Gateway|71|Special|{1}{BP}|Artifact Creature — Imp|1|1|({BP} can be paid with either {B} or 2 life.)$Flying$Lifelink (Damage dealt by this creature also causes you to gain that much life.)|
+Maul Splicer|WPN Gateway|72|Special|{6}{G}|Creature — Human Artificer|1|1|When Maul Splicer enters the battlefield, put two 3/3 colorless Golem artifact creature tokens onto the battlefield.$Golem creatures you control have trample.|
Shrine of Burning Rage|WPN Gateway|73|Special|{2}|Artifact|||At the beginning of your upkeep or whenever you cast a red spell, put a charge counter on Shrine of Burning Rage.${3}, {T}, Sacrifice Shrine of Burning Rage: Shrine of Burning Rage deals damage equal to the number of charge counters on it to target creature or player.|
-Tormented Soul|WPN Gateway|76|Special|{B}|Creature — Spirit|1|1|Tormented Soul can't block and can't be blocked.|
-Auramancer|WPN Gateway|77|Special|{2}{W}|Creature — Human Wizard|2|2|When Auramancer enters the battlefield, you may return target enchantment card from your graveyard to your hand.|
+Tormented Soul|WPN Gateway|76|Special|{B}|Creature — Spirit|1|1|Tormented Soul can't block and can't be blocked.|
+Auramancer|WPN Gateway|77|Special|{2}{W}|Creature — Human Wizard|2|2|When Auramancer enters the battlefield, you may return target enchantment card from your graveyard to your hand.|
Circle of Flame|WPN Gateway|78|Special|{1}{R}|Enchantment|||Whenever a creature without flying attacks you or a planeswalker you control, Circle of Flame deals 1 damage to that creature.|
-Gather the Townsfolk|WPN Gateway|79|Special|{1}{W}|Sorcery|||Put two 1/1 white Human creature tokens onto the battlefield.$Fateful hour — If you have 5 or less life, put five of those tokens onto the battlefield instead.|
-Curse of the Bloody Tome|WPN Gateway|80|Special|{2}{U}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard.|
-Curse of Thirst|WPN Gateway|81|Special|{4}{B}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her.|
-Nearheath Stalker|WPN Gateway|82|Special|{4}{R}|Creature — Vampire Rogue|4|1|Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)|
-Bloodcrazed Neonate|WPN Gateway|83|Special|{1}{R}|Creature — Vampire|2|1|Bloodcrazed Neonate attacks each turn if able.$Whenever Bloodcrazed Neonate deals combat damage to a player, put a +1/+1 counter on it.|
-Boneyard Wurm|WPN Gateway|84|Special|{1}{G}|Creature — Wurm|*|*|Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard.|
+Gather the Townsfolk|WPN Gateway|79|Special|{1}{W}|Sorcery|||Put two 1/1 white Human creature tokens onto the battlefield.$Fateful hour — If you have 5 or less life, put five of those tokens onto the battlefield instead.|
+Curse of the Bloody Tome|WPN Gateway|80|Special|{2}{U}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, that player puts the top two cards of his or her library into his or her graveyard.|
+Curse of Thirst|WPN Gateway|81|Special|{4}{B}|Enchantment — Aura Curse|||Enchant player$At the beginning of enchanted player's upkeep, Curse of Thirst deals damage to that player equal to the number of Curses attached to him or her.|
+Nearheath Stalker|WPN Gateway|82|Special|{4}{R}|Creature — Vampire Rogue|4|1|Undying (When this creature dies, if it had no +1/+1 counters on it, return it to the battlefield under its owner's control with a +1/+1 counter on it.)|
+Bloodcrazed Neonate|WPN Gateway|83|Special|{1}{R}|Creature — Vampire|2|1|Bloodcrazed Neonate attacks each turn if able.$Whenever Bloodcrazed Neonate deals combat damage to a player, put a +1/+1 counter on it.|
+Boneyard Wurm|WPN Gateway|84|Special|{1}{G}|Creature — Wurm|*|*|Boneyard Wurm's power and toughness are each equal to the number of creature cards in your graveyard.|
Dirtcowl Wurm|Prerelease Events|1|Special|{4}{G}|Creature - Wurm|3|4|Whenever an opponent plays a land, put a +1/+1 counter on Dirtcowl Wurm.|
Revenant|Prerelease Events|2|Special|{4}{B}|Creature - Spirit|*|*|Flying$Revenant's power and toughness are each equal to the number of creature cards in your graveyard.|
Monstrous Hount|Prerelease Events|3|Special|{3}{R}|Creature - Hound|4|4|Monstrous Hound can't attack unless you control more lands than defending player.$Monstrous Hound can't block unless you control more lands than attacking player.|
@@ -25601,7 +25601,7 @@ Avatar of Hope|Prerelease Events|11|Special|{6}{W}{W}|Creature - Avatar|4|9|If y
Raging Kavu|Prerelease Events|12|Special|{4}{1}{R}{G}|Creature - Kavu|3|1|Flash$Haste|
Questing Phelddagrif|Prerelease Events|13|Special|{1}{W}{U}{G}|Creature - Phelddagrif|4|4|{G}: Questing Phelddagrif gets +1/+1 until end of turn. Target opponent puts a 1/1 green Hippo creature token onto the battlefield.${W}: Questing Phelddagrif gains protection from black and from red until end of turn. Target opponent gains 2 life.${U}: Questing Phelddagrif gains flying until end of turn. Target opponent may draw a card.|
Fungal Shambler|Prerelease Events|14|Special|{4}{U}{B}{G}|Creature - Fungus Beast|6|4|Trample$Whenever Fungal Shambler deals damage to an opponent, you draw a card and that opponent discards a card.|
-Stone-Tongue Baselisk|Prerelease Events|15|Special|{4}{G}{G}{G}|Creature - Basilisk|4|5|Whenever Stone-Tongue Basilisk deals combat damage to a creature, destroy that creature at end of combat.$Threshold — As long as seven or more cards are in your graveyard, all creatures able to block Stone-Tongue Basilisk do so.|
+Stone-Tongue Baselisk|Prerelease Events|15|Special|{4}{G}{G}{G}|Creature - Basilisk|4|5|Whenever Stone-Tongue Basilisk deals combat damage to a creature, destroy that creature at end of combat.$Threshold — As long as seven or more cards are in your graveyard, all creatures able to block Stone-Tongue Basilisk do so.|
Laquatus's Champion|Prerelease Events|16|Special|{4}{B}{B}|Creature - Nightmare Horror|6|3|When Laquatus's Champion enters the battlefield, target player loses 6 life.$When Laquatus's Champion leaves the battlefield, that player gains 6 life.${B}: Regenerate Laquatus's Champion.|
Glory|Prerelease Events|17|Special|{{3}{W}{W}|Creature - Incarnation|3|3|Flying${2}{W}: Choose a color. Creatures you control gain protection from the chosen color until end of turn. Activate this ability only if Glory is in your graveyard.|
Silent Specter|Prerelease Events|18|Special|{4}{B}{B}|Creature - Specter|4|4|Flying$Whenever Silent Specter deals combat damage to a player, that player discards two cards.$Morph {3}{B}{B} (You may cast this card face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.)|
@@ -25617,9 +25617,9 @@ Gleancrawler|Prerelease Events|27|Special|{3}{BG}{BG}{BG}|Creature - Insect Horr
Djinn Illuminatus|Prerelease Events|28|Special|{5}{UR}{UR}|Creature - Djinn|3|5|({U/R} can be paid with either {U} or {R}.)$Flying$Each instant and sorcery spell you cast has replicate. The replicate cost is equal to its mana cost. (When you cast it, copy it for each time you paid its replicate cost. You may choose new targets for the copies.)|
Avatar of Discord|Prerelease Events|29|Special|{BR}{BR}{BR}|Creature - Avatar|5|3|({B/R} can be paid with either {B} or {R}.)$Flying$When Avatar of Discord enters the battlefield, sacrifice it unless you discard two cards.|
Allosaurus Rider|Prerelease Events|30|Special|{5}{G}{G}|Creature - Elf Warrior|1+*|1+*|You may exile two green cards from your hand rather than pay Allosaurus Rider's mana cost.$Allosaurus Rider's power and toughness are each equal to 1 plus the number of lands you control.|
-Lotus Bloom|Prerelease Events|31|Special||Artifact|||Suspend 3�{0} (Rather than cast this card from your hand, pay {0} and exile it with three time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost.)${T}, Sacrifice Lotus Bloom: Add three mana of any one color to your mana pool.
+Lotus Bloom|Prerelease Events|31|Special||Artifact|||Suspend 3�{0} (Rather than cast this card from your hand, pay {0} and exile it with three time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost.)${T}, Sacrifice Lotus Bloom: Add three mana of any one color to your mana pool.
Oros, the Avenger|Prerelease Events|32|Special|{3}{W}{B}{R}|Legendary Creature - Dragon|6|6|Flying$Whenever Oros, the Avenger deals combat damage to a player, you may pay {2}{W}. If you do, Oros deals 3 damage to each nonwhite creature.|
-Korlash, Heir to Blackblade|Prerelease Events|33|Special|{2}{B}{B}|Legendary Creature - Zombie Warrior|*|*|Korlash, Heir to Blackblade's power and toughness are each equal to the number of Swamps you control.${1}{B}: Regenerate Korlash.$Grandeur — Discard another card named Korlash, Heir to Blackblade: Search your library for up to two Swamp cards, put them onto the battlefield tapped, then shuffle your library.|
+Korlash, Heir to Blackblade|Prerelease Events|33|Special|{2}{B}{B}|Legendary Creature - Zombie Warrior|*|*|Korlash, Heir to Blackblade's power and toughness are each equal to the number of Swamps you control.${1}{B}: Regenerate Korlash.$Grandeur — Discard another card named Korlash, Heir to Blackblade: Search your library for up to two Swamp cards, put them onto the battlefield tapped, then shuffle your library.|
Wren's Run Packmaster|Prerelease Events|34|Special|{3}{G}|Creature - Elf Warrior|5|5|Champion an Elf (When this creature enters the battlefield, sacrifice it unless you exile another Elf you control. When this creature leaves the battlefield, that card returns to the battlefield.)${2}{G}: Put a 2/2 green Wolf creature token onto the battlefield.$Wolves you control have deathtouch.|
Door of Destinies|Prerelease Events|35|Special|{4}|Artifact|||As Door of Destinies enters the battlefield, choose a creature type.$Whenever you cast a spell of the chosen type, put a charge counter on Door of Destinies.$Creatures you control of the chosen type get +1/+1 for each charge counter on Door of Destinies.|
Demigod of Revenge|Prerelease Events|36|Special|{BR}{BR}{BR}{BR}{BR}|Creature - Spirit Avatar|5|4|Flying$Haste$When you cast Demigod of Revenge, return all cards named Demigod of Revenge from your graveyard to the battlefield.|
@@ -25628,7 +25628,7 @@ Ajani Vengeant|Prerelease Events|38|Special|{2}{W}{R}|Planeswalker - Ajani|||+1:
Malfegor|Prerelease Events|39|Special|{2}{B}{B}{R}{R}|Legendary Creature - Demon Dragon|6|6|Flying$When Malfegor enters the battlefield, discard your hand. Each opponent sacrifices a creature for each card discarded this way.|
Dragon Broodmother|Prerelease Events|40|Special|{2}{R}{R}{R}{G}|Creature - Dragon|4|4|Flying$At the beginning of each upkeep, put a 1/1 red and green Dragon creature token with flying and devour 2 onto the battlefield. (As the token enters the battlefield, you may sacrifice any number of creatures. It enters the battlefield with twice that many +1/+1 counters on it.)|
Vampire Nocturnus|Prerelease Events|41|Special|{1}{B}{B}{B}|Creature - Vampire|3|3|Play with the top card of your library revealed.$As long as the top card of your library is black, Vampire Nocturnus and other Vampire creatures you control get +2/+1 and have flying.|
-Rampaging Baloths|Prerelease Events|42|Special|{4}{G}{G}|Creature - Beast|6|6|Trample$Landfall — Whenever a land enters the battlefield under your control, you may put a 4/4 green Beast creature token onto the battlefield.|
+Rampaging Baloths|Prerelease Events|42|Special|{4}{G}{G}|Creature - Beast|6|6|Trample$Landfall — Whenever a land enters the battlefield under your control, you may put a 4/4 green Beast creature token onto the battlefield.|
Comet Storm|Prerelease Events|43|Special|{X}{R}{R}|Instant|||Multikicker {1} (You may pay an additional {1} any number of times as you cast this spell.)$Choose target creature or player, then choose another target creature or player for each time Comet Storm was kicked. Comet Storm deals X damage to each of them.|
Emrakul, the Aeons Torn|Prerelease Events|44|Special|{15}|Legendary Creature - Eldrazi|15|15|Emrakul, the Aeons Torn can't be countered.$When you cast Emrakul, take an extra turn after this one.$Flying, protection from colored spells, annihilator 6$When Emrakul is put into a graveyard from anywhere, its owner shuffles his or her graveyard into his or her library.|
Sun Titan|Prerelease Events|45|Special|{4}{W}{W}|Creature - Giant|6|6|Vigilance$Whenever Sun Titan enters the battlefield or attacks, you may return target permanent card with converted mana cost 3 or less from your graveyard to the battlefield.|
@@ -25651,7 +25651,7 @@ Grove of the Guardian|Prerelease Events|59|Special||Land|||{T}: Add {1} to your
Consuming Aberration|Prerelease Events|60|Special|{3}{U}{B}|Creature - Horror|*|*|Consuming Aberration's power and toughness are each equal to the number of cards in your opponents' graveyards.$Whenever you cast a spell, each opponent reveals cards from the top of his or her library until he or she reveals a land card, then puts those cards into his or her graveyard.|
Fathom Mage|Prerelease Events|61|Special|{2}{U}{G}|Creature - Human Wizard|1|1|Evolve (Whenever a creature enters the battlefield under your control, if that creature has greater power or toughness than this creature, put a +1/+1 counter on this creature.)$Whenever a +1/+1 counter is placed on Fathom Mage, you may draw a card.|
Foundry Champion|Prerelease Events|62|Special|{4}{W}{R}|Creature - Elemental Soldier|4|4When Foundry Champion enters the battlefield, it deals damage to target creature or player equal to the number of creatures you control.${R}: Foundry Champion gets +1/+0 until end of turn.${W}: Foundry Champion gets +0/+1 until end of turn.|
-Rubblehulk|Prerelease Events|63|Special|{4}{R}{G}|Creature - Elemental|*|*|Rubblehulk's power and toughness are each equal to the number of lands you control.$Bloodrush — {1}{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control.|
+Rubblehulk|Prerelease Events|63|Special|{4}{R}{G}|Creature - Elemental|*|*|Rubblehulk's power and toughness are each equal to the number of lands you control.$Bloodrush — {1}{R}{G}, Discard Rubblehulk: Target attacking creature gets +X/+X until end of turn, where X is the number of lands you control.|
Treasury Thrull|Prerelease Events|64|Special|{4}{W}{B}|Creature - Thrull|4|4|Extort (Whenever you cast a spell, you may pay {WB}. If you do, each opponent loses 1 life and you gain that much life.)$Whenever Treasury Thrull attacks, you may return target artifact, creature, or enchantment card from your graveyard to your hand.|
Maze's End|Prerelease Events|65|Special||Land|||Maze's End enters the battlefield tapped.${T}: Add {1} to your mana pool.${3}, {T}, Return Maze's End to its owner's hand: Search your library for a Gate card, put it onto the battlefield, then shuffle your library. If you control ten or more Gates with different names, you win the game.|
Plains|Prerelease Events|66|Special||Basic Land - Plains|||({T}: Add {W} to your mana pool.)|
@@ -25660,15 +25660,15 @@ Celestial Archon|Prerelease Events|68|Special|{3}{W}{W}|Enchantment Creature - A
Shipbreaker Kraken|Prerelease Events|69|Special|{4}{U}{U}|Creature - Kraken|6|6|{6}{U}{U}: Monstrosity 4. (If this creature isn't monstrous, put four +1/+1 counters on it and it becomes monstrous.)$When Shipbreaker Kraken becomes monstrous, tap up to four target creatures. Those creatures don't untap during their controllers' untap steps for as long as you control Shipbreaker Kraken.|
Abhorrent Overlord|Prerelease Events|70|Special|{5}{B}{B}|Creature - Demon|6|6|Flying$When Abhorrent Overlord enters the battlefield, put a number of 1/1 black Harpy creature tokens with flying onto the battlefield equal to your devotion to black. (Each {B} in the mana costs of permanents you control counts toward your devotion to black.)$At the beginning of your upkeep, sacrifice a creature.|
Ember Swallower|Prerelease Events|71|Special|{2}{R}{R}|Creature - Elemental|4|5|{5}{R}{R}: Monstrosity 3. (If this creature isn't monstrous, put three +1/+1 counters on it and it becomes monstrous.)$When Ember Swallower becomes monstrous, each player sacrifices three lands.|
-Anthousa, Setessan Hero|Prerelease Events|72|Special|{3}{G}{G}|Legendary Creature - Human Warrior|4|5|Heroic — Whenever you cast a spell that targets Anthousa, Setessan Hero, up to three target lands you control each become 2/2 Warrior creatures until end of turn. They're still lands.|
+Anthousa, Setessan Hero|Prerelease Events|72|Special|{3}{G}{G}|Legendary Creature - Human Warrior|4|5|Heroic — Whenever you cast a spell that targets Anthousa, Setessan Hero, up to three target lands you control each become 2/2 Warrior creatures until end of turn. They're still lands.|
Silent Sentinel|Prerelease Events|73|Special|{5}{W}{W}|Creature - Archon|4|6|Flying$Whenever Silent Sentinel attacks, you may return target enchantment card from your graveyard to the battlefield.|
-Arbiter of the Ideal|Prerelease Events|74|Special|{4}{U}{U}|Creature - Sphinx|4|5|Flying$Inspired — Whenever Arbiter of the Ideal becomes untapped, reveal the top card of your library. If it's an artifact, creature, or land card, you may put it onto the battlefield with a manifestation counter on it. That permanent is an enchantment in addition to its other types.|
+Arbiter of the Ideal|Prerelease Events|74|Special|{4}{U}{U}|Creature - Sphinx|4|5|Flying$Inspired — Whenever Arbiter of the Ideal becomes untapped, reveal the top card of your library. If it's an artifact, creature, or land card, you may put it onto the battlefield with a manifestation counter on it. That permanent is an enchantment in addition to its other types.|
Eater of Hope|Prerelease Events|75|Special|{5}{B}{B}|Creature - Demon|6|4|Flying${B}, Sacrifice another creature: Regenerate Eater of Hope.${2}{B}, Sacrifice two other creatures: Destroy target creature.|
Forgestoker Dragon|Prerelease Events|76|Special|{4}{R}{R}|Creature - Dragon|5|4|Flying${1}{R}: Forgestoker Dragon deals 1 damage to target creature. That creature can't block this combat. Activate this ability only if Forgestoker Dragon is attacking.|
Nessian Wilds Ravager|Prerelease Events|77|Special|{4}{G}{G}|Creature - Hydra|6|6|Tribute 6 (As this creature enters the battlefield, an opponent of your choice may place six +1/+1 counters on it.)$When Nessian Wilds Ravager enters the battlefield, if tribute wasn't paid, you may have Nessian Wilds Ravager fight another target creature. (Each deals damage equal to its power to the other.)|
-Dawnbringer Charioteers|Prerelease Events|78|Special|{2}{W}{W}|Creature - Human Soldier|2|4|Flying, lifelink$Heroic — Whenever you cast a spell that targets Dawnbringer Charioteers, put a +1/+1 counter on Dawnbringer Charioteers.|
+Dawnbringer Charioteers|Prerelease Events|78|Special|{2}{W}{W}|Creature - Human Soldier|2|4|Flying, lifelink$Heroic — Whenever you cast a spell that targets Dawnbringer Charioteers, put a +1/+1 counter on Dawnbringer Charioteers.|
Scourge of Fleets|Prerelease Events|79|Special|{5}{U}{U}|Creature - Kraken|6|6|When Scourge of Fleets enters the battlefield, return each creature your opponents control with toughness X or less to its owner's hand, where X is the number of Islands you control.|
-Doomwake Giant|Prerelease Events|80|Special|{4}{B}|Enchantment Creature - Giant|4|6|Constellation — Whenever Doomwake Giant or another enchantment enters the battlefield under your control, creatures your opponents control get -1/-1 until end of turn.|
+Doomwake Giant|Prerelease Events|80|Special|{4}{B}|Enchantment Creature - Giant|4|6|Constellation — Whenever Doomwake Giant or another enchantment enters the battlefield under your control, creatures your opponents control get -1/-1 until end of turn.|
Spawn of Thraxes|Prerelease Events|81|Special|{5}{R}{R}|Creature - Dragon|5|5|Flying$When Spawn of Thraxes enters the battlefield, it deals damage to target creature or player equal to the number of Mountains you control.|
Heroes' Bane|Prerelease Events|82|Special|{3}{G}{G}|Creature - Hydra|0|0|Heroes' Bane enters the battlefield with four +1/+1 counters on it.${2}{G}{G}: Put X +1/+1 counters on Heroes' Bane, where X is its power.|
Resolute Archangel|Prerelease Events|83|Special|{5}{W}{W}|Creature - Angel|4|4|Flying$When Resolute Archangel enters the battlefield, if your life total is less than your starting life total, it becomes equal to your starting life total.|
@@ -26018,7 +26018,7 @@ Thrive|Modern Masters 2015 Edition|166|C|{X}{G}|Sorcery|||Put a +1/+1 counter on
Tukatongue Thallid|Modern Masters 2015 Edition|167|C|{G}|Creature - Fungus|1|1|When Tukatongue Thallid dies, put a 1/1 green Saproling creature token onto the battlefield.|
Vines of Vastwood|Modern Masters 2015 Edition|168|C|{G}|Instant|||Kicker {G} (You may pay an additional {G} as you cast this spell.)$Target creature can't be the target of spells or abilities your opponents control this turn. If Vines of Vastwood was kicked, that creature gets +4/+4 until end of turn.|
Wolfbriar Elemental|Modern Masters 2015 Edition|169|R|{2}{G}{G}|Creature - Elemental|4|4|Multikicker {G} (You may pay an additional {G} any number of times as you cast this spell.)$When Wolfbriar Elemental enters the battlefield, put a 2/2 green Wolf creature token onto the battlefield for each time it was kicked.|
-Fortify|Modern Masters 2015 Edition|17|C|{2}{W}|Instant|||Choose one -$• Creatures you control get +2/+0 until end of turn.$• Creatures you control get +0/+2 until end of turn.|
+Fortify|Modern Masters 2015 Edition|17|C|{2}{W}|Instant|||Choose one -$• Creatures you control get +2/+0 until end of turn.$• Creatures you control get +0/+2 until end of turn.|
Agony Warp|Modern Masters 2015 Edition|170|U|{U}{B}|Instant|||Target creature gets -3/-0 until end of turn.$Target creature gets -0/-3 until end of turn.|
Apocalypse Hydra|Modern Masters 2015 Edition|171|R|{X}{R}{G}|Creature - Hydra|0|0|Apocalypse Hydra enters the battlefield with X +1/+1 counters on it. If X is 5 or more, it enters the battlefield with an additional X +1/+1 counters on it.${1}{R}, Remove a +1/+1 counter from Apocalypse Hydra: Apocalypse Hydra deals 1 damage to target creature or player.|
Boros Swiftblade|Modern Masters 2015 Edition|172|U|{R}{W}|Creature - Human Soldier|1|2|Double strike|
@@ -26127,7 +26127,7 @@ Karn Liberated|Modern Masters 2015 Edition|4|M|{7}|Planeswalker - Karn|||+4: Tar
Air Servant|Modern Masters 2015 Edition|40|U|{4}{U}|Creature - Elemental|4|3|Flying${2}{U}: Tap target creature with flying.|
Argent Sphinx|Modern Masters 2015 Edition|41|R|{2}{U}{U}|Creature - Sphinx|4|3|Flying$Metalcraft - {U}: Exile Argent Sphinx. Return it to the battlefield under your control at the beginning of the next end step. Activate this ability only if you control three or more artifacts.|
Cloud Elemental|Modern Masters 2015 Edition|42|C|{2}{U}|Creature - Elemental|2|3|Flying$Cloud Elemental can block only creatures with flying.|
-Cryptic Command|Modern Masters 2015 Edition|43|R|{1}{U}{U}{U}|Instant|||Choose two -$• Counter target spell.$• Return target permanent to its owner's hand.$• Tap all creatures your opponents control.$• Draw a card.|
+Cryptic Command|Modern Masters 2015 Edition|43|R|{1}{U}{U}{U}|Instant|||Choose two -$• Counter target spell.$• Return target permanent to its owner's hand.$• Tap all creatures your opponents control.$• Draw a card.|
Faerie Mechanist|Modern Masters 2015 Edition|44|C|{3}{U}|Artifact Creature - Faerie Artificer|2|2|Flying$When Faerie Mechanist enters the battlefield, look at the top three cards of your library. You may reveal an artifact card from among them and put it into your hand. Put the rest on the bottom of your library in any order.|
Flashfreeze|Modern Masters 2015 Edition|45|U|{1}{U}|Instant|||Counter target red or green spell.|
Guile|Modern Masters 2015 Edition|46|R|{3}{U}{U}{U}|Creature - Elemental Incarnation|6|6|Guile can't be blocked except by three or more creatures.$If a spell or ability you control would counter a spell, instead exile that spell and you may play that card without paying its mana cost.$When Guile is put into a graveyard from anywhere, shuffle it into its owner's library.|
@@ -26179,7 +26179,7 @@ Nameless Inversion|Modern Masters 2015 Edition|87|C|{1}{B}|Tribal Instant - Shap
Necroskitter|Modern Masters 2015 Edition|88|R|{1}{B}{B}|Creature - Elemental|1|4|Wither (This deals damage to creatures in the form of -1/-1 counters.)$Whenever a creature an opponent controls with a -1/-1 counter on it dies, you may return that card to the battlefield under your control.|
Plagued Rusalka|Modern Masters 2015 Edition|89|C|{B}|Creature - Spirit|1|1|{B}, Sacrifice a creature: Target creature gets -1/-1 until end of turn.|
Arrest|Modern Masters 2015 Edition|9|C|{2}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature can't attack or block, and its activated abilities can't be activated.|
-Profane Command|Modern Masters 2015 Edition|90|R|{X}{B}{B}|Sorcery|||Choose two -$• Target player loses X life.$• Return target creature card with converted mana cost X or less from your graveyard to the battlefield.$• Target creature gets -X/-X until end of turn.$• Up to X target creatures gain fear until end of turn. (They can't be blocked except by artifact creatures and/or black creatures.)|
+Profane Command|Modern Masters 2015 Edition|90|R|{X}{B}{B}|Sorcery|||Choose two -$• Target player loses X life.$• Return target creature card with converted mana cost X or less from your graveyard to the battlefield.$• Target creature gets -X/-X until end of turn.$• Up to X target creatures gain fear until end of turn. (They can't be blocked except by artifact creatures and/or black creatures.)|
Puppeteer Clique|Modern Masters 2015 Edition|91|R|{3}{B}{B}|Creature - Faerie Wizard|3|2|Flying$When Puppeteer Clique enters the battlefield, put target creature card from an opponent's graveyard onto the battlefield under your control. It gains haste. At the beginning of your next end step, exile it.$Persist (When this creature dies, if it had no -1/-1 counters on it, return it to the battlefield under its owner's control with a -1/-1 counter on it.)|
Reassembling Skeleton|Modern Masters 2015 Edition|92|U|{1}{B}|Creature - Skeleton Warrior|1|1|{1}{B}: Return Reassembling Skeleton from your graveyard to the battlefield tapped.|
Scavenger Drake|Modern Masters 2015 Edition|93|U|{3}{B}|Creature - Drake|1|1|Flying$Whenever another creature dies, you may put a +1/+1 counter on Scavenger Drake.|
@@ -26189,8 +26189,96 @@ Sickle Ripper|Modern Masters 2015 Edition|96|C|{1}{B}|Creature - Elemental Warri
Sign in Blood|Modern Masters 2015 Edition|97|C|{B}{B}|Sorcery|||Target player draws two cards and loses 2 life.|
Spread the Sickness|Modern Masters 2015 Edition|98|U|{4}{B}|Sorcery|||Destroy target creature, then proliferate. (You choose any number of permanents and/or players with counters on them, then give each another counter of a kind already there.)|
Surgical Extraction|Modern Masters 2015 Edition|99|R|{BP}|Instant|||({BP} can be paid with either {B} or 2 life.)$Choose target card in a graveyard other than a basic land card. Search its owner's graveyard, hand, and library for any number of cards with the same name as that card and exile them. Then that player shuffles his or her library.|
-Liliana, Heretical Healer|Magic Origins|106|M|{1}{B}{B}|Legendary Creature - Human Cleric|2|3|Lifelink$Whenever another nontoken creature you control dies, exile Liliana, Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.|
-Liliana, Defiant Necromancer|Magic Origins|106|M||Planeswalker - Liliana|||+2: Each player discards a card.$-X: Return target nonlegendary creature card with converted mana cost X from your graveyard to the battlefield.$-8: You get an emble with "Whenever a creature dies, return it to the battlefield under your control at the beginning of the next end step."|
+Charging Griffin|Magic Origins|?|C|{3}{W}{3}{W}|Creature - Griffin|2|22|2|Flying$Whenever Charging Griffin attacks, it gets +1/+1 until end of turn.$Flying$Whenever Charging Griffin attacks, it gets +1/+1 until end of turn.|
+Mighty Leap|Magic Origins|?|C|{1}{W}{1}{W}|Instant|||Target creature gets +2/+2 and gains flying until end of turn.$Target creature gets +2/+2 and gains flying until end of turn.|
+Yoked Ox|Magic Origins|?|C|{W}{W}|Creature - Ox|0|40|4||
+Akroan Jailer|Magic Origins|1|C|{W}|Creature - Human Soldier|1|1|{2}{W}, {T}: Tap target creature.|
+Grasp of the Hieromancer|Magic Origins|15|C|{1}{W}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +1/+1 and has "Whenever this creature attacks, tap target creature defending player controls."|
+Heavy Infantry|Magic Origins|18|C|{4}{W}|Creature - Human Soldier|3|4|When Heavy Infantry enters the battlefield, tap target creature an opponent controls.|
+Hixus, Prison Warden|Magic Origins|19|R|{3}{W}{W}{3}{W}{W}|Legendary Creature - Human Soldier|4|44|4|Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.$Flash$Whenever a creature deals combat damage to you, if Hixus, Prison Warden entered the battlefield this turn, exile that creature until Hixus leaves the battlefield.|
+Gideon, Battle-Forged|Magic Origins|23|M||Planeswalker - Gideon|3|+2: Up to one target creature an opponent controls attacks Gideon, Battle-Forged during its controller's next turn if able.$+1: Until your next turn, target creature gains indestructible. Untap that creature.$0: Until end of turn, Gideon, Battle-Forged becomes a 4/4 Human Soldier creature with indestructible that's still a planeswalker. Prevent all damage that would be dealt to him this turn.|
+Kytheon, Hero of Akros|Magic Origins|23|M|{W}|Legendary Creature - Human Soldier|2|1|At end of combat, if Kytheon, Hero of Akros and at least two other creatures attacked this combat, exile Kytheon, then return him to the battlefield transformed under his owner's control.${2}{W}: Kytheon gains indestructible until end of turn.|
+Sentinel of the Eternal Watch|Magic Origins|30|U|{5}{W}|Creature - Giant Soldier|4|6|Vigilance (Attacking doesn't cause this creature to tap.)$At the beginning of combat on each opponent's turn, tap target creature that player controls.|
+Valor in Akros|Magic Origins|39|U|{3}{W}|Enchantment|||Whenever a creature enters the battlefield under your control, creatures you control get +1/+1 until end of turn.|
+Aegis Angel|Magic Origins|273|R|{4}{W}{W}{4}{W}{W}|Creature - Angel|5|55|5|Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.$Flying$When Aegis Angel enters the battlefield, another target permanent gains indestructible for as long as you control Aegis Angel.|
+Divine Verdict|Magic Origins|274|C|{3}{W}{3}{W}|Instant|||Destroy target attacking or blocking creature.$Destroy target attacking or blocking creature.|
+Eagle of the Watch|Magic Origins|275|C|{2}{W}|Creature - Bird|2|1|Flying, vigilance|
+Serra Angel|Magic Origins|276|U|{3}{W}{W}{3}{W}{W}|Creature - Angel|4|44|4|Flying$Vigilance$Flying$Vigilance|
+Claustrophobia|Magic Origins|?|C|{1}{U}{U}{1}{U}{U}|Enchantment - Aura|||$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.$Enchant creature$When Claustrophobia enters the battlefield, tap enchanted creature.$Enchanted creature doesn't untap during its controller's untap step.|
+Disperse|Magic Origins|?|C|{1}{U}{1}{U}|Instant|||Return target nonland permanent to its owner's hand.$Return target nonland permanent to its owner's hand.|
+Displacement Wave|Magic Origins|?|?mtg-set-icon mtg-set-magic-origins-unknown|{X}{U}{U}{X}{U}{U}|Sorcery|||Return all nonland permanents with converted mana cost X or less to their owners' hands.$Return all nonland permanents with converted mana cost X or less to their owners' hands.|
+Maritime Guard|Magic Origins|?|C|{1}{U}{1}{U}|Creature - Merfolk Soldier|1|31|3||
+Mizzium Meddler|Magic Origins|?|R|{2}{U}{2}{U}|Creature - Vedalken Wizard|1|41|4|Flash$When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler.$Flash$When Mizzium Meddler enters the battlefield, change a target of target spell or ability to Mizzium Meddler.|
+Scrapskin Drake|Magic Origins|?|C|{2}{U}{2}{U}|Creature - Zombie Drake|2|32|3|Flying$Scrapskin Drake can block only creatures with flying.$Flying$Scrapskin Drake can block only creatures with flying.|
+Tower Geist|Magic Origins|?|U|{3}{U}{3}{U}|Creature - Spirit|2|22|2|Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.$Flying$When Tower Geist enters the battlefield, look at the top two cards of your library. Put one of them into your hand and the other into your graveyard.|
+Hydrolash|Magic Origins|59|U|{2}{U}|Instant|||Attacking creatures get -2/-0 until end of turn.$Draw a card.|
+Jace, Telepath Unbound|Magic Origins|60|M||Planeswalker - Jace|55|+1: Up to one target creature gets -2/-0 until your next turn.$-3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead.$-9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". $+1: Up to one target creature gets -2/-0 until your next turn.$-3: You may cast target instant or sorcery card from your graveyard this turn. If that card would be put into your graveyard this turn, exile it instead.$-9: You get an emblem with "Whenever you cast a spell, target opponent puts the top five cards of his or her library into his or her graveyard". |
+Jace, Vryn's Prodigy|Magic Origins|60|M|{1}{U}{1}{U}|Legendary Creature - Human Wizard|0|20|2|{T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. ${T}: Draw a card, then discard a card. If there are five or more cards in your graveyard, exile Jace, Vryn''s Prodigy, then return him to the battefield transformed under his owner's control. |
+Jhessian Thief|Magic Origins|62|U|{2}{U}|Creature - Human Rogue|1|3|Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)$Whenever Jhessian Thief deals combat damage to a player, draw a card.|
+Ringwarden Owl|Magic Origins|068|C|{3}{U}{U}|Creature - Bird|3|3|Flying (This creature can't be blocked except by creatures with flying or reach.)$Prowess (Whenever you cast a noncreature spell, this creature gets +1/+1 until end of turn.)|
+Separatist Voidmage|Magic Origins|72|C|{3}{U}|Creature - Human Wizard|2|2|When Separatist Voidmage enters the battlefield, you may return target creature to its owner's hand.|
+Sphinx's Tutelage|Magic Origins|76|U|{2}{U}|Enchantment|||Whenever you draw a card, target opponent puts the top two cards of his or her library into his or her graveyard. If they're both nonland cards that share a color, repeat this process.${5}{U}: Draw a card, then discard a card.|
+Into the Void|Magic Origins|277|U|{3}{U}{3}{U}|Sorcery|||Return up to two target creatures to their owners' hands.$Return up to two target creatures to their owners' hands.|
+Mahamoti Djinn|Magic Origins|278|R|{4}{U}{U}{4}{U}{U}|Creature - Djinn|5|65|6|Flying$Flying|
+Weave Fate|Magic Origins|279|C|{3}{U}{3}{U}|Instant|||Draw two cards.$Draw two cards.|
+Catacomb Slug|Magic Origins|?|C|{4}{B}{4}{B}|Creature - Slug|2|62|6||
+Cruel Revival|Magic Origins|?|C|{4}{B}{4}{B}|Instant|||Destroy target non-Zombie creature. It can't be regenerated. Return up to one target Zombie card from your graveyard to your hand.$Destroy target non-Zombie creature. It can't be regenerated. Return up to one target Zombie card from your graveyard to your hand.|
+Weight of the Underworld|Magic Origins|?|C|{3}{B}{3}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets -3/-2.$Enchant creature$Enchanted creature gets -3/-2.|
+Deadbridge Shaman|Magic Origins|91|C|{2}{B}|Creature - Elf Shaman|3|1|When Deadbridge Shaman dies, target opponent discards a card.|
+Eyeblight Assassin|Magic Origins|95|C|{2}{B}|Creature - Elf Assassin|2|2|When Eyeblight Assassin enters the battlefield, target creature an opponent controls gets -1/-1 until end of turn.|
+Infernal Scarring|Magic Origins|102|C|{1}{B}|Enchantment - Aura|||Enchant creature$Enchanted creature gets +2/+0 and has "When this creature dies, draw a card."|
+Liliana, Defiant Necromancer|Magic Origins|106|M||Planeswalker - Liliana|3|+2: Each player discards a card.$-X: Return target nonlegendary creature with converted mana cost X from your graveyard to the battlefield.$-8: You get an emblem with "Whenever a creature you control dies, return it to the battlefield under your control at the beginning of the next end step."|
+Liliana, Heretical Healer|Magic Origins|106|M|{1}{B}{B}|Legendary Creature - Human Cleric|2|3|Lifelink$Whenever another nontoken creature you control dies, exile Liliana Heretical Healer, then return her to the battlefield transformed under her owner's control. If you do, put a 2/2 black Zombie creature token onto the battlefield.|
+Malakir Cullblade|Magic Origins|108|U|{1}{B}|Creature - Vampire Warrior|1|1|Whenever a creature an opponent controls dies, put a +1/+1 counter on Malakir Cullblade.|
+Rabid Bloodsucker|Magic Origins|113|C|{4}{B}|Creature - Vampire|3|2|Flying$When Rabid Bloodsucker enters the battlefield, each player loses 2 life.|
+Reave Soul|Magic Origins|115|C|{1}{B}|Sorcery|||Destroy target creature with power 3 or less.|
+Shambling Ghoul|Magic Origins|119|C|{1}{B}|Creature - Zombie|2|3|Shambling Ghoul enters the battlefield tapped.|
+Flesh to Dust|Magic Origins|280|C|{3}{B}{B}{3}{B}{B}|Instant|||Destroy target creature. It can't be regenerated.$Destroy target creature. It can't be regenerated.|
+Mind Rot|Magic Origins|281|C|{2}{B}{2}{B}|Sorcery|||Target player discards two cards.$Target player discards two cards.|
+Nightmare|Magic Origins|282|R|{5}{B}{5}{B}|Creature - Nightmare Horse|0|00|0|Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.$Flying$Nightmare's power and toughness are each equal to the number of Swamps you control.|
+Sengir Vampire|Magic Origins|283|U|{3}{B}{B}{3}{B}{B}|Creature - Vampire|4|44|4|Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.$Flying$Whenever a creature dealt damage by Sengir Vampire this turn dies, put a +1/+1 counter on Sengir Vampire.|
+Act of Treason|Magic Origins|?|C|{2}{R}{2}{R}|Sorcery|||Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.$Gain control of target creature until end of turn. Untap that creature. It gains haste until end of turn.|
+Cobblebrute|Magic Origins|?|C|{3}{R}{3}{R}|Creature - Elemental|5|25|2||
+Fiery Conclusion|Magic Origins|?|C|{1}{R}{1}{R}|Instant|||As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.$As an additional cost to cast Fiery Conclusion, sacrifice a creature.$Fiery Conclusion deals 5 damage to target creature.|
+Titan's Strength|Magic Origins|?|C|{R}{R}|Instant|||Target creature gets +3/+1 until end of turn. Scry 1.$Target creature gets +3/+1 until end of turn. Scry 1.|
+Avaricious Dragon|Magic Origins|131|M|{2}{R}{R}|Creature - Dragon|4|4|Flying$At the beginning of your draw step, draw an additional card.$At the beginning of your end step, discard your hand.|
+Bellows Lizard|Magic Origins|132|C|{R}{R}|Creature - Lizard|1|11|1|{1}{R}: Bellows Lizard gets +1/+0 until end of turn.${1}{R}: Bellows Lizard gets +1/+0 until end of turn.|
+Boggart Brute|Magic Origins|133|C|{2}{R}|Creature - Goblin Warrior|3|2|Menace (This creature can't be blocked except by two or more creatures.)|
+Chandra, Fire of Kaladesh|Magic Origins|135|M|{1}{R}{R}{1}{R}{R}|Legendary Creature - Human Shaman|2|22|2|Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.$Whenever you cast a red spell, untap Chandra, Fire of Kaladesh.${T}: Chandra, Fire of Kaladesh deals 1 damage to target player. If Chandra has dealt 3 or more damage this turn, exile her, then return her to the battlefield transformed under her owner's control.|
+Chandra, Roaring Flame|Magic Origins|135|M||Planeswalker - Chandra|44|+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."$+1: Chandra, Roaring Flame deals 2 damage to target player.$-2: Chandra, Roaring Flame deals 2 damage to target creature.$-7: Chandra, Roaring Flame deals 6 damage to each opponent. Each player dealt damage this way gets an emblem with "At the beginning of your upkeep, this emblem deals 3 damage to you."|
+Chandra's Fury|Magic Origins|136|C|{4}{R}{4}{R}|Instant|||Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.$Chandra's Fury deals 4 damage to target player and 1 damage to each creature that player controls.|
+Chandra's Ignition|Magic Origins|137|R|{3}{R}{R}|Sorcery|||Target creature you control deals damage equal to its power to each other creature and each opponent.|
+Enthralling Victor|Magic Origins|142|U|{3}{R}|Creature - Human Warrior|3|2|When Enthralling Victor enters the battlefield, gain control of target creature an opponent controls with power 2 or less until end of turn. Untap that creature. It gains haste until end of turn.|
+Lightning Javelin|Magic Origins|153|C|{3}{R}|Sorcery|||Lightning Javelin deals 3 damage to target creature or player. Scry 1.|
+Pia and Kiran Nalaar|Magic Origins|157|R|{2}{R}{R}|Legendary Creature - Human Artificer|2|2|When Pia and Kiran Nalaar enters the battlefield put 2 1/1 colorless Thopter artifact creature tokens with flying onto the battlefield.${2}{R}, Sacrifice an artifact: Pia and Kiran Nalaar deals 2 damage to target creature or player.|
+Ravaging Blaze|Magic Origins|159|U|{X}{R}{R}|Instant|||Ravaging Blaze deals X damage to target creature. $Spell mastery — If there are two or more instant and/or sorcery cards in your graveyard, Ravaging Blaze also deals X damage to that creature's controller.|
+Seismic Elemental|Magic Origins|161|U|{3}{R}{R}|Creature - Elemental|4|4|When Seismic Elemental enters the battlefield, creatures without flying can't block this turn.|
+Subterranean Scout|Magic Origins|164|C|{1}{R}|Creature - Goblin Scout|2|1|When Subterranean Scout enters the battlefield, target creature with power 2 or less can't be blocked this turn.|
+Volcanic Rambler|Magic Origins|167|C|{5}{R}|Creature - Elemental|6|4|{2}{R}: Volcanic Rambler deals 1 damage to target player.|
+Fiery Hellhound|Magic Origins|284|C|{1}{R}{R}{1}{R}{R}|Creature - Elemental Hound|2|22|2|{R}: Fiery Hellhound gets +1/+0 until end of turn.${R}: Fiery Hellhound gets +1/+0 until end of turn.|
+Shivan Dragon|Magic Origins|285|R|{4}{R}{R}{4}{R}{R}|Creature - Dragon|5|55|5|Flying${R}: Shivan Dragon gets +1/+0 until end of turn.$Flying${R}: Shivan Dragon gets +1/+0 until end of turn.|
+Elvish Visionary|Magic Origins|?|C|{1}{G}{1}{G}|Creature - Elf Shaman|1|11|1|When Elvish Visionary enters the battlefield, draw a card.$When Elvish Visionary enters the battlefield, draw a card.|
+Leaf Gilder|Magic Origins|?|C|{1}{G}{1}{G}|Creature - Elf Druid|2|12|1|{T}: Add {G} to your mana pool.${T}: Add {G} to your mana pool.|
+Titanic Growth|Magic Origins|?|C|{1}{G}{1}{G}|Instant|||Target creature gets +4/+4 until end of turn.$Target creature gets +4/+4 until end of turn.|
+Vastwood Gorger|Magic Origins|?|C|{5}{G}{5}{G}|Creature - Wurm|5|65|6||
+Yeva's Forcemage|Magic Origins|?|C|{2}{G}{2}{G}|Creature - Elf Shaman|2|22|2|When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.$When Yeva's Forcemage enters the battlefield, target creature gets +2/+2 until end of turn.|
+Conclave Naturalists|Magic Origins|171|U|{4}{G}|Creature - Dryad|4|4|When Conclave Naturalists enters the battlefield, you may destroy target artifact or enchantment.|
+Dwynen, Gilt-Leaf Daen|Magic Origins|172|R|{2}{G}{G}|Legendary Creature - Elf Warrior|3|4|Reach$Other Elf creatures you control get +1/+1.$Whenever Dwynen, Gilt-Leaf Daen attacks, you gain 1 life for each attacking Elf you control.|
+Elemental Bond|Magic Origins|174|U|{2}{G}|Enchantment|||Whenever a creature with power 3 or greater enters the battlefield under your control, draw a card.|
+Hitchclaw Recluse|Magic Origins|181|C|{2}{G}|Creature - Spider|1|4|Reach|
+Joraga Invocation|Magic Origins|183|U|{4}{G}{G}|Sorcery|||Each creature you control gets +3/+3 until end of turn and must be blocked this turn if able.|
+Mantle of Webs|Magic Origins|187|C|{1}{G}|Enchantment - Aura|||Enchant Creature$Enchanted creature gets +1/+3 and has reach.|
+Nissa, Sage Animist|Magic Origins|189|M||Planeswalker - Nissa|33|+1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.$-2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.$-7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.$+1: Reveal the top card of your library. If it's a land card, put it onto the battlefield. Otherwise, put it into your hand.$-2: Put a legendary 4/4 green Elemental creature token named Ashaya, the Awoken World onto the battlefield.$-7: Untap up to six target lands. They become 6/6 Elemental creatures. They're still lands.|
+Nissa, Vastwood Seer|Magic Origins|189|M|{2}{G}{2}{G}|Legendary Creature - Elf Scout|2|22|2|When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.$Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.$When Nissa, Vastwood Seer enters the battlefield, you may search your library for a basic Forest card, reveal it, put it into your hand, then shuffle your library.$Whenever a land enters the battlefield under your control, if you control seven or more lands, exile Nissa, then return her to the battlefield transformed under her owner's control.|
+Plummet|Magic Origins|286|C|{1}{G}{1}{G}|Instant|||Destroy target creature with flying.$Destroy target creature with flying.|
+Prized Unicorn|Magic Origins|287|U|{3}{G}{3}{G}|Creature - Unicorn|2|22|2|All creatures able to block Prized Unicorn do so.$All creatures able to block Prized Unicorn do so.|
+Terra Stomper|Magic Origins|288|R|{3}{G}{G}{G}{3}{G}{G}{G}|Creature - Beast|8|88|8|Terra Stomper can't be countered.$Trample$Terra Stomper can't be countered.$Trample|
+Zendikar Incarnate|Magic Origins|219|U|{2}{R}{G}|Creature - Elemental|0|4|Zendikar Incarnate's power is equal to the amount of lands you control.|
+Meteorite|Magic Origins|?|U|{5}{5}|Artifact|||When Meteorite enters the battlefield, it deals 2 damage to target creature or player.${T}: Add one mana of any color to your mana pool.$When Meteorite enters the battlefield, it deals 2 damage to target creature or player.${T}: Add one mana of any color to your mana pool.|
+Gold-Forged Sentinel|Magic Origins|?|U|{6}{6}|Artifact Creature - Chimera|4|44|4|Flying$Flying|
+Runed Servitor|Magic Origins|?|U|{2}{2}|Artifact Creature - Construct|2|22|2|When Runed Servitor dies, each player draws a card.$When Runed Servitor dies, each player draws a card.|
+Jayemdae Tome|Magic Origins|?|U|{4}{4}|Artifact|||{4}, {T}: Draw a card.${4}, {T}: Draw a card.|
+Veteran's Sidearm|Magic Origins|242|C|{2}|Artifact - Equipment|||Equipped creature gets +1/+1.$Equip {1}|
Ambush Commander|Duel Decks: Anthology, Elves vs. Goblins|1|R|{3}{G}{G}|Creature - Elf|2|2|Forests you control are 1/1 green Elf creatures that are still lands.${1}{G}, Sacrifice an Elf: Target creature gets +3/+3 until end of turn.|
Lys Alana Huntmaster|Duel Decks: Anthology, Elves vs. Goblins|10|C|{2}{G}{G}|Creature - Elf Warrior|3|3|Whenever you cast an Elf spell, you may put a 1/1 green Elf Warrior creature token onto the battlefield.|
Stonewood Invoker|Duel Decks: Anthology, Elves vs. Goblins|11|C|{1}{G}|Creature - Elf Mutant|2|2|{7}{G}: Stonewood Invoker gets +5/+5 until end of turn.|
@@ -26486,7 +26574,7 @@ Surrakar Banisher|Duel Decks: Elspeth vs. Kiora|43|C|{4}{U}|Creature - Surrakar|
Whelming Wave|Duel Decks: Elspeth vs. Kiora|44|R|{2}{U}{U}|Sorcery|||Return all creatures to their owners' hands except for Krakens, Leviathans, Octopuses, and Serpents.|
Explore|Duel Decks: Elspeth vs. Kiora|45|C|{1}{G}|Sorcery|||You may play an additional land this turn.$Draw a card.|
Explosive Vegetation|Duel Decks: Elspeth vs. Kiora|46|U|{3}{G}|Sorcery|||Search your library for up to two basic land cards and put them onto the battlefield tapped. Then shuffle your library.|
-Grazing Gladehart|Duel Decks: Elspeth vs. Kiora|47|C|{2}{G}|Creature - Antelope|2|2|Landfall — Whenever a land enters the battlefield under your control, you may gain 2 life.|
+Grazing Gladehart|Duel Decks: Elspeth vs. Kiora|47|C|{2}{G}|Creature - Antelope|2|2|Landfall — Whenever a land enters the battlefield under your control, you may gain 2 life.|
Nessian Asp|Duel Decks: Elspeth vs. Kiora|48|C|{4}{G}|Creature - Snake|4|5|Reach${6}{G}: Monstrosity 4. (If this creature isn't monstrous, put four +1/+1 counters on it and it becomes monstrous.)|
Netcaster Spider|Duel Decks: Elspeth vs. Kiora|49|C|{2}{G}|Creature - Spider|2|3|Reach (This creature can block creatures with flying.)$Whenever Netcaster Spider blocks a creature with flying, Netcaster Spider gets +2/+0 until end of turn.|
Time to Feed|Duel Decks: Elspeth vs. Kiora|50|C|{2}{G}|Sorcery|||Choose target creature an opponent controls. When that creature dies this turn, you gain 3 life. Target creature you control fights that creature. (Each deals damage equal to its power to the other.)|
@@ -26557,7 +26645,7 @@ Day of Judgment|Magic Player Rewards|49|Special|{2}{W}{W}|Sorcery|||Destroy all
Brave the Elements|Magic Player Rewards|50|Special|{W}|Instant|||Choose a color. White creatures you control gain protection from the chosen color until end of turn.|
Doom Blade|Magic Player Rewards|51|Special|{1}{B}|Instant|||Destroy target nonblack creature.|
Treasure Hunt|Magic Player Rewards|52|Special|{1}{U}|Sorcery|||Reveal cards from the top of your library until you reveal a nonland card, then put all cards revealed this way into your hand.|
-Searing Blaze|Magic Player Rewards|53|Special|{R}{R}|Instant|||Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls.$Landfall — If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead.|
+Searing Blaze|Magic Player Rewards|53|Special|{R}{R}|Instant|||Searing Blaze deals 1 damage to target player and 1 damage to target creature that player controls.$Landfall — If you had a land enter the battlefield under your control this turn, Searing Blaze deals 3 damage to that player and 3 damage to that creature instead.|
Angelic Blessing|Tempest Remastered|1|C|{2}{W}|Sorcery|||Target creature gets +3/+3 and gains flying until end of turn.|
Angelic Protector|Tempest Remastered|2|U|{3}{W}|Creature - Angel|2|2|Flying$Whenever Angelic Protector becomes the target of a spell or ability, Angelic Protector gets +0/+3 until end of turn.|
Anoint|Tempest Remastered|3|C|{W}|Instant|||Buyback {3} (You may pay an additional {3} as you cast this spell. If you do, put this card into your hand as it resolves.)$Prevent the next 3 damage that would be dealt to target creature this turn.|
diff --git a/Utils/pick-convertor.pl b/Utils/pick-convertor.pl
old mode 100644
new mode 100755
diff --git a/Utils/release/getting_implemented_cards.txt b/Utils/release/getting_implemented_cards.txt
index 6ef99fa38e8..875530ee3ee 100644
--- a/Utils/release/getting_implemented_cards.txt
+++ b/Utils/release/getting_implemented_cards.txt
@@ -131,6 +131,16 @@ git log e8b2e01cd465f6a8ced2c83ec52a698ee093baa4..HEAD --diff-filter=A --name-st
since 1.4.0.v2
git log eb96b08dfac3de4f78403d6f23e41ce8d41ece6f..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
+since 1.4.1.v0
+git log 7a54d5364c9789ce2c3ef2c3eb4df7e0e0cde0cf..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
+
+since 1.4.1.v1
+git log 3e9b4cfb7c22d363755d28f5ff1de351f6b7123c..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
+
+since 1.4.1.v2
+git log 675801e8d493b023add4333e7835751d20da07a1..HEAD --diff-filter=A --name-status | sed -ne "s/^A[^u]Mage.Sets\/src\/mage\/sets\///p" | sort > added_cards.txt
+
+
3. Copy added_cards.txt to trunk\Utils folder
4. Run script:
> perl extract_in_wiki_format.perl
diff --git a/Utils/update-list-implemented-cards.pl b/Utils/update-list-implemented-cards.pl
old mode 100644
new mode 100755
diff --git a/Utils/version-bump.pl b/Utils/version-bump.pl
old mode 100644
new mode 100755
diff --git a/pom.xml b/pom.xml
index d3d6cbda2ae..95512367fd3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
org.mage
mage-root
- 1.4.0
+ 1.4.1
pom
Mage Root
Mage Root POM
@@ -73,7 +73,7 @@
- 1.4.0
+ 1.4.1
UTF-8