This commit is contained in:
BetaSteward 2010-10-28 03:19:26 +00:00
parent 78e640487b
commit 3a784f59ee
88 changed files with 2521 additions and 447 deletions

View file

@ -10,7 +10,7 @@ resource-path=C:\\Program Files (x86)\\Wizards of the Coast\\Magic Online III\\G
card-scaling-factor=0.4
# parameters for debugging and testing faster
default-deck-path=C:\\UW Control.dck
default-deck-path=C:\\Projects\\Mage\\Mage.Client\\release\\sample-decks\\WhiteTokens.dck
# 0: Human, 1: Computer - default, 2: Computer - minimax, 3: Computer - minimax hybrid
default-other-player-index=1
default-computer-name=computer

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Client</artifactId>
<artifactId>mage-client</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Client</name>
@ -19,17 +19,17 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage-Common</artifactId>
<artifactId>mage-common</artifactId>
<version>${mage-version}</version>
</dependency>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage-Sets</artifactId>
<artifactId>mage-sets</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>
@ -39,6 +39,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
@ -50,26 +51,7 @@
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>mage.client.MageFrame</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/main/assembly/distribution.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
<finalName>mage-client</finalName>

View file

@ -8,7 +8,7 @@
</Border>
</Property>
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
<Connection code="new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight)" type="code"/>
<Connection code="(!Beans.isDesignTime())?(new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight)):(new Dimension(100, 100))" type="code"/>
</Property>
</Properties>
<AuxValues>

View file

@ -38,6 +38,7 @@ import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.Beans;
import java.util.UUID;
import mage.client.util.Config;
import mage.client.util.Event;
@ -108,7 +109,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener {
cardArea = new javax.swing.JLayeredPane();
setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
setPreferredSize(new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight));
setPreferredSize((!Beans.isDesignTime())?(new Dimension(Config.dimensions.frameWidth, Config.dimensions.frameHeight)):(new Dimension(100, 100)));
setLayout(new java.awt.BorderLayout());
jScrollPane1.setViewportView(cardArea);

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.client.deckeditor;
import mage.cards.decks.DeckCardLists;
import mage.sets.Sets;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class DecDeckImporter extends DeckImporterImpl {
@Override
protected void readLine(String line, DeckCardLists deckList) {
if (line.length() == 0 || line.startsWith("//")) return;
boolean sideboard = false;
if (line.startsWith("SB:")) {
line = line.substring(3).trim();
sideboard = true;
}
int delim = line.indexOf(' ');
String lineNum = line.substring(0, delim).trim();
String lineName = line.substring(delim).trim();
try {
int num = Integer.parseInt(lineNum);
String cardName = Sets.findCard(lineName);
if (cardName == null)
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
else {
for (int i = 0; i < num; i++) {
if (!sideboard)
deckList.getCards().add(cardName);
else
deckList.getSideboard().add(cardName);
}
}
}
catch (NumberFormatException nfe) {
sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
}
}
}

View file

@ -79,6 +79,10 @@
<EmptySpace max="-2" attributes="0"/>
<Component id="btnExit" min="-2" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="btnImport" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace max="-2" attributes="0"/>
</Group>
@ -99,7 +103,9 @@
<Component id="btnNew" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="btnExit" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace pref="188" max="32767" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="btnImport" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="159" max="32767" attributes="0"/>
<Component id="bigCard" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
@ -157,6 +163,15 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnExitActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="btnImport">
<Properties>
<Property name="text" type="java.lang.String" value="Import"/>
<Property name="name" type="java.lang.String" value="btnImport" noResource="true"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnImportActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Container>
</SubComponents>

View file

@ -58,6 +58,7 @@ import mage.view.CardsView;
public class DeckEditorPanel extends javax.swing.JPanel {
private JFileChooser fcSelectDeck;
private JFileChooser fcImportDeck;
private Deck deck = new Deck();;
/** Creates new form DeckEditorPanel */
@ -66,6 +67,9 @@ public class DeckEditorPanel extends javax.swing.JPanel {
fcSelectDeck = new JFileChooser();
fcSelectDeck.setAcceptAllFileFilterUsed(false);
fcSelectDeck.addChoosableFileFilter(new DeckFilter());
fcImportDeck = new JFileChooser();
fcImportDeck.setAcceptAllFileFilterUsed(false);
fcImportDeck.addChoosableFileFilter(new ImportFilter());
}
public void showDeckEditor() {
@ -152,6 +156,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
btnLoad = new javax.swing.JButton();
btnNew = new javax.swing.JButton();
btnExit = new javax.swing.JButton();
btnImport = new javax.swing.JButton();
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
jSplitPane1.setResizeWeight(0.5);
@ -191,6 +196,14 @@ public class DeckEditorPanel extends javax.swing.JPanel {
}
});
btnImport.setText("Import");
btnImport.setName("btnImport"); // NOI18N
btnImport.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnImportActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
@ -211,7 +224,10 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnNew)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnExit)))
.addComponent(btnExit))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnImport)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
@ -227,7 +243,9 @@ public class DeckEditorPanel extends javax.swing.JPanel {
.addComponent(btnLoad)
.addComponent(btnNew)
.addComponent(btnExit))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 188, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnImport)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 159, Short.MAX_VALUE)
.addComponent(bigCard, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
);
@ -306,10 +324,43 @@ public class DeckEditorPanel extends javax.swing.JPanel {
this.setVisible(false);
}//GEN-LAST:event_btnExitActionPerformed
private void btnImportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnImportActionPerformed
String lastFolder = MageFrame.getPreferences().get("lastImportFolder", "");
if (!lastFolder.isEmpty())
fcImportDeck.setCurrentDirectory(new File(lastFolder));
int ret = fcImportDeck.showOpenDialog(this);
if (ret == JFileChooser.APPROVE_OPTION) {
File file = fcImportDeck.getSelectedFile();
try {
setCursor(new Cursor(Cursor.WAIT_CURSOR));
deck = Deck.load(importDeck(file.getPath()));
} catch (Exception ex) {
Logger.getLogger(DeckEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
}
finally {
setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
}
refreshDeck();
try {
MageFrame.getPreferences().put("lastImportFolder", file.getCanonicalPath());
} catch (IOException ex) { }
}
fcImportDeck.setSelectedFile(null);
}//GEN-LAST:event_btnImportActionPerformed
public DeckCardLists importDeck(String file) {
DeckImporter importer;
if (file.endsWith("dec"))
importer = new DecDeckImporter();
else
importer = new MWSDeckImporter();
return importer.importDeck(file);
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private mage.client.cards.BigCard bigCard;
private javax.swing.JButton btnExit;
private javax.swing.JButton btnImport;
private javax.swing.JButton btnLoad;
private javax.swing.JButton btnNew;
private javax.swing.JButton btnSave;
@ -345,3 +396,30 @@ class DeckFilter extends FileFilter {
return "Deck Files";
}
}
class ImportFilter extends FileFilter {
@Override
public boolean accept(File f) {
if (f.isDirectory())
return true;
String ext = null;
String s = f.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1) {
ext = s.substring(i+1).toLowerCase();
}
if (ext != null) {
if (ext.equals("dec") || ext.equals("mwDeck"))
return true;
}
return false;
}
@Override
public String getDescription() {
return "*.dec | *.mwDeck";
}
}

View file

@ -0,0 +1,41 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.client.deckeditor;
import mage.cards.decks.DeckCardLists;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public interface DeckImporter {
public DeckCardLists importDeck(String file);
}

View file

@ -0,0 +1,78 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.client.deckeditor;
import java.io.File;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import mage.cards.decks.DeckCardLists;
import mage.client.MageFrame;
import mage.util.Logging;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public abstract class DeckImporterImpl implements DeckImporter {
private final static Logger logger = Logging.getLogger(DeckImporterImpl.class.getName());
protected StringBuilder sbMessage = new StringBuilder();
protected int lineCount;
@Override
public DeckCardLists importDeck(String file) {
File f = new File(file);
DeckCardLists deckList = new DeckCardLists();
lineCount = 0;
sbMessage.setLength(0);
try {
Scanner scanner = new Scanner(f);
try {
while (scanner.hasNextLine()) {
String line = scanner.nextLine().trim();
lineCount++;
readLine(line, deckList);
}
if (sbMessage.length() > 0) {
JOptionPane.showMessageDialog(MageFrame.getDesktop(), sbMessage.toString(), "Error importing deck", JOptionPane.ERROR_MESSAGE);
}
}
finally {
scanner.close();
}
} catch (Exception ex) {
logger.log(Level.SEVERE, null, ex);
}
return deckList;
}
protected abstract void readLine(String line, DeckCardLists deckList);
}

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.client.deckeditor;
import mage.cards.decks.DeckCardLists;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class MWSDeckImporter extends DeckImporterImpl {
@Override
protected void readLine(String line, DeckCardLists deckList) {
//TODO: implement this
}
}

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Common</artifactId>
<artifactId>mage-common</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Common Classes</name>
@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Deck-Contructed</artifactId>
<artifactId>mage-deck-contructed</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Deck Constructed</name>
@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Game-FreeForAll</artifactId>
<artifactId>mage-game-freeforall</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Game Free For All</name>
@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Game-TwoPlayerDuel</artifactId>
<artifactId>mage-game-twoplayerduel</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Game Two Player</name>
@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Player-AI</artifactId>
<artifactId>mage-player-ai</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Player AI</name>
@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -19,12 +19,12 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage-Player-AI</artifactId>
<artifactId>mage-player-ai</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Player-Human</artifactId>
<artifactId>mage-player-human</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Player Human</name>
@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -49,7 +49,6 @@ import mage.abilities.SpecialAction;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.VariableManaCost;
import mage.cards.decks.Deck;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.common.FilterCreatureForCombat;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -57,7 +56,6 @@ import mage.target.Target;
import mage.target.TargetAmount;
import mage.target.TargetCard;
import mage.target.common.TargetAttackingCreature;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetCreaturePermanent;
import mage.target.common.TargetDefender;

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Server</artifactId>
<artifactId>mage-server</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Server</name>
@ -19,17 +19,17 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage-Common</artifactId>
<artifactId>mage-common</artifactId>
<version>${mage-version}</version>
</dependency>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage-Sets</artifactId>
<artifactId>mage-sets</artifactId>
<version>${mage-version}</version>
<scope>runtime</scope>
</dependency>

View file

@ -38,6 +38,7 @@ import java.util.Map.Entry;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -57,6 +58,7 @@ import mage.game.events.TableEvent;
import mage.players.Player;
import mage.server.ChatManager;
import mage.server.util.ThreadExecutor;
import mage.sets.Sets;
import mage.util.Logging;
import mage.view.AbilityPickerView;
import mage.view.CardsView;
@ -71,6 +73,7 @@ public class GameController implements GameCallback {
private static ExecutorService gameExecutor = ThreadExecutor.getInstance().getGameExecutor();
private final static Logger logger = Logging.getLogger(GameController.class.getName());
public static final String INIT_FILE_PATH = "config" + File.separator + "init.txt";
private ConcurrentHashMap<UUID, GameSession> gameSessions = new ConcurrentHashMap<UUID, GameSession>();
private ConcurrentHashMap<UUID, GameWatcher> watchers = new ConcurrentHashMap<UUID, GameWatcher>();
@ -392,17 +395,17 @@ public class GameController implements GameCallback {
*/
private void addCardsForTesting(Game game, Player player) {
try {
File f = new File(Constants.INIT_FILE_PATH);
File f = new File(INIT_FILE_PATH);
Pattern pattern = Pattern.compile("([a-zA-Z]*):([\\w]*):([a-zA-Z ,.!\\d]*):([\\d]*)");
if (!f.exists()) {
//TODO: log warning with Logger
System.err.println("WARN! Couldn't find init file: " + Constants.INIT_FILE_PATH);
logger.warning("Couldn't find init file: " + INIT_FILE_PATH);
return;
}
System.err.println("Parsing init.txt for player : " + player.getName());
logger.info("Parsing init.txt for player : " + player.getName());
Scanner scanner = new Scanner(f);
try {
while (scanner.hasNextLine()) {
String line = scanner.nextLine().trim();
if (line.startsWith("#")) continue;
@ -427,29 +430,29 @@ public class GameController implements GameCallback {
String cardName = m.group(3);
Integer amount = Integer.parseInt(m.group(4));
for (int i = 0; i < amount; i++) {
Card card = CardImpl.createCard(cardName);
Card card = CardImpl.createCard(Sets.findCard(cardName));
if (card != null) {
Set<Card> cards = new HashSet<Card>();
cards.add(card);
game.loadCards(cards, player.getId());
swapWithAnyCard(game, player, card, gameZone);
} else {
//TODO: log warning with Logger
System.err.println("ERROR! Couldn't create a card: " + cardName);
logger.severe("Couldn't create a card: " + cardName);
}
}
} else {
//TODO: log warning with Logger
System.err.println("WARN! Was skipped: " + line);
logger.warning("Was skipped: " + line);
}
} else {
//TODO: log warning with Logger
System.err.println("WARN! Init string wasn't parsed: " + line);
logger.warning("Init string wasn't parsed: " + line);
}
}
}
finally {
scanner.close();
}
} catch (Exception e) {
//TODO: add logger
e.printStackTrace();
logger.log(Level.SEVERE, "", e);
}
}
@ -465,6 +468,6 @@ public class GameController implements GameCallback {
} else {
card.moveToZone(zone, game, false);
}
System.out.println("Added card to player's " + zone.toString() + ": " + card.getName() +", player = " + player.getName());
logger.info("Added card to player's " + zone.toString() + ": " + card.getName() +", player = " + player.getName());
}
}

View file

@ -10,7 +10,7 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage-Sets</artifactId>
<artifactId>mage-sets</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Sets</name>
@ -19,7 +19,7 @@
<dependencies>
<dependency>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<version>${mage-version}</version>
</dependency>
</dependencies>

View file

@ -72,4 +72,13 @@ public class Sets extends HashMap<String, ExpansionSet> {
return names;
}
public static String findCard(String name) {
for (ExpansionSet set: fINSTANCE.values()) {
for (Card card: set.createCards()) {
if (name.equals(card.getName()))
return card.getClass().getCanonicalName();
}
}
return null;
}
}

View file

@ -103,7 +103,7 @@ class DuressEffect extends OneShotEffect<DuressEffect> {
if (you.chooseTarget(player.getHand(), target, source, game)) {
Card card = player.getHand().get(target.getFirstTarget(), game);
if (card != null) {
return player.discard(card, game);
return player.discard(card, source, game);
}
}
}

View file

@ -57,7 +57,7 @@ public class Fireball extends CardImpl<Fireball> {
@Override
public void adjustCosts(Ability ability, Game game) {
int numTargets = ability.getTargets().get(0).getNumberOfTargets();
int numTargets = ability.getTargets().get(0).getTargets().size();
if (numTargets > 1) {
ability.getManaCosts().add(new GenericManaCost(numTargets - 1));
}
@ -90,8 +90,9 @@ class FireballEffect extends OneShotEffect<FireballEffect> {
@Override
public boolean apply(Game game, Ability source) {
int numTargets = source.getTargets().get(0).getNumberOfTargets();
int numTargets = source.getTargets().get(0).getTargets().size();
int damage = source.getManaCosts().getVariableCosts().get(0).getAmount();
if (numTargets > 0) {
int damagePer = damage/numTargets;
if (damagePer > 0) {
for (UUID targetId: source.getTargets().get(0).getTargets()) {
@ -108,6 +109,7 @@ class FireballEffect extends OneShotEffect<FireballEffect> {
}
return true;
}
}
return false;
}

View file

@ -0,0 +1,124 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2010;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Layer;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.SubLayer;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class PalaceGuard extends CardImpl<PalaceGuard> {
public PalaceGuard(UUID ownerId) {
super(ownerId, "Palace Guard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{W}");
this.expansionSetCode = "M10";
this.subtype.add("Human");
this.subtype.add("Soldier");
this.color.setWhite(true);
this.power = new MageInt(1);
this.toughness = new MageInt(4);
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new PalaceGuardEffect()));
}
public PalaceGuard(final PalaceGuard card) {
super(card);
}
@Override
public PalaceGuard copy() {
return new PalaceGuard(this);
}
@Override
public String getArt() {
return "121617_typ_reg_sty_010.jpg";
}
class PalaceGuardEffect extends ContinuousEffectImpl<PalaceGuardEffect> {
public PalaceGuardEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);
}
public PalaceGuardEffect(final PalaceGuardEffect effect) {
super(effect);
}
@Override
public PalaceGuardEffect copy() {
return new PalaceGuardEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Permanent perm = game.getPermanent(source.getSourceId());
if (perm != null) {
switch (layer) {
case RulesEffects:
perm.setMaxBlocks(0);
break;
}
return true;
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.RulesEffects;
}
@Override
public String getText(Ability source) {
return "Palace Guard can block any number of creatures";
}
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains1 extends mage.cards.basiclands.Plains {
public Plains1(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
@Override
public String getArt() {
return "33222_typ_reg_sty_010.jpg";
}
public Plains1(final Plains1 card) {
super(card);
}
@Override
public Plains1 copy() {
return new Plains1(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains2 extends mage.cards.basiclands.Plains {
public Plains2(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
@Override
public String getArt() {
return "121682_typ_reg_sty_010.jpg";
}
public Plains2(final Plains2 card) {
super(card);
}
@Override
public Plains2 copy() {
return new Plains2(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains3 extends mage.cards.basiclands.Plains {
public Plains3(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
@Override
public String getArt() {
return "121696_typ_reg_sty_010.jpg";
}
public Plains3(final Plains3 card) {
super(card);
}
@Override
public Plains3 copy() {
return new Plains3(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2010;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains4 extends mage.cards.basiclands.Plains {
public Plains4(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M10";
}
@Override
public String getArt() {
return "33224_typ_reg_sty_010.jpg";
}
public Plains4(final Plains4 card) {
super(card);
}
@Override
public Plains4 copy() {
return new Plains4(this);
}
}

View file

@ -40,6 +40,7 @@ import mage.cards.CardImpl;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetControlledPermanent;
import mage.target.common.TargetCreatureOrPlayer;
@ -99,6 +100,11 @@ class FlingEffect extends OneShotEffect<FlingEffect> {
permanent.damage(amount, source.getSourceId(), game, true);
return true;
}
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
player.damage(amount, source.getSourceId(), game, false, true);
return true;
}
}
return false;
}

View file

@ -89,7 +89,7 @@ class LilianasSpecterEffect extends OneShotEffect<LilianasSpecterEffect> {
public boolean apply(Game game, Ability source) {
for (UUID playerId: game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(playerId);
player.discard(1, game);
player.discard(1, source, game);
}
return true;
}

View file

@ -0,0 +1,137 @@
/*
* 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.magic2011;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Duration;
import mage.Constants.Outcome;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.abilities.effects.common.GainLifeEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.stack.StackObject;
import mage.players.Player;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class ObstinateBaloth extends CardImpl<ObstinateBaloth> {
public ObstinateBaloth(UUID ownerId) {
super(ownerId, "Obstinate Baloth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
this.expansionSetCode = "M11";
this.subtype.add("Beast");
this.color.setGreen(true);
this.power = new MageInt(4);
this.toughness = new MageInt(4);
this.addAbility(new EntersBattlefieldTriggeredAbility(new GainLifeEffect(4), false));
this.addAbility(new SimpleStaticAbility(Zone.HAND, new ObstinateBalothEffect()));
}
public ObstinateBaloth(final ObstinateBaloth card) {
super(card);
}
@Override
public ObstinateBaloth copy() {
return new ObstinateBaloth(this);
}
@Override
public String getArt() {
return "129158_typ_reg_sty_010.jpg";
}
}
class ObstinateBalothEffect extends ReplacementEffectImpl<ObstinateBalothEffect> {
public ObstinateBalothEffect() {
super(Duration.EndOfGame, Outcome.PutCardInPlay);
}
public ObstinateBalothEffect(final ObstinateBalothEffect effect) {
super(effect);
}
@Override
public ObstinateBalothEffect copy() {
return new ObstinateBalothEffect(this);
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == EventType.DISCARD_CARD && event.getTargetId().equals(source.getSourceId())) {
StackObject spell = game.getStack().getStackObject(event.getSourceId());
if (spell != null && game.getOpponents(source.getControllerId()).contains(spell.getControllerId())) {
return true;
}
}
return false;
}
@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
if (card != null) {
Player player = game.getPlayer(card.getOwnerId());
if (player != null) {
player.removeFromHand(card, game);
if (card.putOntoBattlefield(game, Zone.HAND, player.getId())) {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARD, card.getId(), source.getId(), player.getId()));
return true;
}
}
}
return false;
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
return apply(game, source);
}
@Override
public String getText(Ability source) {
return "If a spell or ability an opponent controls causes you to discard Obstinate Baloth, put it onto the battlefield instead of putting it into your graveyard";
}
}

View file

@ -0,0 +1,53 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2011;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class PalaceGuard extends mage.sets.magic2010.PalaceGuard {
public PalaceGuard(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M11";
}
public PalaceGuard(final PalaceGuard card) {
super(card);
}
@Override
public PalaceGuard copy() {
return new PalaceGuard(this);
}
}

View file

@ -0,0 +1,110 @@
/*
* 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.magic2011;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.cards.CardImpl;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class PhantomBeast extends CardImpl<PhantomBeast> {
public PhantomBeast(UUID ownerId) {
super(ownerId, "Phantom Beast", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.expansionSetCode = "M11";
this.subtype.add("Illusion");
this.subtype.add("Beast");
this.color.setBlue(true);
this.power = new MageInt(4);
this.toughness = new MageInt(5);
this.addAbility(new PhantomBeastAbility());
}
public PhantomBeast(final PhantomBeast card) {
super(card);
}
@Override
public PhantomBeast copy() {
return new PhantomBeast(this);
}
@Override
public String getArt() {
return "129107_typ_reg_sty_010.jpg";
}
class PhantomBeastAbility extends TriggeredAbilityImpl<PhantomBeastAbility> {
public PhantomBeastAbility() {
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
}
public PhantomBeastAbility(final PhantomBeastAbility ability) {
super(ability);
}
@Override
public PhantomBeastAbility copy() {
return new PhantomBeastAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent perm = game.getPermanent(sourceId);
if (perm != null) {
if (event.getTargetId().equals(perm.getId()) && event.getType() == EventType.TARGETED) {
trigger(game, event.getPlayerId());
return true;
}
}
return false;
}
@Override
public String getRule() {
return "When Phantom Beast becomes the target of a spell or ability, sacrifice it";
}
}
}

View file

@ -0,0 +1,123 @@
/*
* 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.magic2011;
import java.util.UUID;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.common.AddCountersTargetEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.keyword.IndestructibleAbility;
import mage.cards.CardImpl;
import mage.filter.Filter.ComparisonScope;
import mage.filter.common.FilterControlledPermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class PhylacteryLich extends CardImpl<PhylacteryLich> {
private static FilterControlledPermanent filter = new FilterControlledPermanent("artifact");
static {
filter.getCardType().add(CardType.ARTIFACT);
filter.setScopeCardType(ComparisonScope.Any);
}
public PhylacteryLich(UUID ownerId) {
super(ownerId, "Phylactery Lich", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{B}{B}{B}");
this.expansionSetCode = "M11";
this.subtype.add("Zombie");
this.color.setBlack(true);
this.power = new MageInt(5);
this.toughness = new MageInt(5);
Ability ability = new EntersBattlefieldTriggeredAbility(new AddCountersTargetEffect("phylactery", 1), false);
ability.addTarget(new TargetControlledPermanent(filter));
this.addAbility(ability);
this.addAbility(IndestructibleAbility.getInstance());
this.addAbility(new PhylacteryLichAbility());
}
public PhylacteryLich(final PhylacteryLich card) {
super(card);
}
@Override
public PhylacteryLich copy() {
return new PhylacteryLich(this);
}
@Override
public String getArt() {
return "129123_typ_reg_sty_010.jpg";
}
class PhylacteryLichAbility extends StateTriggeredAbility<PhylacteryLichAbility> {
public PhylacteryLichAbility() {
super(Zone.BATTLEFIELD, new SacrificeSourceEffect());
}
public PhylacteryLichAbility(final PhylacteryLichAbility ability) {
super(ability);
}
@Override
public PhylacteryLichAbility copy() {
return new PhylacteryLichAbility(this);
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
for (Permanent perm: game.getBattlefield().getAllActivePermanents(controllerId)) {
if (perm.getCounters().getCount("phylactery") > 0)
return true;
}
return false;
}
@Override
public String getRule() {
return "When you control no permanents with phylactery counters on them, sacrifice Phylactery Lich.";
}
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2011;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains1 extends mage.cards.basiclands.Plains {
public Plains1(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M11";
}
@Override
public String getArt() {
return "121696_typ_reg_sty_010.jpg";
}
public Plains1(final Plains1 card) {
super(card);
}
@Override
public Plains1 copy() {
return new Plains1(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2011;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains2 extends mage.cards.basiclands.Plains {
public Plains2(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M11";
}
@Override
public String getArt() {
return "121682_typ_reg_sty_010.jpg";
}
public Plains2(final Plains2 card) {
super(card);
}
@Override
public Plains2 copy() {
return new Plains2(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2011;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains3 extends mage.cards.basiclands.Plains {
public Plains3(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M11";
}
@Override
public String getArt() {
return "106213_typ_reg_sty_010.jpg";
}
public Plains3(final Plains3 card) {
super(card);
}
@Override
public Plains3 copy() {
return new Plains3(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.magic2011;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains4 extends mage.cards.basiclands.Plains {
public Plains4(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "M11";
}
@Override
public String getArt() {
return "25492_typ_reg_sty_010.jpg";
}
public Plains4(final Plains4 card) {
super(card);
}
@Override
public Plains4 copy() {
return new Plains4(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains1 extends mage.cards.basiclands.Plains {
public Plains1(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ROE";
}
@Override
public String getArt() {
return "127487_typ_reg_sty_010.jpg";
}
public Plains1(final Plains1 card) {
super(card);
}
@Override
public Plains1 copy() {
return new Plains1(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains2 extends mage.cards.basiclands.Plains {
public Plains2(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ROE";
}
@Override
public String getArt() {
return "127490_typ_reg_sty_010.jpg";
}
public Plains2(final Plains2 card) {
super(card);
}
@Override
public Plains2 copy() {
return new Plains2(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains3 extends mage.cards.basiclands.Plains {
public Plains3(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ROE";
}
@Override
public String getArt() {
return "127493_typ_reg_sty_010.jpg";
}
public Plains3(final Plains3 card) {
super(card);
}
@Override
public Plains3 copy() {
return new Plains3(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.riseoftheeldrazi;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains4 extends mage.cards.basiclands.Plains {
public Plains4(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ROE";
}
@Override
public String getArt() {
return "127500_typ_reg_sty_010.jpg";
}
public Plains4(final Plains4 card) {
super(card);
}
@Override
public Plains4 copy() {
return new Plains4(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.shardsofalara;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains1 extends mage.cards.basiclands.Plains {
public Plains1(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ALA";
}
@Override
public String getArt() {
return "115087_typ_reg_sty_010.jpg";
}
public Plains1(final Plains1 card) {
super(card);
}
@Override
public Plains1 copy() {
return new Plains1(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.shardsofalara;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains2 extends mage.cards.basiclands.Plains {
public Plains2(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ALA";
}
@Override
public String getArt() {
return "115090_typ_reg_sty_010.jpg";
}
public Plains2(final Plains2 card) {
super(card);
}
@Override
public Plains2 copy() {
return new Plains2(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.shardsofalara;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains3 extends mage.cards.basiclands.Plains {
public Plains3(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ALA";
}
@Override
public String getArt() {
return "115089_typ_reg_sty_010.jpg";
}
public Plains3(final Plains3 card) {
super(card);
}
@Override
public Plains3 copy() {
return new Plains3(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.shardsofalara;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains4 extends mage.cards.basiclands.Plains {
public Plains4(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ALA";
}
@Override
public String getArt() {
return "115088_typ_reg_sty_010.jpg";
}
public Plains4(final Plains4 card) {
super(card);
}
@Override
public Plains4 copy() {
return new Plains4(this);
}
}

View file

@ -43,7 +43,7 @@ public class Plains1 extends mage.cards.basiclands.Plains {
@Override
public String getArt() {
return "80949_typ_reg_sty_010.jpg";
return "08661_typ_reg_sty_010.jpg";
}
public Plains1(final Plains1 card) {

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.tenth;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains2 extends mage.cards.basiclands.Plains {
public Plains2(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "10E";
}
@Override
public String getArt() {
return "80949_typ_reg_sty_010.jpg";
}
public Plains2(final Plains2 card) {
super(card);
}
@Override
public Plains2 copy() {
return new Plains2(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.tenth;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains3 extends mage.cards.basiclands.Plains {
public Plains3(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "10E";
}
@Override
public String getArt() {
return "89178_typ_reg_sty_010.jpg";
}
public Plains3(final Plains3 card) {
super(card);
}
@Override
public Plains3 copy() {
return new Plains3(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.tenth;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains4 extends mage.cards.basiclands.Plains {
public Plains4(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "10E";
}
@Override
public String getArt() {
return "25178_typ_reg_sty_010.jpg";
}
public Plains4(final Plains4 card) {
super(card);
}
@Override
public Plains4 copy() {
return new Plains4(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.zendikar;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains1 extends mage.cards.basiclands.Plains {
public Plains1(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ZEN";
}
@Override
public String getArt() {
return "123755_typ_reg_sty_010.jpg";
}
public Plains1(final Plains1 card) {
super(card);
}
@Override
public Plains1 copy() {
return new Plains1(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.zendikar;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains2 extends mage.cards.basiclands.Plains {
public Plains2(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ZEN";
}
@Override
public String getArt() {
return "123760_typ_reg_sty_010.jpg";
}
public Plains2(final Plains2 card) {
super(card);
}
@Override
public Plains2 copy() {
return new Plains2(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.zendikar;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains3 extends mage.cards.basiclands.Plains {
public Plains3(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ZEN";
}
@Override
public String getArt() {
return "123763_typ_reg_sty_010.jpg";
}
public Plains3(final Plains3 card) {
super(card);
}
@Override
public Plains3 copy() {
return new Plains3(this);
}
}

View file

@ -0,0 +1,58 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.sets.zendikar;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class Plains4 extends mage.cards.basiclands.Plains {
public Plains4(UUID ownerId) {
super(ownerId);
this.expansionSetCode = "ZEN";
}
@Override
public String getArt() {
return "123770_typ_reg_sty_010.jpg";
}
public Plains4(final Plains4 card) {
super(card);
}
@Override
public Plains4 copy() {
return new Plains4(this);
}
}

View file

@ -10,10 +10,10 @@
</parent>
<groupId>org.mage</groupId>
<artifactId>Mage</artifactId>
<artifactId>mage</artifactId>
<packaging>jar</packaging>
<version>0.3</version>
<name>Mage Framework</name>
<name>Mage Application</name>
<url>http://maven.apache.org</url>
<dependencies />

View file

@ -28,14 +28,11 @@
package mage;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public final class Constants {
public static final String INIT_FILE_PATH = "config" + File.separator + "init.txt";
public enum ColoredManaSymbol {
W("W"), U("U"), B("B"), R("R"), G("G");

View file

@ -147,13 +147,13 @@ public abstract class AbilityImpl<T extends AbilityImpl<T>> implements Ability {
logger.fine("activate failed - target");
return false;
}
game.getObject(sourceId).adjustCosts(this, game);
if (!useAlternativeCost(game)) {
if (!manaCosts.pay(game, sourceId, controllerId, noMana)) {
logger.fine("activate failed - mana");
return false;
}
}
game.getObject(sourceId).adjustCosts(this, game);
if (!costs.pay(game, sourceId, controllerId, noMana)) {
logger.fine("activate failed - non mana costs");
return false;

View file

@ -0,0 +1,72 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities;
import java.util.UUID;
import mage.Constants.Zone;
import mage.abilities.effects.Effect;
import mage.game.Game;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public abstract class StateTriggeredAbility<T extends StateTriggeredAbility<T>> extends TriggeredAbilityImpl<T> {
protected boolean triggered;
public StateTriggeredAbility(Zone zone, Effect effect) {
super(zone, effect);
}
public StateTriggeredAbility(final StateTriggeredAbility ability) {
super(ability);
this.triggered = ability.triggered;
}
@Override
public void trigger(Game game, UUID controllerId) {
//20100716 - 603.8
if (!triggered) {
triggered = true;
super.trigger(game, controllerId);
}
}
@Override
public boolean resolve(Game game) {
//20100716 - 603.8
triggered = false;
return super.resolve(game);
}
public void counter() {
triggered = false;
}
}

View file

@ -56,7 +56,7 @@ public class DiscardSourceCost extends CostImpl<DiscardSourceCost> {
public boolean pay(Game game, UUID sourceId, UUID controllerId, boolean noMana) {
Player player = game.getPlayer(controllerId);
Card card = player.getHand().get(sourceId, game);
return player.discard(card, game);
return player.discard(card, null, game);
}
@Override

View file

@ -60,7 +60,7 @@ public class DiscardTargetCost extends CostImpl<DiscardTargetCost> {
Card card = player.getHand().get(targetId, game);
if (card == null)
return false;
paid |= player.discard(card, game);
paid |= player.discard(card, null, game);
}
}
return paid;

View file

@ -28,11 +28,10 @@
package mage.abilities.effects.common;
import mage.Constants.Duration;
import mage.Constants.Outcome;
import mage.abilities.Ability;
import mage.abilities.keyword.ProtectionAbility;
import mage.choices.ChoiceColor;
import mage.filter.FilterCard;
import mage.abilities.effects.OneShotEffect;
import mage.counters.Counter;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -40,42 +39,52 @@ import mage.game.permanent.Permanent;
*
* @author BetaSteward_at_googlemail.com
*/
public class GainProtectionFromColorTargetEOTEffect extends GainAbilityTargetEffect {
public class AddCountersTargetEffect extends OneShotEffect<AddCountersTargetEffect> {
FilterCard protectionFilter;
private int amount;
private String name;
public GainProtectionFromColorTargetEOTEffect() {
super(new ProtectionAbility(new FilterCard()), Duration.EndOfTurn);
protectionFilter = (FilterCard)((ProtectionAbility)ability).getFilter();
protectionFilter.setUseColor(true);
public AddCountersTargetEffect(String name, int amount) {
super(Outcome.Benefit);
this.name = name;
this.amount = amount;
}
public GainProtectionFromColorTargetEOTEffect(final GainProtectionFromColorTargetEOTEffect effect) {
public AddCountersTargetEffect(final AddCountersTargetEffect effect) {
super(effect);
this.protectionFilter = effect.protectionFilter.copy();
}
@Override
public GainProtectionFromColorTargetEOTEffect copy() {
return new GainProtectionFromColorTargetEOTEffect(this);
this.amount = effect.amount;
this.name = effect.name;
}
@Override
public boolean apply(Game game, Ability source) {
ChoiceColor choice = (ChoiceColor) source.getChoices().get(0);
protectionFilter.setColor(choice.getColor());
protectionFilter.setMessage(choice.getChoice());
Permanent creature = game.getPermanent(source.getFirstTarget());
if (creature != null) {
creature.addAbility(ability);
return true;
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
Counter counter = new Counter(name);
counter.add(amount);
permanent.getCounters().addCounter(counter);
}
return false;
return true;
}
@Override
public String getText(Ability source) {
return "target creature you control gains protection from the color of your choice until end of turn";
StringBuilder sb = new StringBuilder();
sb.append("put ");
if (amount > 1) {
sb.append(Integer.toString(amount)).append(" ").append(name).append(" counters on ");
}
else {
sb.append("a ").append(name).append(" counter on ");
}
sb.append(source.getTargets().get(0).getTargetName());
return sb.toString();
}
@Override
public AddCountersTargetEffect copy() {
return new AddCountersTargetEffect(this);
}
}

View file

@ -61,7 +61,7 @@ public class DiscardTargetEffect extends OneShotEffect<DiscardTargetEffect> {
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getFirstTarget());
if (player != null) {
player.discard(amount, game);
player.discard(amount, source, game);
return true;
}
return false;

View file

@ -1,72 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.effects.common;
import mage.Constants.Duration;
import mage.Constants.Layer;
import mage.Constants.Outcome;
import mage.Constants.SubLayer;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class GainControlTargetEOTEffect extends ContinuousEffectImpl {
public GainControlTargetEOTEffect() {
super(Duration.EndOfTurn, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
}
public GainControlTargetEOTEffect(final GainControlTargetEOTEffect effect) {
super(effect);
}
@Override
public GainControlTargetEOTEffect copy() {
return new GainControlTargetEOTEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null) {
return permanent.changeControllerId(source.getControllerId(), game);
}
return false;
}
@Override
public String getText(Ability source) {
return "Gain control of target " + source.getTargets().get(0).getTargetName() + " until end of turn";
}
}

View file

@ -1,45 +0,0 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.abilities.mana;
import mage.Constants.Zone;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.ManaEffect;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public abstract class BasicLandManaAbility extends ManaAbility {
public BasicLandManaAbility(ManaEffect effect) {
super(Zone.BATTLEFIELD, effect, new TapSourceCost());
}
}

View file

@ -31,6 +31,8 @@ package mage.cards;
import java.lang.reflect.Constructor;
import java.util.List;
import java.util.UUID;
import java.util.logging.Level;
import java.util.logging.Logger;
import mage.Constants.CardType;
import mage.Constants.Rarity;
import mage.Constants.Zone;
@ -43,10 +45,13 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.PermanentCard;
import mage.util.Logging;
import mage.watchers.Watchers;
public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T> implements Card {
private final static Logger logger = Logging.getLogger(CardImpl.class.getName());
protected UUID ownerId;
protected Watchers watchers = new Watchers();
protected String expansionSetCode;
@ -92,7 +97,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
return card;
}
catch (Exception e) {
e.printStackTrace();
logger.log(Level.SEVERE, "Error loading card: " + name, e);
return null;
}
}
@ -189,7 +194,13 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
game.getPlayer(ownerId).getLibrary().putOnTop(this, game);
else
game.getPlayer(ownerId).getLibrary().putOnBottom(this, game);
break;
case BATTLEFIELD:
PermanentCard permanent = new PermanentCard(this, ownerId);
game.getBattlefield().addPermanent(permanent);
permanent.entersBattlefield(game);
game.applyEffects();
break;
}
zone = event.getToZone();
game.fireEvent(new ZoneChangeEvent(this.getId(), ownerId, fromZone, event.getToZone()));

View file

@ -43,6 +43,7 @@ import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;
import mage.util.Logging;
/**
*
@ -50,6 +51,8 @@ import java.util.logging.Logger;
*/
public abstract class ExpansionSet implements Serializable {
private final static Logger logger = Logging.getLogger(ExpansionSet.class.getName());
protected String name;
protected String code;
protected String symbolCode;
@ -83,7 +86,7 @@ public abstract class ExpansionSet implements Serializable {
Constructor<?> con = clazz.getConstructor(new Class[]{UUID.class});
return (Card) con.newInstance(new Object[] {null});
} catch (Exception ex) {
Logger.getLogger(ExpansionSet.class.getName()).log(Level.SEVERE, "Error creating card:" + clazz.getName(), ex);
logger.log(Level.SEVERE, "Error creating card:" + clazz.getName(), ex);
return null;
}
}

View file

@ -28,15 +28,18 @@
package mage.cards.decks;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
/**

View file

@ -28,6 +28,8 @@
package mage.filter.common;
import mage.game.permanent.Permanent;
/**
*
* @author BetaSteward_at_googlemail.com
@ -42,8 +44,6 @@ public class FilterCreatureForCombat extends FilterCreaturePermanent<FilterCreat
super(name);
this.attacking = false;
this.useAttacking = true;
this.blocking = false;
this.useBlocking = true;
this.tapped = false;
this.useTapped = true;
this.phasedIn = true;
@ -54,6 +54,14 @@ public class FilterCreatureForCombat extends FilterCreaturePermanent<FilterCreat
super(filter);
}
@Override
public boolean match(Permanent permanent) {
if (!super.match(permanent))
return notFilter;
return permanent.getMaxBlocks() == 0 || permanent.getBlocking() < permanent.getMaxBlocks();
}
@Override
public FilterCreatureForCombat copy() {
return new FilterCreatureForCombat(this);

View file

@ -50,7 +50,9 @@ public class FilterCreatureOrPlayer extends FilterImpl<Object, FilterCreatureOrP
}
public FilterCreatureOrPlayer(String name, UUID controllerId) {
this(name);
super(name);
creatureFilter = new FilterCreaturePermanent();
playerFilter = new FilterPlayer();
creatureFilter.getControllerId().add(controllerId);
playerFilter.getPlayerId().add(controllerId);
}

View file

@ -74,7 +74,7 @@ public class FilterCreaturePermanent<T extends FilterCreaturePermanent<T>> exten
if (useAttacking && permanent.isAttacking() != attacking)
return notFilter;
if (useBlocking && permanent.isBlocking() != blocking)
if (useBlocking && (permanent.getBlocking() > 0) != blocking)
return notFilter;
return !notFilter;

View file

@ -175,7 +175,7 @@ public class Combat implements Serializable, Copyable<Combat> {
Permanent creature = game.getPermanent(creatureId);
if (creature != null) {
creature.setAttacking(false);
creature.setBlocking(false);
creature.setBlocking(0);
for (CombatGroup group: groups) {
group.remove(creatureId);
}
@ -189,14 +189,14 @@ public class Combat implements Serializable, Copyable<Combat> {
creature = game.getPermanent(attacker);
if (creature != null) {
creature.setAttacking(false);
creature.setBlocking(false);
creature.setBlocking(0);
}
}
for (UUID blocker: group.blockers) {
creature = game.getPermanent(blocker);
if (creature != null) {
creature.setAttacking(false);
creature.setBlocking(false);
creature.setBlocking(0);
}
}
}

View file

@ -249,7 +249,9 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
return;
}
}
game.getPermanent(blockerId).setBlocking(true);
Permanent blocker = game.getPermanent(blockerId);
if (blockerId != null) {
blocker.setBlocking(blocker.getBlocking() + 1);
blockers.add(blockerId);
blockerOrder.add(blockerId);
this.blocked = true;
@ -257,6 +259,7 @@ public class CombatGroup implements Serializable, Copyable<CombatGroup> {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.BLOCKER_DECLARED, attackerId, blockerId, playerId));
}
}
}
public int totalAttackerDamage(Game game) {
int total = 0;

View file

@ -75,8 +75,8 @@ public interface Permanent extends Card {
public boolean destroy(UUID sourceId, Game game, boolean noRegen);
public boolean sacrifice(UUID sourceId, Game game);
public void entersBattlefield(Game game);
public boolean moveToZone(Zone zone, Game game, boolean flag);
public boolean moveToExile(UUID exileId, String name, Game game);
// public boolean moveToZone(Zone zone, Game game, boolean flag);
// public boolean moveToExile(UUID exileId, String name, Game game);
public String getValue();
public void setArt(String art);
@ -94,9 +94,11 @@ public interface Permanent extends Card {
public void addToughness(int toughness);
public boolean isAttacking();
public boolean isBlocking();
public int getBlocking();
public void setAttacking(boolean attacking);
public void setBlocking(boolean blocking);
public void setBlocking(int blocking);
public int getMaxBlocks();
public void setMaxBlocks(int maxBlocks);
public boolean canAttack(Game game);
public boolean canBlock(UUID attackerId, Game game);
public boolean removeFromCombat(Game game);

View file

@ -71,7 +71,8 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
protected boolean phasedIn = true;
protected boolean faceUp = true;
protected boolean attacking;
protected boolean blocking;
protected int blocking;
protected int maxBlocks = 1;
protected boolean loyaltyUsed;
protected boolean deathtouched;
protected Counters counters;
@ -102,6 +103,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
this.faceUp = permanent.faceUp;
this.attacking = permanent.attacking;
this.blocking = permanent.blocking;
this.maxBlocks = permanent.maxBlocks;
this.loyaltyUsed = permanent.loyaltyUsed;
this.deathtouched = permanent.deathtouched;
this.counters = permanent.counters.copy();
@ -114,6 +116,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
@Override
public void reset(Game game) {
this.controllerId = ownerId;
this.maxBlocks = 1;
}
@Override
@ -133,7 +136,6 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
abilities.add(copy);
}
@Override
public Counters getCounters() {
return counters;
@ -300,10 +302,15 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
}
@Override
public boolean isBlocking() {
public int getBlocking() {
return blocking;
}
@Override
public int getMaxBlocks() {
return maxBlocks;
}
@Override
public UUID getControllerId() {
return this.controllerId;
@ -558,10 +565,15 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
}
@Override
public void setBlocking(boolean blocking) {
public void setBlocking(int blocking) {
this.blocking = blocking;
}
@Override
public void setMaxBlocks(int maxBlocks) {
this.maxBlocks = maxBlocks;
}
@Override
public boolean removeFromCombat(Game game) {
game.getCombat().removeFromCombat(objectId, game);

View file

@ -48,6 +48,7 @@ import mage.ObjectColor;
import mage.abilities.Abilities;
import mage.abilities.AbilitiesImpl;
import mage.abilities.Ability;
import mage.abilities.StateTriggeredAbility;
import mage.abilities.costs.CostsImpl;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
@ -97,7 +98,10 @@ public class StackAbility implements StackObject, Ability {
@Override
public void counter(Game game) {
//20100716 - 603.8
if (ability instanceof StateTriggeredAbility) {
((StateTriggeredAbility)ability).counter();
}
}
@Override

View file

@ -28,12 +28,10 @@
package mage.players;
import java.util.Collection;
import java.util.List;
import java.util.Set;
import java.util.UUID;
import mage.Constants.Outcome;
import mage.Constants.Zone;
import mage.MageItem;
import mage.MageObject;
import mage.abilities.Abilities;
@ -54,7 +52,6 @@ import mage.filter.FilterAbility;
import mage.game.events.GameEvent;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.Token;
import mage.target.Target;
import mage.target.TargetAmount;
import mage.target.TargetCard;
@ -106,9 +103,9 @@ public interface Player extends MageItem, Copyable<Player> {
public boolean triggerAbility(TriggeredAbility ability, Game game);
public boolean canBeTargetedBy(MageObject source);
public void checkTriggers(GameEvent event, Game game);
public void discard(int amount, Game game);
public void discard(int amount, Ability source, Game game);
public void discardToMax(Game game);
public boolean discard(Card card, Game game);
public boolean discard(Card card, Ability source, Game game);
public void lost(Game game);
public void won(Game game);
public void leaveGame(Game game);

View file

@ -1,50 +0,0 @@
/*
* 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.players;
import java.io.Serializable;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class PlayerDecision implements Serializable {
private String message;
private DecisionType type;
public enum DecisionType {
USE_EFFECT,
PICK_COLOR,
PICK_ONE
}
}

View file

@ -69,10 +69,6 @@ import mage.game.Game;
import mage.game.combat.CombatGroup;
import mage.game.permanent.Permanent;
import mage.game.events.GameEvent;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.PermanentCard;
import mage.game.permanent.PermanentToken;
import mage.game.permanent.token.Token;
import mage.game.stack.Spell;
import mage.game.stack.StackAbility;
import mage.game.stack.StackObject;
@ -285,7 +281,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
while (hand.size() > this.maxHandSize) {
TargetDiscard target = new TargetDiscard(playerId);
chooseTarget(Outcome.Discard, target, null, game);
discard(hand.get(target.getFirstTarget(), game), game);
discard(hand.get(target.getFirstTarget(), game), null, game);
}
}
@ -306,11 +302,11 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
}
@Override
public void discard(int amount, Game game) {
public void discard(int amount, Ability source, Game game) {
if (amount >= hand.size()) {
int discardAmount = hand.size();
while (hand.size() > 0) {
discard(hand.get(hand.iterator().next(), game), game);
discard(hand.get(hand.iterator().next(), game), source, game);
}
game.fireInformEvent(name + " discards " + Integer.toString(discardAmount) + " card" + (discardAmount > 1?"s":""));
return;
@ -318,18 +314,18 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
for (int i = 0; i < amount; i++) {
TargetDiscard target = new TargetDiscard(playerId);
choose(Outcome.Discard, target, game);
discard(hand.get(target.getFirstTarget(), game), game);
discard(hand.get(target.getFirstTarget(), game), source, game);
}
game.fireInformEvent(name + " discards " + Integer.toString(amount) + " card" + (amount > 1?"s":""));
}
@Override
public boolean discard(Card card, Game game) {
public boolean discard(Card card, Ability source, Game game) {
//20091005 - 701.1
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DISCARD_CARD, playerId, playerId))) {
if (!game.replaceEvent(GameEvent.getEvent(GameEvent.EventType.DISCARD_CARD, card.getId(), source==null?null:source.getId(), playerId))) {
removeFromHand(card, game);
if (card.moveToZone(Zone.GRAVEYARD, game, false)) {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARD, playerId, playerId));
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.DISCARDED_CARD, card.getId(), source==null?null:source.getId(), playerId));
return true;
}
}
@ -603,18 +599,10 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
public int loseLife(int amount, Game game) {
GameEvent event = new GameEvent(GameEvent.EventType.LOSE_LIFE, playerId, playerId, playerId, amount);
if (!game.replaceEvent(event)) {
if (amount > life) {
int curLife = life;
setLife(0, game);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST_LIFE, playerId, playerId, playerId, curLife));
return curLife;
}
else {
setLife(this.life - amount, game);
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.LOST_LIFE, playerId, playerId, playerId, amount));
return amount;
}
}
return 0;
}

View file

@ -1,76 +0,0 @@
/*
* 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.players;
import java.io.Serializable;
import java.util.UUID;
/**
*
* @author BetaSteward_at_googlemail.com
*/
public class PlayerResponse implements Serializable {
private String responseString;
private UUID responseUUID;
private Boolean responseBoolean;
public void clear() {
responseString = null;
responseUUID = null;
responseBoolean = null;
}
public String getString() {
return responseString;
}
public void setString(String responseString) {
this.responseString = responseString;
}
public UUID getUUID() {
return responseUUID;
}
public void setUUID(UUID responseUUID) {
this.responseUUID = responseUUID;
}
public Boolean getBoolean() {
return responseBoolean;
}
public void setBoolean(Boolean responseBoolean) {
this.responseBoolean = responseBoolean;
}
}

View file

@ -127,7 +127,7 @@ public abstract class TargetImpl<T extends TargetImpl<T>> implements Target {
@Override
public boolean isChosen() {
if (targets.size() == maxNumberOfTargets)
if (maxNumberOfTargets != 0 && targets.size() == maxNumberOfTargets)
return true;
return chosen;
}
@ -157,7 +157,7 @@ public abstract class TargetImpl<T extends TargetImpl<T>> implements Target {
@Override
public void addTarget(UUID id, Ability source, Game game) {
//20100423 - 113.3
if (targets.size() < maxNumberOfTargets) {
if (maxNumberOfTargets == 0 || targets.size() < maxNumberOfTargets) {
if (!targets.containsKey(id)) {
if (source != null) {
if (!game.replaceEvent(GameEvent.getEvent(EventType.TARGET, id, source.getSourceId(), source.getControllerId()))) {

View file

@ -28,8 +28,6 @@
package mage.target.common;
import mage.Constants.TargetController;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledPermanent;
import mage.target.TargetPermanent;