This commit is contained in:
BetaSteward 2010-09-25 20:35:23 +00:00
parent 460ee77e4e
commit e0b4388361
555 changed files with 20323 additions and 1942 deletions

View file

@ -1,7 +1,10 @@
server-name=localhost server-name=localhost
port=17171 port=17171
remote-server=mage-server remote-server=mage-server
cards-resource-path=resources/images/cards/ cards-resource-path=C:\\Program Files (x86)\\Wizards of the Coast\\Magic Online III\\Graphics\\Cards\\
symbols-resource-path=resources/images/symbols/ symbols-resource-path=C:\\Program Files (x86)\\Wizards of the Coast\\Magic Online III\\Graphics\\Chat\\chat_graphic_typingicon_
resource-path=resources/images/ resource-path=C:\\Program Files (x86)\\Wizards of the Coast\\Magic Online III\\Graphics\\Cards\\Pics\\
#cards-resource-path=resources/images/cards/
#symbols-resource-path=resources/images/symbols/
#resource-path=resources/images/
card-scaling-factor=0.4 card-scaling-factor=0.4

Binary file not shown.

View file

@ -1 +1,7 @@
@ECHO OFF
IF NOT EXIST "C:\Program Files\Java\jre6" GOTO NOJAVADIR
set JAVA_HOME="C:\Program Files\Java\jre6"
set CLASSPATH=%JAVA_HOME%/bin;%CLASSPATH%
set PATH=%JAVA_HOME%/bin;%PATH%
:NOJAVADIR
start javaw -jar .\MageClient.jar start javaw -jar .\MageClient.jar

View file

@ -34,14 +34,19 @@
package mage.client; package mage.client;
import java.awt.Cursor;
import java.awt.event.WindowAdapter; import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent; import java.awt.event.WindowEvent;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.prefs.Preferences;
import javax.swing.Box; import javax.swing.Box;
import javax.swing.JDesktopPane; import javax.swing.JDesktopPane;
import javax.swing.JLayeredPane; import javax.swing.JLayeredPane;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities; import javax.swing.SwingUtilities;
import javax.swing.UIManager; import javax.swing.UIManager;
import mage.client.dialog.AboutDialog; import mage.client.dialog.AboutDialog;
@ -64,6 +69,7 @@ public class MageFrame extends javax.swing.JFrame {
private ConnectDialog connectDialog; private ConnectDialog connectDialog;
private static CombatDialog combat; private static CombatDialog combat;
private static PickNumberDialog pickNumber; private static PickNumberDialog pickNumber;
private static Preferences prefs = Preferences.userNodeForPackage(MageFrame.class);
/** /**
* @return the session * @return the session
@ -76,6 +82,10 @@ public class MageFrame extends javax.swing.JFrame {
return desktopPane; return desktopPane;
} }
public static Preferences getPreferences() {
return prefs;
}
/** Creates new form MageFrame */ /** Creates new form MageFrame */
public MageFrame() { public MageFrame() {
@ -99,14 +109,17 @@ public class MageFrame extends javax.swing.JFrame {
initComponents(); initComponents();
session = new Session(this); session = new Session(this);
connectDialog = new ConnectDialog(session); connectDialog = new ConnectDialog();
combat = new CombatDialog(); combat = new CombatDialog();
pickNumber = new PickNumberDialog(); pickNumber = new PickNumberDialog();
desktopPane.add(connectDialog, JLayeredPane.POPUP_LAYER); desktopPane.add(connectDialog, JLayeredPane.POPUP_LAYER);
desktopPane.add(combat, JLayeredPane.POPUP_LAYER); desktopPane.add(combat, JLayeredPane.POPUP_LAYER);
combat.hideDialog(); combat.hideDialog();
desktopPane.add(pickNumber, JLayeredPane.POPUP_LAYER); desktopPane.add(pickNumber, JLayeredPane.POPUP_LAYER);
disableButtons(); if (autoConnect())
enableButtons();
else
disableButtons();
} }
public void showGame(UUID gameId, UUID playerId) { public void showGame(UUID gameId, UUID playerId) {
@ -130,6 +143,32 @@ public class MageFrame extends javax.swing.JFrame {
this.gamePane.replayGame(); this.gamePane.replayGame();
} }
public static boolean connect(String userName, String serverName, int port) {
return session.connect(userName, serverName, port);
}
public boolean autoConnect() {
boolean autoConnect = Boolean.parseBoolean(prefs.get("autoConnect", "false"));
if (autoConnect) {
String userName = prefs.get("userName", "");
String server = prefs.get("serverAddress", "");
int port = Integer.parseInt(prefs.get("serverPort", ""));
try {
setCursor(new Cursor(Cursor.WAIT_CURSOR));
if (MageFrame.connect(userName, server, port)) {
return true;
}
else {
JOptionPane.showMessageDialog(rootPane, "Unable to connect to server");
}
}
finally {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
}
return false;
}
/** This method is called from within the constructor to /** This method is called from within the constructor to
* initialize the form. * initialize the form.
* WARNING: Do NOT modify this code. The content of this method is * WARNING: Do NOT modify this code. The content of this method is
@ -289,7 +328,14 @@ public class MageFrame extends javax.swing.JFrame {
}//GEN-LAST:event_btnExitActionPerformed }//GEN-LAST:event_btnExitActionPerformed
private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed
connectDialog.showDialog(); if (session.isConnected()) {
if (JOptionPane.showConfirmDialog(this, "Are you sure you want to disconnect?", "Confirm disconnect", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
session.disconnect();
}
}
else {
connectDialog.showDialog();
}
}//GEN-LAST:event_btnConnectActionPerformed }//GEN-LAST:event_btnConnectActionPerformed
private void btnAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAboutActionPerformed private void btnAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAboutActionPerformed
@ -305,13 +351,15 @@ public class MageFrame extends javax.swing.JFrame {
} }
public void enableButtons() { public void enableButtons() {
btnConnect.setEnabled(false); btnConnect.setEnabled(true);
btnConnect.setText("Disconnect");
btnGames.setEnabled(true); btnGames.setEnabled(true);
btnDeckEditor.setEnabled(true); btnDeckEditor.setEnabled(true);
} }
public void disableButtons() { public void disableButtons() {
btnConnect.setEnabled(true); btnConnect.setEnabled(true);
btnConnect.setText("Connect");
btnGames.setEnabled(false); btnGames.setEnabled(false);
btnDeckEditor.setEnabled(true); btnDeckEditor.setEnabled(true);
this.tablesPane.setVisible(false); this.tablesPane.setVisible(false);

View file

@ -66,7 +66,10 @@ import mage.client.remote.Session;
import mage.client.util.Config; import mage.client.util.Config;
import mage.client.util.ImageHelper; import mage.client.util.ImageHelper;
import mage.sets.Sets;
import mage.view.AbilityView;
import mage.view.CardView; import mage.view.CardView;
import mage.view.StackAbilityView;
import static mage.client.util.Constants.*; import static mage.client.util.Constants.*;
/** /**
@ -90,6 +93,7 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
protected BufferedImage background; protected BufferedImage background;
protected BufferedImage image = new BufferedImage(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT, BufferedImage.TYPE_INT_RGB); protected BufferedImage image = new BufferedImage(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT, BufferedImage.TYPE_INT_RGB);
protected BufferedImage small; protected BufferedImage small;
protected String backgroundName;
/** Creates new form Card */ /** Creates new form Card */
public Card(CardView card, BigCard bigCard, CardDimensions dimension, UUID gameId) { public Card(CardView card, BigCard bigCard, CardDimensions dimension, UUID gameId) {
@ -100,7 +104,8 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
this.card = card; this.card = card;
this.bigCard = bigCard; this.bigCard = bigCard;
small = new BufferedImage(Config.dimensions.frameWidth, Config.dimensions.frameHeight, BufferedImage.TYPE_INT_RGB); small = new BufferedImage(Config.dimensions.frameWidth, Config.dimensions.frameHeight, BufferedImage.TYPE_INT_RGB);
background = ImageHelper.getBackground(card); backgroundName = getBackgroundName();
background = ImageHelper.getBackground(card, backgroundName);
StyledDocument doc = text.getStyledDocument(); StyledDocument doc = text.getStyledDocument();
Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE); Style def = StyleContext.getDefaultStyleContext().getStyle(StyleContext.DEFAULT_STYLE);
@ -126,6 +131,11 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
Graphics2D gImage = image.createGraphics(); Graphics2D gImage = image.createGraphics();
Graphics2D gSmall = small.createGraphics(); Graphics2D gSmall = small.createGraphics();
String cardType = getType(card); String cardType = getType(card);
String testBackgroundName = getBackgroundName();
if (!testBackgroundName.equals(backgroundName)) {
backgroundName = testBackgroundName;
background = ImageHelper.getBackground(card, backgroundName);
}
popupText.setText(getText(cardType)); popupText.setText(getText(cardType));
@ -134,11 +144,11 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
gImage.drawImage(background, 0, 0, this); gImage.drawImage(background, 0, 0, this);
if (card.getManaCost().size() > 0) if (card.getManaCost().size() > 0)
ImageHelper.DrawCosts(card.getManaCost(), gImage, FRAME_MAX_WIDTH - SYMBOL_MAX_XOFFSET, SYMBOL_MAX_YOFFSET, this); ImageHelper.drawCosts(card.getManaCost(), gImage, FRAME_MAX_WIDTH - SYMBOL_MAX_XOFFSET, SYMBOL_MAX_YOFFSET, this);
gSmall.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); gSmall.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
gSmall.setColor(Color.BLACK); gSmall.setColor(Color.BLACK);
gSmall.drawImage(ImageHelper.ScaleImage(image, Config.dimensions.frameWidth, Config.dimensions.frameHeight), 0, 0, this); gSmall.drawImage(ImageHelper.scaleImage(image, Config.dimensions.frameWidth, Config.dimensions.frameHeight), 0, 0, this);
gImage.setFont(new Font("Arial", Font.PLAIN, NAME_FONT_MAX_SIZE)); gImage.setFont(new Font("Arial", Font.PLAIN, NAME_FONT_MAX_SIZE));
gImage.drawString(card.getName(), CONTENT_MAX_XOFFSET, NAME_MAX_YOFFSET); gImage.drawString(card.getName(), CONTENT_MAX_XOFFSET, NAME_MAX_YOFFSET);
@ -172,24 +182,47 @@ public class Card extends javax.swing.JPanel implements MouseMotionListener, Mou
protected String getText(String cardType) { protected String getText(String cardType) {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append(card.getName()); if (card instanceof StackAbilityView || card instanceof AbilityView) {
if (card.getManaCost().size() > 0) { for (String rule: getRules()) {
sb.append("\n").append(card.getManaCost()); sb.append("\n").append(rule);
}
} }
sb.append("\n").append(cardType); else {
if (card.getColor().hasColor()) { sb.append(card.getName());
sb.append("\n").append(card.getColor().toString()); if (card.getManaCost().size() > 0) {
sb.append("\n").append(card.getManaCost());
}
sb.append("\n").append(cardType);
if (card.getColor().hasColor()) {
sb.append("\n").append(card.getColor().toString());
}
if (card.getCardTypes().contains(CardType.CREATURE)) {
sb.append("\n").append(card.getPower()).append("/").append(card.getToughness());
}
else if (card.getCardTypes().contains(CardType.PLANESWALKER)) {
sb.append("\n").append(card.getLoyalty());
}
for (String rule: getRules()) {
sb.append("\n").append(rule);
}
sb.append("\n").append(Sets.getInstance().get(card.getExpansionSetCode()).getName()).append(" - ").append(card.getRarity().toString());
} }
if (card.getCardTypes().contains(CardType.CREATURE)) { // sb.append("\n").append(card.getId());
sb.append("\n").append(card.getPower()).append("/").append(card.getToughness()); return sb.toString();
}
protected String getBackgroundName() {
if (card instanceof StackAbilityView || card instanceof AbilityView) {
return "effect";
} }
else if (card.getCardTypes().contains(CardType.PLANESWALKER)) { StringBuilder sb = new StringBuilder();
sb.append("\n").append(card.getLoyalty()); if (card.getCardTypes().contains(CardType.LAND)) {
sb.append("land").append(card.getSuperTypes()).append(card.getSubTypes());
} }
for (String rule: getRules()) { else if (card.getCardTypes() != null && (card.getCardTypes().contains(CardType.CREATURE) || card.getCardTypes().contains(CardType.PLANESWALKER))) {
sb.append("\n").append(rule); sb.append("creature");
} }
sb.append("\n").append(card.getId()); sb.append(card.getColor()).append(card.getArt()).append(card.getRarity()).append(card.getExpansionSetCode());
return sb.toString(); return sb.toString();
} }

View file

@ -46,8 +46,10 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import javax.swing.PopupFactory; import javax.swing.PopupFactory;
import mage.Constants.CardType;
import mage.client.util.Config; import mage.client.util.Config;
import mage.client.util.ImageHelper; import mage.client.util.ImageHelper;
import mage.sets.Sets;
import mage.view.CounterView; import mage.view.CounterView;
import mage.view.PermanentView; import mage.view.PermanentView;
import static mage.client.util.Constants.*; import static mage.client.util.Constants.*;
@ -89,6 +91,34 @@ public class Permanent extends Card {
this.linked = linked; this.linked = linked;
} }
@Override
protected String getText(String cardType) {
StringBuilder sb = new StringBuilder();
sb.append(super.getText(cardType));
sb.append("\n----- Originally -------\n");
sb.append(permanent.getOriginal().getName());
if (permanent.getOriginal().getManaCost().size() > 0) {
sb.append("\n").append(permanent.getOriginal().getManaCost());
}
sb.append("\n").append(getType(permanent.getOriginal()));
if (permanent.getOriginal().getColor().hasColor()) {
sb.append("\n").append(permanent.getOriginal().getColor().toString());
}
if (permanent.getOriginal().getCardTypes().contains(CardType.CREATURE)) {
sb.append("\n").append(permanent.getOriginal().getPower()).append("/").append(permanent.getOriginal().getToughness());
}
else if (permanent.getOriginal().getCardTypes().contains(CardType.PLANESWALKER)) {
sb.append("\n").append(permanent.getOriginal().getLoyalty());
}
for (String rule: getRules()) {
sb.append("\n").append(rule);
}
sb.append("\n").append(Sets.getInstance().get(permanent.getOriginal().getExpansionSetCode()).getName()).append(" - ").append(permanent.getOriginal().getRarity().toString());
// sb.append("\n").append(card.getId());
return sb.toString();
}
@Override @Override
protected List<String> getRules() { protected List<String> getRules() {
if (permanent.getCounters() != null) { if (permanent.getCounters() != null) {

View file

@ -71,10 +71,10 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
public void loadCards(BigCard bigCard) { public void loadCards(BigCard bigCard) {
this.bigCard = bigCard; this.bigCard = bigCard;
cbExpansionSet.setModel(new DefaultComboBoxModel(Sets.getInstance().toArray())); cbExpansionSet.setModel(new DefaultComboBoxModel(Sets.getInstance().values().toArray()));
cbExpansionSet.insertItemAt("All sets", 0); cbExpansionSet.insertItemAt("All sets", 0);
cbExpansionSet.setSelectedIndex(0); cbExpansionSet.setSelectedIndex(0);
for (ExpansionSet set: Sets.getInstance()) { for (ExpansionSet set: Sets.getInstance().values()) {
allCards.addAll(set.createCards()); allCards.addAll(set.createCards());
} }
filter.setUseColor(true); filter.setUseColor(true);
@ -427,9 +427,9 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
}//GEN-LAST:event_rdoPlaneswalkersActionPerformed }//GEN-LAST:event_rdoPlaneswalkersActionPerformed
private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed private void cbExpansionSetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbExpansionSetActionPerformed
filter.getExpansionSetId().clear(); filter.getExpansionSetCode().clear();
if (cbExpansionSet.getSelectedItem() instanceof ExpansionSet) { if (cbExpansionSet.getSelectedItem() instanceof ExpansionSet) {
filter.getExpansionSetId().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getId()); filter.getExpansionSetCode().add(((ExpansionSet)this.cbExpansionSet.getSelectedItem()).getCode());
} }
filterCards(); filterCards();
}//GEN-LAST:event_cbExpansionSetActionPerformed }//GEN-LAST:event_cbExpansionSetActionPerformed

View file

@ -41,12 +41,12 @@ import java.lang.reflect.Constructor;
import java.util.UUID; import java.util.UUID;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.prefs.Preferences;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileFilter;
import mage.cards.Card; import mage.cards.Card;
import mage.cards.decks.Deck; import mage.cards.decks.Deck;
import mage.cards.decks.DeckCardLists; import mage.cards.decks.DeckCardLists;
import mage.client.MageFrame;
import mage.client.util.Event; import mage.client.util.Event;
import mage.client.util.Listener; import mage.client.util.Listener;
import mage.view.CardsView; import mage.view.CardsView;
@ -59,12 +59,10 @@ public class DeckEditorPanel extends javax.swing.JPanel {
private JFileChooser fcSelectDeck; private JFileChooser fcSelectDeck;
private Deck deck = new Deck();; private Deck deck = new Deck();;
private Preferences prefs;
/** Creates new form DeckEditorPanel */ /** Creates new form DeckEditorPanel */
public DeckEditorPanel() { public DeckEditorPanel() {
initComponents(); initComponents();
prefs = Preferences.userNodeForPackage(this.getClass());
fcSelectDeck = new JFileChooser(); fcSelectDeck = new JFileChooser();
fcSelectDeck.setAcceptAllFileFilterUsed(false); fcSelectDeck.setAcceptAllFileFilterUsed(false);
fcSelectDeck.addChoosableFileFilter(new DeckFilter()); fcSelectDeck.addChoosableFileFilter(new DeckFilter());
@ -250,7 +248,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void btnLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoadActionPerformed private void btnLoadActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnLoadActionPerformed
String lastFolder = prefs.get("lastDeckFolder", ""); String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", "");
if (!lastFolder.isEmpty()) if (!lastFolder.isEmpty())
fcSelectDeck.setCurrentDirectory(new File(lastFolder)); fcSelectDeck.setCurrentDirectory(new File(lastFolder));
int ret = fcSelectDeck.showOpenDialog(this); int ret = fcSelectDeck.showOpenDialog(this);
@ -267,14 +265,14 @@ public class DeckEditorPanel extends javax.swing.JPanel {
} }
refreshDeck(); refreshDeck();
try { try {
prefs.put("lastDeckFolder", file.getCanonicalPath()); MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath());
} catch (IOException ex) { } } catch (IOException ex) { }
} }
fcSelectDeck.setSelectedFile(null); fcSelectDeck.setSelectedFile(null);
}//GEN-LAST:event_btnLoadActionPerformed }//GEN-LAST:event_btnLoadActionPerformed
private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed private void btnSaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSaveActionPerformed
String lastFolder = prefs.get("lastDeckFolder", ""); String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", "");
if (!lastFolder.isEmpty()) if (!lastFolder.isEmpty())
fcSelectDeck.setCurrentDirectory(new File(lastFolder)); fcSelectDeck.setCurrentDirectory(new File(lastFolder));
deck.setName(this.txtDeckName.getText()); deck.setName(this.txtDeckName.getText());
@ -294,7 +292,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
} }
try { try {
prefs.put("lastDeckFolder", file.getCanonicalPath()); MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath());
} catch (IOException ex) { } } catch (IOException ex) { }
} }
}//GEN-LAST:event_btnSaveActionPerformed }//GEN-LAST:event_btnSaveActionPerformed

View file

@ -25,10 +25,15 @@
<Layout> <Layout>
<DimensionLayout dim="0"> <DimensionLayout dim="0">
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="1" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="1" attributes="0">
<Group type="102" attributes="0"> <Group type="102" alignment="1" attributes="0">
<Component id="btnConnect" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="1" attributes="0"> <Group type="103" groupAlignment="1" attributes="0">
<Component id="lblPort" alignment="1" min="-2" max="-2" attributes="0"/> <Component id="lblPort" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="lblServer" min="-2" max="-2" attributes="0"/> <Component id="lblServer" min="-2" max="-2" attributes="0"/>
@ -40,15 +45,11 @@
<Component id="txtPort" min="-2" pref="71" max="-2" attributes="0"/> <Component id="txtPort" min="-2" pref="71" max="-2" attributes="0"/>
<EmptySpace min="-2" pref="131" max="-2" attributes="0"/> <EmptySpace min="-2" pref="131" max="-2" attributes="0"/>
</Group> </Group>
<Component id="txtServer" pref="236" max="32767" attributes="0"/> <Component id="txtServer" pref="245" max="32767" attributes="0"/>
<Component id="txtUserName" alignment="0" pref="236" max="32767" attributes="0"/> <Component id="txtUserName" alignment="0" pref="245" max="32767" attributes="0"/>
<Component id="chkAutoConnect" alignment="0" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
<Group type="102" alignment="1" attributes="0">
<Component id="btnConnect" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
</Group>
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
@ -72,7 +73,9 @@
<Component id="txtUserName" min="-2" max="-2" attributes="0"/> <Component id="txtUserName" min="-2" max="-2" attributes="0"/>
<Component id="lblUserName" min="-2" max="-2" attributes="0"/> <Component id="lblUserName" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace pref="17" max="32767" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="chkAutoConnect" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="19" max="32767" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnCancel" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnConnect" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="btnConnect" alignment="3" min="-2" max="-2" attributes="0"/>
@ -132,5 +135,13 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/> <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCancelActionPerformed"/>
</Events> </Events>
</Component> </Component>
<Component class="javax.swing.JCheckBox" name="chkAutoConnect">
<Properties>
<Property name="text" type="java.lang.String" value="Automatically connect to this server next time"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="chkAutoConnectActionPerformed"/>
</Events>
</Component>
</SubComponents> </SubComponents>
</Form> </Form>

View file

@ -39,8 +39,8 @@ import java.rmi.NotBoundException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.logging.Level; import java.util.logging.Level;
import java.util.logging.Logger; import java.util.logging.Logger;
import java.util.prefs.Preferences;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
import mage.client.MageFrame;
import mage.client.remote.Session; import mage.client.remote.Session;
import mage.client.util.Config; import mage.client.util.Config;
import mage.util.Logging; import mage.util.Logging;
@ -52,20 +52,17 @@ import mage.util.Logging;
public class ConnectDialog extends MageDialog { public class ConnectDialog extends MageDialog {
private final static Logger logger = Logging.getLogger(ConnectDialog.class.getName()); private final static Logger logger = Logging.getLogger(ConnectDialog.class.getName());
private Session session;
private Preferences prefs;
/** Creates new form ConnectDialog */ /** Creates new form ConnectDialog */
public ConnectDialog(Session session) { public ConnectDialog() {
this.session = session; initComponents();
prefs = Preferences.userNodeForPackage(this.getClass());
initComponents();
} }
public void showDialog() { public void showDialog() {
this.txtServer.setText(prefs.get("serverAddress", Config.serverName)); this.txtServer.setText(MageFrame.getPreferences().get("serverAddress", Config.serverName));
this.txtPort.setText(prefs.get("serverPort", Integer.toString(Config.port))); this.txtPort.setText(MageFrame.getPreferences().get("serverPort", Integer.toString(Config.port)));
this.txtUserName.setText(prefs.get("userName", "")); this.txtUserName.setText(MageFrame.getPreferences().get("userName", ""));
this.chkAutoConnect.setSelected(Boolean.parseBoolean(MageFrame.getPreferences().get("autoConnect", "false")));
this.setModal(true); this.setModal(true);
this.setLocation(50, 50); this.setLocation(50, 50);
this.setVisible(true); this.setVisible(true);
@ -88,6 +85,7 @@ public class ConnectDialog extends MageDialog {
lblUserName = new javax.swing.JLabel(); lblUserName = new javax.swing.JLabel();
btnConnect = new javax.swing.JButton(); btnConnect = new javax.swing.JButton();
btnCancel = new javax.swing.JButton(); btnCancel = new javax.swing.JButton();
chkAutoConnect = new javax.swing.JCheckBox();
setTitle("Connect"); setTitle("Connect");
setNormalBounds(new java.awt.Rectangle(100, 100, 410, 307)); setNormalBounds(new java.awt.Rectangle(100, 100, 410, 307));
@ -121,14 +119,25 @@ public class ConnectDialog extends MageDialog {
} }
}); });
chkAutoConnect.setText("Automatically connect to this server next time");
chkAutoConnect.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
chkAutoConnectActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout); getContentPane().setLayout(layout);
layout.setHorizontalGroup( layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(btnConnect)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnCancel))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(lblPort) .addComponent(lblPort)
.addComponent(lblServer) .addComponent(lblServer)
@ -138,12 +147,9 @@ public class ConnectDialog extends MageDialog {
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(txtPort, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtPort, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(131, 131, 131)) .addGap(131, 131, 131))
.addComponent(txtServer, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE) .addComponent(txtServer, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
.addComponent(txtUserName, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE))) .addComponent(txtUserName, javax.swing.GroupLayout.DEFAULT_SIZE, 245, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addComponent(chkAutoConnect, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addComponent(btnConnect)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnCancel)))
.addContainerGap()) .addContainerGap())
); );
layout.setVerticalGroup( layout.setVerticalGroup(
@ -161,7 +167,9 @@ public class ConnectDialog extends MageDialog {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtUserName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtUserName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(lblUserName)) .addComponent(lblUserName))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 17, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(chkAutoConnect)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnCancel) .addComponent(btnCancel)
.addComponent(btnConnect)) .addComponent(btnConnect))
@ -172,48 +180,46 @@ public class ConnectDialog extends MageDialog {
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed
MageFrame.getPreferences().put("autoConnect", Boolean.toString(chkAutoConnect.isSelected()));
this.setVisible(false); this.setVisible(false);
}//GEN-LAST:event_btnCancelActionPerformed }//GEN-LAST:event_btnCancelActionPerformed
private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed private void btnConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConnectActionPerformed
if (txtUserName.getText().isEmpty()) {
JOptionPane.showMessageDialog(rootPane, "Please provide a user name");
return;
}
if (txtServer.getText().isEmpty()) {
JOptionPane.showMessageDialog(rootPane, "Please provide a server address");
return;
}
if (txtPort.getText().isEmpty()) {
JOptionPane.showMessageDialog(rootPane, "Please provide a port number");
return;
}
if (Integer.valueOf(txtPort.getText()) < 1 || Integer.valueOf(txtPort.getText()) > 65535 ) {
JOptionPane.showMessageDialog(rootPane, "Invalid port number");
txtPort.setText(MageFrame.getPreferences().get("serverPort", Integer.toString(Config.port)));
return;
}
try { try {
if (txtUserName.getText().isEmpty()) {
JOptionPane.showMessageDialog(rootPane, "Please provide a user name");
return;
}
if (txtServer.getText().isEmpty()) {
JOptionPane.showMessageDialog(rootPane, "Please provide a server address");
return;
}
if (txtPort.getText().isEmpty()) {
JOptionPane.showMessageDialog(rootPane, "Please provide a port number");
return;
}
if (Integer.valueOf(txtPort.getText()) < 1 || Integer.valueOf(txtPort.getText()) > 65535 ) {
JOptionPane.showMessageDialog(rootPane, "Invalid port number");
txtPort.setText(prefs.get("serverPort", Integer.toString(Config.port)));
return;
}
setCursor(new Cursor(Cursor.WAIT_CURSOR)); setCursor(new Cursor(Cursor.WAIT_CURSOR));
session.connect(txtUserName.getText(), txtServer.getText(), Integer.valueOf(txtPort.getText())); if (MageFrame.connect(txtUserName.getText(), txtServer.getText(), Integer.valueOf(txtPort.getText()))) {
MageFrame.getPreferences().put("serverAddress", txtServer.getText());
prefs.put("serverAddress", txtServer.getText()); MageFrame.getPreferences().put("serverPort", txtPort.getText());
prefs.put("serverPort", txtPort.getText()); MageFrame.getPreferences().put("userName", txtUserName.getText());
prefs.put("userName", txtUserName.getText()); MageFrame.getPreferences().put("autoConnect", Boolean.toString(chkAutoConnect.isSelected()));
this.setVisible(false); this.setVisible(false);
} catch (RemoteException ex) { }
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); else {
logger.log(Level.SEVERE, "Unable to connect to server", ex); JOptionPane.showMessageDialog(rootPane, "Unable to connect to server");
JOptionPane.showMessageDialog(rootPane, "Unable to connect to server"); }
} catch (NotBoundException ex) {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
logger.log(Level.SEVERE, "Unable to connect to server", ex);
JOptionPane.showMessageDialog(rootPane, "Unable to connect to server");
} }
finally { finally {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
} }
}//GEN-LAST:event_btnConnectActionPerformed }//GEN-LAST:event_btnConnectActionPerformed
private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped private void keyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_keyTyped
@ -222,10 +228,16 @@ public class ConnectDialog extends MageDialog {
evt.consume(); evt.consume();
}//GEN-LAST:event_keyTyped }//GEN-LAST:event_keyTyped
private void chkAutoConnectActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_chkAutoConnectActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_chkAutoConnectActionPerformed
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel; private javax.swing.JButton btnCancel;
private javax.swing.JButton btnConnect; private javax.swing.JButton btnConnect;
private javax.swing.JCheckBox chkAutoConnect;
private javax.swing.JLabel lblPort; private javax.swing.JLabel lblPort;
private javax.swing.JLabel lblServer; private javax.swing.JLabel lblServer;
private javax.swing.JLabel lblUserName; private javax.swing.JLabel lblUserName;

View file

@ -65,6 +65,7 @@ public class MageDialog extends javax.swing.JInternalFrame {
public void show() { public void show() {
super.show(); super.show();
this.toFront(); this.toFront();
this.setClosable(!modal);
if (this.modal) { if (this.modal) {
startModal(); startModal();
} }
@ -74,6 +75,7 @@ public class MageDialog extends javax.swing.JInternalFrame {
public void setVisible(boolean value) { public void setVisible(boolean value) {
super.setVisible(value); super.setVisible(value);
this.toFront(); this.toFront();
this.setClosable(!modal);
if (modal) { if (modal) {
if (value) { if (value) {
startModal(); startModal();
@ -100,7 +102,7 @@ public class MageDialog extends javax.swing.JInternalFrame {
private synchronized void startModal() { private synchronized void startModal() {
try { try {
if (SwingUtilities.isEventDispatchThread()) { if (SwingUtilities.isEventDispatchThread()) {
EventQueue theQueue = getToolkit().getSystemEventQueue(); EventQueue theQueue = getToolkit().getSystemEventQueue();
while (isVisible()) { while (isVisible()) {

View file

@ -60,7 +60,7 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
this.setModal(false); this.setModal(false);
} }
public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId) { public void loadCards(String name, CardsView showCards, BigCard bigCard, CardDimensions dimension, UUID gameId, boolean modal) {
this.title = name; this.title = name;
cardArea.removeAll(); cardArea.removeAll();
if (showCards != null && showCards.size() < 10) if (showCards != null && showCards.size() < 10)
@ -73,6 +73,7 @@ public class ShowCardsDialog extends MageDialog implements MouseListener {
pack(); pack();
this.revalidate(); this.revalidate();
this.repaint(); this.repaint();
this.setModal(modal);
this.setVisible(true); this.setVisible(true);
} }

View file

@ -1,6 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<Form version="1.3" maxVersion="1.7"> <Form version="1.3" maxVersion="1.7">
<Properties>
<Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="80" green="80" id="gray" palette="1" red="80" type="palette"/>
</Property>
<Property name="foreground" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor">
<Color blue="80" green="80" id="gray" palette="1" red="80" type="palette"/>
</Property>
<Property name="opaque" type="boolean" value="true"/>
</Properties>
<AuxValues> <AuxValues>
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>

View file

@ -162,6 +162,10 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane implements Compon
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() { private void initComponents() {
setBackground(java.awt.Color.gray);
setForeground(java.awt.Color.gray);
setOpaque(true);
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
@Override @Override

View file

@ -137,15 +137,12 @@ public class GamePanel extends javax.swing.JPanel {
this.players.clear(); this.players.clear();
this.pnlBattlefield.removeAll(); this.pnlBattlefield.removeAll();
MageFrame.getCombatDialog().hideDialog(); MageFrame.getCombatDialog().hideDialog();
// MageFrame.getDesktop().remove(combat);
this.setVisible(false); this.setVisible(false);
} }
public synchronized void init(GameView game) { public synchronized void init(GameView game) {
MageFrame.getCombatDialog().init(gameId, bigCard); MageFrame.getCombatDialog().init(gameId, bigCard);
// MageFrame.getDesktop().add(combat, JLayeredPane.POPUP_LAYER);
MageFrame.getCombatDialog().setLocation(500, 300); MageFrame.getCombatDialog().setLocation(500, 300);
// MageFrame.getDesktop().add(pickNumber, JLayeredPane.POPUP_LAYER);
addPlayers(game); addPlayers(game);
updateGame(game); updateGame(game);
} }
@ -257,20 +254,17 @@ public class GamePanel extends javax.swing.JPanel {
this.feedbackPanel.getFeedback(FeedbackMode.QUESTION, question, true, false); this.feedbackPanel.getFeedback(FeedbackMode.QUESTION, question, true, false);
} }
public void inform(String information, CardsView cardView, GameView gameView) { public void pickTarget(String message, CardsView cardView, GameView gameView, boolean required) {
updateGame(gameView); updateGame(gameView);
this.feedbackPanel.getFeedback(required?FeedbackMode.INFORM:FeedbackMode.CANCEL, message, false, gameView.getSpecial());
if (cardView != null && cardView.size() > 0) { if (cardView != null && cardView.size() > 0) {
showCards(information, cardView); showCards(message, cardView, required);
} }
this.feedbackPanel.getFeedback(FeedbackMode.INFORM, information, false, gameView.getSpecial());
} }
public void cancel(String message, CardsView cardView, GameView gameView) { public void inform(String information, GameView gameView) {
updateGame(gameView); updateGame(gameView);
if (cardView != null && cardView.size() > 0) { this.feedbackPanel.getFeedback(FeedbackMode.INFORM, information, false, gameView.getSpecial());
showCards(message, cardView);
}
this.feedbackPanel.getFeedback(FeedbackMode.CANCEL, message, false, gameView.getSpecial());
} }
public void modalMessage(String message) { public void modalMessage(String message) {
@ -310,13 +304,12 @@ public class GamePanel extends javax.swing.JPanel {
public void revealCards(String name, CardsView cards) { public void revealCards(String name, CardsView cards) {
ShowCardsDialog showCards = new ShowCardsDialog(); ShowCardsDialog showCards = new ShowCardsDialog();
MageFrame.getDesktop().add(showCards); showCards.loadCards(name, cards, bigCard, Config.dimensions, gameId, false);
showCards.loadCards(name, cards, bigCard, Config.dimensions, gameId);
} }
private void showCards(String title, CardsView cards) { private void showCards(String title, CardsView cards, boolean required) {
ShowCardsDialog showCards = new ShowCardsDialog(); ShowCardsDialog showCards = new ShowCardsDialog();
showCards.loadCards(title, cards, bigCard, Config.dimensions, gameId); showCards.loadCards(title, cards, bigCard, Config.dimensions, gameId, required);
} }
public void getAmount(int min, int max, String message) { public void getAmount(int min, int max, String message) {

View file

@ -200,7 +200,7 @@ public class PlayerPanel extends javax.swing.JPanel {
if (graveyard == null) { if (graveyard == null) {
graveyard = new ShowCardsDialog(); graveyard = new ShowCardsDialog();
} }
graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId); graveyard.loadCards(player.getName() + " graveyard", player.getGraveyard(), bigCard, Config.dimensions, gameId, false);
}//GEN-LAST:event_btnGraveActionPerformed }//GEN-LAST:event_btnGraveActionPerformed

View file

@ -103,11 +103,7 @@ public class Client implements CallbackClient {
} }
else if (callback.getMethod().equals("gameTarget")) { else if (callback.getMethod().equals("gameTarget")) {
GameClientMessage message = (GameClientMessage) callback.getData(); GameClientMessage message = (GameClientMessage) callback.getData();
if (message.isFlag()) { session.getGame().pickTarget(message.getMessage(), message.getCardsView(), message.getGameView(), message.isFlag());
session.getGame().inform(message.getMessage(), message.getCardsView(), message.getGameView());
} else {
session.getGame().cancel(message.getMessage(), message.getCardsView(), message.getGameView());
}
} }
else if (callback.getMethod().equals("gameSelect")) { else if (callback.getMethod().equals("gameSelect")) {
GameClientMessage message = (GameClientMessage) callback.getData(); GameClientMessage message = (GameClientMessage) callback.getData();
@ -142,7 +138,7 @@ public class Client implements CallbackClient {
else if (callback.getMethod().equals("gameInform")) { else if (callback.getMethod().equals("gameInform")) {
if (callback.getMessageId() > messageId) { if (callback.getMessageId() > messageId) {
GameClientMessage message = (GameClientMessage) callback.getData(); GameClientMessage message = (GameClientMessage) callback.getData();
session.getGame().inform(message.getMessage(), null, message.getGameView()); session.getGame().inform(message.getMessage(), message.getGameView());
} }
else { else {
logger.warning("message out of sequence - ignoring"); logger.warning("message out of sequence - ignoring");

View file

@ -28,6 +28,7 @@
package mage.client.remote; package mage.client.remote;
import java.awt.Cursor;
import java.rmi.NotBoundException; import java.rmi.NotBoundException;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry; import java.rmi.registry.LocateRegistry;
@ -70,9 +71,6 @@ public class Session {
private String userName; private String userName;
private MageFrame frame; private MageFrame frame;
private ServerState serverState; private ServerState serverState;
// private String[] playerTypes;
// private List<GameTypeView> gameTypes;
// private String[] deckTypes;
private Map<UUID, ChatPanel> chats = new HashMap<UUID, ChatPanel>(); private Map<UUID, ChatPanel> chats = new HashMap<UUID, ChatPanel>();
private GamePanel game; private GamePanel game;
private CallbackClientDaemon callbackDaemon; private CallbackClientDaemon callbackDaemon;
@ -81,15 +79,15 @@ public class Session {
this.frame = frame; this.frame = frame;
} }
public void connect(String userName, String serverName, int port) throws RemoteException, NotBoundException { public boolean connect(String userName, String serverName, int port) {
if (isConnected()) { if (isConnected()) {
disconnect(); disconnect();
} }
System.setSecurityManager(null);
Registry reg = LocateRegistry.getRegistry(serverName, port);
this.server = (Server) reg.lookup(Config.remoteServer);
this.userName = userName;
try { try {
System.setSecurityManager(null);
Registry reg = LocateRegistry.getRegistry(serverName, port);
this.server = (Server) reg.lookup(Config.remoteServer);
this.userName = userName;
this.client = new Client(this, frame, userName); this.client = new Client(this, frame, userName);
sessionId = server.registerClient(userName, client.getId()); sessionId = server.registerClient(userName, client.getId());
callbackDaemon = new CallbackClientDaemon(sessionId, client, server); callbackDaemon = new CallbackClientDaemon(sessionId, client, server);
@ -97,9 +95,15 @@ public class Session {
logger.info("Connected to RMI server at " + serverName + ":" + port); logger.info("Connected to RMI server at " + serverName + ":" + port);
frame.setStatusText("Connected to " + serverName + ":" + port + " "); frame.setStatusText("Connected to " + serverName + ":" + port + " ");
frame.enableButtons(); frame.enableButtons();
return true;
} catch (MageException ex) { } catch (MageException ex) {
Logger.getLogger(Session.class.getName()).log(Level.SEVERE, null, ex); logger.log(Level.SEVERE, null, ex);
} catch (RemoteException ex) {
logger.log(Level.SEVERE, "Unable to connect to server - ", ex);
} catch (NotBoundException ex) {
logger.log(Level.SEVERE, "Unable to connect to server - ", ex);
} }
return false;
} }
public void disconnect() { public void disconnect() {
@ -119,6 +123,7 @@ public class Session {
logger.log(Level.SEVERE, "Error disconnecting ...", ex); logger.log(Level.SEVERE, "Error disconnecting ...", ex);
} }
frame.setStatusText("Not connected "); frame.setStatusText("Not connected ");
frame.disableButtons();
} }
} }

View file

@ -36,9 +36,9 @@ package mage.client.table;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.prefs.Preferences;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.filechooser.FileFilter; import javax.swing.filechooser.FileFilter;
import mage.client.MageFrame;
/** /**
* *
@ -47,12 +47,10 @@ import javax.swing.filechooser.FileFilter;
public class NewPlayerPanel extends javax.swing.JPanel { public class NewPlayerPanel extends javax.swing.JPanel {
private JFileChooser fcSelectDeck; private JFileChooser fcSelectDeck;
private Preferences prefs;
/** Creates new form NewPlayerPanel */ /** Creates new form NewPlayerPanel */
public NewPlayerPanel() { public NewPlayerPanel() {
initComponents(); initComponents();
prefs = Preferences.userNodeForPackage(this.getClass());
fcSelectDeck = new JFileChooser(); fcSelectDeck = new JFileChooser();
fcSelectDeck.setAcceptAllFileFilterUsed(false); fcSelectDeck.setAcceptAllFileFilterUsed(false);
fcSelectDeck.addChoosableFileFilter(new DeckFilter()); fcSelectDeck.addChoosableFileFilter(new DeckFilter());
@ -65,7 +63,7 @@ public class NewPlayerPanel extends javax.swing.JPanel {
} }
protected void playerLoadDeck() { protected void playerLoadDeck() {
String lastFolder = prefs.get("lastDeckFolder", ""); String lastFolder = MageFrame.getPreferences().get("lastDeckFolder", "");
if (!lastFolder.isEmpty()) if (!lastFolder.isEmpty())
fcSelectDeck.setCurrentDirectory(new File(lastFolder)); fcSelectDeck.setCurrentDirectory(new File(lastFolder));
int ret = fcSelectDeck.showDialog(this, "Select Deck"); int ret = fcSelectDeck.showDialog(this, "Select Deck");
@ -73,7 +71,7 @@ public class NewPlayerPanel extends javax.swing.JPanel {
File file = fcSelectDeck.getSelectedFile(); File file = fcSelectDeck.getSelectedFile();
this.txtPlayerDeck.setText(file.getPath()); this.txtPlayerDeck.setText(file.getPath());
try { try {
prefs.put("lastDeckFolder", file.getCanonicalPath()); MageFrame.getPreferences().put("lastDeckFolder", file.getCanonicalPath());
} catch (IOException ex) { } } catch (IOException ex) { }
} }
fcSelectDeck.setSelectedFile(null); fcSelectDeck.setSelectedFile(null);

View file

@ -53,6 +53,7 @@ public class Config {
public static final String powerboxResourcePath; public static final String powerboxResourcePath;
public static final String cardArtResourcePath; public static final String cardArtResourcePath;
public static final String symbolsResourcePath; public static final String symbolsResourcePath;
public static final String setIconsResourcePath;
public static final String resourcePath; public static final String resourcePath;
public static final double cardScalingFactor; public static final double cardScalingFactor;
public static final boolean useResource; public static final boolean useResource;
@ -78,6 +79,7 @@ public class Config {
frameResourcePath = cardsResourcePath + "Frame\\"; frameResourcePath = cardsResourcePath + "Frame\\";
powerboxResourcePath = cardsResourcePath + "PowerBox\\"; powerboxResourcePath = cardsResourcePath + "PowerBox\\";
cardArtResourcePath = cardsResourcePath + "Pics\\"; cardArtResourcePath = cardsResourcePath + "Pics\\";
setIconsResourcePath = cardsResourcePath + "Icon\\";
symbolsResourcePath = p.getProperty("symbols-resource-path"); symbolsResourcePath = p.getProperty("symbols-resource-path");
} }
else { else {
@ -85,6 +87,7 @@ public class Config {
frameResourcePath = resourcePath + "cards/frame/"; frameResourcePath = resourcePath + "cards/frame/";
powerboxResourcePath = resourcePath + "cards/powerbox/"; powerboxResourcePath = resourcePath + "cards/powerbox/";
cardArtResourcePath = resourcePath + "cards/art/"; cardArtResourcePath = resourcePath + "cards/art/";
setIconsResourcePath = resourcePath + "cards/icon/";
symbolsResourcePath = resourcePath + "symbols/"; symbolsResourcePath = resourcePath + "symbols/";
} }
} }

View file

@ -50,12 +50,15 @@ public final class Constants {
public static final int ART_MAX_YOFFSET = 37; public static final int ART_MAX_YOFFSET = 37;
public static final int NAME_MAX_YOFFSET = 28; public static final int NAME_MAX_YOFFSET = 28;
public static final int TYPE_MAX_YOFFSET = 223; public static final int TYPE_MAX_YOFFSET = 223;
public static final int ICON_MAX_HEIGHT = 16;
public static final int ICON_MAX_WIDTH = 16;
public static final int ICON_MAX_XOFFSET = 238;
public static final int ICON_MAX_YOFFSET = 210;
public static final int TEXT_MAX_YOFFSET = 232; public static final int TEXT_MAX_YOFFSET = 232;
public static final int TEXT_MAX_WIDTH = 227; public static final int TEXT_MAX_WIDTH = 227;
public static final int TEXT_MAX_HEIGHT = 105; public static final int TEXT_MAX_HEIGHT = 105;
public static final int NAME_FONT_MAX_SIZE = 13; public static final int NAME_FONT_MAX_SIZE = 13;
public static final int TEXT_FONT_MAX_SIZE = 11; public static final int TEXT_FONT_MAX_SIZE = 11;
// public static final int PARAGRAPH_MAX_SPACING = 4;
public static final int POWBOX_MAX_TOP = 336; public static final int POWBOX_MAX_TOP = 336;
public static final int POWBOX_MAX_LEFT = 202; public static final int POWBOX_MAX_LEFT = 202;
public static final int POWBOX_TEXT_MAX_TOP = 352; public static final int POWBOX_TEXT_MAX_TOP = 352;
@ -63,28 +66,5 @@ public final class Constants {
public static final int DAMAGE_MAX_LEFT = 180; public static final int DAMAGE_MAX_LEFT = 180;
public static final double SCALE_FACTOR = 0.5; public static final double SCALE_FACTOR = 0.5;
// public static final int FRAME_HEIGHT = (int)(FRAME_MAX_HEIGHT * SCALE_FACTOR);
// public static final int FRAME_WIDTH = (int)(FRAME_MAX_WIDTH * SCALE_FACTOR);
//// public static final int ART_HEIGHT = (int)(ART_MAX_HEIGHT * SCALE_FACTOR);
//// public static final int ART_WIDTH = (int)(ART_MAX_WIDTH * SCALE_FACTOR);
// public static final int SYMBOL_HEIGHT = (int)(SYMBOL_MAX_HEIGHT * SCALE_FACTOR);
// public static final int SYMBOL_WIDTH = (int)(SYMBOL_MAX_WIDTH * SCALE_FACTOR);
//// public static final int SYMBOL_XOFFSET = (int)(SYMBOL_MAX_XOFFSET * SCALE_FACTOR);
//// public static final int SYMBOL_YOFFSET = (int)(SYMBOL_MAX_YOFFSET * SCALE_FACTOR);
//// public static final int SYMBOL_SPACE = (int)(SYMBOL_MAX_SPACE * SCALE_FACTOR);
// public static final int CONTENT_XOFFSET = (int)(CONTENT_MAX_XOFFSET * SCALE_FACTOR);
//// public static final int ART_YOFFSET = (int)(ART_MAX_YOFFSET * SCALE_FACTOR);
// public static final int NAME_YOFFSET = (int)(NAME_MAX_YOFFSET * SCALE_FACTOR);
// public static final int TYPE_YOFFSET = (int)(TYPE_MAX_YOFFSET * SCALE_FACTOR);
// public static final int TEXT_YOFFSET = (int)(TEXT_MAX_YOFFSET * SCALE_FACTOR);
// public static final int TEXT_WIDTH = (int)(TEXT_MAX_WIDTH * SCALE_FACTOR);
// public static final int TEXT_HEIGHT = (int)(TEXT_MAX_HEIGHT * SCALE_FACTOR);
// public static final int POWBOX_TEXT_TOP = (int)(POWBOX_TEXT_MAX_TOP * SCALE_FACTOR);
// public static final int POWBOX_TEXT_LEFT = (int)(POWBOX_TEXT_MAX_LEFT * SCALE_FACTOR);
//// public static final int DAMAGE_LEFT = (int)(DAMAGE_MAX_LEFT * SCALE_FACTOR);
// public static final int NAME_FONT_SIZE = Math.max(9, (int)(NAME_FONT_MAX_SIZE * SCALE_FACTOR));
//// public static final int TEXT_FONT_SIZE = Math.max(9, (int)(TEXT_FONT_MAX_SIZE * SCALE_FACTOR));
//// public static final int PARAGRAPH_SPACING = (int)(PARAGRAPH_MAX_SPACING * SCALE_FACTOR);
} }

View file

@ -29,6 +29,7 @@
package mage.client.util; package mage.client.util;
import java.awt.Image; import java.awt.Image;
import java.awt.image.BufferedImage;
import static mage.client.util.Constants.*; import static mage.client.util.Constants.*;
/** /**
@ -37,35 +38,35 @@ import static mage.client.util.Constants.*;
*/ */
public class Frames { public class Frames {
public static Image Black = ImageHelper.loadImage(Config.frameResourcePath + "8 black.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Black = ImageHelper.loadImage(Config.frameResourcePath + "8 black.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Blue = ImageHelper.loadImage(Config.frameResourcePath + "8 blue.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Blue = ImageHelper.loadImage(Config.frameResourcePath + "8 blue.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Gold = ImageHelper.loadImage(Config.frameResourcePath + "8 gold.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Gold = ImageHelper.loadImage(Config.frameResourcePath + "8 gold.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Green = ImageHelper.loadImage(Config.frameResourcePath + "8 green.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Green = ImageHelper.loadImage(Config.frameResourcePath + "8 green.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Grey = ImageHelper.loadImage(Config.frameResourcePath + "8 grey.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Grey = ImageHelper.loadImage(Config.frameResourcePath + "8 grey.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Red = ImageHelper.loadImage(Config.frameResourcePath + "8 red.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Red = ImageHelper.loadImage(Config.frameResourcePath + "8 red.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image White = ImageHelper.loadImage(Config.frameResourcePath + "8 white.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage White = ImageHelper.loadImage(Config.frameResourcePath + "8 white.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image BlackRed = ImageHelper.loadImage(Config.frameResourcePath + "black to red hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage BlackRed = ImageHelper.loadImage(Config.frameResourcePath + "black to red hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image BlackGreen = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid black to green.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage BlackGreen = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid black to green.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image BlueBlack = ImageHelper.loadImage(Config.frameResourcePath + "blue_to_black_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage BlueBlack = ImageHelper.loadImage(Config.frameResourcePath + "blue_to_black_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image BlueRed = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid blue to red.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage BlueRed = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid blue to red.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image GreenBlue = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid green to blue.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage GreenBlue = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid green to blue.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image GreenWhite = ImageHelper.loadImage(Config.frameResourcePath + "green_to_white_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage GreenWhite = ImageHelper.loadImage(Config.frameResourcePath + "green_to_white_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image RedGreen = ImageHelper.loadImage(Config.frameResourcePath + "red_to_green_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage RedGreen = ImageHelper.loadImage(Config.frameResourcePath + "red_to_green_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image RedWhite = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid red to white.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage RedWhite = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid red to white.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image WhiteBlack = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid white to black.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage WhiteBlack = ImageHelper.loadImage(Config.frameResourcePath + "eve hybrid white to black.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image WhiteBlue = ImageHelper.loadImage(Config.frameResourcePath + "white_to_blue_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage WhiteBlue = ImageHelper.loadImage(Config.frameResourcePath + "white_to_blue_hybrid.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Forest = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana green.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Forest = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana green.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Island = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana blue.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Island = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana blue.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Mountain = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana red.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Mountain = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana red.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Plains = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana white.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Plains = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana white.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Swamp = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana black.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Swamp = ImageHelper.loadImage(Config.frameResourcePath + "8 land mana black.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Land = ImageHelper.loadImage(Config.frameResourcePath + "8 multiland nomana colorless.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Land = ImageHelper.loadImage(Config.frameResourcePath + "8 multiland nomana colorless.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image Effect = ImageHelper.loadImage(Config.frameResourcePath + "Effects\\effect0.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); public static BufferedImage Effect = ImageHelper.loadImage(Config.frameResourcePath + "Effects\\effect0.png", FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
public static Image PowBoxLeft = ImageHelper.loadImage(Config.powerboxResourcePath + "graphic_card_powerbox_a_left.png"); public static BufferedImage PowBoxLeft = ImageHelper.loadImage(Config.powerboxResourcePath + "graphic_card_powerbox_a_left.png");
public static Image PowBoxMid = ImageHelper.loadImage(Config.powerboxResourcePath + "graphic_card_powerbox_a_middle.png"); public static BufferedImage PowBoxMid = ImageHelper.loadImage(Config.powerboxResourcePath + "graphic_card_powerbox_a_middle.png");
public static Image PowBoxRight = ImageHelper.loadImage(Config.powerboxResourcePath + "graphic_card_powerbox_a_right.png"); public static BufferedImage PowBoxRight = ImageHelper.loadImage(Config.powerboxResourcePath + "graphic_card_powerbox_a_right.png");
} }

View file

@ -42,6 +42,7 @@ import java.util.List;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.client.cards.CardDimensions; import mage.client.cards.CardDimensions;
import mage.sets.Sets;
import mage.view.AbilityView; import mage.view.AbilityView;
import mage.view.CardView; import mage.view.CardView;
import mage.view.StackAbilityView; import mage.view.StackAbilityView;
@ -52,17 +53,30 @@ import static mage.client.util.Constants.*;
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class ImageHelper { public class ImageHelper {
protected static HashMap<String, Image> images = new HashMap<String, Image>(); protected static HashMap<String, BufferedImage> images = new HashMap<String, BufferedImage>();
protected static HashMap<String, BufferedImage> backgrounds = new HashMap<String, BufferedImage>(); protected static HashMap<String, BufferedImage> backgrounds = new HashMap<String, BufferedImage>();
public static Image loadImage(String ref, int width, int height) { public static BufferedImage loadImage(String ref, int width, int height) {
Image image = loadImage(ref); BufferedImage image = loadImage(ref);
if (image != null) if (image != null)
return ScaleImage(image, width, height); return scaleImage(image, width, height);
return null; return null;
} }
public static Image loadImage(String ref) { /**
*
* @param ref - image name
* @param height - height after scaling
* @return a scaled image that preserves the original aspect ratio, with a specified height
*/
public static BufferedImage loadImage(String ref, int height) {
BufferedImage image = loadImage(ref);
if (image != null)
return scaleImage(image, height);
return null;
}
public static BufferedImage loadImage(String ref) {
if (!images.containsKey(ref)) { if (!images.containsKey(ref)) {
try { try {
if (Config.useResource) if (Config.useResource)
@ -76,11 +90,9 @@ public class ImageHelper {
return images.get(ref); return images.get(ref);
} }
public static BufferedImage getBackground(CardView card) { public static BufferedImage getBackground(CardView card, String backgroundName) {
// card background should be the same for all cards with the same name/art if (backgrounds.containsKey(backgroundName)) {
String cardName = card.getName()+card.getArt(); return backgrounds.get(backgroundName);
if (backgrounds.containsKey(cardName)) {
return backgrounds.get(cardName);
} }
BufferedImage background = new BufferedImage(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT, BufferedImage.TYPE_INT_RGB); BufferedImage background = new BufferedImage(FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT, BufferedImage.TYPE_INT_RGB);
@ -88,28 +100,40 @@ public class ImageHelper {
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g.setColor(Color.WHITE); g.setColor(Color.WHITE);
g.fillRect(0, 0, FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT); g.fillRect(0, 0, FRAME_MAX_WIDTH, FRAME_MAX_HEIGHT);
g.drawImage(getFrame(card), 0, 0, Color.WHITE, null); if (card instanceof StackAbilityView || card instanceof AbilityView) {
if (card.getArt() != null && !card.getArt().equals("")) { g.drawImage(Frames.Effect, 0, 0, Color.WHITE, null);
Image art = loadImage(Config.cardArtResourcePath + card.getArt(), ART_MAX_WIDTH, ART_MAX_HEIGHT);
g.drawImage(art, CONTENT_MAX_XOFFSET, ART_MAX_YOFFSET, null);
} }
else {
g.drawImage(getFrame(card), 0, 0, Color.WHITE, null);
if (card.getArt() != null && !card.getArt().equals("")) {
BufferedImage art = loadImage(Config.cardArtResourcePath + card.getArt(), ART_MAX_WIDTH, ART_MAX_HEIGHT);
g.drawImage(art, CONTENT_MAX_XOFFSET, ART_MAX_YOFFSET, null);
}
if (card.getCardTypes() != null && (card.getCardTypes().contains(CardType.CREATURE) || card.getCardTypes().contains(CardType.PLANESWALKER))) { if (card.getExpansionSetCode() != null && card.getRarity() != null) {
g.drawImage(Frames.PowBoxLeft, POWBOX_MAX_LEFT, POWBOX_MAX_TOP, null); String symbolCode = Sets.getInstance().get(card.getExpansionSetCode()).getSymbolCode();
g.drawImage(Frames.PowBoxMid, POWBOX_MAX_LEFT + 7, POWBOX_MAX_TOP, null); if (symbolCode != null && symbolCode.length() > 0) {
g.drawImage(Frames.PowBoxRight, POWBOX_MAX_LEFT + 38, POWBOX_MAX_TOP, null); StringBuilder sb = new StringBuilder();
sb.append(Config.setIconsResourcePath).append("graphic_").append(symbolCode).append("_").append(card.getRarity().getSymbolCode()).append(".png");
BufferedImage icon = loadImage(sb.toString(), ICON_MAX_HEIGHT);
g.drawImage(icon, ICON_MAX_XOFFSET - icon.getWidth(), ICON_MAX_YOFFSET, null);
}
}
if (card.getCardTypes() != null && (card.getCardTypes().contains(CardType.CREATURE) || card.getCardTypes().contains(CardType.PLANESWALKER))) {
g.drawImage(Frames.PowBoxLeft, POWBOX_MAX_LEFT, POWBOX_MAX_TOP, null);
g.drawImage(Frames.PowBoxMid, POWBOX_MAX_LEFT + 7, POWBOX_MAX_TOP, null);
g.drawImage(Frames.PowBoxRight, POWBOX_MAX_LEFT + 38, POWBOX_MAX_TOP, null);
}
} }
g.dispose(); g.dispose();
backgrounds.put(cardName, background); backgrounds.put(backgroundName, background);
return background; return background;
} }
protected static Image getFrame(CardView card) { protected static BufferedImage getFrame(CardView card) {
if (card instanceof StackAbilityView || card instanceof AbilityView) {
return Frames.Effect;
}
if (card.getCardTypes().contains(CardType.LAND)) { if (card.getCardTypes().contains(CardType.LAND)) {
return getLandFrame(card); return getLandFrame(card);
@ -178,7 +202,7 @@ public class ImageHelper {
return Frames.Grey; return Frames.Grey;
} }
protected static Image getLandFrame(CardView card) { protected static BufferedImage getLandFrame(CardView card) {
if (card.getSuperTypes().contains("Basic")) { if (card.getSuperTypes().contains("Basic")) {
if (card.getSubTypes().contains("Forest")) { if (card.getSubTypes().contains("Forest")) {
return Frames.Forest; return Frames.Forest;
@ -199,8 +223,31 @@ public class ImageHelper {
return Frames.Land; return Frames.Land;
} }
public static Image ScaleImage(Image image, int width, int height) { public static BufferedImage scaleImage(BufferedImage image, int width, int height) {
return image.getScaledInstance(width, height, Image.SCALE_SMOOTH); BufferedImage scaledImage = image;
int w = image.getWidth();
int h = image.getHeight();
do {
w /= 2;
h /= 2;
if (w < width || h < height) {
w = width;
h = height;
}
BufferedImage newImage = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics2D = newImage.createGraphics();
graphics2D.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
graphics2D.drawImage(scaledImage, 0, 0, w, h, null);
graphics2D.dispose();
scaledImage = newImage;
} while (w != width || h != height);
return scaledImage;
}
public static BufferedImage scaleImage(BufferedImage image, int height) {
double ratio = height / (double)image.getHeight();
int width = (int) (image.getWidth() * ratio);
return scaleImage(image, width, height);
} }
public static MemoryImageSource rotate(Image image, CardDimensions dimensions) { public static MemoryImageSource rotate(Image image, CardDimensions dimensions) {
@ -223,7 +270,7 @@ public class ImageHelper {
} }
public static void DrawCosts(List<String> costs, Graphics2D g, int xOffset, int yOffset, ImageObserver o) { public static void drawCosts(List<String> costs, Graphics2D g, int xOffset, int yOffset, ImageObserver o) {
if (costs.size() > 0) { if (costs.size() > 0) {
int costLeft = xOffset; int costLeft = xOffset;
for (int i = costs.size() - 1; i >= 0; i--) { for (int i = costs.size() - 1; i >= 0; i--) {

View file

@ -33,6 +33,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.ObjectColor; import mage.ObjectColor;
import mage.cards.Card; import mage.cards.Card;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -55,6 +56,8 @@ public class CardView implements Serializable {
protected ObjectColor color; protected ObjectColor color;
protected List<String> manaCost; protected List<String> manaCost;
protected String art; protected String art;
protected Rarity rarity;
protected String expansionSetCode;
public CardView(Card card) { public CardView(Card card) {
this.id = card.getId(); this.id = card.getId();
@ -75,6 +78,8 @@ public class CardView implements Serializable {
this.color = card.getColor(); this.color = card.getColor();
this.manaCost = card.getManaCost().getSymbols(); this.manaCost = card.getManaCost().getSymbols();
this.art = card.getArt(); this.art = card.getArt();
this.rarity = card.getRarity();
this.expansionSetCode = card.getExpansionSetCode();
} }
protected CardView() { protected CardView() {
@ -139,6 +144,14 @@ public class CardView implements Serializable {
return art; return art;
} }
public Rarity getRarity() {
return rarity;
}
public String getExpansionSetCode() {
return expansionSetCode;
}
public UUID getId() { public UUID getId() {
return id; return id;
} }

View file

@ -46,24 +46,24 @@ public class CombatGroupView implements Serializable {
private CardsView blockers = new CardsView(); private CardsView blockers = new CardsView();
private String defenderName; private String defenderName;
public CombatGroupView(CombatGroup combatGroup, GameState state) { public CombatGroupView(CombatGroup combatGroup, Game game) {
Player player = state.getPlayer(combatGroup.getDefenderId()); Player player = game.getPlayer(combatGroup.getDefenderId());
if (player != null) { if (player != null) {
this.defenderName = player.getName(); this.defenderName = player.getName();
} }
else { else {
Permanent perm = state.getPermanent(combatGroup.getDefenderId()); Permanent perm = game.getPermanent(combatGroup.getDefenderId());
this.defenderName = perm.getName(); this.defenderName = perm.getName();
} }
for (UUID id: combatGroup.getAttackers()) { for (UUID id: combatGroup.getAttackers()) {
Permanent attacker = state.getPermanent(id); Permanent attacker = game.getPermanent(id);
if (attacker != null) if (attacker != null)
attackers.put(id, new PermanentView(attacker)); attackers.put(id, new PermanentView(attacker, game.getCard(attacker.getId())));
} }
for (UUID id: combatGroup.getBlockers()) { for (UUID id: combatGroup.getBlockers()) {
Permanent blocker = state.getPermanent(id); Permanent blocker = game.getPermanent(id);
if (blocker != null) if (blocker != null)
blockers.put(id, new PermanentView(blocker)); blockers.put(id, new PermanentView(blocker, game.getCard(blocker.getId())));
} }
} }

View file

@ -63,7 +63,7 @@ public class GameView implements Serializable {
public GameView(GameState state, Game game) { public GameView(GameState state, Game game) {
for (Player player: state.getPlayers().values()) { for (Player player: state.getPlayers().values()) {
players.add(new PlayerView(player, state, game)); players.add(new PlayerView(player, game));
} }
for (StackObject stackObject: state.getStack()) { for (StackObject stackObject: state.getStack()) {
if (stackObject instanceof StackAbility) { if (stackObject instanceof StackAbility) {
@ -92,7 +92,7 @@ public class GameView implements Serializable {
else else
this.priorityPlayerName = ""; this.priorityPlayerName = "";
for (CombatGroup combatGroup: state.getCombat().getGroups()) { for (CombatGroup combatGroup: state.getCombat().getGroups()) {
combat.add(new CombatGroupView(combatGroup, state)); combat.add(new CombatGroupView(combatGroup, game));
} }
this.special = state.getSpecialActions().getControlledBy(state.getPriorityPlayerId()).size() > 0; this.special = state.getSpecialActions().getControlledBy(state.getPriorityPlayerId()).size() > 0;
} }

View file

@ -31,6 +31,7 @@ package mage.view;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.UUID; import java.util.UUID;
import mage.cards.Card;
import mage.counters.Counter; import mage.counters.Counter;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
@ -47,8 +48,9 @@ public class PermanentView extends CardView {
private int damage; private int damage;
private List<UUID> attachments; private List<UUID> attachments;
private List<CounterView> counters; private List<CounterView> counters;
private CardView original;
public PermanentView(Permanent permanent) { public PermanentView(Permanent permanent, Card card) {
super(permanent); super(permanent);
this.tapped = permanent.isTapped(); this.tapped = permanent.isTapped();
this.flipped = permanent.isFlipped(); this.flipped = permanent.isFlipped();
@ -65,6 +67,7 @@ public class PermanentView extends CardView {
counters.add(new CounterView(counter)); counters.add(new CounterView(counter));
} }
} }
original = new CardView(card);
} }
public boolean isTapped() { public boolean isTapped() {
@ -94,4 +97,8 @@ public class PermanentView extends CardView {
public List<CounterView> getCounters() { public List<CounterView> getCounters() {
return counters; return counters;
} }
public CardView getOriginal() {
return original;
}
} }

View file

@ -55,33 +55,33 @@ public class PlayerView implements Serializable {
private CardsView graveyard = new CardsView(); private CardsView graveyard = new CardsView();
private Map<UUID, PermanentView> battlefield = new HashMap<UUID, PermanentView>(); private Map<UUID, PermanentView> battlefield = new HashMap<UUID, PermanentView>();
public PlayerView(Player player, GameState state, Game game) { public PlayerView(Player player, Game game) {
this.playerId = player.getId(); this.playerId = player.getId();
this.name = player.getName(); this.name = player.getName();
this.life = player.getLife(); this.life = player.getLife();
this.libraryCount = player.getLibrary().size(); this.libraryCount = player.getLibrary().size();
this.handCount = player.getHand().size(); this.handCount = player.getHand().size();
this.manaPool = new ManaPoolView(player.getManaPool()); this.manaPool = new ManaPoolView(player.getManaPool());
this.isActive = (player.getId().equals(state.getActivePlayerId())); this.isActive = (player.getId().equals(game.getActivePlayerId()));
this.hasLeft = player.hasLeft(); this.hasLeft = player.hasLeft();
for (Card card: player.getGraveyard().getCards(game)) { for (Card card: player.getGraveyard().getCards(game)) {
graveyard.put(card.getId(), new CardView(card)); graveyard.put(card.getId(), new CardView(card));
} }
for (Permanent permanent: state.getBattlefield().getAllPermanents()) { for (Permanent permanent: game.getBattlefield().getAllPermanents()) {
if (showInBattlefield(permanent, state)) { if (showInBattlefield(permanent, game)) {
PermanentView view = new PermanentView(permanent); PermanentView view = new PermanentView(permanent, game.getCard(permanent.getId()));
battlefield.put(view.getId(), view); battlefield.put(view.getId(), view);
} }
} }
} }
private boolean showInBattlefield(Permanent permanent, GameState state) { private boolean showInBattlefield(Permanent permanent, Game game) {
//show permanents controlled by player or attachments to permanents controlled by player //show permanents controlled by player or attachments to permanents controlled by player
if (permanent.getAttachedTo() == null) if (permanent.getAttachedTo() == null)
return permanent.getControllerId().equals(playerId); return permanent.getControllerId().equals(playerId);
else else
return state.getPermanent(permanent.getAttachedTo()).getControllerId().equals(playerId); return game.getPermanent(permanent.getAttachedTo()).getControllerId().equals(playerId);
} }
public int getLife() { public int getLife() {

View file

@ -141,6 +141,72 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
return false; return false;
} }
@Override
public boolean choose(Outcome outcome, Target target, Game game) {
if (logger.isLoggable(Level.FINE))
logger.fine("chooseTarget: " + outcome.toString() + ":" + target.toString());
UUID opponentId = game.getOpponents(playerId).iterator().next();
if (target instanceof TargetPlayer) {
if (outcome.isGood()) {
if (target.canTarget(playerId, game)) {
target.add(playerId, game);
return true;
}
}
else {
if (target.canTarget(playerId, game)) {
target.add(opponentId, game);
return true;
}
}
}
if (target instanceof TargetDiscard) {
findPlayables(game);
if (unplayable.size() > 0) {
for (int i = unplayable.size() - 1; i >= 0; i--) {
if (target.canTarget(unplayable.values().toArray(new Card[0])[i].getId(), game)) {
target.add(unplayable.values().toArray(new Card[0])[i].getId(), game);
return true;
}
}
}
if (hand.size() > 0) {
if (target.canTarget(hand.toArray(new UUID[0])[0], game)) {
target.add(hand.toArray(new UUID[0])[0], game);
return true;
}
}
}
if (target instanceof TargetControlledPermanent) {
List<Permanent> targets;
targets = threats(playerId, ((TargetPermanent)target).getFilter(), game);
if (!outcome.isGood())
Collections.reverse(targets);
for (Permanent permanent: targets) {
if (target.canTarget(permanent.getId(), game)) {
target.add(permanent.getId(), game);
return true;
}
}
}
if (target instanceof TargetPermanent) {
List<Permanent> targets;
if (outcome.isGood()) {
targets = threats(playerId, ((TargetPermanent)target).getFilter(), game);
}
else {
targets = threats(opponentId, ((TargetPermanent)target).getFilter(), game);
}
for (Permanent permanent: targets) {
if (target.canTarget(permanent.getId(), game)) {
target.add(permanent.getId(), game);
return true;
}
}
}
return false;
}
@Override @Override
public boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game) { public boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game) {
if (logger.isLoggable(Level.FINE)) if (logger.isLoggable(Level.FINE))
@ -219,10 +285,10 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
} }
List<Permanent> targets; List<Permanent> targets;
if (outcome.isGood()) { if (outcome.isGood()) {
targets = threats(playerId, new FilterCreaturePermanent(), game); targets = threats(playerId, FilterCreaturePermanent.getDefault(), game);
} }
else { else {
targets = threats(opponentId, new FilterCreaturePermanent(), game); targets = threats(opponentId, FilterCreaturePermanent.getDefault(), game);
} }
for (Permanent permanent: targets) { for (Permanent permanent: targets) {
if (target.canTarget(permanent.getId(), source, game)) { if (target.canTarget(permanent.getId(), source, game)) {
@ -555,7 +621,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
public boolean choose(Outcome outcome, Choice choice, Game game) { public boolean choose(Outcome outcome, Choice choice, Game game) {
logger.fine("choose"); logger.fine("choose");
//TODO: improve this //TODO: improve this
choice.setChoice(choice.getChoices().get(0)); choice.setChoice(choice.getChoices().iterator().next());
return true; return true;
} }
@ -638,7 +704,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
public void assignDamage(int damage, List<UUID> targets, UUID sourceId, Game game) { public void assignDamage(int damage, List<UUID> targets, UUID sourceId, Game game) {
logger.fine("assignDamage"); logger.fine("assignDamage");
//TODO: improve this //TODO: improve this
game.getPermanent(targets.get(0)).damage(damage, sourceId, game); game.getPermanent(targets.get(0)).damage(damage, sourceId, game, true);
} }
@Override @Override

View file

@ -407,15 +407,11 @@ public class ComputerPlayer3 extends ComputerPlayer2 implements Player {
sim.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_BLOCKERS_STEP_POST, sim.getActivePlayerId(), sim.getActivePlayerId())); sim.fireEvent(GameEvent.getEvent(GameEvent.EventType.DECLARE_BLOCKERS_STEP_POST, sim.getActivePlayerId(), sim.getActivePlayerId()));
Combat simCombat = sim.getCombat().copy(); Combat simCombat = sim.getCombat().copy();
finishCombat(sim); finishCombat(sim);
if (!counter) { if (sim.isGameOver()) {
int testScore = GameStateEvaluator.evaluate(playerId, sim); val = GameStateEvaluator.evaluate(playerId, sim);
if (testScore < currentScore) { }
// if score at end of combat is worse than original score don't check counterattack else if (!counter) {
logger.fine("simulating -- abandoning counterattack check, no immediate benefit"); val = simulatePostCombatMain(sim, newNode, depth-1, alpha, beta);
val = testScore;
}
else
val = simulatePostCombatMain(sim, newNode, depth-1, alpha, beta);
} }
else else
val = GameStateEvaluator.evaluate(playerId, sim); val = GameStateEvaluator.evaluate(playerId, sim);

View file

@ -154,6 +154,23 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
return false; return false;
} }
@Override
public boolean choose(Outcome outcome, Target target, Game game) {
while (!abort) {
game.fireSelectTargetEvent(playerId, target.getMessage(), target.isRequired());
waitForResponse();
if (response.getUUID() != null) {
if (target.canTarget(response.getUUID(), game)) {
target.add(response.getUUID(), game);
return true;
}
} else if (!target.isRequired()) {
return false;
}
}
return false;
}
@Override @Override
public boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game) { public boolean chooseTarget(Outcome outcome, Target target, Ability source, Game game) {
while (!abort) { while (!abort) {
@ -277,7 +294,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
@Override @Override
public boolean playXMana(VariableManaCost cost, Game game) { public boolean playXMana(VariableManaCost cost, Game game) {
game.firePlayXManaEvent(playerId, "Pay {X}: {X}=" + cost.getValue()); game.firePlayXManaEvent(playerId, "Pay {X}: {X}=" + cost.getAmount());
waitForResponse(); waitForResponse();
if (response.getBoolean() != null) { if (response.getBoolean() != null) {
if (!response.getBoolean()) if (!response.getBoolean())
@ -382,12 +399,12 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
int damageAmount = getAmount(0, remainingDamage, "Select amount", game); int damageAmount = getAmount(0, remainingDamage, "Select amount", game);
Permanent permanent = game.getPermanent(target.getFirstTarget()); Permanent permanent = game.getPermanent(target.getFirstTarget());
if (permanent != null) { if (permanent != null) {
permanent.damage(damageAmount, sourceId, game); permanent.damage(damageAmount, sourceId, game, true);
} }
else { else {
Player player = game.getPlayer(target.getFirstTarget()); Player player = game.getPlayer(target.getFirstTarget());
if (player != null) { if (player != null) {
player.damage(damageAmount, sourceId, game); player.damage(damageAmount, sourceId, game, false, true);
} }
} }
} }

View file

@ -1 +1,7 @@
start java -server -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -jar ./MageServer.jar @ECHO OFF
IF NOT EXIST "C:\Program Files\Java\jre6" GOTO NOJAVADIR
set JAVA_HOME="C:\Program Files\Java\jre6"
set CLASSPATH=%JAVA_HOME%/bin;%CLASSPATH%
set PATH=%JAVA_HOME%/bin;%PATH%
:NOJAVADIR
start java -Djava.security.policy=./config/security.policy -Djava.util.logging.config.file=./config/logging.config -jar ./MageServer.jar

View file

@ -198,7 +198,7 @@ public class TableController {
finally { finally {
output.close(); output.close();
} }
logger.log(Level.SEVERE, "Saved game:" + game.getId()); logger.log(Level.INFO, "Saved game:" + game.getId());
} }
catch(IOException ex) { catch(IOException ex) {
logger.log(Level.SEVERE, "Cannot save game.", ex); logger.log(Level.SEVERE, "Cannot save game.", ex);

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.alarareborn.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,16 +43,7 @@ public class AlaraReborn extends ExpansionSet {
} }
private AlaraReborn() { private AlaraReborn() {
this.name = "Alara Reborn"; super("Alara Reborn", "ARB", "seticon_mtgarb", "mage.sets.alarareborn");
this.cards.add(BehemothSledge.class);
this.cards.add(BituminousBlast.class);
this.cards.add(BloodbraidElf.class);
this.cards.add(FinestHour.class);
this.cards.add(MaelstromPulse.class);
this.cards.add(PutridLeech.class);
this.cards.add(SpellbreakerBehemoth.class);
this.cards.add(Terminate.class);
this.cards.add(VengefulRebirth.class);
} }
} }

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.conflux.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,15 +43,7 @@ public class Conflux extends ExpansionSet {
} }
private Conflux() { private Conflux() {
this.name = "Conflux"; super("Conflux", "CON", "seticon_conflux", "mage.sets.conflux");
this.cards.add(FontOfMythos.class);
this.cards.add(HellsparkElemental.class);
this.cards.add(KnightOfTheReliquary.class);
this.cards.add(MartialCoup.class);
this.cards.add(NobleHierarch.class);
this.cards.add(PathToExile.class);
this.cards.add(QuenchableFire.class);
this.cards.add(Thornling.class);
} }
} }

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.magic2010.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,59 +43,6 @@ public class Magic2010 extends ExpansionSet {
} }
private Magic2010() { private Magic2010() {
this.name = "Magic 2010"; super("Magic 2010", "M10", "seticon_M10", "mage.sets.magic2010");
this.cards.add(AcidicSlime.class);
this.cards.add(AcolyteOfXathrid.class);
this.cards.add(ActOfTreason.class);
this.cards.add(AirElemental.class);
this.cards.add(AjaniGoldmane.class);
this.cards.add(AlluringSiren.class);
this.cards.add(AngelsFeather.class);
this.cards.add(AngelsMercy.class);
this.cards.add(AntQueen.class);
this.cards.add(ArmoredAscension.class);
this.cards.add(Assassinate.class);
this.cards.add(AwakenerDruid.class);
this.cards.add(BallLightning.class);
this.cards.add(BaneslayerAngel.class);
this.cards.add(BirdsOfParadise.class);
this.cards.add(BerserkersOfBloodRidge.class);
this.cards.add(BlackKnight.class);
this.cards.add(BlindingMage.class);
this.cards.add(BogWraith.class);
this.cards.add(BogardanHellkite.class);
this.cards.add(Cancel.class);
this.cards.add(CelestialPurge.class);
this.cards.add(DiabolicTutor.class);
this.cards.add(DoomBlade.class);
this.cards.add(DragonskullSummit.class);
this.cards.add(Earthquake.class);
this.cards.add(EliteVanguard.class);
this.cards.add(Flashfreeze.class);
this.cards.add(GargoyleCastle.class);
this.cards.add(GarrukWildspeaker.class);
this.cards.add(GiantGrowth.class);
this.cards.add(GlacialFortress.class);
this.cards.add(GreatSableStag.class);
this.cards.add(HonorOfThePure.class);
this.cards.add(HowlingMine.class);
this.cards.add(JaceBeleren.class);
this.cards.add(LlanowarElves.class);
this.cards.add(LightningBolt.class);
this.cards.add(MasterOfTheWildHunt.class);
this.cards.add(MightOfOaks.class);
this.cards.add(MindRot.class);
this.cards.add(Naturalize.class);
this.cards.add(Overrun.class);
this.cards.add(RampantGrowth.class);
this.cards.add(MindSpring.class);
this.cards.add(Negate.class);
this.cards.add(RootboundCrag.class);
this.cards.add(RoyalAssassin.class);
this.cards.add(SafePassage.class);
this.cards.add(SunpetalGrove.class);
this.cards.add(TerramorphicExpanse.class);
this.cards.add(TimeWarp.class);
this.cards.add(WhiteKnight.class);
} }
} }

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.magic2011.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,59 +43,6 @@ public class Magic2011 extends ExpansionSet {
} }
private Magic2011() { private Magic2011() {
this.name = "Magic 2011"; super("Magic 2011", "M11", "seticon_M11", "mage.sets.magic2011");
this.cards.add(AcidicSlime.class);
this.cards.add(ActOfTreason.class);
this.cards.add(AetherAdept.class);
this.cards.add(AirServant.class);
this.cards.add(AjaniGoldmane.class);
// this.cards.add(AlluringSiren.class);
// this.cards.add(AngelsFeather.class);
// this.cards.add(AngelsMercy.class);
// this.cards.add(AntQueen.class);
// this.cards.add(ArmoredAscension.class);
// this.cards.add(Assassinate.class);
// this.cards.add(AwakenerDruid.class);
// this.cards.add(BallLightning.class);
// this.cards.add(BaneslayerAngel.class);
// this.cards.add(BirdsOfParadise.class);
// this.cards.add(BerserkersOfBloodRidge.class);
// this.cards.add(BlackKnight.class);
// this.cards.add(BlindingMage.class);
// this.cards.add(BogWraith.class);
// this.cards.add(BogardanHellkite.class);
// this.cards.add(Cancel.class);
// this.cards.add(CelestialPurge.class);
// this.cards.add(DiabolicTutor.class);
// this.cards.add(DoomBlade.class);
// this.cards.add(DragonskullSummit.class);
// this.cards.add(Earthquake.class);
// this.cards.add(EliteVanguard.class);
// this.cards.add(Flashfreeze.class);
// this.cards.add(GargoyleCastle.class);
// this.cards.add(GarrukWildspeaker.class);
// this.cards.add(GiantGrowth.class);
// this.cards.add(GlacialFortress.class);
// this.cards.add(GreatSableStag.class);
// this.cards.add(HonorOfThePure.class);
// this.cards.add(HowlingMine.class);
// this.cards.add(JaceBeleren.class);
// this.cards.add(LlanowarElves.class);
// this.cards.add(LightningBolt.class);
// this.cards.add(MasterOfTheWildHunt.class);
// this.cards.add(MightOfOaks.class);
// this.cards.add(MindRot.class);
// this.cards.add(Naturalize.class);
// this.cards.add(Overrun.class);
// this.cards.add(RampantGrowth.class);
// this.cards.add(MindSpring.class);
// this.cards.add(Negate.class);
// this.cards.add(RootboundCrag.class);
// this.cards.add(RoyalAssassin.class);
// this.cards.add(SafePassage.class);
// this.cards.add(SunpetalGrove.class);
// this.cards.add(TerramorphicExpanse.class);
// this.cards.add(TimeWarp.class);
// this.cards.add(WhiteKnight.class);
} }
} }

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.planechase.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,9 +43,7 @@ public class Planechase extends ExpansionSet {
} }
private Planechase() { private Planechase() {
this.name = "Planechase"; super("Planechase", "HOP", "", "mage.sets.planechase");
this.cards.add(SoulWarden.class);
this.cards.add(OblivionRing.class);
} }
} }

View file

@ -29,7 +29,6 @@
package mage.sets; package mage.sets;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
import mage.sets.riseoftheeldrazi.*;
/** /**
* *
@ -44,15 +43,7 @@ public class RiseOfTheEldrazi extends ExpansionSet {
} }
private RiseOfTheEldrazi() { private RiseOfTheEldrazi() {
this.name = "Rise Of The Eldrazi"; super("Rise Of The Eldrazi", "ROE", "seticon_ROE", "mage.sets.riseoftheeldrazi");
this.cards.add(Deprive.class);
this.cards.add(GideonJura.class);
this.cards.add(JoragaTreespeaker.class);
this.cards.add(KarganDragonlord.class);
this.cards.add(KozileksPredator.class);
this.cards.add(NestInvader.class);
this.cards.add(Vengevine.class);
this.cards.add(WallOfOmens.class);
} }
} }

View file

@ -28,32 +28,48 @@
package mage.sets; package mage.sets;
import java.util.ArrayList; import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import mage.cards.Card;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class Sets extends ArrayList<ExpansionSet> { public class Sets extends HashMap<String, ExpansionSet> {
private static final Sets fINSTANCE = new Sets(); private static final Sets fINSTANCE = new Sets();
private static Set<String> names;
public static Sets getInstance() { public static Sets getInstance() {
return fINSTANCE; return fINSTANCE;
} }
private Sets() { private Sets() {
this.add(AlaraReborn.getInstance()); names = new HashSet<String>();
this.add(Conflux.getInstance()); this.addSet(AlaraReborn.getInstance());
this.add(Magic2010.getInstance()); this.addSet(Conflux.getInstance());
this.add(Magic2011.getInstance()); this.addSet(Magic2010.getInstance());
this.add(Planechase.getInstance()); this.addSet(Magic2011.getInstance());
this.add(RiseOfTheEldrazi.getInstance()); this.addSet(Planechase.getInstance());
this.add(ShardsOfAlara.getInstance()); this.addSet(RiseOfTheEldrazi.getInstance());
this.add(Tenth.getInstance()); this.addSet(ShardsOfAlara.getInstance());
this.add(Worldwake.getInstance()); this.addSet(Tenth.getInstance());
this.add(Zendikar.getInstance()); this.addSet(Worldwake.getInstance());
this.addSet(Zendikar.getInstance());
}
private void addSet(ExpansionSet set) {
this.put(set.getCode(), set);
for (Card card: set.createCards()) {
names.add(card.getName());
}
}
public static Set<String> getCardNames() {
return names;
} }
} }

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.shardsofalara.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,24 +43,7 @@ public class ShardsOfAlara extends ExpansionSet {
} }
private ShardsOfAlara() { private ShardsOfAlara() {
this.name = "Shards Of Alara"; super("Shards Of Alara", "ALA", "seticon_mtgala", "mage.sets.shardsofalara");
this.cards.add(AjaniVengeant.class);
this.cards.add(Angelsong.class);
this.cards.add(Blightning.class);
this.cards.add(BroodmateDragon.class);
this.cards.add(CrumblingNecropolis.class);
this.cards.add(ElspethKnightErrant.class);
this.cards.add(HellsThunder.class);
this.cards.add(JundPanorama.class);
this.cards.add(KnightOfTheWhiteOrchid.class);
this.cards.add(RafiqOfTheMany.class);
this.cards.add(RangerOfEos.class);
this.cards.add(RhoxWarMonk.class);
this.cards.add(SarkhanVol.class);
this.cards.add(SavageLands.class);
this.cards.add(SproutingThrinax.class);
this.cards.add(WildNacatl.class);
this.cards.add(WoollyThoctar.class);
} }
} }

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.tenth.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,12 +43,7 @@ public class Tenth extends ExpansionSet {
} }
private Tenth() { private Tenth() {
this.name = "Tenth Edition"; super("Tenth Edition", "10E", "exp_symbol_mtg10e", "mage.sets.tenth");
this.cards.add(Forest1.class);
this.cards.add(Island1.class);
this.cards.add(Mountain1.class);
this.cards.add(Plains1.class);
this.cards.add(Swamp1.class);
} }
} }

View file

@ -29,7 +29,6 @@
package mage.sets; package mage.sets;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
import mage.sets.worldwake.*;
/** /**
* *
@ -44,22 +43,7 @@ public class Worldwake extends ExpansionSet {
} }
private Worldwake() { private Worldwake() {
this.name = "Worldwake"; super("Worldwake", "WWK", "seticon_WWK", "mage.sets.worldwake");
this.cards.add(ArborElf.class);
this.cards.add(BasiliskCollar.class);
this.cards.add(CelestialColonnade.class);
this.cards.add(DreadStatuary.class);
this.cards.add(EverflowingChalice.class);
this.cards.add(JaceTheMindSculptor.class);
this.cards.add(KhalniGarden.class);
this.cards.add(LavaclawReaches.class);
this.cards.add(RagingRavine.class);
this.cards.add(SearingBlaze.class);
this.cards.add(SejiriSteppe.class);
this.cards.add(StirringWildwood.class);
this.cards.add(StoneforgeMystic.class);
this.cards.add(TectonicEdge.class);
this.cards.add(WolfbriarElemental.class);
} }
} }

View file

@ -28,7 +28,6 @@
package mage.sets; package mage.sets;
import mage.sets.zendikar.*;
import mage.cards.ExpansionSet; import mage.cards.ExpansionSet;
/** /**
@ -44,34 +43,7 @@ public class Zendikar extends ExpansionSet {
} }
private Zendikar() { private Zendikar() {
this.name = "Zendikar"; super("Zendikar", "ZEN", "seticon_ZEN", "mage.sets.zendikar");
this.cards.add(AdventuringGear.class);
this.cards.add(AetherFigment.class);
this.cards.add(ArchiveTrap.class);
this.cards.add(AridMesa.class);
this.cards.add(BeastmasterAscension.class);
this.cards.add(BraveTheElements.class);
this.cards.add(BurstLightning.class);
this.cards.add(ConquerorsPledge.class);
this.cards.add(DayOfJudgment.class);
this.cards.add(EldraziMonument.class);
this.cards.add(EmeriaAngel.class);
this.cards.add(GoblinGuide.class);
this.cards.add(GoblinRuinblaster.class);
this.cards.add(KabiraCrossroads.class);
this.cards.add(LotusCobra.class);
this.cards.add(MarshFlats.class);
this.cards.add(MistyRainforest.class);
this.cards.add(OranRiefTheVastwood.class);
this.cards.add(RampagingBaloths.class);
this.cards.add(RiverBoa.class);
this.cards.add(ScaldingTarn.class);
this.cards.add(ScuteMob.class);
this.cards.add(SpreadingSeas.class);
this.cards.add(SteppeLynx.class);
this.cards.add(SunspringExpedition.class);
this.cards.add(TeeteringPeaks.class);
this.cards.add(VerdantCatacombs.class);
} }
} }

View file

@ -31,8 +31,8 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageObjectImpl;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost; import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.BoostEquippedEffect; import mage.abilities.effects.common.BoostEquippedEffect;
@ -41,7 +41,7 @@ import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.LifelinkAbility; import mage.abilities.keyword.LifelinkAbility;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.AlaraReborn;
/** /**
* *
@ -50,8 +50,8 @@ import mage.sets.AlaraReborn;
public class BehemothSledge extends CardImpl<BehemothSledge> { public class BehemothSledge extends CardImpl<BehemothSledge> {
public BehemothSledge(UUID ownerId) { public BehemothSledge(UUID ownerId) {
super(ownerId, "Behemoth Sledge", new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}"); super(ownerId, "Behemoth Sledge", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.subtype.add("Equipment"); this.subtype.add("Equipment");
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3))); this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance()))); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance())));

View file

@ -30,10 +30,11 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DamageTargetEffect; import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.keyword.CascadeAbility; import mage.abilities.keyword.CascadeAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.AlaraReborn;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -43,8 +44,8 @@ import mage.target.common.TargetCreaturePermanent;
public class BituminousBlast extends CardImpl<BituminousBlast> { public class BituminousBlast extends CardImpl<BituminousBlast> {
public BituminousBlast(UUID ownerId) { public BituminousBlast(UUID ownerId) {
super(ownerId, "Bituminous Blast", new CardType[]{CardType.INSTANT}, "{3}{B}{R}"); super(ownerId, "Bituminous Blast", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{B}{R}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setBlack(true); this.color.setBlack(true);
this.color.setRed(true); this.color.setRed(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -30,11 +30,12 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.CascadeAbility; import mage.abilities.keyword.CascadeAbility;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.AlaraReborn;
/** /**
* *
@ -43,8 +44,8 @@ import mage.sets.AlaraReborn;
public class BloodbraidElf extends CardImpl<BloodbraidElf> { public class BloodbraidElf extends CardImpl<BloodbraidElf> {
public BloodbraidElf(UUID ownerId) { public BloodbraidElf(UUID ownerId) {
super(ownerId, "Bloodbraid Elf", new CardType[]{CardType.CREATURE}, "{2}{R}{G}"); super(ownerId, "Bloodbraid Elf", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setRed(true); this.color.setRed(true);
this.color.setGreen(true); this.color.setGreen(true);
this.subtype.add("Elf"); this.subtype.add("Elf");

View file

@ -31,6 +31,7 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.TurnPhase; import mage.Constants.TurnPhase;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -43,7 +44,7 @@ import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.turn.TurnMod; import mage.game.turn.TurnMod;
import mage.sets.AlaraReborn;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -53,8 +54,8 @@ import mage.target.common.TargetCreaturePermanent;
public class FinestHour extends CardImpl<FinestHour> { public class FinestHour extends CardImpl<FinestHour> {
public FinestHour(UUID ownerId) { public FinestHour(UUID ownerId) {
super(ownerId, "Finest Hour", new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{W}{U}"); super(ownerId, "Finest Hour", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{W}{U}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setWhite(true); this.color.setWhite(true);
this.color.setGreen(true); this.color.setGreen(true);
this.color.setBlue(true); this.color.setBlue(true);

View file

@ -30,9 +30,10 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyAllNamedPermanentsEffect; import mage.abilities.effects.common.DestroyAllNamedPermanentsEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.AlaraReborn;
import mage.target.common.TargetNonlandPermanent; import mage.target.common.TargetNonlandPermanent;
/** /**
@ -42,8 +43,8 @@ import mage.target.common.TargetNonlandPermanent;
public class MaelstromPulse extends CardImpl<MaelstromPulse> { public class MaelstromPulse extends CardImpl<MaelstromPulse> {
public MaelstromPulse(UUID ownerId) { public MaelstromPulse(UUID ownerId) {
super(ownerId, "Maelstrom Pulse", new CardType[]{CardType.SORCERY}, "{1}{B}{G}"); super(ownerId, "Maelstrom Pulse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{G}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setBlack(true); this.color.setBlack(true);
this.color.setGreen(true); this.color.setGreen(true);
this.getSpellAbility().addTarget(new TargetNonlandPermanent()); this.getSpellAbility().addTarget(new TargetNonlandPermanent());

View file

@ -31,13 +31,14 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.ActivateOncePerTurnActivatedAbility; import mage.abilities.common.ActivateOncePerTurnActivatedAbility;
import mage.abilities.costs.common.PayLifeCost; import mage.abilities.costs.common.PayLifeCost;
import mage.abilities.effects.common.BoostSourceEffect; import mage.abilities.effects.common.BoostSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.AlaraReborn;
/** /**
* *
@ -46,8 +47,8 @@ import mage.sets.AlaraReborn;
public class PutridLeech extends CardImpl<PutridLeech> { public class PutridLeech extends CardImpl<PutridLeech> {
public PutridLeech(UUID ownerId) { public PutridLeech(UUID ownerId) {
super(ownerId, "Putrid Leech", new CardType[]{CardType.CREATURE}, "{B}{G}"); super(ownerId, "Putrid Leech", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{G}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setBlack(true); this.color.setBlack(true);
this.color.setGreen(true); this.color.setGreen(true);
this.subtype.add("Zombie"); this.subtype.add("Zombie");

View file

@ -30,6 +30,8 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleStaticAbility; import mage.abilities.common.SimpleStaticAbility;
@ -37,7 +39,7 @@ import mage.abilities.effects.common.CantCounterControlledEffect;
import mage.abilities.effects.common.CantCounterSourceEffect; import mage.abilities.effects.common.CantCounterSourceEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterSpell; import mage.filter.FilterSpell;
import mage.sets.AlaraReborn;
/** /**
* *
@ -45,20 +47,24 @@ import mage.sets.AlaraReborn;
*/ */
public class SpellbreakerBehemoth extends CardImpl<SpellbreakerBehemoth> { public class SpellbreakerBehemoth extends CardImpl<SpellbreakerBehemoth> {
private static FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater");
static {
filter.getCardType().add(CardType.CREATURE);
filter.setPower(5);
}
public SpellbreakerBehemoth(UUID ownerId) { public SpellbreakerBehemoth(UUID ownerId) {
super(ownerId, "Spellbreaker Behemoth", new CardType[]{CardType.CREATURE}, "{1}{R}{G}{G}"); super(ownerId, "Spellbreaker Behemoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{G}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setRed(true); this.color.setRed(true);
this.color.setGreen(true); this.color.setGreen(true);
this.subtype.add("Beast"); this.subtype.add("Beast");
this.power = new MageInt(5); this.power = new MageInt(5);
this.toughness = new MageInt(5); this.toughness = new MageInt(5);
this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect()));
FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater");
filter.getCardType().add(CardType.CREATURE);
filter.setPower(5);
this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterControlledEffect(filter)));
this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect()));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantCounterControlledEffect(filter, Duration.WhileOnBattlefield)));
} }
public SpellbreakerBehemoth(final SpellbreakerBehemoth card) { public SpellbreakerBehemoth(final SpellbreakerBehemoth card) {

View file

@ -30,9 +30,10 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.DestroyNoRegenTargetEffect; import mage.abilities.effects.common.DestroyNoRegenTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.AlaraReborn;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -42,8 +43,8 @@ import mage.target.common.TargetCreaturePermanent;
public class Terminate extends CardImpl<Terminate> { public class Terminate extends CardImpl<Terminate> {
public Terminate(UUID ownerId) { public Terminate(UUID ownerId) {
super(ownerId, "Terminate", new CardType[]{CardType.INSTANT}, "{B}{R}"); super(ownerId, "Terminate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{R}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setBlack(true); this.color.setBlack(true);
this.color.setRed(true); this.color.setRed(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());

View file

@ -31,6 +31,7 @@ package mage.sets.alarareborn;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.ExileSpellEffect; import mage.abilities.effects.common.ExileSpellEffect;
@ -39,7 +40,7 @@ import mage.cards.CardImpl;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.sets.AlaraReborn;
import mage.target.common.TargetCardInGraveyard; import mage.target.common.TargetCardInGraveyard;
import mage.target.common.TargetCreatureOrPlayer; import mage.target.common.TargetCreatureOrPlayer;
@ -50,8 +51,8 @@ import mage.target.common.TargetCreatureOrPlayer;
public class VengefulRebirth extends CardImpl<VengefulRebirth> { public class VengefulRebirth extends CardImpl<VengefulRebirth> {
public VengefulRebirth(UUID ownerId) { public VengefulRebirth(UUID ownerId) {
super(ownerId, "Vengeful Rebirth", new CardType[]{CardType.SORCERY}, "{4}{R}{G}"); super(ownerId, "Vengeful Rebirth", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{R}{G}");
this.expansionSetId = AlaraReborn.getInstance().getId(); this.expansionSetCode = "ARB";
this.color.setRed(true); this.color.setRed(true);
this.color.setGreen(true); this.color.setGreen(true);
this.getSpellAbility().addTarget(new TargetCardInGraveyard()); this.getSpellAbility().addTarget(new TargetCardInGraveyard());
@ -100,12 +101,12 @@ class VengefulRebirthEffect extends OneShotEffect<VengefulRebirthEffect> {
if (!card.getCardType().contains(CardType.LAND)) { if (!card.getCardType().contains(CardType.LAND)) {
Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0)); Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0));
if (permanent != null) { if (permanent != null) {
permanent.damage(damage, source.getSourceId(), game); permanent.damage(damage, source.getSourceId(), game, true);
return true; return true;
} }
Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0)); Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0));
if (targetPlayer != null) { if (targetPlayer != null) {
targetPlayer.damage(damage, source.getSourceId(), game); targetPlayer.damage(damage, source.getSourceId(), game, false, true);
return true; return true;
} }
return false; return false;

View file

@ -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.conflux;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.cards.CardImpl;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CanyonMinotaur extends CardImpl<CanyonMinotaur> {
public CanyonMinotaur(UUID ownerId) {
super(ownerId, "Canyon Minotaur", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{R}");
this.expansionSetCode = "CON";
this.color.setRed(true);
this.subtype.add("Minotaur");
this.subtype.add("Warrior");
this.power = new MageInt(3);
this.toughness = new MageInt(3);
}
public CanyonMinotaur(final CanyonMinotaur card) {
super(card);
}
@Override
public CanyonMinotaur copy() {
return new CanyonMinotaur(this);
}
@Override
public String getArt() {
return "118765_typ_reg_sty_010.jpg";
}
}

View file

@ -0,0 +1,79 @@
/*
* 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.conflux;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.TargetController;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;
import mage.target.TargetPermanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CelestialPurge extends CardImpl<CelestialPurge> {
private static FilterPermanent filter = new FilterPermanent("black or red permanent");
static {
filter.setUseColor(true);
filter.setScopeColor(ComparisonScope.Any);
filter.getColor().setBlack(true);
filter.getColor().setRed(true);
}
public CelestialPurge(UUID ownerId) {
super(ownerId, "Celestial Purge", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{1}{W}");
this.expansionSetCode = "CON";
this.color.setWhite(true);
this.getSpellAbility().addTarget(new TargetPermanent(filter, TargetController.ANY));
this.getSpellAbility().addEffect(new ExileTargetEffect());
}
public CelestialPurge(final CelestialPurge card) {
super(card);
}
@Override
public CelestialPurge copy() {
return new CelestialPurge(this);
}
@Override
public String getArt() {
return "118751_typ_reg_sty_010.jpg";
}
}

View file

@ -30,6 +30,7 @@ package mage.sets.conflux;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.abilities.TriggeredAbilityImpl; import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.DrawCardTargetEffect; import mage.abilities.effects.common.DrawCardTargetEffect;
@ -37,7 +38,7 @@ import mage.cards.CardImpl;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.sets.Conflux;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
/** /**
@ -47,8 +48,8 @@ import mage.target.TargetPlayer;
public class FontOfMythos extends CardImpl<FontOfMythos> { public class FontOfMythos extends CardImpl<FontOfMythos> {
public FontOfMythos(UUID ownerId) { public FontOfMythos(UUID ownerId) {
super(ownerId, "Font of Mythos", new CardType[]{CardType.ARTIFACT}, "{4}"); super(ownerId, "Font of Mythos", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{4}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.addAbility(new FontOfMythosAbility()); this.addAbility(new FontOfMythosAbility());
} }

View file

@ -30,6 +30,7 @@ package mage.sets.conflux;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.OnEventTriggeredAbility; import mage.abilities.common.OnEventTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
@ -38,7 +39,7 @@ import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.UnearthAbility; import mage.abilities.keyword.UnearthAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.sets.Conflux;
/** /**
* *
@ -47,8 +48,8 @@ import mage.sets.Conflux;
public class HellsparkElemental extends CardImpl<HellsparkElemental> { public class HellsparkElemental extends CardImpl<HellsparkElemental> {
public HellsparkElemental(UUID ownerId) { public HellsparkElemental(UUID ownerId) {
super(ownerId, "Hellspark Elemental", new CardType[]{CardType.CREATURE}, "{1}{R}"); super(ownerId, "Hellspark Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.subtype.add("Elemental"); this.subtype.add("Elemental");
this.color.setRed(true); this.color.setRed(true);
this.power = new MageInt(3); this.power = new MageInt(3);

View file

@ -33,6 +33,7 @@ import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Layer; import mage.Constants.Layer;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.SubLayer; import mage.Constants.SubLayer;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
@ -51,7 +52,7 @@ import mage.filter.common.FilterLandCard;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.sets.Conflux;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetControlledPermanent; import mage.target.common.TargetControlledPermanent;
@ -70,8 +71,8 @@ public class KnightOfTheReliquary extends CardImpl<KnightOfTheReliquary> {
} }
public KnightOfTheReliquary(UUID ownerId) { public KnightOfTheReliquary(UUID ownerId) {
super(ownerId, "Knight of the Reliquary", new CardType[]{CardType.CREATURE}, "{1}{G}{W}"); super(ownerId, "Knight of the Reliquary", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G}{W}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.color.setWhite(true); this.color.setWhite(true);
this.color.setGreen(true); this.color.setGreen(true);
this.subtype.add("Human"); this.subtype.add("Human");
@ -81,7 +82,7 @@ public class KnightOfTheReliquary extends CardImpl<KnightOfTheReliquary> {
TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard()); TargetCardInLibrary target = new TargetCardInLibrary(new FilterLandCard());
Costs costs = new CostsImpl(); Costs costs = new CostsImpl();
costs.add(new TapSourceCost()); costs.add(new TapSourceCost());
costs.add(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter))); costs.add(new SacrificeTargetCost(new TargetControlledPermanent(1, 1, filter, false)));
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KnightOfTheReliquaryEffect())); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KnightOfTheReliquaryEffect()));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay), costs)); this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new SearchLibraryPutInPlayEffect(target, false, Outcome.PutLandInPlay), costs));
} }

View file

@ -31,6 +31,7 @@ package mage.sets.conflux;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
@ -39,7 +40,7 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.SoldierToken; import mage.game.permanent.token.SoldierToken;
import mage.players.Player; import mage.players.Player;
import mage.sets.Conflux;
/** /**
* *
@ -48,8 +49,8 @@ import mage.sets.Conflux;
public class MartialCoup extends CardImpl<MartialCoup> { public class MartialCoup extends CardImpl<MartialCoup> {
public MartialCoup(UUID ownerId) { public MartialCoup(UUID ownerId) {
super(ownerId, "Martial Coup", new CardType[]{CardType.SORCERY}, "{X}{W}{W}"); super(ownerId, "Martial Coup", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{W}{W}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.color.setWhite(true); this.color.setWhite(true);
this.getSpellAbility().addEffect(new MartialCoupEffect()); this.getSpellAbility().addEffect(new MartialCoupEffect());
} }
@ -87,11 +88,10 @@ class MartialCoupEffect extends OneShotEffect<MartialCoupEffect> {
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId()); Player controller = game.getPlayer(source.getControllerId());
int amount = source.getManaCosts().getVariableCosts().get(0).getValue(); int amount = source.getCosts().getVariableCosts().get(0).getAmount();
FilterCreaturePermanent filter = new FilterCreaturePermanent();
if (amount > 4) { if (amount > 4) {
for (Permanent permanent: game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) { for (Permanent permanent: game.getBattlefield().getActivePermanents(FilterCreaturePermanent.getDefault(), source.getControllerId(), game)) {
permanent.destroy(source.getSourceId(), game, false); permanent.destroy(source.getSourceId(), game, false);
} }
} }

View file

@ -30,13 +30,14 @@ package mage.sets.conflux;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.ExaltedAbility; import mage.abilities.keyword.ExaltedAbility;
import mage.abilities.mana.BlueManaAbility; import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility; import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.WhiteManaAbility; import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Conflux;
/** /**
* *
@ -45,8 +46,8 @@ import mage.sets.Conflux;
public class NobleHierarch extends CardImpl<NobleHierarch> { public class NobleHierarch extends CardImpl<NobleHierarch> {
public NobleHierarch(UUID ownerId) { public NobleHierarch(UUID ownerId) {
super(ownerId, "Noble Hierarch", new CardType[]{CardType.CREATURE}, "{G}"); super(ownerId, "Noble Hierarch", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{G}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.color.setGreen(true); this.color.setGreen(true);
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Druid"); this.subtype.add("Druid");

View file

@ -31,6 +31,7 @@ package mage.sets.conflux;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect; import mage.abilities.effects.OneShotEffect;
@ -40,7 +41,7 @@ import mage.filter.common.FilterBasicLandCard;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.players.Player; import mage.players.Player;
import mage.sets.Conflux;
import mage.target.common.TargetCardInLibrary; import mage.target.common.TargetCardInLibrary;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -51,8 +52,8 @@ import mage.target.common.TargetCreaturePermanent;
public class PathToExile extends CardImpl<PathToExile> { public class PathToExile extends CardImpl<PathToExile> {
public PathToExile(UUID ownerId) { public PathToExile(UUID ownerId) {
super(ownerId, "Path To Exile", new CardType[]{CardType.INSTANT}, "{W}"); super(ownerId, "Path To Exile", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{W}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.color.setWhite(true); this.color.setWhite(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new PathToExileEffect()); this.getSpellAbility().addEffect(new PathToExileEffect());

View file

@ -31,6 +31,7 @@ package mage.sets.conflux;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility; import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.SpecialAction; import mage.abilities.SpecialAction;
@ -43,7 +44,7 @@ import mage.cards.CardImpl;
import mage.game.Game; import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.sets.Conflux;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
/** /**
@ -53,8 +54,8 @@ import mage.target.TargetPlayer;
public class QuenchableFire extends CardImpl<QuenchableFire> { public class QuenchableFire extends CardImpl<QuenchableFire> {
public QuenchableFire(UUID ownerId) { public QuenchableFire(UUID ownerId) {
super(ownerId, "Quenchable Fire", new CardType[]{CardType.SORCERY}, "{3}{R}"); super(ownerId, "Quenchable Fire", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{3}{R}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.color.setRed(true); this.color.setRed(true);
this.getSpellAbility().addTarget(new TargetPlayer()); this.getSpellAbility().addTarget(new TargetPlayer());
this.getSpellAbility().addEffect(new DamageTargetEffect(3)); this.getSpellAbility().addEffect(new DamageTargetEffect(3));

View file

@ -31,6 +31,7 @@ package mage.sets.conflux;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -41,7 +42,7 @@ import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.IndestructibleAbility; import mage.abilities.keyword.IndestructibleAbility;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Conflux;
/** /**
* *
@ -50,8 +51,8 @@ import mage.sets.Conflux;
public class Thornling extends CardImpl<Thornling> { public class Thornling extends CardImpl<Thornling> {
public Thornling(UUID ownerId) { public Thornling(UUID ownerId) {
super(ownerId, "Thornling", new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); super(ownerId, "Thornling", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.expansionSetId = Conflux.getInstance().getId(); this.expansionSetCode = "CON";
this.color.setGreen(true); this.color.setGreen(true);
this.subtype.add("Elemental"); this.subtype.add("Elemental");
this.subtype.add("Shapeshifter"); this.subtype.add("Shapeshifter");

View file

@ -30,6 +30,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.TargetController; import mage.Constants.TargetController;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -39,7 +40,6 @@ import mage.abilities.keyword.DeathtouchAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope; import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.sets.Magic2010;
import mage.target.Target; import mage.target.Target;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
@ -59,8 +59,8 @@ public class AcidicSlime extends CardImpl<AcidicSlime> {
} }
public AcidicSlime(UUID ownerId) { public AcidicSlime(UUID ownerId) {
super(ownerId, "Acidic Slime", new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); super(ownerId, "Acidic Slime", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Ooze"); this.subtype.add("Ooze");
this.color.setGreen(true); this.color.setGreen(true);
this.power = new MageInt(2); this.power = new MageInt(2);

View file

@ -30,6 +30,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -38,7 +39,6 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.LoseLifeTargetEffect; import mage.abilities.effects.common.LoseLifeTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Magic2010;
import mage.target.TargetPlayer; import mage.target.TargetPlayer;
/** /**
@ -48,8 +48,8 @@ import mage.target.TargetPlayer;
public class AcolyteOfXathrid extends CardImpl { public class AcolyteOfXathrid extends CardImpl {
public AcolyteOfXathrid(UUID ownerId) { public AcolyteOfXathrid(UUID ownerId) {
super(ownerId, "Acolyte Of Xathrid", new CardType[]{CardType.CREATURE}, "{B}"); super(ownerId, "Acolyte Of Xathrid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Cleric"); this.subtype.add("Cleric");
this.color.setBlack(true); this.color.setBlack(true);

View file

@ -31,12 +31,12 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.abilities.effects.common.GainAbilityTargetEffect; import mage.abilities.effects.common.GainAbilityTargetEffect;
import mage.abilities.effects.common.GainControlTargetEOTEffect; import mage.abilities.effects.common.GainControlTargetEffect;
import mage.abilities.effects.common.UntapTargetEffect; import mage.abilities.effects.common.UntapTargetEffect;
import mage.abilities.keyword.HasteAbility; import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Magic2010;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -46,11 +46,11 @@ import mage.target.common.TargetCreaturePermanent;
public class ActOfTreason extends CardImpl<ActOfTreason> { public class ActOfTreason extends CardImpl<ActOfTreason> {
public ActOfTreason(UUID ownerId) { public ActOfTreason(UUID ownerId) {
super(ownerId, "Act Of Treason", new CardType[]{CardType.SORCERY}, "{2}{R}"); super(ownerId, "Act Of Treason", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{2}{R}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setRed(true); this.color.setRed(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent()); this.getSpellAbility().addTarget(new TargetCreaturePermanent());
this.getSpellAbility().addEffect(new GainControlTargetEOTEffect()); this.getSpellAbility().addEffect(new GainControlTargetEffect(Duration.EndOfTurn));
this.getSpellAbility().addEffect(new UntapTargetEffect()); this.getSpellAbility().addEffect(new UntapTargetEffect());
this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn)); this.getSpellAbility().addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn));

View file

@ -30,10 +30,10 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Magic2010;
/** /**
* *
@ -42,8 +42,8 @@ import mage.sets.Magic2010;
public class AirElemental extends CardImpl<AirElemental> { public class AirElemental extends CardImpl<AirElemental> {
public AirElemental(UUID ownerId) { public AirElemental(UUID ownerId) {
super(ownerId, "Air Elemental", new CardType[]{CardType.CREATURE}, "{3}{U}{U}"); super(ownerId, "Air Elemental", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setBlue(true); this.color.setBlue(true);
this.subtype.add("Elemental"); this.subtype.add("Elemental");
this.power = new MageInt(4); this.power = new MageInt(4);

View file

@ -33,6 +33,7 @@ import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Layer; import mage.Constants.Layer;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.SubLayer; import mage.Constants.SubLayer;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
@ -52,7 +53,6 @@ import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.players.Player; import mage.players.Player;
import mage.sets.Magic2010;
/** /**
* *
@ -61,8 +61,8 @@ import mage.sets.Magic2010;
public class AjaniGoldmane extends CardImpl<AjaniGoldmane> { public class AjaniGoldmane extends CardImpl<AjaniGoldmane> {
public AjaniGoldmane(UUID ownerId) { public AjaniGoldmane(UUID ownerId) {
super(ownerId, "Ajani Goldmane", new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}"); super(ownerId, "Ajani Goldmane", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{2}{W}{W}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Ajani"); this.subtype.add("Ajani");
this.color.setWhite(true); this.color.setWhite(true);
this.loyalty = new MageInt(4); this.loyalty = new MageInt(4);
@ -71,7 +71,7 @@ public class AjaniGoldmane extends CardImpl<AjaniGoldmane> {
Effects effects1 = new Effects(); Effects effects1 = new Effects();
effects1.add(new AddPlusOneCountersControlledEffect(1)); effects1.add(new AddPlusOneCountersControlledEffect(1));
effects1.add(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, new FilterCreaturePermanent())); effects1.add(new GainAbilityControlledEffect(VigilanceAbility.getInstance(), Duration.EndOfTurn, FilterCreaturePermanent.getDefault()));
this.addAbility(new LoyaltyAbility(effects1, -1)); this.addAbility(new LoyaltyAbility(effects1, -1));
this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new AvatarToken()), -6)); this.addAbility(new LoyaltyAbility(new CreateTokenEffect(new AvatarToken()), -6));

View file

@ -31,6 +31,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Rarity;
import mage.Constants.TargetController; import mage.Constants.TargetController;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
@ -43,7 +44,6 @@ import mage.game.Game;
import mage.game.events.GameEvent; import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.sets.Magic2010;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -53,8 +53,8 @@ import mage.target.common.TargetCreaturePermanent;
public class AlluringSiren extends CardImpl<AlluringSiren> { public class AlluringSiren extends CardImpl<AlluringSiren> {
public AlluringSiren(UUID ownerId) { public AlluringSiren(UUID ownerId) {
super(ownerId, "Alluring Siren", new CardType[]{CardType.CREATURE}, "{1}{U}"); super(ownerId, "Alluring Siren", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setBlue(true); this.color.setBlue(true);
this.subtype.add("Siren"); this.subtype.add("Siren");
this.power = new MageInt(1); this.power = new MageInt(1);
@ -85,7 +85,7 @@ public class AlluringSiren extends CardImpl<AlluringSiren> {
class AlluringSirenEffect extends RequirementAttackEffect<AlluringSirenEffect> { class AlluringSirenEffect extends RequirementAttackEffect<AlluringSirenEffect> {
public AlluringSirenEffect() { public AlluringSirenEffect() {
super(Duration.OneUse); super(Duration.EndOfTurn);
} }
public AlluringSirenEffect(final AlluringSirenEffect effect) { public AlluringSirenEffect(final AlluringSirenEffect effect) {
@ -97,15 +97,6 @@ class AlluringSirenEffect extends RequirementAttackEffect<AlluringSirenEffect> {
return new AlluringSirenEffect(this); return new AlluringSirenEffect(this);
} }
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType().equals(EventType.DECLARE_ATTACKERS_STEP_PRE) && event.getPlayerId().equals(source.getFirstTarget()))
return true;
if (event.getType().equals(EventType.END_PHASE_POST) && event.getPlayerId().equals(source.getFirstTarget()))
used = true;
return false;
}
@Override @Override
public boolean apply(Game game, Ability source) { public boolean apply(Game game, Ability source) {
Permanent creature = game.getPermanent(source.getFirstTarget()); Permanent creature = game.getPermanent(source.getFirstTarget());
@ -119,6 +110,6 @@ class AlluringSirenEffect extends RequirementAttackEffect<AlluringSirenEffect> {
@Override @Override
public String getText(Ability source) { public String getText(Ability source) {
return "Target creature an opponent controls attacks you this turn if able."; return "Target creature an opponent controls attacks you this turn if able";
} }
} }

View file

@ -29,75 +29,16 @@
package mage.sets.magic2010; package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Zone;
import mage.MageObject;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.sets.Magic2010;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class AngelsFeather extends CardImpl<AngelsFeather> { public class AngelsFeather extends mage.sets.tenth.AngelsFeather {
public AngelsFeather(UUID ownerId) { public AngelsFeather(UUID ownerId) {
super(ownerId, "Angel's Feather", new CardType[]{CardType.ARTIFACT}, "{2}"); super(ownerId);
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.addAbility(new AngelsFeatherAbility());
}
public AngelsFeather(final AngelsFeather card) {
super(card);
}
@Override
public AngelsFeather copy() {
return new AngelsFeather(this);
}
@Override
public String getArt() {
return "75223_typ_reg_sty_010.jpg";
}
}
class AngelsFeatherAbility extends TriggeredAbilityImpl<AngelsFeatherAbility> {
public AngelsFeatherAbility() {
super(Zone.BATTLEFIELD, new GainLifeEffect(1), true);
}
public AngelsFeatherAbility(final AngelsFeatherAbility ability) {
super(ability);
}
@Override
public AngelsFeatherAbility copy() {
return new AngelsFeatherAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.SPELL_CAST) {
MageObject spell = game.getObject(event.getTargetId());
if (spell != null && spell.getColor().isWhite()) {
trigger(game, event.getPlayerId());
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a player casts a white spell, you may gain 1 life.";
} }
} }

View file

@ -30,9 +30,9 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.GainLifeEffect; import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Magic2010;
/** /**
* *
@ -41,8 +41,8 @@ import mage.sets.Magic2010;
public class AngelsMercy extends CardImpl<AngelsMercy> { public class AngelsMercy extends CardImpl<AngelsMercy> {
public AngelsMercy(UUID ownerId) { public AngelsMercy(UUID ownerId) {
super(ownerId, "Angel's Mercy", new CardType[]{CardType.INSTANT}, "{2}{W}{W}"); super(ownerId, "Angel's Mercy", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}{W}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setWhite(true); this.color.setWhite(true);
this.getSpellAbility().addEffect(new GainLifeEffect(7)); this.getSpellAbility().addEffect(new GainLifeEffect(7));
} }

View file

@ -30,6 +30,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility; import mage.abilities.common.SimpleActivatedAbility;
@ -37,7 +38,6 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.CreateTokenEffect; import mage.abilities.effects.common.CreateTokenEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.game.permanent.token.InsectToken; import mage.game.permanent.token.InsectToken;
import mage.sets.Magic2010;
/** /**
* *
@ -48,8 +48,8 @@ public class AntQueen extends CardImpl<AntQueen> {
private static InsectToken insectToken = new InsectToken(); private static InsectToken insectToken = new InsectToken();
public AntQueen(UUID ownerId) { public AntQueen(UUID ownerId) {
super(ownerId, "Ant Queen", new CardType[]{CardType.CREATURE}, "{3}{G}{G}"); super(ownerId, "Ant Queen", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{G}{G}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Insect"); this.subtype.add("Insect");
this.color.setGreen(true); this.color.setGreen(true);
// this.art = "122179_typ_reg_sty_010.jpg"; // this.art = "122179_typ_reg_sty_010.jpg";

View file

@ -33,6 +33,7 @@ import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Layer; import mage.Constants.Layer;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.SubLayer; import mage.Constants.SubLayer;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -45,7 +46,6 @@ import mage.cards.CardImpl;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.sets.Magic2010;
import mage.target.TargetPermanent; import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
@ -56,8 +56,8 @@ import mage.target.common.TargetCreaturePermanent;
public class ArmoredAscension extends CardImpl<ArmoredAscension> { public class ArmoredAscension extends CardImpl<ArmoredAscension> {
public ArmoredAscension(UUID ownerId) { public ArmoredAscension(UUID ownerId) {
super(ownerId, "Armored Ascension", new CardType[]{CardType.ENCHANTMENT}, "{3}{W}"); super(ownerId, "Armored Ascension", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{W}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setWhite(true); this.color.setWhite(true);
this.subtype.add("Aura"); this.subtype.add("Aura");
@ -109,9 +109,9 @@ class ArmoredAscensionEffect extends ContinuousEffectImpl<ArmoredAscensionEffect
@Override @Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) { public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent enchantment = game.getPermanent(source.getSourceId()); Permanent enchantment = game.getPermanent(source.getSourceId());
if (enchantment.getAttachedTo() != null) { if (enchantment != null && enchantment.getAttachedTo() != null) {
Permanent creature = game.getPermanent(enchantment.getAttachedTo()); Permanent creature = game.getPermanent(enchantment.getAttachedTo());
if (creature != null) { if (creature != null) {
switch (layer) { switch (layer) {
case PTChangingEffects_7: case PTChangingEffects_7:
if (sublayer == SubLayer.ModifyPT_7c) { if (sublayer == SubLayer.ModifyPT_7c) {

View file

@ -29,48 +29,16 @@
package mage.sets.magic2010; package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.TargetController;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.sets.Magic2010;
import mage.target.common.TargetCreaturePermanent;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class Assassinate extends CardImpl<Assassinate> { public class Assassinate extends mage.sets.tenth.Assassinate {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("tapped creature");
static {
filter.setTapped(true);
filter.setUseTapped(true);
}
public Assassinate(UUID ownerId) { public Assassinate(UUID ownerId) {
super(ownerId, "Assassinate", new CardType[]{CardType.SORCERY}, "{2}{B}"); super(ownerId);
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setBlack(true);
this.getSpellAbility().addTarget(new TargetCreaturePermanent(1, 1, filter, TargetController.ANY));
this.getSpellAbility().addEffect(new DestroyTargetEffect());
}
public Assassinate(final Assassinate card) {
super(card);
}
@Override
public Assassinate copy() {
return new Assassinate(this);
}
@Override
public String getArt() {
return "97461_typ_reg_sty_010.jpg";
} }
} }

View file

@ -33,6 +33,7 @@ import mage.Constants.CardType;
import mage.Constants.Duration; import mage.Constants.Duration;
import mage.Constants.Layer; import mage.Constants.Layer;
import mage.Constants.Outcome; import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.SubLayer; import mage.Constants.SubLayer;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -43,7 +44,6 @@ import mage.filter.common.FilterLandPermanent;
import mage.game.Game; import mage.game.Game;
import mage.game.permanent.Permanent; import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token; import mage.game.permanent.token.Token;
import mage.sets.Magic2010;
import mage.target.common.TargetLandPermanent; import mage.target.common.TargetLandPermanent;
/** /**
@ -59,8 +59,8 @@ public class AwakenerDruid extends CardImpl<AwakenerDruid> {
} }
public AwakenerDruid(UUID ownerId) { public AwakenerDruid(UUID ownerId) {
super(ownerId, "Awakener Druid", new CardType[]{CardType.CREATURE}, "{2}{G}"); super(ownerId, "Awakener Druid", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setGreen(true); this.color.setGreen(true);
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Druid"); this.subtype.add("Druid");

View file

@ -30,6 +30,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.OnEventTriggeredAbility; import mage.abilities.common.OnEventTriggeredAbility;
import mage.abilities.effects.common.SacrificeSourceEffect; import mage.abilities.effects.common.SacrificeSourceEffect;
@ -37,7 +38,6 @@ import mage.abilities.keyword.HasteAbility;
import mage.abilities.keyword.TrampleAbility; import mage.abilities.keyword.TrampleAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.game.events.GameEvent.EventType; import mage.game.events.GameEvent.EventType;
import mage.sets.Magic2010;
/** /**
* *
@ -46,8 +46,8 @@ import mage.sets.Magic2010;
public class BallLightning extends CardImpl<BallLightning> { public class BallLightning extends CardImpl<BallLightning> {
public BallLightning(UUID ownerId) { public BallLightning(UUID ownerId) {
super(ownerId, "Ball Lightning", new CardType[]{CardType.CREATURE}, "{R}{R}{R}"); super(ownerId, "Ball Lightning", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{R}{R}{R}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Elemental"); this.subtype.add("Elemental");
this.color.setRed(true); this.color.setRed(true);
this.power = new MageInt(6); this.power = new MageInt(6);

View file

@ -30,6 +30,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
@ -38,7 +39,6 @@ import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterPermanent; import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent; import mage.filter.common.FilterCreaturePermanent;
import mage.sets.Magic2010;
/** /**
* *
@ -47,8 +47,8 @@ import mage.sets.Magic2010;
public class BaneslayerAngel extends CardImpl<BaneslayerAngel> { public class BaneslayerAngel extends CardImpl<BaneslayerAngel> {
public BaneslayerAngel(UUID ownerId) { public BaneslayerAngel(UUID ownerId) {
super(ownerId, "Baneslayer Angel", new CardType[]{CardType.CREATURE}, "{3}{W}{W}"); super(ownerId, "Baneslayer Angel", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{3}{W}{W}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Angel"); this.subtype.add("Angel");
this.color.setWhite(true); this.color.setWhite(true);
this.power = new MageInt(5); this.power = new MageInt(5);

View file

@ -30,10 +30,10 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.common.AttacksEachTurnStaticAbility; import mage.abilities.common.AttacksEachTurnStaticAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Magic2010;
/** /**
* *
@ -42,8 +42,8 @@ import mage.sets.Magic2010;
public class BerserkersOfBloodRidge extends CardImpl<BerserkersOfBloodRidge> { public class BerserkersOfBloodRidge extends CardImpl<BerserkersOfBloodRidge> {
public BerserkersOfBloodRidge(UUID ownerId) { public BerserkersOfBloodRidge(UUID ownerId) {
super(ownerId, "Berserkers of Blood Ridge", new CardType[]{CardType.CREATURE}, "{4}{R}"); super(ownerId, "Berserkers of Blood Ridge", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{R}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setRed(true); this.color.setRed(true);
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Berserker"); this.subtype.add("Berserker");

View file

@ -29,50 +29,16 @@
package mage.sets.magic2010; package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType;
import mage.MageInt;
import mage.abilities.keyword.FlyingAbility;
import mage.abilities.mana.BlackManaAbility;
import mage.abilities.mana.BlueManaAbility;
import mage.abilities.mana.GreenManaAbility;
import mage.abilities.mana.RedManaAbility;
import mage.abilities.mana.WhiteManaAbility;
import mage.cards.CardImpl;
import mage.sets.Magic2010;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class BirdsOfParadise extends CardImpl<BirdsOfParadise> { public class BirdsOfParadise extends mage.sets.tenth.BirdsOfParadise {
public BirdsOfParadise(UUID ownerId) { public BirdsOfParadise(UUID ownerId) {
super(ownerId, "Birds of Paradise", new CardType[]{CardType.CREATURE}, "{G}"); super(ownerId);
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Bird");
this.color.setGreen(true);
this.power = new MageInt(0);
this.toughness = new MageInt(1);
this.addAbility(FlyingAbility.getInstance());
this.addAbility(new BlackManaAbility());
this.addAbility(new BlueManaAbility());
this.addAbility(new GreenManaAbility());
this.addAbility(new RedManaAbility());
this.addAbility(new WhiteManaAbility());
}
public BirdsOfParadise(final BirdsOfParadise card) {
super(card);
}
@Override
public BirdsOfParadise copy() {
return new BirdsOfParadise(this);
}
@Override
public String getArt() {
return "88690_typ_reg_sty_010.jpg";
} }
} }

View file

@ -30,12 +30,12 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.FirstStrikeAbility; import mage.abilities.keyword.FirstStrikeAbility;
import mage.abilities.keyword.ProtectionAbility; import mage.abilities.keyword.ProtectionAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.FilterCard; import mage.filter.FilterCard;
import mage.sets.Magic2010;
/** /**
* *
@ -51,8 +51,8 @@ public class BlackKnight extends CardImpl<BlackKnight> {
} }
public BlackKnight(UUID ownerId) { public BlackKnight(UUID ownerId) {
super(ownerId, "Black Knight", new CardType[]{CardType.CREATURE}, "{B}{B}"); super(ownerId, "Black Knight", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{B}{B}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Knight"); this.subtype.add("Knight");
this.color.setBlack(true); this.color.setBlack(true);

View file

@ -30,6 +30,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone; import mage.Constants.Zone;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
@ -38,7 +39,6 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl; import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.TapTargetEffect; import mage.abilities.effects.common.TapTargetEffect;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Magic2010;
import mage.target.common.TargetCreaturePermanent; import mage.target.common.TargetCreaturePermanent;
/** /**
@ -48,8 +48,8 @@ import mage.target.common.TargetCreaturePermanent;
public class BlindingMage extends CardImpl<BlindingMage> { public class BlindingMage extends CardImpl<BlindingMage> {
public BlindingMage(UUID ownerId) { public BlindingMage(UUID ownerId) {
super(ownerId, "Blinding Mage", new CardType[]{CardType.CREATURE}, "{1}{W}"); super(ownerId, "Blinding Mage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{W}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Human"); this.subtype.add("Human");
this.subtype.add("Wizard"); this.subtype.add("Wizard");
this.color.setWhite(true); this.color.setWhite(true);

View file

@ -30,12 +30,12 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.keyword.LandwalkAbility; import mage.abilities.keyword.LandwalkAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope; import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterLandPermanent; import mage.filter.common.FilterLandPermanent;
import mage.sets.Magic2010;
/** /**
* *
@ -51,8 +51,8 @@ public class BogWraith extends CardImpl<BogWraith> {
} }
public BogWraith(UUID ownerId) { public BogWraith(UUID ownerId) {
super(ownerId, "Bog Wraith", new CardType[]{CardType.CREATURE}, "{3}{B}"); super(ownerId, "Bog Wraith", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{B}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setBlack(true); this.color.setBlack(true);
this.subtype.add("Wraith"); this.subtype.add("Wraith");
this.power = new MageInt(3); this.power = new MageInt(3);

View file

@ -30,6 +30,7 @@ package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType; import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt; import mage.MageInt;
import mage.abilities.Ability; import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility; import mage.abilities.common.EntersBattlefieldTriggeredAbility;
@ -37,7 +38,6 @@ import mage.abilities.effects.common.DamageMultiEffect;
import mage.abilities.keyword.FlashAbility; import mage.abilities.keyword.FlashAbility;
import mage.abilities.keyword.FlyingAbility; import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl; import mage.cards.CardImpl;
import mage.sets.Magic2010;
import mage.target.common.TargetCreatureOrPlayerAmount; import mage.target.common.TargetCreatureOrPlayerAmount;
/** /**
@ -47,8 +47,8 @@ import mage.target.common.TargetCreatureOrPlayerAmount;
public class BogardanHellkite extends CardImpl<BogardanHellkite> { public class BogardanHellkite extends CardImpl<BogardanHellkite> {
public BogardanHellkite(UUID ownerId) { public BogardanHellkite(UUID ownerId) {
super(ownerId, "Bogardan Hellkite", new CardType[]{CardType.CREATURE}, "{6}{R}{R}"); super(ownerId, "Bogardan Hellkite", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{6}{R}{R}");
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.subtype.add("Dragon"); this.subtype.add("Dragon");
this.color.setRed(true); this.color.setRed(true);
this.power = new MageInt(5); this.power = new MageInt(5);

View file

@ -29,38 +29,16 @@
package mage.sets.magic2010; package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType;
import mage.abilities.effects.common.CounterTargetEffect;
import mage.cards.CardImpl;
import mage.sets.Magic2010;
import mage.target.TargetSpell;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class Cancel extends CardImpl<Cancel> { public class Cancel extends mage.sets.shardsofalara.Cancel {
public Cancel(UUID ownerId) { public Cancel(UUID ownerId) {
super(ownerId, "Cancel", new CardType[]{CardType.INSTANT}, "{1}{U}{U}"); super(ownerId);
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setBlue(true);
this.getSpellAbility().addTarget(new TargetSpell());
this.getSpellAbility().addEffect(new CounterTargetEffect());
} }
public Cancel(final Cancel card) { }
super(card);
}
@Override
public Cancel copy() {
return new Cancel(this);
}
@Override
public String getArt() {
return "116179_typ_reg_sty_010.jpg";
}
}

View file

@ -0,0 +1,44 @@
/*
* 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.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CanyonMinotaur extends mage.sets.conflux.CanyonMinotaur {
public CanyonMinotaur(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
}

View file

@ -29,50 +29,16 @@
package mage.sets.magic2010; package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.TargetController;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.FilterPermanent;
import mage.sets.Magic2010;
import mage.target.TargetPermanent;
/** /**
* *
* @author BetaSteward_at_googlemail.com * @author BetaSteward_at_googlemail.com
*/ */
public class CelestialPurge extends CardImpl<CelestialPurge> { public class CelestialPurge extends mage.sets.conflux.CelestialPurge {
private static FilterPermanent filter = new FilterPermanent("black or red permanent");
static {
filter.setUseColor(true);
filter.setScopeColor(ComparisonScope.Any);
filter.getColor().setBlack(true);
filter.getColor().setRed(true);
}
public CelestialPurge(UUID ownerId) { public CelestialPurge(UUID ownerId) {
super(ownerId, "Celestial Purge", new CardType[]{CardType.INSTANT}, "{1}{W}"); super(ownerId);
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setWhite(true);
this.getSpellAbility().addTarget(new TargetPermanent(filter, TargetController.ANY));
this.getSpellAbility().addEffect(new ExileTargetEffect());
} }
public CelestialPurge(final CelestialPurge card) { }
super(card);
}
@Override
public CelestialPurge copy() {
return new CelestialPurge(this);
}
@Override
public String getArt() {
return "118751_typ_reg_sty_010.jpg";
}
}

View file

@ -0,0 +1,88 @@
/*
* 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.magic2010;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.LoyaltyAbility;
import mage.abilities.effects.Effects;
import mage.abilities.effects.common.DamageAllControlledTargetEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DamageXTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.target.TargetPlayer;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ChandraNalaar extends CardImpl<ChandraNalaar> {
public ChandraNalaar(UUID ownerId) {
super(ownerId, "Chandra Nalaar", Rarity.MYTHIC, new CardType[]{CardType.PLANESWALKER}, "{3}{R}{R}");
this.expansionSetCode = "M10";
this.subtype.add("Chandra ");
this.color.setRed(true);
this.loyalty = new MageInt(6);
LoyaltyAbility ability1 = new LoyaltyAbility(new DamageTargetEffect(1), 1);
ability1.addTarget(new TargetPlayer());
this.addAbility(ability1);
LoyaltyAbility ability2 = new LoyaltyAbility(new DamageXTargetEffect());
ability2.addTarget(new TargetCreaturePermanent());
this.addAbility(ability2);
Effects effects1 = new Effects();
effects1.add(new DamageTargetEffect(10));
effects1.add(new DamageAllControlledTargetEffect(10, FilterCreaturePermanent.getDefault()));
LoyaltyAbility ability3 = new LoyaltyAbility(effects1, -8);
ability3.addTarget(new TargetPlayer());
this.addAbility(ability3);
}
public ChandraNalaar(final ChandraNalaar card) {
super(card);
}
@Override
public ChandraNalaar copy() {
return new ChandraNalaar(this);
}
@Override
public String getArt() {
return "105500_typ_reg_sty_010.jpg";
}
}

View file

@ -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.magic2010;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.MageInt;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ChildOfNight extends CardImpl<ChildOfNight> {
public ChildOfNight(UUID ownerId) {
super(ownerId, "Child Of Night", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}");
this.expansionSetCode = "M10";
this.color.setBlack(true);
this.subtype.add("Vampire");
this.power = new MageInt(2);
this.toughness = new MageInt(1);
this.abilities.add(LifelinkAbility.getInstance());
}
public ChildOfNight(final ChildOfNight card) {
super(card);
}
@Override
public ChildOfNight copy() {
return new ChildOfNight(this);
}
@Override
public String getArt() {
return "98590_typ_reg_sty_010.jpg";
}
}

View file

@ -0,0 +1,44 @@
/*
* 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.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Clone extends mage.sets.tenth.Clone {
public Clone(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
}

View file

@ -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.magic2010;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.RegenerateSourceEffect;
import mage.abilities.keyword.LifelinkAbility;
import mage.cards.CardImpl;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class CudgelTroll extends CardImpl<CudgelTroll> {
public CudgelTroll(UUID ownerId) {
super(ownerId, "Cudgel Troll", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
this.expansionSetCode = "M10";
this.color.setGreen(true);
this.subtype.add("Troll");
this.power = new MageInt(4);
this.toughness = new MageInt(3);
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{G}")));
}
public CudgelTroll(final CudgelTroll card) {
super(card);
}
@Override
public CudgelTroll copy() {
return new CudgelTroll(this);
}
@Override
public String getArt() {
return "121570_typ_reg_sty_010.jpg";
}
}

View file

@ -0,0 +1,49 @@
/*
* 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.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Deathmark extends mage.sets.tenth.Deathmark {
public Deathmark(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
@Override
public String getArt() {
return "122155_typ_reg_sty_010.jpg";
}
}

View file

@ -0,0 +1,44 @@
/*
* 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.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class DemonsHorn extends mage.sets.tenth.DemonsHorn {
public DemonsHorn(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
}

View file

@ -29,37 +29,16 @@
package mage.sets.magic2010; package mage.sets.magic2010;
import java.util.UUID; import java.util.UUID;
import mage.Constants.CardType;
import mage.abilities.effects.common.SearchLibraryPutInHandEffect;
import mage.cards.CardImpl;
import mage.sets.Magic2010;
import mage.target.common.TargetCardInLibrary;
/** /**
* *
* @author LokiX * @author BetaSteward_at_googlemail.com
*/ */
public class DiabolicTutor extends CardImpl<DiabolicTutor> { public class DiabolicTutor extends mage.sets.tenth.DiabolicTutor {
public DiabolicTutor(UUID onwerId){ public DiabolicTutor(UUID ownerId) {
super(onwerId, "Diabolic Tutor", new CardType[]{CardType.INSTANT},"{2}{B}{B}"); super(ownerId);
this.expansionSetId = Magic2010.getInstance().getId(); this.expansionSetCode = "M10";
this.color.setBlack(true);
TargetCardInLibrary target = new TargetCardInLibrary();
this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(target));
}
public DiabolicTutor(final DiabolicTutor card) {
super(card);
} }
@Override
public DiabolicTutor copy() {
return new DiabolicTutor(this);
}
@Override
public String getArt() {
return "101052_typ_reg_sty_010.jpg";
}
} }

View file

@ -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.magic2010;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.filter.common.FilterCreatureCard;
import mage.target.common.TargetCardInGraveyard;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Disentomb extends CardImpl<Disentomb> {
private static FilterCreatureCard filter = new FilterCreatureCard();
public Disentomb(UUID ownerId) {
super(ownerId, "Disentomb", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{B}");
this.expansionSetCode = "M10";
this.color.setBlack(true);
this.getSpellAbility().addTarget(new TargetCardInGraveyard(filter));
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
}
public Disentomb(final Disentomb card) {
super(card);
}
@Override
public Disentomb copy() {
return new Disentomb(this);
}
@Override
public String getArt() {
return "121633_typ_reg_sty_010.jpg";
}
}

Some files were not shown because too many files have changed in this diff Show more