mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Merge pull request #85 from magefree/master
Merge https://github.com/magefree/mage
This commit is contained in:
commit
d91374c8bc
2588 changed files with 30828 additions and 12144 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -78,6 +78,7 @@ Mage.Tests/Mage.log
|
|||
Mage.Tests/watchdog.log
|
||||
|
||||
# Mage
|
||||
*.log
|
||||
Mage/target
|
||||
|
||||
# Mage.Updater
|
||||
|
|
@ -91,7 +92,7 @@ Mage.Verify/AllCards.json.zip
|
|||
Mage.Verify/AllSets.json.zip
|
||||
Mage.Verify/AllCards.json
|
||||
Mage.Verify/AllSets.json
|
||||
/db
|
||||
Mage.Verify/db
|
||||
|
||||
releases
|
||||
Utils/author.txt
|
||||
|
|
|
|||
|
|
@ -3,3 +3,10 @@ dist: trusty
|
|||
language: java
|
||||
before_install:
|
||||
- echo "MAVEN_OPTS='-Xmx2g'" > ~/.mavenrc
|
||||
# addons:
|
||||
# sonarcloud:
|
||||
# organization: "magefree"
|
||||
# token:
|
||||
# secure: SONAR_TOKEN
|
||||
# script:
|
||||
# - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package mage.client;
|
|||
import mage.cards.action.ActionCallback;
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.cards.repository.RepositoryUtil;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.chat.ChatPanelBasic;
|
||||
import mage.client.components.*;
|
||||
|
|
@ -212,6 +213,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
LOGGER.fatal(null, ex);
|
||||
}
|
||||
|
||||
RepositoryUtil.bootstrapLocalDb();
|
||||
ManaSymbols.loadImages();
|
||||
Plugins.instance.loadPlugins();
|
||||
|
||||
|
|
@ -281,7 +283,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
if (Plugins.instance.isCounterPluginLoaded()) {
|
||||
int i = Plugins.instance.getGamesPlayed();
|
||||
JLabel label = new JLabel(" Games played: " + String.valueOf(i));
|
||||
JLabel label = new JLabel(" Games played: " + i);
|
||||
desktopPane.add(label, JLayeredPane.DEFAULT_LAYER + 1);
|
||||
label.setVisible(true);
|
||||
label.setForeground(Color.white);
|
||||
|
|
@ -1160,7 +1162,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
/**
|
||||
* @param args the command line arguments
|
||||
*/
|
||||
public static void main(final String args[]) {
|
||||
public static void main(final String[] args) {
|
||||
// Workaround for #451
|
||||
System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
|
||||
LOGGER.info("Starting MAGE client version " + VERSION);
|
||||
|
|
|
|||
|
|
@ -85,11 +85,6 @@ public class StackDialog extends IDialogPanel {
|
|||
jTitle.setFont(new Font("Dialog", Font.BOLD, 14));
|
||||
jTitle.setText("Current stack: ");
|
||||
|
||||
/*jTitle2 = new CustomLabel();
|
||||
jTitle2.setBounds(new Rectangle(5, 5 + SettingsManager.getInstance().getCardSize().height + 30, 129, 20));
|
||||
jTitle2.setFont(new Font("Dialog", Font.BOLD, 14));
|
||||
jTitle2.setText("Spell targets:");*/
|
||||
|
||||
this.setLayout(null);
|
||||
jLayeredPane.setLayout(null);
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ public final class Constants {
|
|||
|
||||
public interface IO {
|
||||
String DEFAULT_IMAGES_DIR = "plugins" + File.separator + "images" + File.separator;
|
||||
String IMAGE_PROPERTIES_FILE = "image.url.properties";
|
||||
}
|
||||
|
||||
public enum DeckEditorMode {
|
||||
|
|
|
|||
|
|
@ -253,7 +253,7 @@ public class CardSelector extends javax.swing.JPanel implements ComponentListene
|
|||
predicates.add(new ColorPredicate(ObjectColor.WHITE));
|
||||
}
|
||||
if (this.tbColorless.isSelected()) {
|
||||
predicates.add(new ColorlessPredicate());
|
||||
predicates.add(ColorlessPredicate.instance);
|
||||
}
|
||||
filter.add(Predicates.or(predicates));
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import mage.cards.Sets;
|
|||
import mage.cards.decks.Deck;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
import mage.cards.decks.importer.DeckImporter;
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.client.MageFrame;
|
||||
|
|
@ -798,7 +797,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
|
||||
MageFrame.getDesktop().setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||
try {
|
||||
newDeck = Deck.load(DeckImporterUtil.importDeck(dialog.getTmpPath(), errorMessages), true, true);
|
||||
newDeck = Deck.load(DeckImporter.importDeckFromFile(dialog.getTmpPath(), errorMessages), true, true);
|
||||
processAndShowImportErrors(errorMessages);
|
||||
|
||||
if (newDeck != null) {
|
||||
|
|
@ -831,7 +830,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
|
||||
MageFrame.getDesktop().setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||
try {
|
||||
deckToAppend = Deck.load(DeckImporterUtil.importDeck(dialog.getTmpPath(), errorMessages), true, true);
|
||||
deckToAppend = Deck.load(DeckImporter.importDeckFromFile(dialog.getTmpPath(), errorMessages), true, true);
|
||||
processAndShowImportErrors(errorMessages);
|
||||
|
||||
if (deckToAppend != null) {
|
||||
|
|
@ -878,7 +877,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
Deck newDeck = null;
|
||||
StringBuilder errorMessages = new StringBuilder();
|
||||
|
||||
newDeck = Deck.load(DeckImporterUtil.importDeck(file.getPath(), errorMessages), true, true);
|
||||
newDeck = Deck.load(DeckImporter.importDeckFromFile(file.getPath(), errorMessages), true, true);
|
||||
processAndShowImportErrors(errorMessages);
|
||||
|
||||
if (newDeck != null) {
|
||||
|
|
@ -977,7 +976,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
File file = fcImportDeck.getSelectedFile();
|
||||
MageFrame.getDesktop().setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||
try {
|
||||
DeckImporter importer = DeckImporterUtil.getDeckImporter(file.getPath());
|
||||
DeckImporter importer = DeckImporter.getDeckImporter(file.getPath());
|
||||
|
||||
if (importer != null) {
|
||||
StringBuilder errorMessages = new StringBuilder();
|
||||
|
|
@ -1048,7 +1047,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
try {
|
||||
MageFrame.getDesktop().setCursor(new Cursor(Cursor.WAIT_CURSOR));
|
||||
String path = DeckGenerator.generateDeck();
|
||||
deck = Deck.load(DeckImporterUtil.importDeck(path), true, true);
|
||||
deck = Deck.load(DeckImporter.importDeckFromFile(path), true, true);
|
||||
} catch (GameException ex) {
|
||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), ex.getMessage(), "Error loading generated deck", JOptionPane.ERROR_MESSAGE);
|
||||
} catch (DeckGeneratorException ex) {
|
||||
|
|
@ -1120,7 +1119,12 @@ class ImportFilter extends FileFilter {
|
|||
ext = s.substring(i + 1).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
if (ext != null) {
|
||||
if (ext.toLowerCase(Locale.ENGLISH).equals("dec") || ext.toLowerCase(Locale.ENGLISH).equals("mwdeck") || ext.toLowerCase(Locale.ENGLISH).equals("txt") || ext.toLowerCase(Locale.ENGLISH).equals("dek")) {
|
||||
if (ext.toLowerCase(Locale.ENGLISH).equals("dec")
|
||||
|| ext.toLowerCase(Locale.ENGLISH).equals("mwdeck")
|
||||
|| ext.toLowerCase(Locale.ENGLISH).equals("txt")
|
||||
|| ext.toLowerCase(Locale.ENGLISH).equals("dek")
|
||||
|| ext.toLowerCase(Locale.ENGLISH).equals("cod")
|
||||
|| ext.toLowerCase(Locale.ENGLISH).equals("o8d")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1129,7 +1133,7 @@ class ImportFilter extends FileFilter {
|
|||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "*.dec | *.mwDeck | *.txt | *.dek";
|
||||
return "*.dec | *.mwDeck | *.txt | *.dek | *.cod | *.o8d";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,5 @@
|
|||
|
||||
package mage.client.deckeditor.collection.viewer;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import static java.lang.Math.min;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import mage.cards.*;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
|
|
@ -24,12 +9,13 @@ import mage.client.MageFrame;
|
|||
import mage.client.cards.BigCard;
|
||||
import mage.client.components.HoverButton;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.*;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.NaturalOrderCardNumberComparator;
|
||||
import mage.client.util.audio.AudioManager;
|
||||
import mage.client.util.sets.ConstructedFormats;
|
||||
import mage.components.ImagePanel;
|
||||
import mage.components.ImagePanelStyle;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.command.Emblem;
|
||||
import mage.game.command.Plane;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
|
|
@ -41,6 +27,19 @@ import mage.view.PlaneView;
|
|||
import org.apache.log4j.Logger;
|
||||
import org.mage.card.arcane.ManaSymbols;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import static java.lang.Math.min;
|
||||
import static org.mage.plugins.card.images.DownloadPicturesService.getTokenCardUrls;
|
||||
|
||||
/**
|
||||
|
|
@ -307,25 +306,33 @@ public class MageBook extends JComponent {
|
|||
// Already have numTokens tokens presented. Appending the emblems to the end of these.
|
||||
numTokens = numTokens % conf.CARDS_PER_PAGE;
|
||||
if (numTokens < conf.CARDS_PER_PAGE / 2) {
|
||||
// page 1 with tokens
|
||||
for (int z = 0; z < numTokens && z < conf.CARDS_PER_PAGE / 2; z++) {
|
||||
rectangle = CardPosition.translatePosition(z, rectangle, conf);
|
||||
}
|
||||
} else {
|
||||
// page 2 with tokens
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
for (int z = 0; z < numTokens - conf.CARDS_PER_PAGE / 2; z++) {
|
||||
rectangle = CardPosition.translatePosition(z, rectangle, conf);
|
||||
}
|
||||
}
|
||||
|
||||
// page 1 with emblems after tokens
|
||||
int lastI = 0;
|
||||
boolean needContinueFromPage1 = false;
|
||||
for (int i = 0; i < size && i + numTokens < conf.CARDS_PER_PAGE / 2; i++) {
|
||||
Emblem emblem = emblems.get(i);
|
||||
addEmblem(emblem, bigCard, null, rectangle);
|
||||
rectangle = CardPosition.translatePosition(i + numTokens, rectangle, conf);
|
||||
lastI++;
|
||||
needContinueFromPage1 = true;
|
||||
}
|
||||
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
// page 2 with emblems after tokens
|
||||
if (needContinueFromPage1) {
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
}
|
||||
if (size + numTokens > conf.CARDS_PER_PAGE / 2) {
|
||||
for (int i = lastI; i < size && i + numTokens < conf.CARDS_PER_PAGE; i++) {
|
||||
Emblem emblem = emblems.get(i);
|
||||
|
|
@ -354,25 +361,33 @@ public class MageBook extends JComponent {
|
|||
|
||||
numTokensEmblems = numTokensEmblems % conf.CARDS_PER_PAGE;
|
||||
if (numTokensEmblems < conf.CARDS_PER_PAGE / 2) {
|
||||
// page 1 with tokens/emblems
|
||||
for (int z = 0; z < numTokensEmblems && z < conf.CARDS_PER_PAGE / 2; z++) {
|
||||
rectangle = CardPosition.translatePosition(z, rectangle, conf);
|
||||
}
|
||||
} else {
|
||||
// page 2 with tokens/emblems
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
for (int z = 0; z < numTokensEmblems - conf.CARDS_PER_PAGE / 2; z++) {
|
||||
rectangle = CardPosition.translatePosition(z, rectangle, conf);
|
||||
}
|
||||
}
|
||||
|
||||
// page 1 with planes after tokens/emblems
|
||||
int lastI = 0;
|
||||
boolean needContinueFromPage1 = false;
|
||||
for (int i = 0; i < size && i + numTokensEmblems < conf.CARDS_PER_PAGE / 2; i++) {
|
||||
Plane plane = planes.get(i);
|
||||
addPlane(plane, bigCard, null, rectangle);
|
||||
rectangle = CardPosition.translatePosition(i + numTokensEmblems, rectangle, conf);
|
||||
lastI++;
|
||||
needContinueFromPage1 = true;
|
||||
}
|
||||
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
// page 2 with planes after tokens/emblems
|
||||
if (needContinueFromPage1) {
|
||||
rectangle.setLocation(second_page_x, OFFSET_Y);
|
||||
}
|
||||
if (size + numTokensEmblems > conf.CARDS_PER_PAGE / 2) {
|
||||
for (int i = lastI; i < size && i + numTokensEmblems < conf.CARDS_PER_PAGE; i++) {
|
||||
Plane plane = planes.get(i);
|
||||
|
|
@ -602,13 +617,13 @@ public class MageBook extends JComponent {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int totalTokens = getTotalNumTokens(set);
|
||||
int start = 0;
|
||||
if (!(page * conf.CARDS_PER_PAGE <= totalTokens && (page + 1) * conf.CARDS_PER_PAGE >= totalTokens)) {
|
||||
start = page * conf.CARDS_PER_PAGE - totalTokens;
|
||||
}
|
||||
|
||||
|
||||
int end = emblems.size();
|
||||
if ((page + 1) * conf.CARDS_PER_PAGE < totalTokens + emblems.size()) {
|
||||
end = (page + 1) * conf.CARDS_PER_PAGE - totalTokens;
|
||||
|
|
@ -659,7 +674,7 @@ public class MageBook extends JComponent {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int totalTokens = getTotalNumTokens(set);
|
||||
int totalTokensEmblems = totalTokens + getTotalNumEmblems(set);
|
||||
int start = 0;
|
||||
|
|
@ -667,7 +682,7 @@ public class MageBook extends JComponent {
|
|||
start = page * conf.CARDS_PER_PAGE - totalTokensEmblems;
|
||||
pageRight.setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
int end = planes.size();
|
||||
if ((page + 1) * conf.CARDS_PER_PAGE < totalTokensEmblems + planes.size()) {
|
||||
end = (page + 1) * conf.CARDS_PER_PAGE - totalTokensEmblems;
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ import javax.swing.JOptionPane;
|
|||
import javax.swing.SwingWorker;
|
||||
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.cards.repository.ExpansionRepository;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.client.MageFrame;
|
||||
|
|
@ -456,7 +457,9 @@ public class ConnectDialog extends MageDialog {
|
|||
connection.setPort(Integer.valueOf(this.txtPort.getText().trim()));
|
||||
connection.setUsername(this.txtUserName.getText().trim());
|
||||
connection.setPassword(this.txtPassword.getText().trim());
|
||||
boolean redownloadDatabase = CardRepository.instance.findCard("Island") == null;
|
||||
|
||||
// force to redownload db
|
||||
boolean redownloadDatabase = (ExpansionRepository.instance.getSetByCode("GRN") == null || CardRepository.instance.findCard("Island") == null);
|
||||
connection.setForceDBComparison(this.chkForceUpdateDB.isSelected() || redownloadDatabase);
|
||||
String allMAC = "";
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
package mage.client.dialog;
|
||||
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.cards.decks.importer.DeckImporter;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.SessionHandler;
|
||||
import mage.players.PlayerType;
|
||||
|
|
@ -119,9 +119,9 @@ public class JoinTableDialog extends MageDialog {
|
|||
try {
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_PASSWORD_JOIN, txtPassword.getText());
|
||||
if (isTournament) {
|
||||
joined = session.joinTournamentTable(roomId, tableId, this.newPlayerPanel.getPlayerName(), PlayerType.HUMAN, 1, DeckImporterUtil.importDeck(this.newPlayerPanel.getDeckFile()), this.txtPassword.getText());
|
||||
joined = session.joinTournamentTable(roomId, tableId, this.newPlayerPanel.getPlayerName(), PlayerType.HUMAN, 1, DeckImporter.importDeckFromFile(this.newPlayerPanel.getDeckFile()), this.txtPassword.getText());
|
||||
} else {
|
||||
joined = session.joinTable(roomId, tableId, this.newPlayerPanel.getPlayerName(), PlayerType.HUMAN, 1, DeckImporterUtil.importDeck(this.newPlayerPanel.getDeckFile()), this.txtPassword.getText());
|
||||
joined = session.joinTable(roomId, tableId, this.newPlayerPanel.getPlayerName(), PlayerType.HUMAN, 1, DeckImporter.importDeckFromFile(this.newPlayerPanel.getDeckFile()), this.txtPassword.getText());
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.swing.*;
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
|
||||
import mage.cards.decks.importer.DeckImporter;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.SessionHandler;
|
||||
import mage.client.components.MageComponents;
|
||||
|
|
@ -425,7 +426,7 @@ public class NewTableDialog extends MageDialog {
|
|||
table.getTableId(),
|
||||
this.player1Panel.getPlayerName(),
|
||||
PlayerType.HUMAN, 1,
|
||||
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
|
||||
DeckImporter.importDeckFromFile(this.player1Panel.getDeckFile()),
|
||||
this.txtPassword.getText())) {
|
||||
for (TablePlayerPanel player : players) {
|
||||
if (player.getPlayerType() != PlayerType.HUMAN) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ import java.util.UUID;
|
|||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
import mage.cards.decks.Deck;
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.cards.decks.importer.DeckImporter;
|
||||
import mage.cards.repository.ExpansionInfo;
|
||||
import mage.cards.repository.ExpansionRepository;
|
||||
import mage.client.MageFrame;
|
||||
|
|
@ -557,7 +557,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
if (!(cubeFromDeckFilename.isEmpty())) {
|
||||
Deck cubeFromDeck = new Deck();
|
||||
try {
|
||||
cubeFromDeck = Deck.load(DeckImporterUtil.importDeck(cubeFromDeckFilename), true, true);
|
||||
cubeFromDeck = Deck.load(DeckImporter.importDeckFromFile(cubeFromDeckFilename), true, true);
|
||||
} catch (GameException e1) {
|
||||
JOptionPane.showMessageDialog(MageFrame.getDesktop(), e1.getMessage(), "Error loading deck", JOptionPane.ERROR_MESSAGE);
|
||||
}
|
||||
|
|
@ -631,11 +631,11 @@ public class NewTournamentDialog extends MageDialog {
|
|||
table.getTableId(),
|
||||
this.player1Panel.getPlayerName(),
|
||||
PlayerType.HUMAN, 1,
|
||||
DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()),
|
||||
DeckImporter.importDeckFromFile(this.player1Panel.getDeckFile()),
|
||||
tOptions.getPassword())) {
|
||||
for (TournamentPlayerPanel player : players) {
|
||||
if (player.getPlayerType().getSelectedItem() != PlayerType.HUMAN) {
|
||||
if (!player.joinTournamentTable(roomId, table.getTableId(), DeckImporterUtil.importDeck(this.player1Panel.getDeckFile()))) {
|
||||
if (!player.joinTournamentTable(roomId, table.getTableId(), DeckImporter.importDeckFromFile(this.player1Panel.getDeckFile()))) {
|
||||
// error message must be send by sever
|
||||
SessionHandler.removeTable(roomId, table.getTableId());
|
||||
table = null;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,8 @@ import javax.swing.JPopupMenu;
|
|||
import javax.swing.LayoutStyle.ComponentPlacement;
|
||||
import javax.swing.MenuSelectionManager;
|
||||
import javax.swing.event.ChangeListener;
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
|
||||
import mage.cards.decks.importer.DeckImporter;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.SessionHandler;
|
||||
import mage.client.cards.BigCard;
|
||||
|
|
@ -569,7 +570,7 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
private void btnCheatActionPerformed(java.awt.event.ActionEvent evt) {
|
||||
SessionHandler.cheat(gameId, playerId, DeckImporterUtil.importDeck("cheat.dck"));
|
||||
SessionHandler.cheat(gameId, playerId, DeckImporter.importDeckFromFile("cheat.dck"));
|
||||
}
|
||||
|
||||
public boolean isSmallMode() {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
package mage.client.table;
|
||||
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.cards.decks.importer.DeckImporter;
|
||||
import mage.client.SessionHandler;
|
||||
import mage.client.util.Config;
|
||||
import mage.client.util.Event;
|
||||
|
|
@ -53,7 +53,7 @@ public class TablePlayerPanel extends javax.swing.JPanel {
|
|||
|
||||
public boolean joinTable(UUID roomId, UUID tableId) throws IOException, ClassNotFoundException {
|
||||
if (this.cbPlayerType.getSelectedItem() != PlayerType.HUMAN) {
|
||||
return SessionHandler.joinTable(roomId, tableId, this.newPlayerPanel.getPlayerName(), (PlayerType) this.cbPlayerType.getSelectedItem(), this.newPlayerPanel.getLevel(), DeckImporterUtil.importDeck(this.newPlayerPanel.getDeckFile()), "");
|
||||
return SessionHandler.joinTable(roomId, tableId, this.newPlayerPanel.getPlayerName(), (PlayerType) this.cbPlayerType.getSelectedItem(), this.newPlayerPanel.getLevel(), DeckImporter.importDeckFromFile(this.newPlayerPanel.getDeckFile()), "");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package mage.client.table;
|
||||
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.cards.decks.importer.DeckImporter;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.SessionHandler;
|
||||
import mage.client.chat.ChatPanelBasic;
|
||||
|
|
@ -1263,8 +1263,8 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
options.setBannedUsers(IgnoreList.ignoreList(serverAddress));
|
||||
table = SessionHandler.createTable(roomId, options);
|
||||
|
||||
SessionHandler.joinTable(roomId, table.getTableId(), "Human", PlayerType.HUMAN, 1, DeckImporterUtil.importDeck("test.dck"), "");
|
||||
SessionHandler.joinTable(roomId, table.getTableId(), "Computer", PlayerType.COMPUTER_MAD, 5, DeckImporterUtil.importDeck("test.dck"), "");
|
||||
SessionHandler.joinTable(roomId, table.getTableId(), "Human", PlayerType.HUMAN, 1, DeckImporter.importDeckFromFile("test.dck"), "");
|
||||
SessionHandler.joinTable(roomId, table.getTableId(), "Computer", PlayerType.COMPUTER_MAD, 5, DeckImporter.importDeckFromFile("test.dck"), "");
|
||||
SessionHandler.startMatch(roomId, table.getTableId());
|
||||
} catch (HeadlessException ex) {
|
||||
handleError(ex);
|
||||
|
|
|
|||
|
|
@ -1,17 +1,15 @@
|
|||
package mage.client.util.gui;
|
||||
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.client.dialog.CheckBoxList;
|
||||
import mage.client.dialog.PickCheckBoxDialog;
|
||||
import mage.client.dialog.PickChoiceDialog;
|
||||
|
||||
import mage.client.dialog.CheckBoxList;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class FastSearchUtil {
|
||||
|
|
@ -19,27 +17,28 @@ public class FastSearchUtil {
|
|||
public static String DEFAULT_EXPANSION_SEARCH_MESSAGE = "Select set or expansion";
|
||||
public static String DEFAULT_EXPANSION_TOOLTIP_MESSAGE = "Fast search set or expansion";
|
||||
|
||||
public static void showFastSearchForStringComboBox(JComboBox combo, String chooseMessage){
|
||||
public static void showFastSearchForStringComboBox(JComboBox combo, String chooseMessage) {
|
||||
showFastSearchForStringComboBox(combo, chooseMessage, 300, 500);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show fast choice modal dialog with incremental searching for any string combobox components
|
||||
* @param combo combobox control with default data model
|
||||
*
|
||||
* @param combo combobox control with default data model
|
||||
* @param chooseMessage caption message for dialog
|
||||
*/
|
||||
public static void showFastSearchForStringComboBox(JComboBox combo, String chooseMessage, int windowWidth, int windowHeight){
|
||||
public static void showFastSearchForStringComboBox(JComboBox combo, String chooseMessage, int windowWidth, int windowHeight) {
|
||||
// fast search/choice dialog for string combobox
|
||||
|
||||
mage.choices.Choice choice = new ChoiceImpl(false);
|
||||
|
||||
// collect data from expansion combobox (String)
|
||||
DefaultComboBoxModel comboModel = (DefaultComboBoxModel)combo.getModel();
|
||||
DefaultComboBoxModel comboModel = (DefaultComboBoxModel) combo.getModel();
|
||||
Map<String, String> choiceItems = new HashMap<>(comboModel.getSize());
|
||||
Map<String, Integer> choiceSorting = new HashMap<>(comboModel.getSize());
|
||||
String item;
|
||||
|
||||
for(int i = 0; i < comboModel.getSize(); i++){
|
||||
for (int i = 0; i < comboModel.getSize(); i++) {
|
||||
item = comboModel.getElementAt(i).toString();
|
||||
choiceItems.put(item, item);
|
||||
choiceSorting.put(item, i); // need so sorting
|
||||
|
|
@ -57,35 +56,36 @@ public class FastSearchUtil {
|
|||
PickChoiceDialog dlg = new PickChoiceDialog();
|
||||
dlg.setWindowSize(windowWidth, windowHeight);
|
||||
dlg.showDialog(choice, needSelectValue);
|
||||
if(choice.isChosen()){
|
||||
if (choice.isChosen()) {
|
||||
item = choice.getChoiceKey();
|
||||
|
||||
// compatible select for object's models (use setSelectedIndex instead setSelectedObject)
|
||||
for(int i = 0; i < comboModel.getSize(); i++){
|
||||
if(comboModel.getElementAt(i).toString().equals(item)){
|
||||
for (int i = 0; i < comboModel.getSize(); i++) {
|
||||
if (comboModel.getElementAt(i).toString().equals(item)) {
|
||||
combo.setSelectedIndex(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show fast choice modal dialog with incremental searching for any string CheckBoxList components
|
||||
* @param combo CheckBoxList control with default data model
|
||||
*
|
||||
* @param combo CheckBoxList control with default data model
|
||||
* @param chooseMessage caption message for dialog
|
||||
*/
|
||||
public static void showFastSearchForStringComboBox(CheckBoxList combo, String chooseMessage){
|
||||
public static void showFastSearchForStringComboBox(CheckBoxList combo, String chooseMessage) {
|
||||
// fast search/choice dialog for string combobox
|
||||
|
||||
mage.choices.Choice choice = new ChoiceImpl(false);
|
||||
|
||||
// collect data from expansion combobox (String)
|
||||
DefaultListModel comboModel = (DefaultListModel)combo.getModel();
|
||||
DefaultListModel comboModel = (DefaultListModel) combo.getModel();
|
||||
Map<String, String> choiceItems = new HashMap<>(comboModel.getSize());
|
||||
Map<String, Integer> choiceSorting = new HashMap<>(comboModel.getSize());
|
||||
String item;
|
||||
|
||||
for(int i = 0; i < comboModel.size(); i++){
|
||||
for (int i = 0; i < comboModel.size(); i++) {
|
||||
item = comboModel.getElementAt(i).toString();
|
||||
choiceItems.put(item, item);
|
||||
choiceSorting.put(item, i); // need so sorting
|
||||
|
|
@ -96,21 +96,22 @@ public class FastSearchUtil {
|
|||
choice.setMessage(chooseMessage);
|
||||
|
||||
// current selection value restore
|
||||
String needSelectValue;
|
||||
needSelectValue = comboModel.firstElement().toString();
|
||||
String needSelectValue = null;
|
||||
if (comboModel.size() > 0) {
|
||||
needSelectValue = comboModel.firstElement().toString();
|
||||
}
|
||||
|
||||
// ask for new value
|
||||
|
||||
PickCheckBoxDialog dlg = new PickCheckBoxDialog(combo);
|
||||
PickCheckBoxDialog dlg = new PickCheckBoxDialog(combo);
|
||||
|
||||
dlg.setWindowSize(300, 500);
|
||||
dlg.showDialog(choice, needSelectValue);
|
||||
if(choice.isChosen()){
|
||||
if (choice.isChosen()) {
|
||||
item = choice.getChoiceKey();
|
||||
|
||||
// compatible select for object's models (use setSelectedIndex instead setSelectedObject)
|
||||
for(int i = 0; i < comboModel.getSize(); i++){
|
||||
if(comboModel.getElementAt(i).toString().equals(item)){
|
||||
for (int i = 0; i < comboModel.getSize(); i++) {
|
||||
if (comboModel.getElementAt(i).toString().equals(item)) {
|
||||
combo.setSelectedIndex(i);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,13 @@
|
|||
package mage.client.util.sets;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import mage.cards.repository.ExpansionInfo;
|
||||
import mage.cards.repository.ExpansionRepository;
|
||||
import mage.cards.repository.RepositoryEvent;
|
||||
import mage.constants.SetType;
|
||||
import static mage.constants.SetType.EXPANSION;
|
||||
import static mage.constants.SetType.SUPPLEMENTAL;
|
||||
import mage.deck.Standard;
|
||||
import mage.game.events.Listener;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Utility class for constructed formats (expansions and other editions).
|
||||
|
|
@ -26,11 +22,36 @@ public final class ConstructedFormats {
|
|||
public static final String FRONTIER = "- Frontier";
|
||||
public static final String MODERN = "- Modern";
|
||||
public static final String VINTAGE_LEGACY = "- Vintage / Legacy";
|
||||
public static final String JOKE = "- Joke Sets";
|
||||
public static final String CUSTOM = "- Custom";
|
||||
public static final Standard STANDARD_CARDS = new Standard();
|
||||
|
||||
// Attention -Month is 0 Based so Feb = 1 for example. //
|
||||
private static final Date extendedDate = new GregorianCalendar(2009, 7, 20).getTime();
|
||||
private static final Date frontierDate = new GregorianCalendar(2014, 6, 17).getTime();
|
||||
private static final Date modernDate = new GregorianCalendar(2003, 6, 20).getTime();
|
||||
|
||||
// for all sets just return empty list
|
||||
private static final List<String> all = new ArrayList<>();
|
||||
|
||||
private static final Map<String, List<String>> underlyingSetCodesPerFormat = new HashMap<>();
|
||||
private static final List<String> formats = new ArrayList<>();
|
||||
private static final Listener<RepositoryEvent> setsDbListener;
|
||||
|
||||
static {
|
||||
buildLists();
|
||||
|
||||
// auto-update sets list on changes
|
||||
setsDbListener = new Listener<RepositoryEvent>() {
|
||||
@Override
|
||||
public void event(RepositoryEvent event) {
|
||||
if (event.getEventType().equals(RepositoryEvent.RepositoryEventType.DB_UPDATED)) {
|
||||
buildLists();
|
||||
}
|
||||
}
|
||||
};
|
||||
ExpansionRepository.instance.subscribe(setsDbListener);
|
||||
}
|
||||
|
||||
private ConstructedFormats() {
|
||||
}
|
||||
|
|
@ -57,12 +78,13 @@ public final class ConstructedFormats {
|
|||
}
|
||||
}
|
||||
|
||||
private static void buildLists() {
|
||||
public static void buildLists() {
|
||||
underlyingSetCodesPerFormat.put(STANDARD, new ArrayList<>());
|
||||
underlyingSetCodesPerFormat.put(EXTENDED, new ArrayList<>());
|
||||
underlyingSetCodesPerFormat.put(FRONTIER, new ArrayList<>());
|
||||
underlyingSetCodesPerFormat.put(MODERN, new ArrayList<>());
|
||||
underlyingSetCodesPerFormat.put(VINTAGE_LEGACY, new ArrayList<>());
|
||||
underlyingSetCodesPerFormat.put(JOKE, new ArrayList<>());
|
||||
underlyingSetCodesPerFormat.put(CUSTOM, new ArrayList<>());
|
||||
final Map<String, ExpansionInfo> expansionInfo = new HashMap<>();
|
||||
formats.clear(); // prevent NPE on sorting if this is not the first try
|
||||
|
|
@ -85,6 +107,10 @@ public final class ConstructedFormats {
|
|||
underlyingSetCodesPerFormat.get(CUSTOM).add(set.getCode());
|
||||
continue;
|
||||
}
|
||||
if (set.getType() == SetType.JOKESET) {
|
||||
underlyingSetCodesPerFormat.get(JOKE).add(set.getCode());
|
||||
continue;
|
||||
}
|
||||
underlyingSetCodesPerFormat.get(VINTAGE_LEGACY).add(set.getCode());
|
||||
if (set.getType() == SetType.CORE || set.getType() == SetType.EXPANSION || set.getType() == SetType.SUPPLEMENTAL_STANDARD_LEGAL) {
|
||||
if (STANDARD_CARDS.getSetCodes().contains(set.getCode())) {
|
||||
|
|
@ -211,12 +237,12 @@ public final class ConstructedFormats {
|
|||
});
|
||||
if (!formats.isEmpty()) {
|
||||
formats.add(0, CUSTOM);
|
||||
formats.add(0, JOKE);
|
||||
formats.add(0, VINTAGE_LEGACY);
|
||||
formats.add(0, MODERN);
|
||||
formats.add(0, EXTENDED);
|
||||
formats.add(0, FRONTIER);
|
||||
formats.add(0, EXTENDED);
|
||||
formats.add(0, STANDARD);
|
||||
|
||||
}
|
||||
formats.add(0, ALL);
|
||||
}
|
||||
|
|
@ -224,15 +250,4 @@ public final class ConstructedFormats {
|
|||
private static String getBlockDisplayName(String blockName) {
|
||||
return "* " + blockName + " Block";
|
||||
}
|
||||
// Attention -Month is 0 Based so Feb = 1 for example.
|
||||
private static final Date extendedDate = new GregorianCalendar(2009, 7, 20).getTime();
|
||||
private static final Date frontierDate = new GregorianCalendar(2014, 6, 17).getTime();
|
||||
private static final Date modernDate = new GregorianCalendar(2003, 6, 20).getTime();
|
||||
|
||||
// for all sets just return empty list
|
||||
private static final List<String> all = new ArrayList<>();
|
||||
|
||||
static {
|
||||
buildLists();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -59,7 +58,7 @@ public enum AltMtgOnlTokensImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,11 +6,11 @@ import org.mage.plugins.card.images.CardDownloadData;
|
|||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* @author North
|
||||
* @author North, JayDi85
|
||||
*/
|
||||
public interface CardImageSource {
|
||||
|
||||
CardImageUrls generateURL(CardDownloadData card) throws Exception;
|
||||
CardImageUrls generateCardUrl(CardDownloadData card) throws Exception;
|
||||
|
||||
CardImageUrls generateTokenUrl(CardDownloadData card) throws Exception;
|
||||
|
||||
|
|
@ -53,7 +53,11 @@ public interface CardImageSource {
|
|||
return true;
|
||||
}
|
||||
|
||||
default boolean isImageProvided(String setCode, String cardName) {
|
||||
default boolean isCardImageProvided(String setCode, String cardName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
default boolean isTokenImageProvided(String setCode, String cardName, Integer tokenNumber) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.awt.Toolkit;
|
||||
import mage.cards.Sets;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.datatransfer.Clipboard;
|
||||
import java.awt.datatransfer.StringSelection;
|
||||
import java.io.IOException;
|
||||
|
|
@ -10,12 +14,8 @@ import java.util.LinkedHashSet;
|
|||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.swing.JOptionPane;
|
||||
import mage.cards.Sets;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author spjspj
|
||||
*/
|
||||
public enum CopyPasteImageSource implements CardImageSource {
|
||||
|
|
@ -74,7 +74,7 @@ public enum CopyPasteImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
if (singleLinks == null) {
|
||||
setupLinks();
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ public enum CopyPasteImageSource implements CardImageSource {
|
|||
@Override
|
||||
public CardImageUrls generateTokenUrl(CardDownloadData card) throws IOException {
|
||||
try {
|
||||
return generateURL(card);
|
||||
return generateCardUrl(card);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
return null;
|
||||
|
|
@ -239,7 +239,7 @@ public enum CopyPasteImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isImageProvided(String setCode, String cardName) {
|
||||
public boolean isCardImageProvided(String setCode, String cardName) {
|
||||
missingCards.add(setCode + "/" + cardName);
|
||||
|
||||
if (singleLinks != null) {
|
||||
|
|
@ -248,6 +248,11 @@ public enum CopyPasteImageSource implements CardImageSource {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTokenImageProvided(String setCode, String cardName, Integer tokenNumber) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSetSupportedComplete(String setCode) {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
|
|
@ -9,9 +11,6 @@ import java.util.Set;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
/**
|
||||
* @author spjspj
|
||||
*/
|
||||
|
|
@ -48,7 +47,7 @@ public enum GrabbagImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
if (singleLinks == null) {
|
||||
setupLinks();
|
||||
}
|
||||
|
|
@ -450,7 +449,7 @@ public enum GrabbagImageSource implements CardImageSource {
|
|||
@Override
|
||||
public CardImageUrls generateTokenUrl(CardDownloadData card) throws IOException {
|
||||
try {
|
||||
return generateURL(card);
|
||||
return generateCardUrl(card);
|
||||
} catch (Exception ex) {
|
||||
java.util.logging.Logger.getLogger(GrabbagImageSource.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
|
|
@ -501,7 +500,7 @@ public enum GrabbagImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isImageProvided(String setCode, String cardName) {
|
||||
public boolean isCardImageProvided(String setCode, String cardName) {
|
||||
if (singleLinks == null) {
|
||||
setupLinks();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,10 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Pete Rossi
|
||||
*/
|
||||
|
|
@ -234,7 +228,7 @@ public enum MagidexImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
String cardDownloadName = card.getDownloadName().toLowerCase(Locale.ENGLISH);
|
||||
String cardSet = card.getSet();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* Site was shutdown by wizards Feb. 2015
|
||||
*
|
||||
|
|
@ -30,7 +29,7 @@ public enum MtgImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
String collectorId = card.getCollectorId();
|
||||
String cardSet = card.getSet();
|
||||
if (collectorId == null || cardSet == null) {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author spjspj
|
||||
*/
|
||||
|
|
@ -59,7 +58,7 @@ public enum MtgOnlTokensImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -352,8 +351,12 @@ public enum MtgOnlTokensImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isImageProvided(String setCode, String cardName) {
|
||||
return true;
|
||||
public boolean isCardImageProvided(String setCode, String cardName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTokenImageProvided(String setCode, String cardName, Integer tokenNumber) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,5 @@
|
|||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.Proxy;
|
||||
import java.net.URL;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.prefs.Preferences;
|
||||
import mage.client.MageFrame;
|
||||
import mage.remote.Connection;
|
||||
import mage.remote.Connection.ProxyType;
|
||||
|
|
@ -26,6 +9,13 @@ import org.jsoup.nodes.Element;
|
|||
import org.jsoup.select.Elements;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.*;
|
||||
import java.util.*;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
|
@ -330,7 +320,7 @@ public enum MythicspoilerComSource implements CardImageSource {
|
|||
}
|
||||
|
||||
private Map<String, String> getSetLinksFromPage(String cardSet, Set<String> aliasesStart, Preferences prefs,
|
||||
ProxyType proxyType, String baseUrl, String pageUrl) throws IOException {
|
||||
ProxyType proxyType, String baseUrl, String pageUrl) throws IOException {
|
||||
Map<String, String> pageLinks = new HashMap<>();
|
||||
|
||||
String urlDocument;
|
||||
|
|
@ -392,7 +382,7 @@ public enum MythicspoilerComSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
String collectorId = card.getCollectorId();
|
||||
String cardSet = card.getSet();
|
||||
if (collectorId == null || cardSet == null) {
|
||||
|
|
|
|||
|
|
@ -3,20 +3,23 @@ package org.mage.plugins.card.dl.sources;
|
|||
import mage.client.util.CardLanguage;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author Quercitron, JayDi85
|
||||
* @author JayDi85
|
||||
*/
|
||||
public enum ScryfallImageSource implements CardImageSource {
|
||||
|
||||
instance;
|
||||
|
||||
private final Set<String> supportedSets;
|
||||
private final Map<CardLanguage, String> languageAliases;
|
||||
private CardLanguage currentLanguage = CardLanguage.ENGLISH; // working language
|
||||
|
||||
ScryfallImageSource() {
|
||||
// LANGUAGES
|
||||
// https://scryfall.com/docs/api/languages
|
||||
languageAliases = new HashMap<>();
|
||||
languageAliases.put(CardLanguage.ENGLISH, "en");
|
||||
|
|
@ -30,225 +33,9 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
languageAliases.put(CardLanguage.RUSSIAN, "ru");
|
||||
languageAliases.put(CardLanguage.CHINES_SIMPLE, "zhs");
|
||||
languageAliases.put(CardLanguage.CHINES_TRADITION, "zht");
|
||||
|
||||
supportedSets = new LinkedHashSet<>();
|
||||
// supportedSets.add("PTC"); //
|
||||
supportedSets.add("LEA");
|
||||
supportedSets.add("LEB");
|
||||
supportedSets.add("2ED");
|
||||
supportedSets.add("ARN");
|
||||
supportedSets.add("ATQ");
|
||||
supportedSets.add("3ED");
|
||||
supportedSets.add("LEG");
|
||||
supportedSets.add("DRK");
|
||||
supportedSets.add("FEM");
|
||||
supportedSets.add("4ED");
|
||||
supportedSets.add("ICE");
|
||||
supportedSets.add("CHR");
|
||||
supportedSets.add("HML");
|
||||
supportedSets.add("ALL");
|
||||
supportedSets.add("MIR");
|
||||
supportedSets.add("VIS");
|
||||
supportedSets.add("5ED");
|
||||
supportedSets.add("POR");
|
||||
supportedSets.add("WTH");
|
||||
supportedSets.add("TMP");
|
||||
supportedSets.add("STH");
|
||||
supportedSets.add("EXO");
|
||||
supportedSets.add("P02");
|
||||
supportedSets.add("UGL");
|
||||
supportedSets.add("USG");
|
||||
supportedSets.add("DD3DVD");
|
||||
supportedSets.add("DD3EVG");
|
||||
supportedSets.add("DD3GVL");
|
||||
supportedSets.add("DD3JVC");
|
||||
|
||||
supportedSets.add("ULG");
|
||||
supportedSets.add("6ED");
|
||||
supportedSets.add("UDS");
|
||||
supportedSets.add("PTK");
|
||||
supportedSets.add("S99");
|
||||
supportedSets.add("MMQ");
|
||||
// supportedSets.add("BRB");Battle Royale Box Set
|
||||
supportedSets.add("NEM");
|
||||
supportedSets.add("S00");
|
||||
supportedSets.add("PCY");
|
||||
supportedSets.add("INV");
|
||||
// supportedSets.add("BTD"); // Beatdown Boxset
|
||||
supportedSets.add("PLS");
|
||||
supportedSets.add("7ED");
|
||||
supportedSets.add("APC");
|
||||
supportedSets.add("ODY");
|
||||
// supportedSets.add("DKM"); // Deckmasters 2001
|
||||
supportedSets.add("TOR");
|
||||
supportedSets.add("JUD");
|
||||
supportedSets.add("ONS");
|
||||
supportedSets.add("LGN");
|
||||
supportedSets.add("SCG");
|
||||
supportedSets.add("8ED");
|
||||
supportedSets.add("MRD");
|
||||
supportedSets.add("DST");
|
||||
supportedSets.add("5DN");
|
||||
supportedSets.add("CHK");
|
||||
supportedSets.add("UNH");
|
||||
supportedSets.add("BOK");
|
||||
supportedSets.add("SOK");
|
||||
supportedSets.add("9ED");
|
||||
supportedSets.add("RAV");
|
||||
supportedSets.add("GPT");
|
||||
supportedSets.add("DIS");
|
||||
supportedSets.add("CSP");
|
||||
supportedSets.add("TSP");
|
||||
supportedSets.add("TSB");
|
||||
supportedSets.add("PLC");
|
||||
supportedSets.add("FUT");
|
||||
supportedSets.add("10E");
|
||||
supportedSets.add("MED");
|
||||
supportedSets.add("LRW");
|
||||
supportedSets.add("EVG");
|
||||
supportedSets.add("MOR");
|
||||
supportedSets.add("SHM");
|
||||
supportedSets.add("EVE");
|
||||
supportedSets.add("DRB");
|
||||
supportedSets.add("ME2");
|
||||
supportedSets.add("ALA");
|
||||
supportedSets.add("DD2");
|
||||
supportedSets.add("CON");
|
||||
supportedSets.add("DDC");
|
||||
supportedSets.add("ARB");
|
||||
supportedSets.add("M10");
|
||||
// supportedSets.add("TD0"); // Magic Online Deck Series
|
||||
supportedSets.add("V09");
|
||||
supportedSets.add("HOP");
|
||||
supportedSets.add("ME3");
|
||||
supportedSets.add("ZEN");
|
||||
supportedSets.add("DDD");
|
||||
supportedSets.add("H09");
|
||||
supportedSets.add("WWK");
|
||||
supportedSets.add("DDE");
|
||||
supportedSets.add("ROE");
|
||||
// duels of the planewalkers:
|
||||
supportedSets.add("DPA");
|
||||
supportedSets.add("DPAP");
|
||||
//
|
||||
supportedSets.add("ARC");
|
||||
supportedSets.add("M11");
|
||||
supportedSets.add("V10");
|
||||
supportedSets.add("DDF");
|
||||
supportedSets.add("SOM");
|
||||
// supportedSets.add("TD0"); // Commander Theme Decks
|
||||
supportedSets.add("PD2");
|
||||
supportedSets.add("ME4");
|
||||
supportedSets.add("MBS");
|
||||
supportedSets.add("DDG");
|
||||
supportedSets.add("NPH");
|
||||
supportedSets.add("CMD");
|
||||
supportedSets.add("M12");
|
||||
supportedSets.add("V11");
|
||||
supportedSets.add("DDH");
|
||||
supportedSets.add("ISD");
|
||||
supportedSets.add("PD3");
|
||||
supportedSets.add("DKA");
|
||||
supportedSets.add("DDI");
|
||||
supportedSets.add("AVR");
|
||||
supportedSets.add("PC2");
|
||||
supportedSets.add("M13");
|
||||
supportedSets.add("V12");
|
||||
supportedSets.add("DDJ");
|
||||
supportedSets.add("RTR");
|
||||
supportedSets.add("CM1");
|
||||
// supportedSets.add("TD2"); // Duel Decks: Mirrodin Pure vs. New Phyrexia
|
||||
supportedSets.add("GTC");
|
||||
supportedSets.add("DDK");
|
||||
supportedSets.add("DGM");
|
||||
supportedSets.add("MMA");
|
||||
supportedSets.add("M14");
|
||||
supportedSets.add("V13");
|
||||
supportedSets.add("DDL");
|
||||
supportedSets.add("THS");
|
||||
supportedSets.add("C13");
|
||||
supportedSets.add("BNG");
|
||||
supportedSets.add("DDM");
|
||||
supportedSets.add("JOU");
|
||||
// supportedSets.add("MD1"); // Modern Event Deck
|
||||
supportedSets.add("CNS");
|
||||
supportedSets.add("VMA");
|
||||
supportedSets.add("M15");
|
||||
supportedSets.add("V14");
|
||||
supportedSets.add("DDN");
|
||||
supportedSets.add("KTK");
|
||||
supportedSets.add("C14");
|
||||
// supportedSets.add("DD3"); // Duel Decks Anthology
|
||||
supportedSets.add("FRF");
|
||||
supportedSets.add("DDO");
|
||||
supportedSets.add("DTK");
|
||||
supportedSets.add("TPR");
|
||||
supportedSets.add("MM2");
|
||||
supportedSets.add("ORI");
|
||||
supportedSets.add("V15");
|
||||
supportedSets.add("DDP");
|
||||
supportedSets.add("BFZ");
|
||||
supportedSets.add("EXP");
|
||||
supportedSets.add("C15");
|
||||
// supportedSets.add("PZ1"); // Legendary Cube
|
||||
supportedSets.add("OGW");
|
||||
supportedSets.add("DDQ");
|
||||
supportedSets.add("W16");
|
||||
supportedSets.add("SOI");
|
||||
supportedSets.add("EMA");
|
||||
supportedSets.add("EMN");
|
||||
supportedSets.add("V16");
|
||||
supportedSets.add("CN2");
|
||||
supportedSets.add("DDR");
|
||||
supportedSets.add("KLD");
|
||||
supportedSets.add("MPS");
|
||||
// supportedSets.add("PZ2");
|
||||
supportedSets.add("C16");
|
||||
supportedSets.add("PCA");
|
||||
supportedSets.add("AER");
|
||||
supportedSets.add("MM3");
|
||||
supportedSets.add("DDS");
|
||||
supportedSets.add("W17");
|
||||
supportedSets.add("AKH");
|
||||
supportedSets.add("CMA");
|
||||
supportedSets.add("E01");
|
||||
supportedSets.add("HOU");
|
||||
supportedSets.add("C17");
|
||||
supportedSets.add("XLN");
|
||||
supportedSets.add("DDT");
|
||||
supportedSets.add("IMA");
|
||||
supportedSets.add("E02");
|
||||
supportedSets.add("V17");
|
||||
supportedSets.add("UST");
|
||||
supportedSets.add("DDU");
|
||||
supportedSets.add("RIX");
|
||||
supportedSets.add("WMCQ");
|
||||
supportedSets.add("PPRO");
|
||||
supportedSets.add("A25");
|
||||
supportedSets.add("DOM");
|
||||
supportedSets.add("BBD");
|
||||
supportedSets.add("C18");
|
||||
supportedSets.add("CM2");
|
||||
supportedSets.add("M19");
|
||||
supportedSets.add("GS1");
|
||||
supportedSets.add("GRN");
|
||||
supportedSets.add("GK1");
|
||||
supportedSets.add("GNT");
|
||||
supportedSets.add("UMA");
|
||||
supportedSets.add("PUMA");
|
||||
supportedSets.add("RNA");
|
||||
//
|
||||
supportedSets.add("EURO");
|
||||
supportedSets.add("GPX");
|
||||
supportedSets.add("ATH");
|
||||
supportedSets.add("GRC");
|
||||
supportedSets.add("ANA");
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
|
||||
String preferredCode = this.getCurrentLanguage().getCode();
|
||||
private CardImageUrls innerGenerateURL(CardDownloadData card, boolean isToken) {
|
||||
String defaultCode = CardLanguage.ENGLISH.getCode();
|
||||
String localizedCode = languageAliases.getOrDefault(this.getCurrentLanguage(), defaultCode);
|
||||
// loc example: https://api.scryfall.com/cards/xln/121/ru?format=image
|
||||
|
|
@ -259,22 +46,20 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
String baseUrl = null;
|
||||
String alternativeUrl = null;
|
||||
|
||||
// TOKENS TRY
|
||||
|
||||
// tokens support only direct links
|
||||
if (baseUrl == null && isToken) {
|
||||
baseUrl = ScryfallImageSupportTokens.findTokenLink(card.getSet(), card.getName(), card.getType());
|
||||
alternativeUrl = null;
|
||||
}
|
||||
|
||||
// CARDS TRY
|
||||
|
||||
// direct links to images (non localization)
|
||||
if (baseUrl == null) {
|
||||
|
||||
// set/card/number
|
||||
String linkCode1 = card.getSet() + "/" + card.getName() + "/" + card.getCollectorId();
|
||||
if (directDownloadLinks.containsKey(linkCode1)) {
|
||||
baseUrl = directDownloadLinks.get(linkCode1);
|
||||
alternativeUrl = null;
|
||||
}
|
||||
|
||||
// set/card
|
||||
String linkCode2 = card.getSet() + "/" + card.getName();
|
||||
if (directDownloadLinks.containsKey(linkCode2)) {
|
||||
baseUrl = directDownloadLinks.get(linkCode2);
|
||||
alternativeUrl = null;
|
||||
}
|
||||
baseUrl = ScryfallImageSupportCards.findDirectDownloadLink(card.getSet(), card.getName(), card.getCollectorId());
|
||||
alternativeUrl = null;
|
||||
}
|
||||
|
||||
// special card number like "103a" and "U123" already compatible
|
||||
|
|
@ -285,9 +70,9 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
// fix for Ultimate Box Topper (PUMA) -- need to use API
|
||||
// ignored and go to API call at the end
|
||||
} else {
|
||||
baseUrl = "https://img.scryfall.com/cards/large/" + localizedCode + "/" + formatSetName(card.getSet()) + "/"
|
||||
baseUrl = "https://img.scryfall.com/cards/large/" + localizedCode + "/" + formatSetName(card.getSet(), isToken) + "/"
|
||||
+ card.getCollectorId() + ".jpg";
|
||||
alternativeUrl = "https://img.scryfall.com/cards/large/" + defaultCode + "/" + formatSetName(card.getSet()) + "/"
|
||||
alternativeUrl = "https://img.scryfall.com/cards/large/" + defaultCode + "/" + formatSetName(card.getSet(), isToken) + "/"
|
||||
+ card.getCollectorId() + ".jpg";
|
||||
}
|
||||
}
|
||||
|
|
@ -295,27 +80,33 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
// double faced cards do not supports by API (need direct link for img)
|
||||
// example: https://img.scryfall.com/cards/large/en/xln/173b.jpg
|
||||
if (baseUrl == null && card.isTwoFacedCard()) {
|
||||
baseUrl = "https://img.scryfall.com/cards/large/" + localizedCode + "/" + formatSetName(card.getSet()) + "/"
|
||||
baseUrl = "https://img.scryfall.com/cards/large/" + localizedCode + "/" + formatSetName(card.getSet(), isToken) + "/"
|
||||
+ card.getCollectorId() + (card.isSecondSide() ? "b" : "a") + ".jpg";
|
||||
alternativeUrl = "https://img.scryfall.com/cards/large/" + defaultCode + "/" + formatSetName(card.getSet()) + "/"
|
||||
alternativeUrl = "https://img.scryfall.com/cards/large/" + defaultCode + "/" + formatSetName(card.getSet(), isToken) + "/"
|
||||
+ card.getCollectorId() + (card.isSecondSide() ? "b" : "a") + ".jpg";
|
||||
}
|
||||
|
||||
// basic cards by api call (redirect to img link)
|
||||
// example: https://api.scryfall.com/cards/xln/121/en?format=image
|
||||
if (baseUrl == null) {
|
||||
baseUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet()) + "/"
|
||||
baseUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet(), isToken) + "/"
|
||||
+ card.getCollectorId() + "/" + localizedCode + "?format=image";
|
||||
alternativeUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet()) + "/"
|
||||
alternativeUrl = "https://api.scryfall.com/cards/" + formatSetName(card.getSet(), isToken) + "/"
|
||||
+ card.getCollectorId() + "/" + defaultCode + "?format=image";
|
||||
}
|
||||
|
||||
return new CardImageUrls(baseUrl, alternativeUrl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
return innerGenerateURL(card, false);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateTokenUrl(CardDownloadData card) throws Exception {
|
||||
return null;
|
||||
return innerGenerateURL(card, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -345,7 +136,7 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
|
||||
@Override
|
||||
public boolean isTokenSource() {
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -368,132 +159,41 @@ public enum ScryfallImageSource implements CardImageSource {
|
|||
|
||||
}
|
||||
|
||||
private String formatSetName(String setName) {
|
||||
if (setNameReplacement.containsKey(setName)) {
|
||||
setName = setNameReplacement.get(setName);
|
||||
private String formatSetName(String setName, boolean isToken) {
|
||||
if (isToken) {
|
||||
// token uses direct link download, not set
|
||||
return setName.toLowerCase(Locale.ENGLISH);
|
||||
} else {
|
||||
return ScryfallImageSupportCards.findScryfallSetCode(setName);
|
||||
}
|
||||
return setName.toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
private static final Map<String, String> setNameReplacement = new HashMap<String, String>() {
|
||||
{
|
||||
put("DD3GVL", "gvl");
|
||||
put("DD3JVC", "jvc");
|
||||
put("DD3DVD", "dvd");
|
||||
put("DD3EVG", "evg");
|
||||
put("MPS-AKH", "mp2");
|
||||
put("MBP", "pmei");
|
||||
put("WMCQ", "pwcq");
|
||||
put("EURO", "pelp");
|
||||
put("GPX", "pgpx");
|
||||
put("MED", "me1");
|
||||
}
|
||||
};
|
||||
|
||||
private static final Map<String, String> directDownloadLinks = new HashMap<String, String>() {
|
||||
{
|
||||
// direct links to download images for special cards
|
||||
|
||||
// Duels of the Planeswalkers Promos -- xmage uses one set (DPAP), but scryfall store it by years
|
||||
// 2009 - https://scryfall.com/sets/pdtp
|
||||
put("DPAP/Garruk Wildspeaker", "https://img.scryfall.com/cards/large/en/pdtp/1.jpg");
|
||||
// 2010 - https://scryfall.com/sets/pdp10
|
||||
put("DPAP/Liliana Vess", "https://img.scryfall.com/cards/large/en/pdp10/1.jpg");
|
||||
put("DPAP/Nissa Revane", "https://img.scryfall.com/cards/large/en/pdp10/2.jpg");
|
||||
// 2011 - https://scryfall.com/sets/pdp11
|
||||
put("DPAP/Frost Titan", "https://img.scryfall.com/cards/large/en/pdp11/1.jpg");
|
||||
put("DPAP/Grave Titan", "https://img.scryfall.com/cards/large/en/pdp11/2.jpg");
|
||||
put("DPAP/Inferno Titan", "https://img.scryfall.com/cards/large/en/pdp11/3.jpg");
|
||||
// 2012 - https://scryfall.com/sets/pdp12
|
||||
put("DPAP/Primordial Hydra", "https://img.scryfall.com/cards/large/en/pdp12/1.jpg");
|
||||
put("DPAP/Serra Avatar", "https://img.scryfall.com/cards/large/en/pdp12/2.jpg");
|
||||
put("DPAP/Vampire Nocturnus", "https://img.scryfall.com/cards/large/en/pdp12/3.jpg");
|
||||
// 2013 - https://scryfall.com/sets/pdp13
|
||||
put("DPAP/Bonescythe Sliver", "https://img.scryfall.com/cards/large/en/pdp13/1.jpg");
|
||||
put("DPAP/Ogre Battledriver", "https://img.scryfall.com/cards/large/en/pdp13/2.jpg");
|
||||
put("DPAP/Scavenging Ooze", "https://img.scryfall.com/cards/large/en/pdp13/3.jpg");
|
||||
// 2014 - https://scryfall.com/sets/pdp14
|
||||
put("DPAP/Soul of Ravnica", "https://img.scryfall.com/cards/large/en/pdp14/1.jpg");
|
||||
put("DPAP/Soul of Zendikar", "https://img.scryfall.com/cards/large/en/pdp14/2.jpg");
|
||||
|
||||
// Gateway Promos -- xmage uses one set (GRC), but scryfall store it by years
|
||||
// 2006 - https://scryfall.com/sets/pgtw
|
||||
put("GRC/Fiery Temper", "https://img.scryfall.com/cards/large/en/pgtw/3.jpg");
|
||||
put("GRC/Icatian Javelineers", "https://img.scryfall.com/cards/large/en/pgtw/2.jpg");
|
||||
put("GRC/Wood Elves", "https://img.scryfall.com/cards/large/en/pgtw/1.jpg");
|
||||
// 2007 - https://scryfall.com/sets/pg07
|
||||
put("GRC/Boomerang", "https://img.scryfall.com/cards/large/en/pg07/4.jpg");
|
||||
put("GRC/Calciderm", "https://img.scryfall.com/cards/large/en/pg07/5.jpg");
|
||||
put("GRC/Dauntless Dourbark", "https://img.scryfall.com/cards/large/en/pg07/12.jpg");
|
||||
put("GRC/Llanowar Elves", "https://img.scryfall.com/cards/large/en/pg07/9.jpg");
|
||||
put("GRC/Mind Stone", "https://img.scryfall.com/cards/large/en/pg07/11.jpg");
|
||||
put("GRC/Mogg Fanatic", "https://img.scryfall.com/cards/large/en/pg07/10.jpg");
|
||||
put("GRC/Reckless Wurm", "https://img.scryfall.com/cards/large/en/pg07/6.jpg");
|
||||
put("GRC/Yixlid Jailer", "https://img.scryfall.com/cards/large/en/pg07/7.jpg");
|
||||
put("GRC/Zoetic Cavern", "https://img.scryfall.com/cards/large/en/pg07/8.jpg");
|
||||
// 2008a - https://scryfall.com/sets/pg08
|
||||
put("GRC/Boggart Ram-Gang", "https://img.scryfall.com/cards/large/en/pg08/17.jpg");
|
||||
put("GRC/Cenn's Tactician", "https://img.scryfall.com/cards/large/en/pg08/14.jpg");
|
||||
put("GRC/Duergar Hedge-Mage", "https://img.scryfall.com/cards/large/en/pg08/19.jpg");
|
||||
put("GRC/Gravedigger", "https://img.scryfall.com/cards/large/en/pg08/16.jpg");
|
||||
put("GRC/Lava Axe", "https://img.scryfall.com/cards/large/en/pg08/13.jpg");
|
||||
put("GRC/Oona's Blackguard", "https://img.scryfall.com/cards/large/en/pg08/15.jpg");
|
||||
put("GRC/Selkie Hedge-Mage", "https://img.scryfall.com/cards/large/en/pg08/20.jpg");
|
||||
put("GRC/Wilt-Leaf Cavaliers", "https://img.scryfall.com/cards/large/en/pg08/18.jpg");
|
||||
|
||||
// Wizards Play Network Promos -- xmage uses one set (GRC), but scryfall store it by years
|
||||
// 2008b - https://scryfall.com/sets/pwpn
|
||||
put("GRC/Sprouting Thrinax", "https://img.scryfall.com/cards/large/en/pwpn/21.jpg");
|
||||
put("GRC/Woolly Thoctar", "https://img.scryfall.com/cards/large/en/pwpn/22.jpg");
|
||||
// 2009 - https://scryfall.com/sets/pwp09
|
||||
put("GRC/Hellspark Elemental", "https://img.scryfall.com/cards/large/en/pwp09/25.jpg");
|
||||
put("GRC/Kor Duelist", "https://img.scryfall.com/cards/large/en/pwp09/32.jpg");
|
||||
put("GRC/Marisi's Twinclaws", "https://img.scryfall.com/cards/large/en/pwp09/26.jpg");
|
||||
put("GRC/Mind Control", "https://img.scryfall.com/cards/large/en/pwp09/30.jpg");
|
||||
put("GRC/Path to Exile", "https://img.scryfall.com/cards/large/en/pwp09/24.jpg");
|
||||
put("GRC/Rise from the Grave", "https://img.scryfall.com/cards/large/en/pwp09/31.jpg");
|
||||
put("GRC/Slave of Bolas", "https://img.scryfall.com/cards/large/en/pwp09/27.jpg");
|
||||
put("GRC/Vampire Nighthawk", "https://img.scryfall.com/cards/large/en/pwp09/33.jpg");
|
||||
// 2010 - https://scryfall.com/sets/pwp10
|
||||
put("GRC/Kor Firewalker", "https://img.scryfall.com/cards/large/en/pwp10/36.jpg");
|
||||
put("GRC/Leatherback Baloth", "https://img.scryfall.com/cards/large/en/pwp10/37.jpg");
|
||||
put("GRC/Syphon Mind", "https://img.scryfall.com/cards/large/en/pwp10/40.jpg");
|
||||
put("GRC/Pathrazer of Ulamog", "https://img.scryfall.com/cards/large/en/pwp10/46.jpg");
|
||||
put("GRC/Curse of Wizardry", "https://img.scryfall.com/cards/large/en/pwp10/47.jpg");
|
||||
put("GRC/Fling/50", "https://img.scryfall.com/cards/large/en/pwp10/50.jpg"); // same card but different year
|
||||
put("GRC/Sylvan Ranger/51", "https://img.scryfall.com/cards/large/en/pwp10/51.jpg"); // same card but different year
|
||||
put("GRC/Plague Stinger", "https://img.scryfall.com/cards/large/en/pwp10/59.jpg");
|
||||
put("GRC/Golem's Heart", "https://img.scryfall.com/cards/large/en/pwp10/60.jpg");
|
||||
put("GRC/Skinrender", "https://img.scryfall.com/cards/large/en/pwp10/63.jpg");
|
||||
// 2011 - https://scryfall.com/sets/pwp11
|
||||
put("GRC/Auramancer", "https://img.scryfall.com/cards/large/en/pwp11/77.jpg");
|
||||
put("GRC/Bloodcrazed Neonate", "https://img.scryfall.com/cards/large/en/pwp11/83.jpg");
|
||||
put("GRC/Boneyard Wurm", "https://img.scryfall.com/cards/large/en/pwp11/84.jpg");
|
||||
put("GRC/Circle of Flame", "https://img.scryfall.com/cards/large/en/pwp11/78.jpg");
|
||||
put("GRC/Curse of the Bloody Tome", "https://img.scryfall.com/cards/large/en/pwp11/80.jpg");
|
||||
put("GRC/Fling/69", "https://img.scryfall.com/cards/large/en/pwp11/69.jpg"); // same card but different year
|
||||
put("GRC/Master's Call", "https://img.scryfall.com/cards/large/en/pwp11/64.jpg");
|
||||
put("GRC/Maul Splicer", "https://img.scryfall.com/cards/large/en/pwp11/72.jpg");
|
||||
put("GRC/Plague Myr", "https://img.scryfall.com/cards/large/en/pwp11/65.jpg");
|
||||
put("GRC/Shrine of Burning Rage", "https://img.scryfall.com/cards/large/en/pwp11/73.jpg");
|
||||
put("GRC/Signal Pest", "https://img.scryfall.com/cards/large/en/pwp11/66.jpg");
|
||||
put("GRC/Sylvan Ranger/70", "https://img.scryfall.com/cards/large/en/pwp11/70.jpg"); // same card but different year
|
||||
put("GRC/Tormented Soul", "https://img.scryfall.com/cards/large/en/pwp11/76.jpg");
|
||||
put("GRC/Vault Skirge", "https://img.scryfall.com/cards/large/en/pwp11/71.jpg");
|
||||
// 2012 - https://scryfall.com/sets/pwp12
|
||||
put("GRC/Curse of Thirst", "https://img.scryfall.com/cards/large/en/pwp12/81.jpg");
|
||||
put("GRC/Gather the Townsfolk", "https://img.scryfall.com/cards/large/en/pwp12/79.jpg");
|
||||
put("GRC/Nearheath Stalker", "https://img.scryfall.com/cards/large/en/pwp12/82.jpg");
|
||||
|
||||
// TODO: remove Grand Prix fix after scryfall fix image's link (that's link must be work: https://img.scryfall.com/cards/large/en/pgpx/2016b.jpg )
|
||||
put("GPX/Sword of Feast and Famine", "https://img.scryfall.com/cards/large/en/pgpx/1%E2%98%85.jpg");
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getSupportedSets() {
|
||||
ArrayList<String> supportedSetsCopy = new ArrayList<>();
|
||||
supportedSetsCopy.addAll(supportedSets);
|
||||
|
||||
// cards
|
||||
supportedSetsCopy.addAll(ScryfallImageSupportCards.getSupportedSets());
|
||||
|
||||
// tokens
|
||||
for (String code : ScryfallImageSupportTokens.getSupportedSets().keySet()) {
|
||||
if (!supportedSetsCopy.contains(code)) {
|
||||
supportedSetsCopy.add(code);
|
||||
}
|
||||
}
|
||||
|
||||
return supportedSetsCopy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCardImageProvided(String setCode, String cardName) {
|
||||
// all cards from set
|
||||
return ScryfallImageSupportCards.getSupportedSets().contains(setCode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTokenImageProvided(String setCode, String cardName, Integer tokenNumber) {
|
||||
// only direct tokens from set
|
||||
return ScryfallImageSupportTokens.findTokenLink(setCode, cardName, tokenNumber) != null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,385 @@
|
|||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import org.tritonus.share.ArraySet;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class ScryfallImageSupportCards {
|
||||
|
||||
private static final Map<String, String> xmageSetsToScryfall = new HashMap<String, String>() {
|
||||
{
|
||||
// xmage -> scryfall
|
||||
put("DD3GVL", "gvl");
|
||||
put("DD3JVC", "jvc");
|
||||
put("DD3DVD", "dvd");
|
||||
put("DD3EVG", "evg");
|
||||
put("MPS-AKH", "mp2");
|
||||
put("MBP", "pmei");
|
||||
put("WMCQ", "pwcq");
|
||||
put("EURO", "pelp");
|
||||
put("GPX", "pgpx");
|
||||
put("MED", "me1");
|
||||
}
|
||||
};
|
||||
|
||||
private static final Set<String> supportedSets = new ArraySet<String>() {
|
||||
{
|
||||
// xmage set codes
|
||||
// add("PTC"); //
|
||||
add("LEA");
|
||||
add("LEB");
|
||||
add("2ED");
|
||||
add("ARN");
|
||||
add("ATQ");
|
||||
add("3ED");
|
||||
add("LEG");
|
||||
add("DRK");
|
||||
add("FEM");
|
||||
add("4ED");
|
||||
add("ICE");
|
||||
add("CHR");
|
||||
add("HML");
|
||||
add("ALL");
|
||||
add("MIR");
|
||||
add("VIS");
|
||||
add("5ED");
|
||||
add("POR");
|
||||
add("WTH");
|
||||
add("TMP");
|
||||
add("STH");
|
||||
add("EXO");
|
||||
add("P02");
|
||||
add("UGL");
|
||||
add("USG");
|
||||
add("DD3DVD");
|
||||
add("DD3EVG");
|
||||
add("DD3GVL");
|
||||
add("DD3JVC");
|
||||
|
||||
add("ULG");
|
||||
add("6ED");
|
||||
add("UDS");
|
||||
add("PTK");
|
||||
add("S99");
|
||||
add("MMQ");
|
||||
// add("BRB");Battle Royale Box Set
|
||||
add("NEM");
|
||||
add("S00");
|
||||
add("PCY");
|
||||
add("INV");
|
||||
// add("BTD"); // Beatdown Boxset
|
||||
add("PLS");
|
||||
add("7ED");
|
||||
add("APC");
|
||||
add("ODY");
|
||||
// add("DKM"); // Deckmasters 2001
|
||||
add("TOR");
|
||||
add("JUD");
|
||||
add("ONS");
|
||||
add("LGN");
|
||||
add("SCG");
|
||||
add("8ED");
|
||||
add("MRD");
|
||||
add("DST");
|
||||
add("5DN");
|
||||
add("CHK");
|
||||
add("UNH");
|
||||
add("BOK");
|
||||
add("SOK");
|
||||
add("9ED");
|
||||
add("RAV");
|
||||
add("GPT");
|
||||
add("DIS");
|
||||
add("CSP");
|
||||
add("TSP");
|
||||
add("TSB");
|
||||
add("PLC");
|
||||
add("FUT");
|
||||
add("10E");
|
||||
add("MED");
|
||||
add("LRW");
|
||||
add("EVG");
|
||||
add("MOR");
|
||||
add("SHM");
|
||||
add("EVE");
|
||||
add("DRB");
|
||||
add("ME2");
|
||||
add("ALA");
|
||||
add("DD2");
|
||||
add("CON");
|
||||
add("DDC");
|
||||
add("ARB");
|
||||
add("M10");
|
||||
// add("TD0"); // Magic Online Deck Series
|
||||
add("V09");
|
||||
add("HOP");
|
||||
add("ME3");
|
||||
add("ZEN");
|
||||
add("DDD");
|
||||
add("H09");
|
||||
add("WWK");
|
||||
add("DDE");
|
||||
add("ROE");
|
||||
// duels of the planewalkers:
|
||||
add("DPA");
|
||||
add("DPAP");
|
||||
//
|
||||
add("ARC");
|
||||
add("M11");
|
||||
add("V10");
|
||||
add("DDF");
|
||||
add("SOM");
|
||||
// add("TD0"); // Commander Theme Decks
|
||||
add("PD2");
|
||||
add("ME4");
|
||||
add("MBS");
|
||||
add("DDG");
|
||||
add("NPH");
|
||||
add("CMD");
|
||||
add("M12");
|
||||
add("V11");
|
||||
add("DDH");
|
||||
add("ISD");
|
||||
add("PD3");
|
||||
add("DKA");
|
||||
add("DDI");
|
||||
add("AVR");
|
||||
add("PC2");
|
||||
add("M13");
|
||||
add("V12");
|
||||
add("DDJ");
|
||||
add("RTR");
|
||||
add("CM1");
|
||||
// add("TD2"); // Duel Decks: Mirrodin Pure vs. New Phyrexia
|
||||
add("GTC");
|
||||
add("DDK");
|
||||
add("DGM");
|
||||
add("MMA");
|
||||
add("M14");
|
||||
add("V13");
|
||||
add("DDL");
|
||||
add("THS");
|
||||
add("C13");
|
||||
add("BNG");
|
||||
add("DDM");
|
||||
add("JOU");
|
||||
// add("MD1"); // Modern Event Deck
|
||||
add("CNS");
|
||||
add("VMA");
|
||||
add("M15");
|
||||
add("V14");
|
||||
add("DDN");
|
||||
add("KTK");
|
||||
add("C14");
|
||||
// add("DD3"); // Duel Decks Anthology
|
||||
add("FRF");
|
||||
add("DDO");
|
||||
add("DTK");
|
||||
add("TPR");
|
||||
add("MM2");
|
||||
add("ORI");
|
||||
add("V15");
|
||||
add("DDP");
|
||||
add("BFZ");
|
||||
add("EXP");
|
||||
add("C15");
|
||||
// add("PZ1"); // Legendary Cube
|
||||
add("OGW");
|
||||
add("DDQ");
|
||||
add("W16");
|
||||
add("SOI");
|
||||
add("EMA");
|
||||
add("EMN");
|
||||
add("V16");
|
||||
add("CN2");
|
||||
add("DDR");
|
||||
add("KLD");
|
||||
add("MPS");
|
||||
// add("PZ2");
|
||||
add("C16");
|
||||
add("PCA");
|
||||
add("AER");
|
||||
add("MM3");
|
||||
add("DDS");
|
||||
add("W17");
|
||||
add("AKH");
|
||||
add("CMA");
|
||||
add("E01");
|
||||
add("HOU");
|
||||
add("C17");
|
||||
add("XLN");
|
||||
add("DDT");
|
||||
add("IMA");
|
||||
add("E02");
|
||||
add("V17");
|
||||
add("UST");
|
||||
add("DDU");
|
||||
add("RIX");
|
||||
add("WMCQ");
|
||||
add("PPRO");
|
||||
add("A25");
|
||||
add("DOM");
|
||||
add("BBD");
|
||||
add("C18");
|
||||
add("CM2");
|
||||
add("M19");
|
||||
add("GS1");
|
||||
add("GRN");
|
||||
add("GK1");
|
||||
add("GNT");
|
||||
add("UMA");
|
||||
add("PUMA");
|
||||
add("RNA");
|
||||
//
|
||||
add("EURO");
|
||||
add("GPX");
|
||||
add("ATH");
|
||||
add("GRC");
|
||||
add("ANA");
|
||||
}
|
||||
};
|
||||
|
||||
private static final Map<String, String> directDownloadLinks = new HashMap<String, String>() {
|
||||
{
|
||||
// xmage card -> direct or api link:
|
||||
// examples:
|
||||
// direct example: https://img.scryfall.com/cards/large/en/trix/6.jpg
|
||||
// api example: https://api.scryfall.com/cards/trix/6/en?format=image
|
||||
// api example: https://api.scryfall.com/cards/trix/6?format=image
|
||||
// api format is primary
|
||||
//
|
||||
// code form for one card:
|
||||
// set/card_name
|
||||
//
|
||||
// code form for same name cards (alternative images):
|
||||
// set/card_name/card_number
|
||||
// set/card_name/card_number
|
||||
|
||||
// Duels of the Planeswalkers Promos -- xmage uses one set (DPAP), but scryfall store it by years
|
||||
// 2009 - https://scryfall.com/sets/pdtp
|
||||
put("DPAP/Garruk Wildspeaker", "https://img.scryfall.com/cards/large/en/pdtp/1.jpg");
|
||||
// 2010 - https://scryfall.com/sets/pdp10
|
||||
put("DPAP/Liliana Vess", "https://img.scryfall.com/cards/large/en/pdp10/1.jpg");
|
||||
put("DPAP/Nissa Revane", "https://img.scryfall.com/cards/large/en/pdp10/2.jpg");
|
||||
// 2011 - https://scryfall.com/sets/pdp11
|
||||
put("DPAP/Frost Titan", "https://img.scryfall.com/cards/large/en/pdp11/1.jpg");
|
||||
put("DPAP/Grave Titan", "https://img.scryfall.com/cards/large/en/pdp11/2.jpg");
|
||||
put("DPAP/Inferno Titan", "https://img.scryfall.com/cards/large/en/pdp11/3.jpg");
|
||||
// 2012 - https://scryfall.com/sets/pdp12
|
||||
put("DPAP/Primordial Hydra", "https://img.scryfall.com/cards/large/en/pdp12/1.jpg");
|
||||
put("DPAP/Serra Avatar", "https://img.scryfall.com/cards/large/en/pdp12/2.jpg");
|
||||
put("DPAP/Vampire Nocturnus", "https://img.scryfall.com/cards/large/en/pdp12/3.jpg");
|
||||
// 2013 - https://scryfall.com/sets/pdp13
|
||||
put("DPAP/Bonescythe Sliver", "https://img.scryfall.com/cards/large/en/pdp13/1.jpg");
|
||||
put("DPAP/Ogre Battledriver", "https://img.scryfall.com/cards/large/en/pdp13/2.jpg");
|
||||
put("DPAP/Scavenging Ooze", "https://img.scryfall.com/cards/large/en/pdp13/3.jpg");
|
||||
// 2014 - https://scryfall.com/sets/pdp14
|
||||
put("DPAP/Soul of Ravnica", "https://img.scryfall.com/cards/large/en/pdp14/1.jpg");
|
||||
put("DPAP/Soul of Zendikar", "https://img.scryfall.com/cards/large/en/pdp14/2.jpg");
|
||||
|
||||
// Gateway Promos -- xmage uses one set (GRC), but scryfall store it by years
|
||||
// 2006 - https://scryfall.com/sets/pgtw
|
||||
put("GRC/Fiery Temper", "https://img.scryfall.com/cards/large/en/pgtw/3.jpg");
|
||||
put("GRC/Icatian Javelineers", "https://img.scryfall.com/cards/large/en/pgtw/2.jpg");
|
||||
put("GRC/Wood Elves", "https://img.scryfall.com/cards/large/en/pgtw/1.jpg");
|
||||
// 2007 - https://scryfall.com/sets/pg07
|
||||
put("GRC/Boomerang", "https://img.scryfall.com/cards/large/en/pg07/4.jpg");
|
||||
put("GRC/Calciderm", "https://img.scryfall.com/cards/large/en/pg07/5.jpg");
|
||||
put("GRC/Dauntless Dourbark", "https://img.scryfall.com/cards/large/en/pg07/12.jpg");
|
||||
put("GRC/Llanowar Elves", "https://img.scryfall.com/cards/large/en/pg07/9.jpg");
|
||||
put("GRC/Mind Stone", "https://img.scryfall.com/cards/large/en/pg07/11.jpg");
|
||||
put("GRC/Mogg Fanatic", "https://img.scryfall.com/cards/large/en/pg07/10.jpg");
|
||||
put("GRC/Reckless Wurm", "https://img.scryfall.com/cards/large/en/pg07/6.jpg");
|
||||
put("GRC/Yixlid Jailer", "https://img.scryfall.com/cards/large/en/pg07/7.jpg");
|
||||
put("GRC/Zoetic Cavern", "https://img.scryfall.com/cards/large/en/pg07/8.jpg");
|
||||
// 2008a - https://scryfall.com/sets/pg08
|
||||
put("GRC/Boggart Ram-Gang", "https://img.scryfall.com/cards/large/en/pg08/17.jpg");
|
||||
put("GRC/Cenn's Tactician", "https://img.scryfall.com/cards/large/en/pg08/14.jpg");
|
||||
put("GRC/Duergar Hedge-Mage", "https://img.scryfall.com/cards/large/en/pg08/19.jpg");
|
||||
put("GRC/Gravedigger", "https://img.scryfall.com/cards/large/en/pg08/16.jpg");
|
||||
put("GRC/Lava Axe", "https://img.scryfall.com/cards/large/en/pg08/13.jpg");
|
||||
put("GRC/Oona's Blackguard", "https://img.scryfall.com/cards/large/en/pg08/15.jpg");
|
||||
put("GRC/Selkie Hedge-Mage", "https://img.scryfall.com/cards/large/en/pg08/20.jpg");
|
||||
put("GRC/Wilt-Leaf Cavaliers", "https://img.scryfall.com/cards/large/en/pg08/18.jpg");
|
||||
|
||||
// Wizards Play Network Promos -- xmage uses one set (GRC), but scryfall store it by years
|
||||
// 2008b - https://scryfall.com/sets/pwpn
|
||||
put("GRC/Sprouting Thrinax", "https://img.scryfall.com/cards/large/en/pwpn/21.jpg");
|
||||
put("GRC/Woolly Thoctar", "https://img.scryfall.com/cards/large/en/pwpn/22.jpg");
|
||||
// 2009 - https://scryfall.com/sets/pwp09
|
||||
put("GRC/Hellspark Elemental", "https://img.scryfall.com/cards/large/en/pwp09/25.jpg");
|
||||
put("GRC/Kor Duelist", "https://img.scryfall.com/cards/large/en/pwp09/32.jpg");
|
||||
put("GRC/Marisi's Twinclaws", "https://img.scryfall.com/cards/large/en/pwp09/26.jpg");
|
||||
put("GRC/Mind Control", "https://img.scryfall.com/cards/large/en/pwp09/30.jpg");
|
||||
put("GRC/Path to Exile", "https://img.scryfall.com/cards/large/en/pwp09/24.jpg");
|
||||
put("GRC/Rise from the Grave", "https://img.scryfall.com/cards/large/en/pwp09/31.jpg");
|
||||
put("GRC/Slave of Bolas", "https://img.scryfall.com/cards/large/en/pwp09/27.jpg");
|
||||
put("GRC/Vampire Nighthawk", "https://img.scryfall.com/cards/large/en/pwp09/33.jpg");
|
||||
// 2010 - https://scryfall.com/sets/pwp10
|
||||
put("GRC/Kor Firewalker", "https://img.scryfall.com/cards/large/en/pwp10/36.jpg");
|
||||
put("GRC/Leatherback Baloth", "https://img.scryfall.com/cards/large/en/pwp10/37.jpg");
|
||||
put("GRC/Syphon Mind", "https://img.scryfall.com/cards/large/en/pwp10/40.jpg");
|
||||
put("GRC/Pathrazer of Ulamog", "https://img.scryfall.com/cards/large/en/pwp10/46.jpg");
|
||||
put("GRC/Curse of Wizardry", "https://img.scryfall.com/cards/large/en/pwp10/47.jpg");
|
||||
put("GRC/Fling/50", "https://img.scryfall.com/cards/large/en/pwp10/50.jpg"); // same card but different year
|
||||
put("GRC/Sylvan Ranger/51", "https://img.scryfall.com/cards/large/en/pwp10/51.jpg"); // same card but different year
|
||||
put("GRC/Plague Stinger", "https://img.scryfall.com/cards/large/en/pwp10/59.jpg");
|
||||
put("GRC/Golem's Heart", "https://img.scryfall.com/cards/large/en/pwp10/60.jpg");
|
||||
put("GRC/Skinrender", "https://img.scryfall.com/cards/large/en/pwp10/63.jpg");
|
||||
// 2011 - https://scryfall.com/sets/pwp11
|
||||
put("GRC/Auramancer", "https://img.scryfall.com/cards/large/en/pwp11/77.jpg");
|
||||
put("GRC/Bloodcrazed Neonate", "https://img.scryfall.com/cards/large/en/pwp11/83.jpg");
|
||||
put("GRC/Boneyard Wurm", "https://img.scryfall.com/cards/large/en/pwp11/84.jpg");
|
||||
put("GRC/Circle of Flame", "https://img.scryfall.com/cards/large/en/pwp11/78.jpg");
|
||||
put("GRC/Curse of the Bloody Tome", "https://img.scryfall.com/cards/large/en/pwp11/80.jpg");
|
||||
put("GRC/Fling/69", "https://img.scryfall.com/cards/large/en/pwp11/69.jpg"); // same card but different year
|
||||
put("GRC/Master's Call", "https://img.scryfall.com/cards/large/en/pwp11/64.jpg");
|
||||
put("GRC/Maul Splicer", "https://img.scryfall.com/cards/large/en/pwp11/72.jpg");
|
||||
put("GRC/Plague Myr", "https://img.scryfall.com/cards/large/en/pwp11/65.jpg");
|
||||
put("GRC/Shrine of Burning Rage", "https://img.scryfall.com/cards/large/en/pwp11/73.jpg");
|
||||
put("GRC/Signal Pest", "https://img.scryfall.com/cards/large/en/pwp11/66.jpg");
|
||||
put("GRC/Sylvan Ranger/70", "https://img.scryfall.com/cards/large/en/pwp11/70.jpg"); // same card but different year
|
||||
put("GRC/Tormented Soul", "https://img.scryfall.com/cards/large/en/pwp11/76.jpg");
|
||||
put("GRC/Vault Skirge", "https://img.scryfall.com/cards/large/en/pwp11/71.jpg");
|
||||
// 2012 - https://scryfall.com/sets/pwp12
|
||||
put("GRC/Curse of Thirst", "https://img.scryfall.com/cards/large/en/pwp12/81.jpg");
|
||||
put("GRC/Gather the Townsfolk", "https://img.scryfall.com/cards/large/en/pwp12/79.jpg");
|
||||
put("GRC/Nearheath Stalker", "https://img.scryfall.com/cards/large/en/pwp12/82.jpg");
|
||||
|
||||
// TODO: remove Grand Prix fix after scryfall fix image's link (that's link must be work: https://img.scryfall.com/cards/large/en/pgpx/2016b.jpg )
|
||||
put("GPX/Sword of Feast and Famine", "https://img.scryfall.com/cards/large/en/pgpx/1%E2%98%85.jpg");
|
||||
}
|
||||
};
|
||||
|
||||
public static String findScryfallSetCode(String xmageCode) {
|
||||
return xmageSetsToScryfall.getOrDefault(xmageCode, xmageCode).toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
public static Set<String> getSupportedSets() {
|
||||
return supportedSets;
|
||||
}
|
||||
|
||||
public static String findDirectDownloadLink(String setCode, String cardName, String cardNumber) {
|
||||
|
||||
// set/card/number
|
||||
String linkCode1 = setCode + "/" + cardName + "/" + cardNumber;
|
||||
if (directDownloadLinks.containsKey(linkCode1)) {
|
||||
return directDownloadLinks.get(linkCode1);
|
||||
}
|
||||
|
||||
// set/card
|
||||
String linkCode2 = setCode + "/" + cardName;
|
||||
if (directDownloadLinks.containsKey(linkCode2)) {
|
||||
return directDownloadLinks.get(linkCode2);
|
||||
}
|
||||
|
||||
// default
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
public class ScryfallImageSupportTokens {
|
||||
|
||||
private static final Map<String, String> supportedSets = new HashMap<>();
|
||||
|
||||
private static final Map<String, String> supportedCards = new HashMap<String, String>() {
|
||||
{
|
||||
// xmage token -> direct or api link:
|
||||
// examples:
|
||||
// direct example: https://img.scryfall.com/cards/large/en/trix/6.jpg
|
||||
// api example: https://api.scryfall.com/cards/trix/6/en?format=image
|
||||
// api example: https://api.scryfall.com/cards/trix/6?format=image
|
||||
// api format is primary
|
||||
//
|
||||
// code form for one token:
|
||||
// set/token_name
|
||||
//
|
||||
// code form for same name tokens (alternative images):
|
||||
// set/token_name/1
|
||||
// set/token_name/2
|
||||
|
||||
// RIX
|
||||
put("RIX/City's Blessing", "https://api.scryfall.com/cards/trix/6/en?format=image"); // TODO: missing from tokens data
|
||||
put("RIX/Elemental/1", "https://api.scryfall.com/cards/trix/1/en?format=image");
|
||||
put("RIX/Elemental/2", "https://api.scryfall.com/cards/trix/2/en?format=image");
|
||||
put("RIX/Golem", "https://api.scryfall.com/cards/trix/4/en?format=image");
|
||||
put("RIX/Emblem Huatli, Radiant Champion", "https://api.scryfall.com/cards/trix/5/en?format=image");
|
||||
put("RIX/Saproling", "https://api.scryfall.com/cards/trix/3/en?format=image");
|
||||
|
||||
// RNA
|
||||
put("RNA/Beast", "https://api.scryfall.com/cards/trna/8/en?format=image");
|
||||
put("RNA/Centaur", "https://api.scryfall.com/cards/trna/5/en?format=image");
|
||||
put("RNA/Emblem Domri, Chaos Bringer", "https://api.scryfall.com/cards/trna/13/en?format=image");
|
||||
put("RNA/Frog Lizard", "https://api.scryfall.com/cards/trna/6/en?format=image");
|
||||
put("RNA/Goblin", "https://api.scryfall.com/cards/trna/4/en?format=image");
|
||||
put("RNA/Human", "https://api.scryfall.com/cards/trna/1/en?format=image");
|
||||
put("RNA/Illusion", "https://api.scryfall.com/cards/trna/2/en?format=image");
|
||||
put("RNA/Ooze", "https://api.scryfall.com/cards/trna/7/en?format=image");
|
||||
put("RNA/Sphinx", "https://api.scryfall.com/cards/trna/9/en?format=image");
|
||||
put("RNA/Spirit", "https://api.scryfall.com/cards/trna/10/en?format=image");
|
||||
put("RNA/Thopter", "https://api.scryfall.com/cards/trna/11/en?format=image");
|
||||
put("RNA/Treasure", "https://api.scryfall.com/cards/trna/12/en?format=image");
|
||||
put("RNA/Zombie", "https://api.scryfall.com/cards/trna/3/en?format=image");
|
||||
|
||||
|
||||
// generate supported sets
|
||||
supportedSets.clear();
|
||||
for (String cardName : this.keySet()) {
|
||||
String[] s = cardName.split("\\/");
|
||||
if (s.length > 1) {
|
||||
supportedSets.putIfAbsent(s[0], s[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public static Map<String, String> getSupportedSets() {
|
||||
return supportedSets;
|
||||
}
|
||||
|
||||
public static String findTokenLink(String setCode, String tokenName, Integer tokenNumber) {
|
||||
String search = setCode + "/" + tokenName + (!tokenNumber.equals(0) ? "/" + tokenNumber : "");
|
||||
return supportedCards.getOrDefault(search, null);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,11 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
import org.mage.plugins.card.images.DownloadPicturesService;
|
||||
import org.mage.plugins.card.utils.CardImageUtils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
|
@ -8,21 +13,9 @@ import java.io.InputStreamReader;
|
|||
import java.net.Proxy;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import mage.constants.SubType;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
import org.mage.plugins.card.images.DownloadPicturesService;
|
||||
import org.mage.plugins.card.utils.CardImageUtils;
|
||||
|
||||
/**
|
||||
* @author Quercitron
|
||||
*/
|
||||
|
|
@ -58,7 +51,7 @@ public enum TokensMtgImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -160,7 +153,12 @@ public enum TokensMtgImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean isImageProvided(String setCode, String cardName) {
|
||||
public boolean isCardImageProvided(String setCode, String cardName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTokenImageProvided(String setCode, String cardName, Integer tokenNumber) {
|
||||
String searchName = cardName;
|
||||
if (cardName.toLowerCase(Locale.ENGLISH).contains("emblem")) {
|
||||
searchName = getEmblemName(cardName);
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ public enum WizardCardsImageSource implements CardImageSource {
|
|||
}
|
||||
|
||||
@Override
|
||||
public CardImageUrls generateURL(CardDownloadData card) throws Exception {
|
||||
public CardImageUrls generateCardUrl(CardDownloadData card) throws Exception {
|
||||
String collectorId = card.getCollectorId();
|
||||
String cardSet = card.getSet();
|
||||
if (collectorId == null || cardSet == null) {
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ import net.java.truevfs.access.TVFS;
|
|||
import net.java.truevfs.kernel.spec.FsSyncException;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.plugins.card.dl.sources.*;
|
||||
import org.mage.plugins.card.properties.SettingsManager;
|
||||
import org.mage.plugins.card.utils.CardImageUtils;
|
||||
|
||||
import javax.swing.*;
|
||||
|
|
@ -45,10 +44,10 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
private static DownloadPicturesService instance;
|
||||
private static final Logger logger = Logger.getLogger(DownloadPicturesService.class);
|
||||
|
||||
public static final String ALL_IMAGES = "- ALL images from selected source (can be slow)";
|
||||
public static final String ALL_MODERN_IMAGES = "- MODERN images (can be slow)";
|
||||
public static final String ALL_STANDARD_IMAGES = "- STANDARD images";
|
||||
public static final String ALL_TOKENS = "- TOKEN images";
|
||||
private static final String ALL_IMAGES = "- ALL images from selected source (can be slow)";
|
||||
private static final String ALL_MODERN_IMAGES = "- MODERN images (can be slow)";
|
||||
private static final String ALL_STANDARD_IMAGES = "- STANDARD images";
|
||||
private static final String ALL_TOKENS = "- TOKEN images";
|
||||
|
||||
private DownloadImagesDialog uiDialog;
|
||||
private boolean needCancel;
|
||||
|
|
@ -60,16 +59,16 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
private int missingCardsCount = 0;
|
||||
private int missingTokensCount = 0;
|
||||
|
||||
List<String> selectedSets = new ArrayList<>();
|
||||
private List<String> selectedSets = new ArrayList<>();
|
||||
private static CardImageSource selectedSource;
|
||||
|
||||
private final Object sync = new Object();
|
||||
private Proxy p = Proxy.NO_PROXY;
|
||||
|
||||
enum DownloadSources {
|
||||
WIZARDS("1. wizards.com - low quality CARDS, multi-language, can be SLOW", WizardCardsImageSource.instance),
|
||||
WIZARDS("1. wizards.com - low quality CARDS, multi-language, slow download", WizardCardsImageSource.instance),
|
||||
TOKENS("2. tokens.mtg.onl - high quality TOKENS", TokensMtgImageSource.instance),
|
||||
SCRYFALL("3. scryfall.com - high quality CARDS, multi-language", ScryfallImageSource.instance),
|
||||
SCRYFALL("3. scryfall.com - high quality CARDS and TOKENS, multi-language", ScryfallImageSource.instance),
|
||||
MAGIDEX("4. magidex.com - high quality CARDS", MagidexImageSource.instance),
|
||||
GRAB_BAG("5. GrabBag - STAR WARS cards and tokens", GrabbagImageSource.instance),
|
||||
MYTHICSPOILER("6. mythicspoiler.com", MythicspoilerComSource.instance),
|
||||
|
|
@ -333,7 +332,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
int numberCardImagesAvailable = 0;
|
||||
for (CardDownloadData data : cardsMissing) {
|
||||
if (data.isToken()) {
|
||||
if (selectedSource.isTokenSource() && selectedSource.isImageProvided(data.getSet(), data.getName())) {
|
||||
if (selectedSource.isTokenSource() && selectedSource.isTokenImageProvided(data.getSet(), data.getName(), data.getType())) {
|
||||
numberTokenImagesAvailable++;
|
||||
cardsDownloadQueue.add(data);
|
||||
} else {
|
||||
|
|
@ -341,7 +340,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
}
|
||||
} else {
|
||||
if (selectedSets != null && selectedSets.contains(data.getSet())) {
|
||||
if (selectedSource.isSetSupportedComplete(data.getSet()) || selectedSource.isImageProvided(data.getSet(), data.getName())) {
|
||||
if (selectedSource.isSetSupportedComplete(data.getSet()) || selectedSource.isCardImageProvided(data.getSet(), data.getName())) {
|
||||
numberCardImagesAvailable++;
|
||||
cardsDownloadQueue.add(data);
|
||||
}
|
||||
|
|
@ -393,7 +392,6 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
}
|
||||
|
||||
private static List<CardDownloadData> prepareMissingCards(List<CardInfo> allCards, boolean redownloadMode) {
|
||||
HashSet<String> ignoreUrls = SettingsManager.getIntance().getIgnoreUrls();
|
||||
|
||||
// get filter for Standard Type 2 cards
|
||||
Set<String> type2SetsFilter = new HashSet<>();
|
||||
|
|
@ -408,8 +406,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
List<CardDownloadData> allCardsUrls = Collections.synchronizedList(new ArrayList<>());
|
||||
try {
|
||||
allCards.parallelStream().forEach(card -> {
|
||||
if (!card.getCardNumber().isEmpty() && !"0".equals(card.getCardNumber()) && !card.getSetCode().isEmpty()
|
||||
&& !ignoreUrls.contains(card.getSetCode())) {
|
||||
if (!card.getCardNumber().isEmpty() && !"0".equals(card.getCardNumber()) && !card.getSetCode().isEmpty()) {
|
||||
String cardName = card.getName();
|
||||
boolean isType2 = type2SetsFilter.contains(card.getSetCode());
|
||||
CardDownloadData url = new CardDownloadData(cardName, card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, "", "", false, card.isDoubleFaced(), card.isNightCard());
|
||||
|
|
@ -498,7 +495,7 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
if (params.length >= 5) {
|
||||
int type = 0;
|
||||
if (params[4] != null && !params[4].isEmpty()) {
|
||||
type = Integer.parseInt(params[4].trim());
|
||||
type = Integer.parseInt(params[4].trim()); // token number for same names
|
||||
}
|
||||
String fileName = "";
|
||||
if (params.length > 5 && params[5] != null && !params[5].isEmpty()) {
|
||||
|
|
@ -547,6 +544,16 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
logger.error(ex);
|
||||
throw new RuntimeException("DownloadPicturesService : readFile() error");
|
||||
}
|
||||
|
||||
// TODO: delete and move to copy-pate images download mode
|
||||
/*
|
||||
for (CardDownloadData card : list) {
|
||||
if (card.isToken()) {
|
||||
System.out.println(card.getSet() + "/" + card.getName() + (!card.getType().equals(0) ? "/" + card.getType() : ""));
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
|
@ -586,8 +593,6 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
}
|
||||
|
||||
if (p != null) {
|
||||
HashSet<String> ignoreUrls = SettingsManager.getIntance().getIgnoreUrls();
|
||||
|
||||
update(0, cardsDownloadQueue.size());
|
||||
logger.info("Started download of " + cardsDownloadQueue.size() + " images"
|
||||
+ " from source: " + selectedSource.getSourceName()
|
||||
|
|
@ -602,13 +607,13 @@ public class DownloadPicturesService extends DefaultBoundedRangeModel implements
|
|||
logger.debug("Downloading image: " + card.getName() + " (" + card.getSet() + ')');
|
||||
|
||||
CardImageUrls urls;
|
||||
if (ignoreUrls.contains(card.getSet()) || card.isToken()) {
|
||||
if (card.isToken()) {
|
||||
if (!"0".equals(card.getCollectorId())) {
|
||||
continue;
|
||||
}
|
||||
urls = selectedSource.generateTokenUrl(card);
|
||||
} else {
|
||||
urls = selectedSource.generateURL(card);
|
||||
urls = selectedSource.generateCardUrl(card);
|
||||
}
|
||||
|
||||
if (urls == null) {
|
||||
|
|
@ -929,7 +934,7 @@ class LoadMissingCardDataNew implements Runnable {
|
|||
private static DownloadPicturesService downloadPicturesService;
|
||||
|
||||
public LoadMissingCardDataNew(DownloadPicturesService downloadPicturesService) {
|
||||
this.downloadPicturesService = downloadPicturesService;
|
||||
LoadMissingCardDataNew.downloadPicturesService = downloadPicturesService;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -940,5 +945,4 @@ class LoadMissingCardDataNew implements Runnable {
|
|||
public static void main() {
|
||||
(new Thread(new LoadMissingCardDataNew(downloadPicturesService))).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,76 +0,0 @@
|
|||
package org.mage.plugins.card.properties;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Properties;
|
||||
import mage.client.constants.Constants;
|
||||
|
||||
public class SettingsManager {
|
||||
|
||||
private static SettingsManager settingsManager = null;
|
||||
|
||||
public static synchronized SettingsManager getIntance() {
|
||||
if (settingsManager == null) {
|
||||
settingsManager = new SettingsManager();
|
||||
}
|
||||
return settingsManager;
|
||||
}
|
||||
|
||||
private SettingsManager() {
|
||||
loadImageProperties();
|
||||
}
|
||||
|
||||
public void reloadImageProperties() {
|
||||
loadImageProperties();
|
||||
}
|
||||
|
||||
private void loadImageProperties() {
|
||||
imageUrlProperties = new Properties();
|
||||
try {
|
||||
InputStream is = SettingsManager.class.getClassLoader().getResourceAsStream(Constants.IO.IMAGE_PROPERTIES_FILE);
|
||||
if (is == null) {
|
||||
throw new RuntimeException("Couldn't load " + Constants.IO.IMAGE_PROPERTIES_FILE);
|
||||
}
|
||||
imageUrlProperties.load(is);
|
||||
} catch (IOException ioe) {
|
||||
ioe.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public String getSetNameReplacement(String setName) {
|
||||
String result = setName;
|
||||
if (imageUrlProperties != null) {
|
||||
result = imageUrlProperties.getProperty(setName, setName);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public HashSet<String> getIgnoreUrls() {
|
||||
HashSet<String> ignoreUrls = new HashSet<>();
|
||||
if (imageUrlProperties != null) {
|
||||
String result = imageUrlProperties.getProperty("ignore.urls");
|
||||
if (result != null) {
|
||||
String[] ignore = result.split(",");
|
||||
ignoreUrls.addAll(Arrays.asList(ignore));
|
||||
}
|
||||
}
|
||||
return ignoreUrls;
|
||||
}
|
||||
|
||||
public ArrayList<String> getTokenLookupOrder() {
|
||||
ArrayList<String> order = new ArrayList<>();
|
||||
if (imageUrlProperties != null) {
|
||||
String result = imageUrlProperties.getProperty("token.lookup.order");
|
||||
if (result != null) {
|
||||
String[] sets = result.split(",");
|
||||
order.addAll(Arrays.asList(sets));
|
||||
}
|
||||
}
|
||||
return order;
|
||||
}
|
||||
|
||||
private Properties imageUrlProperties;
|
||||
}
|
||||
|
|
@ -1,5 +1,16 @@
|
|||
package org.mage.plugins.card.utils;
|
||||
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.constants.Constants;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.remote.Connection;
|
||||
import mage.remote.Connection.ProxyType;
|
||||
import net.java.truevfs.access.TFile;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
|
@ -12,18 +23,6 @@ import java.util.HashMap;
|
|||
import java.util.Locale;
|
||||
import java.util.prefs.Preferences;
|
||||
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.constants.Constants;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.remote.Connection;
|
||||
import mage.remote.Connection.ProxyType;
|
||||
import net.java.truevfs.access.TFile;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
import org.mage.plugins.card.properties.SettingsManager;
|
||||
|
||||
public final class CardImageUtils {
|
||||
|
||||
private static final HashMap<CardDownloadData, String> pathCache = new HashMap<>();
|
||||
|
|
@ -53,7 +52,7 @@ public final class CardImageUtils {
|
|||
return filePath;
|
||||
}
|
||||
|
||||
log.warn("Token image file not found. Set: " + card.getSet() + " Token Set Code: " + card.getTokenSetCode() + " Name: " + card.getName() + " File path: " + filePath);
|
||||
log.warn("Token image file not found. Set: " + card.getSet() + " Token Set Code: " + card.getTokenSetCode() + " Name: " + card.getName() + " File path: " + getTokenImagePath(card));
|
||||
} else {
|
||||
log.warn("Trying to get token path for non token card. Set: " + card.getSet() + " Set Code: " + card.getTokenSetCode() + " Name: " + card.getName());
|
||||
}
|
||||
|
|
@ -85,20 +84,6 @@ public final class CardImageUtils {
|
|||
}
|
||||
}
|
||||
return filename;
|
||||
|
||||
// makes no longer sense
|
||||
// file = new TFile(filename);
|
||||
// if (!file.exists()) {
|
||||
// CardDownloadData updated = new CardDownloadData(card);
|
||||
// updated.setName(card.getName() + " 1");
|
||||
// filename = buildImagePathToCard(updated);
|
||||
// file = new TFile(filename);
|
||||
// if (!file.exists()) {
|
||||
// updated = new CardDownloadData(card);
|
||||
// updated.setName(card.getName() + " 2");
|
||||
// filename = buildImagePathToCard(updated);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private static String searchForCardImage(CardDownloadData card) {
|
||||
|
|
@ -112,30 +97,9 @@ public final class CardImageUtils {
|
|||
pathCache.put(card, path);
|
||||
return path;
|
||||
}
|
||||
|
||||
// for (String set : SettingsManager.getIntance().getTokenLookupOrder()) {
|
||||
// c.setSet(set);
|
||||
// path = getTokenImagePath(c);
|
||||
// file = new TFile(path);
|
||||
// if (file.exists()) {
|
||||
// pathCache.put(card, path);
|
||||
// return path;
|
||||
// }
|
||||
// }
|
||||
return generateTokenDescriptorImagePath(card);
|
||||
}
|
||||
|
||||
public static String updateSet(String cardSet, boolean forUrl) {
|
||||
String set = cardSet.toLowerCase(Locale.ENGLISH);
|
||||
if (set.equals("con")) {
|
||||
set = "cfx";
|
||||
}
|
||||
if (forUrl) {
|
||||
set = SettingsManager.getIntance().getSetNameReplacement(set);
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
public static String prepareCardNameForFile(String cardName) {
|
||||
return cardName.replace(":", "").replace("\"", "").replace("//", "-");
|
||||
}
|
||||
|
|
@ -182,7 +146,7 @@ public final class CardImageUtils {
|
|||
throw new IllegalArgumentException("Card " + card.getName() + " have empty set.");
|
||||
}
|
||||
|
||||
String set = updateSet(card.getSet(), false).toUpperCase(Locale.ENGLISH); // TODO: research auto-replace... old code?
|
||||
String set = card.getSet().toUpperCase(Locale.ENGLISH);
|
||||
|
||||
if (card.isToken()) {
|
||||
return buildImagePathToSetAsToken(set);
|
||||
|
|
@ -211,7 +175,7 @@ public final class CardImageUtils {
|
|||
|
||||
String prefixType = "";
|
||||
if (card.getType() != 0) {
|
||||
prefixType = " " + Integer.toString(card.getType());
|
||||
prefixType = " " + card.getType();
|
||||
}
|
||||
|
||||
String cardName = card.getFileName();
|
||||
|
|
@ -228,6 +192,7 @@ public final class CardImageUtils {
|
|||
finalFileName = cardName + prefixType + ".full.jpg";
|
||||
}
|
||||
|
||||
/* 2019-01-12: no needs in name corrections, all files must be same and auto-downloaded
|
||||
// if image file exists, correct name (for case sensitive systems)
|
||||
// use TFile for zips
|
||||
TFile dirFile = new TFile(setPath);
|
||||
|
|
@ -246,6 +211,7 @@ public final class CardImageUtils {
|
|||
} catch (Exception ex) {
|
||||
log.error("Can't read card name from file, may be it broken: " + setPath);
|
||||
}
|
||||
*/
|
||||
|
||||
return setPath + finalFileName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@
|
|||
|Generate|EMBLEM:MMA|Elspeth, Knight Errant||Emblem Elspeth|ElspethKnightErrantEmblem|
|
||||
|Generate|EMBLEM:SWS|Obi-Wan Kenobi||Emblem Obi-Wan Kenobi|ObiWanKenobiEmblem|
|
||||
|Generate|EMBLEM:RIX|Huatli, Radiant Champion||Emblem Huatli|HuatliRadiantChampionEmblem|
|
||||
|Generate|EMBLEM:RNA|Domri, Chaos Bringer||Emblem Domri|DomriChaosBringerEmblem|
|
||||
|Generate|PLANE:PCA|Plane - Academy At Tolaria West|||AcademyAtTolariaWestPlane|
|
||||
|Generate|PLANE:PCA|Plane - Agyrem|||AgyremPlane|
|
||||
|Generate|PLANE:PCA|Plane - Akoum|||AkoumPlane|
|
||||
|
|
@ -1185,3 +1186,15 @@
|
|||
|Generate|TOK:ZEN|Vampire||
|
||||
|Generate|TOK:ZEN|Wolf|||WolfToken|
|
||||
|Generate|TOK:ZEN|Zombie Giant|||QuestForTheGravelordZombieToken|
|
||||
|Generate|TOK:RNA|Beast|||RedGreenBeastToken|
|
||||
|Generate|TOK:RNA|Centaur|||CentaurToken|
|
||||
|Generate|TOK:RNA|Frog Lizard|||FrogLizardToken|
|
||||
|Generate|TOK:RNA|Goblin|||GoblinToken|
|
||||
|Generate|TOK:RNA|Human|||HumanToken|
|
||||
|Generate|TOK:RNA|Illusion|||MesmerizingBenthidToken|
|
||||
|Generate|TOK:RNA|Ooze|||BiogenicOozeToken|
|
||||
|Generate|TOK:RNA|Sphinx|||WardenSphinxToken|
|
||||
|Generate|TOK:RNA|Spirit|||SpiritWhiteToken|
|
||||
|Generate|TOK:RNA|Thopter|||ThopterToken|
|
||||
|Generate|TOK:RNA|Treasure|||TreasureToken|
|
||||
|Generate|TOK:RNA|Zombie|||ZombieToken|
|
||||
|
|
@ -1,78 +0,0 @@
|
|||
tsp=ts
|
||||
tor=tr
|
||||
mor=mt
|
||||
ody=od
|
||||
lrw=lw
|
||||
plc=pc
|
||||
gpt=gp
|
||||
inv=in
|
||||
ons=on
|
||||
scg=sc
|
||||
jud=ju
|
||||
mmq=mm
|
||||
pls=ps
|
||||
mrd=mi
|
||||
mir=mr
|
||||
tst=ts
|
||||
usg=us
|
||||
apc=ap
|
||||
nem=ne
|
||||
dis=di
|
||||
vis=vi
|
||||
9ed=9e
|
||||
8ed=8e
|
||||
7ed=7e
|
||||
4ed=4e
|
||||
tsb=tsts
|
||||
ulg=ul
|
||||
5ed=5e
|
||||
6ed=6e
|
||||
btd=bd
|
||||
sth=sh
|
||||
por=po
|
||||
s99=st
|
||||
lgn=le
|
||||
ice=ia
|
||||
csp=cs
|
||||
tmp=tp
|
||||
s00=st2k
|
||||
dst=ds
|
||||
pcy=pr
|
||||
uds=ud
|
||||
exo=ex
|
||||
lea=al
|
||||
hop=pch
|
||||
chr=ch
|
||||
arn=an
|
||||
wth=wl
|
||||
leb=be
|
||||
2ed=un
|
||||
3ed=rv
|
||||
brb=br
|
||||
atq=aq
|
||||
fem=fe
|
||||
leg=lg
|
||||
hml=hl
|
||||
all=ai
|
||||
drk=dk
|
||||
ptk=p3k
|
||||
gur=guru
|
||||
ddc=dvd
|
||||
dd2=jvc
|
||||
ddd=gvl
|
||||
unh=uh
|
||||
dde=pvc
|
||||
v09=fve
|
||||
v10=fvr
|
||||
v11=fvl
|
||||
drb=fvd
|
||||
h09=pds
|
||||
ugl=ug
|
||||
dd3dvd=ddadvd
|
||||
dd3evg=ddaevg
|
||||
dd3gvl=ddagvl
|
||||
dd3jvc=ddajvc
|
||||
# Remove setname as soon as the images can be downloaded
|
||||
ignore.urls=TOK,H17
|
||||
# sets ordered by release time (newest goes first)
|
||||
token.lookup.order=C18,M19,A25,DOM,E02,RIX,UST,XLN,IMA,H17,C17,V17,E01,DDT,CMA,HOU,MM3,DDS,AKH,DD3DVD,DD3EVG,DD3GVL,DD3JVC,H09,AER,PCA,C16,V16,MPS,KLD,DDR,CN2,EMN,EMA,SOI,DDQ,CP,CMA,ARENA,SUS,APAC,EURO,UGIN,C15,OGW,EXP,DDP,BFZ,DRB,V09,V10,V11,V12,V13,V14,V15,TPR,MPRP,DD3,DDO,ORI,MM2,PTC,DTK,FRF,KTK,M15,VMA,CNS,JOU,BNG,THS,DDL,M14,MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,DDE,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK,GRC
|
||||
|
|
@ -80,7 +80,7 @@ public class SessionImpl implements Session {
|
|||
// handling.
|
||||
public interface RemotingTask {
|
||||
|
||||
public boolean run() throws Throwable;
|
||||
boolean run() throws Throwable;
|
||||
}
|
||||
|
||||
// handleRemotingTaskExceptions runs the given task and handles exceptions appropriately. This
|
||||
|
|
@ -223,7 +223,7 @@ public class SessionImpl implements Session {
|
|||
|
||||
@Override
|
||||
public Optional<String> getServerHostname() {
|
||||
return isConnected() ? Optional.of(connection.getHost()) : Optional.<String>empty();
|
||||
return isConnected() ? Optional.of(connection.getHost()) : Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -392,26 +392,22 @@ public class SessionImpl implements Session {
|
|||
}
|
||||
|
||||
private void updateDatabase(boolean forceDBComparison, ServerState serverState) {
|
||||
long cardDBVersion = CardRepository.instance.getContentVersionFromDB();
|
||||
if (forceDBComparison || serverState.getCardsContentVersion() > cardDBVersion) {
|
||||
List<String> classNames = CardRepository.instance.getClassNames();
|
||||
List<CardInfo> cards = server.getMissingCardsData(classNames);
|
||||
CardRepository.instance.addCards(cards);
|
||||
CardRepository.instance.setContentVersion(serverState.getCardsContentVersion());
|
||||
logger.info("Updating client cards DB - existing cards: " + classNames.size() + " new cards: " + cards.size()
|
||||
+ " content versions - server: " + serverState.getCardsContentVersion() + " client: " + cardDBVersion);
|
||||
}
|
||||
|
||||
// sets
|
||||
long expansionDBVersion = ExpansionRepository.instance.getContentVersionFromDB();
|
||||
if (forceDBComparison || serverState.getExpansionsContentVersion() > expansionDBVersion) {
|
||||
List<String> setCodes = ExpansionRepository.instance.getSetCodes();
|
||||
List<ExpansionInfo> expansions = server.getMissingExpansionData(setCodes);
|
||||
for (ExpansionInfo expansion : expansions) {
|
||||
ExpansionRepository.instance.add(expansion);
|
||||
}
|
||||
ExpansionRepository.instance.setContentVersion(serverState.getExpansionsContentVersion());
|
||||
logger.info("Updating client expansions DB - existing sets: " + setCodes.size() + " new sets: " + expansions.size()
|
||||
+ " content versions - server: " + serverState.getExpansionsContentVersion() + " client: " + expansionDBVersion);
|
||||
logger.info("DB: updating sets... Founded new: " + expansions.size());
|
||||
ExpansionRepository.instance.saveSets(expansions, null, serverState.getExpansionsContentVersion());
|
||||
}
|
||||
|
||||
// cards
|
||||
long cardDBVersion = CardRepository.instance.getContentVersionFromDB();
|
||||
if (forceDBComparison || serverState.getCardsContentVersion() > cardDBVersion) {
|
||||
List<String> classNames = CardRepository.instance.getClassNames();
|
||||
List<CardInfo> cards = server.getMissingCardsData(classNames);
|
||||
logger.info("DB: updating cards... Founded new: " + cards.size());
|
||||
CardRepository.instance.saveCards(cards, serverState.getCardsContentVersion());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,7 @@
|
|||
|
||||
package mage.view;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.cards.Card;
|
||||
|
|
@ -32,8 +25,10 @@ import mage.players.Player;
|
|||
import mage.watchers.common.CastSpellLastTurnWatcher;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class GameView implements Serializable {
|
||||
|
|
@ -90,7 +85,7 @@ public class GameView implements Serializable {
|
|||
if (object != null) {
|
||||
if (object instanceof Permanent) {
|
||||
boolean controlled = ((Permanent) object).getControllerId().equals(createdForPlayerId);
|
||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, ((Permanent) object).getName(), new CardView(((Permanent) object), game, controlled, false, false)));
|
||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, object.getName(), new CardView(((Permanent) object), game, controlled, false, false)));
|
||||
} else {
|
||||
stack.put(stackObject.getId(), new StackAbilityView(game, (StackAbility) stackObject, card.getName(), new CardView(card, game, false, false, false)));
|
||||
}
|
||||
|
|
@ -109,14 +104,14 @@ public class GameView implements Serializable {
|
|||
} else if (object instanceof Emblem) {
|
||||
CardView cardView = new CardView(new EmblemView((Emblem) object));
|
||||
// Card sourceCard = (Card) ((Emblem) object).getSourceObject();
|
||||
((StackAbility) stackObject).setName(((Emblem) object).getName());
|
||||
stackObject.setName(object.getName());
|
||||
// ((StackAbility) stackObject).setExpansionSetCode(sourceCard.getExpansionSetCode());
|
||||
stack.put(stackObject.getId(),
|
||||
new StackAbilityView(game, (StackAbility) stackObject, object.getName(), cardView));
|
||||
checkPaid(stackObject.getId(), ((StackAbility) stackObject));
|
||||
} else if (object instanceof Plane) {
|
||||
CardView cardView = new CardView(new PlaneView((Plane) object));
|
||||
((StackAbility) stackObject).setName(((Plane) object).getName());
|
||||
stackObject.setName(object.getName());
|
||||
stack.put(stackObject.getId(),
|
||||
new StackAbilityView(game, (StackAbility) stackObject, object.getName(), cardView));
|
||||
checkPaid(stackObject.getId(), ((StackAbility) stackObject));
|
||||
|
|
@ -131,7 +126,7 @@ public class GameView implements Serializable {
|
|||
} else if (object instanceof StackAbility) {
|
||||
StackAbility stackAbility = ((StackAbility) object);
|
||||
stackAbility.newId();
|
||||
stack.put(stackObject.getId(), new CardView(((StackAbility) stackObject)));
|
||||
stack.put(stackObject.getId(), new CardView(stackObject));
|
||||
checkPaid(stackObject.getId(), ((StackAbility) stackObject));
|
||||
} else {
|
||||
LOGGER.fatal("Object can't be cast to StackAbility: " + object.getName() + ' ' + object.toString() + ' ' + object.getClass().toString());
|
||||
|
|
@ -182,7 +177,7 @@ public class GameView implements Serializable {
|
|||
this.special = false;
|
||||
}
|
||||
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
|
||||
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
|
||||
if (watcher != null) {
|
||||
spellsCastCurrentTurn = watcher.getAmountOfSpellsAllPlayersCastOnCurrentTurn();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,9 @@ public class FreeformCommander extends Constructed {
|
|||
for (ExpansionSet set : Sets.getInstance().values()) {
|
||||
setCodes.add(set.getCode());
|
||||
}
|
||||
|
||||
// no banned cards
|
||||
this.banned.clear();
|
||||
}
|
||||
|
||||
public FreeformCommander(String name) {
|
||||
|
|
|
|||
|
|
@ -1,28 +1,12 @@
|
|||
|
||||
package mage.player.ai;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.FutureTask;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.ActivatedAbility;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.PassAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.SearchEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.DoubleStrikeAbility;
|
||||
import mage.abilities.keyword.ExaltedAbility;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.IndestructibleAbility;
|
||||
import mage.abilities.keyword.ReachAbility;
|
||||
import mage.abilities.keyword.*;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.choices.Choice;
|
||||
|
|
@ -49,8 +33,11 @@ import mage.target.Targets;
|
|||
import mage.util.RandomUtil;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author nantuko
|
||||
*/
|
||||
public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
||||
|
|
@ -180,10 +167,9 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
if (!suggested.isEmpty() && !(ability instanceof PassAbility)) {
|
||||
Iterator<String> it = suggested.iterator();
|
||||
while (it.hasNext()) {
|
||||
Card card = game.getCard(ability.getSourceId());
|
||||
String action = it.next();
|
||||
logger.info("Suggested action=" + action + ";card=" + card);
|
||||
if (action.equals(card.getName())) {
|
||||
Card card = game.getCard(ability.getSourceId());
|
||||
if (card != null && action.equals(card.getName())) {
|
||||
logger.info("-> removed from suggested=" + action);
|
||||
it.remove();
|
||||
}
|
||||
|
|
@ -930,7 +916,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
String line = scanner.nextLine();
|
||||
if (line.startsWith("cast:")
|
||||
|| line.startsWith("play:")) {
|
||||
suggested.add(line.substring(5, line.length()));
|
||||
suggested.add(line.substring(5));
|
||||
}
|
||||
}
|
||||
System.out.println("suggested::");
|
||||
|
|
@ -953,7 +939,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
|||
if (action != null
|
||||
&& (action.startsWith("cast:")
|
||||
|| action.startsWith("play:"))) {
|
||||
suggested.add(action.substring(5, action.length()));
|
||||
suggested.add(action.substring(5));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
package mage.player.ai;
|
||||
|
||||
import mage.MageObject;
|
||||
|
|
@ -25,7 +24,6 @@ import java.util.*;
|
|||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class SimulatedPlayer2 extends ComputerPlayer {
|
||||
|
|
@ -173,6 +171,7 @@ public class SimulatedPlayer2 extends ComputerPlayer {
|
|||
// allActions.add(new SimulatedAction(sim, actions));
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* if suggested abilities exist, return only those from playables
|
||||
*
|
||||
|
|
@ -191,11 +190,13 @@ public class SimulatedPlayer2 extends ComputerPlayer {
|
|||
List<Ability> filtered = new ArrayList<>();
|
||||
for (Ability ability : playables) {
|
||||
Card card = game.getCard(ability.getSourceId());
|
||||
for (String s : suggested) {
|
||||
if (s.equals(card.getName())) {
|
||||
logger.debug("matched: " + s);
|
||||
forced = true;
|
||||
filtered.add(ability);
|
||||
if (card != null) {
|
||||
for (String s : suggested) {
|
||||
if (s.equals(card.getName())) {
|
||||
logger.debug("matched: " + s);
|
||||
forced = true;
|
||||
filtered.add(ability);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -216,26 +217,28 @@ public class SimulatedPlayer2 extends ComputerPlayer {
|
|||
for (Ability option : options) {
|
||||
if (!option.getTargets().isEmpty() && option.getTargets().get(0).getMaxNumberOfTargets() == 1) {
|
||||
Card card = game.getCard(ability.getSourceId());
|
||||
for (String s : suggested) {
|
||||
String[] groups = s.split(";");
|
||||
logger.trace("s=" + s + ";groups=" + groups.length);
|
||||
if (groups.length == 2) {
|
||||
if (groups[0].equals(card.getName()) && groups[1].startsWith("name=")) {
|
||||
// extract target and compare to suggested
|
||||
String targetName = groups[1].split("=")[1];
|
||||
Player player = game.getPlayer(option.getFirstTarget());
|
||||
if (player != null && targetName.equals(player.getName())) {
|
||||
System.out.println("matched(option): " + s);
|
||||
filtered.add(option);
|
||||
return filtered;
|
||||
} else {
|
||||
Card target = game.getCard(option.getFirstTarget());
|
||||
if (target != null && target.getName().equals(targetName)) {
|
||||
if (card != null) {
|
||||
for (String s : suggested) {
|
||||
String[] groups = s.split(";");
|
||||
logger.trace("s=" + s + ";groups=" + groups.length);
|
||||
if (groups.length == 2) {
|
||||
if (groups[0].equals(card.getName()) && groups[1].startsWith("name=")) {
|
||||
// extract target and compare to suggested
|
||||
String targetName = groups[1].split("=")[1];
|
||||
Player player = game.getPlayer(option.getFirstTarget());
|
||||
if (player != null && targetName.equals(player.getName())) {
|
||||
System.out.println("matched(option): " + s);
|
||||
filtered.add(option);
|
||||
return filtered;
|
||||
} else {
|
||||
Card target = game.getCard(option.getFirstTarget());
|
||||
if (target != null && target.getName().equals(targetName)) {
|
||||
System.out.println("matched(option): " + s);
|
||||
filtered.add(option);
|
||||
return filtered;
|
||||
}
|
||||
System.out.println("not equal UUID for target, player=" + player);
|
||||
}
|
||||
System.out.println("not equal UUID for target, player=" + player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,26 @@
|
|||
package mage.player.ai.utils;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.*;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetAttackingCreature;
|
||||
import mage.target.common.TargetAttackingOrBlockingCreature;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.*;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.common.DamageWithPowerTargetEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.ExileTargetEffect;
|
||||
import mage.abilities.effects.common.ExileUntilSourceLeavesEffect;
|
||||
import mage.abilities.effects.common.FightTargetsEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostTargetEffect;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubType;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetAttackingCreature;
|
||||
import mage.target.common.TargetAttackingOrBlockingCreature;
|
||||
import mage.target.common.TargetPlayerOrPlaneswalker;
|
||||
|
||||
/**
|
||||
* Class responsible for reading ratings from resources and rating given cards.
|
||||
|
|
@ -43,13 +38,12 @@ public final class RateCard {
|
|||
* Rating that is given for new cards.
|
||||
* Ratings are in [1,10] range, so setting it high will make new cards appear more often.
|
||||
* nowadays, cards that are more rare are more powerful, lets trust that and play the shiny cards.
|
||||
*
|
||||
*/
|
||||
private static final int DEFAULT_NOT_RATED_CARD_RATING = 40;
|
||||
private static final int DEFAULT_NOT_RATED_UNCOMMON_RATING = 60;
|
||||
private static final int DEFAULT_NOT_RATED_RARE_RATING = 75;
|
||||
private static final int DEFAULT_NOT_RATED_MYTHIC_RATING = 90;
|
||||
|
||||
|
||||
private static String RATINGS_DIR = "/ratings/";
|
||||
private static String RATINGS_SET_LIST = RATINGS_DIR + "setsWithRatings.csv";
|
||||
|
||||
|
|
@ -100,54 +94,54 @@ public final class RateCard {
|
|||
if (card.isEnchantment() || card.isInstant() || card.isSorcery()) {
|
||||
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
if (isEffectRemoval(card, ability, effect) == 1){
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
if (isEffectRemoval(card, ability, effect) == 1) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
for (Mode mode: ability.getModes().values() ){
|
||||
for (Effect effect: mode.getEffects()){
|
||||
if (isEffectRemoval(card, ability, effect) == 1){
|
||||
for (Mode mode : ability.getModes().values()) {
|
||||
for (Effect effect : mode.getEffects()) {
|
||||
if (isEffectRemoval(card, ability, effect) == 1) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int isEffectRemoval(Card card, Ability ability, Effect effect){
|
||||
|
||||
private static int isEffectRemoval(Card card, Ability ability, Effect effect) {
|
||||
if (effect.getOutcome() == Outcome.Removal) {
|
||||
log.debug("Found removal: " + card.getName());
|
||||
return 1;
|
||||
}
|
||||
//static List<Effect> removalEffects =[BoostTargetEffect,BoostEnchantedEffect]
|
||||
if (effect instanceof BoostTargetEffect || effect instanceof BoostEnchantedEffect){
|
||||
if (effect instanceof BoostTargetEffect || effect instanceof BoostEnchantedEffect) {
|
||||
String text = effect.getText(null);
|
||||
if (text.contains("/-")){
|
||||
if (text.contains("/-")) {
|
||||
// toughness reducer, aka removal
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
if (effect instanceof FightTargetsEffect || effect instanceof DamageWithPowerTargetEffect){
|
||||
if (effect instanceof FightTargetsEffect || effect instanceof DamageWithPowerTargetEffect) {
|
||||
return 1;
|
||||
}
|
||||
if (effect.getOutcome() == Outcome.Damage || effect instanceof DamageTargetEffect) {
|
||||
for (Target target : ability.getTargets()) {
|
||||
if (!(target instanceof TargetPlayerOrPlaneswalker)){
|
||||
if (!(target instanceof TargetPlayerOrPlaneswalker)) {
|
||||
log.debug("Found damage dealer: " + card.getName());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (effect.getOutcome() == Outcome.DestroyPermanent ||
|
||||
effect instanceof DestroyTargetEffect ||
|
||||
effect instanceof ExileTargetEffect ||
|
||||
if (effect.getOutcome() == Outcome.DestroyPermanent ||
|
||||
effect instanceof DestroyTargetEffect ||
|
||||
effect instanceof ExileTargetEffect ||
|
||||
effect instanceof ExileUntilSourceLeavesEffect) {
|
||||
for (Target target : ability.getTargets()) {
|
||||
if (target instanceof TargetCreaturePermanent ||
|
||||
if (target instanceof TargetCreaturePermanent ||
|
||||
target instanceof TargetAttackingCreature ||
|
||||
target instanceof TargetAttackingOrBlockingCreature ||
|
||||
target instanceof TargetPermanent) {
|
||||
|
|
@ -175,37 +169,37 @@ public final class RateCard {
|
|||
}
|
||||
|
||||
Rarity r = card.getRarity();
|
||||
if (Rarity.COMMON == r){
|
||||
if (Rarity.COMMON == r) {
|
||||
return DEFAULT_NOT_RATED_CARD_RATING;
|
||||
}else if (Rarity.UNCOMMON == r){
|
||||
} else if (Rarity.UNCOMMON == r) {
|
||||
return DEFAULT_NOT_RATED_UNCOMMON_RATING;
|
||||
}else if (Rarity.RARE == r){
|
||||
} else if (Rarity.RARE == r) {
|
||||
return DEFAULT_NOT_RATED_RARE_RATING;
|
||||
}else if (Rarity.MYTHIC == r){
|
||||
} else if (Rarity.MYTHIC == r) {
|
||||
return DEFAULT_NOT_RATED_MYTHIC_RATING;
|
||||
}
|
||||
return DEFAULT_NOT_RATED_CARD_RATING;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* reads the list of sets that have ratings csv files
|
||||
* populates the setsWithRatingsToBeLoaded
|
||||
*/
|
||||
private synchronized static void readRatingSetList(){
|
||||
private synchronized static void readRatingSetList() {
|
||||
try {
|
||||
if (setsWithRatingsToBeLoaded == null){
|
||||
if (setsWithRatingsToBeLoaded == null) {
|
||||
setsWithRatingsToBeLoaded = new LinkedList<>();
|
||||
InputStream is = RateCard.class.getResourceAsStream(RATINGS_SET_LIST);
|
||||
Scanner scanner = new Scanner(is);
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine();
|
||||
if (!line.substring(0,1).equals("#")){
|
||||
setsWithRatingsToBeLoaded.add(line);
|
||||
}
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine();
|
||||
if (!line.substring(0, 1).equals("#")) {
|
||||
setsWithRatingsToBeLoaded.add(line);
|
||||
}
|
||||
}
|
||||
}
|
||||
}catch (Exception e) {
|
||||
log.info("failed to read ratings set list file: " + RATINGS_SET_LIST );
|
||||
} catch (Exception e) {
|
||||
log.info("failed to read ratings set list file: " + RATINGS_SET_LIST);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
|
@ -217,15 +211,16 @@ public final class RateCard {
|
|||
if (ratings == null) {
|
||||
ratings = new HashMap<>();
|
||||
}
|
||||
if (setsWithRatingsToBeLoaded.contains(expCode)){
|
||||
log.info("reading draftbot ratings for the set" + expCode);
|
||||
readFromFile(RATINGS_DIR + expCode + ".csv");
|
||||
if (setsWithRatingsToBeLoaded.contains(expCode)) {
|
||||
log.info("reading draftbot ratings for the set " + expCode);
|
||||
readFromFile(RATINGS_DIR + expCode + ".csv");
|
||||
setsWithRatingsToBeLoaded.remove(expCode);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* reads ratings from the file
|
||||
*/
|
||||
* reads ratings from the file
|
||||
*/
|
||||
private synchronized static void readFromFile(String path) {
|
||||
Integer min = Integer.MAX_VALUE, max = 0;
|
||||
Map<String, Integer> thisFileRatings = new HashMap<>();
|
||||
|
|
@ -248,21 +243,21 @@ public final class RateCard {
|
|||
}
|
||||
}
|
||||
// normalize for the file to [1..100]
|
||||
for (String name: thisFileRatings.keySet()){
|
||||
for (String name : thisFileRatings.keySet()) {
|
||||
int r = thisFileRatings.get(name);
|
||||
int newrating = (int)(100.0f * (r - min) / (max - min));
|
||||
if (!ratings.containsKey(name) ||
|
||||
(ratings.containsKey(name) && newrating > ratings.get(name)) ){
|
||||
ratings.put(name, newrating);
|
||||
int newrating = (int) (100.0f * (r - min) / (max - min));
|
||||
if (!ratings.containsKey(name) ||
|
||||
(ratings.containsKey(name) && newrating > ratings.get(name))) {
|
||||
ratings.put(name, newrating);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.info("failed to read ratings file: " + path );
|
||||
log.info("failed to read ratings file: " + path);
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static final int SINGLE_PENALTY[] = {0, 1, 1, 3, 6, 9};
|
||||
private static final int[] SINGLE_PENALTY = {0, 1, 1, 3, 6, 9};
|
||||
private static final int MULTICOLOR_BONUS = 15;
|
||||
|
||||
/**
|
||||
|
|
@ -271,7 +266,6 @@ public final class RateCard {
|
|||
* If allowed colors are not chosen, then score based on converted cost is returned with penalty for heavy colored cards.
|
||||
* gives bonus to multicolor cards that fit within allowed colors and if allowed colors is <5
|
||||
*
|
||||
*
|
||||
* @param card
|
||||
* @param allowedColors Can be null.
|
||||
* @return
|
||||
|
|
@ -282,7 +276,7 @@ public final class RateCard {
|
|||
int colorPenalty = 0;
|
||||
for (String symbol : card.getManaCost().getSymbols()) {
|
||||
if (isColoredMana(symbol)) {
|
||||
colorPenalty++;
|
||||
colorPenalty++;
|
||||
}
|
||||
}
|
||||
return 2 * (converted - colorPenalty + 1);
|
||||
|
|
@ -314,22 +308,22 @@ public final class RateCard {
|
|||
maxSingleCount = 5;
|
||||
|
||||
int rate = 2 * converted + 3 * (10 - SINGLE_PENALTY[maxSingleCount]);
|
||||
if( singleCount.size() > 1 && singleCount.size() < 5){
|
||||
if (singleCount.size() > 1 && singleCount.size() < 5) {
|
||||
rate += MULTICOLOR_BONUS;
|
||||
}
|
||||
return rate;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determines whether mana symbol is color.
|
||||
*
|
||||
* @param symbol
|
||||
* @param symbol
|
||||
* @return
|
||||
*/
|
||||
public static boolean isColoredMana(String symbol) {
|
||||
String s = symbol;
|
||||
if (s.length() > 1) {
|
||||
s = s.replace("{","").replace("}","");
|
||||
s = s.replace("{", "").replace("}", "");
|
||||
}
|
||||
if (s.length() > 1) {
|
||||
return false;
|
||||
|
|
@ -339,6 +333,7 @@ public final class RateCard {
|
|||
|
||||
/**
|
||||
* Return number of color mana symbols in manacost.
|
||||
*
|
||||
* @param card
|
||||
* @return
|
||||
*/
|
||||
|
|
@ -354,6 +349,7 @@ public final class RateCard {
|
|||
|
||||
/**
|
||||
* Return number of different color mana symbols in manacost.
|
||||
*
|
||||
* @param card
|
||||
* @return
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,375 @@
|
|||
package mage.tournament.cubes;
|
||||
|
||||
import mage.game.draft.DraftCube;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author PirateHunter
|
||||
*/
|
||||
public class ScgConCube2018December extends DraftCube {
|
||||
|
||||
public ScgConCube2018December() {
|
||||
super("SCG Con Cube 2018 December");
|
||||
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dauntless Bodyguard", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kytheon, Hero of Akros", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mardu Woe-Reaper", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mother of Runes", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Skymarcher Aspirant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Student of Warfare", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thraben Inspector", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Toolcraft Exemplar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Accorder Paladin", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Adanto Vanguard", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Containment Priest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Leonin Relic-Warder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Remorseful Cleric", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Selfless Spirit", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Stoneforge Mystic", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thalia, Guardian of Thraben", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wall of Omens", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blade Splicer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Brimaz, King of Oreskos", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Monastery Mentor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thalia, Heretic Cathar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hero of Bladehold", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Palace Jailer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Restoration Angel", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Angel of Invention", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Baneslayer Angel", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sun Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gideon, Ally of Zendikar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Elspeth, Sun's Champion", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Porcelain Legionnaire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Path to Exile", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Swords to Plowshares", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Disenchant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Secure the Wastes", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Balance", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Declaration in Stone", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Council's Judgment", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lingering Souls", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spectral Procession", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Armageddon", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ravages of War", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wrath of God", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Terminus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Intangible Virtue", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Journey to Nowhere", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Oblivion Ring", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Conclave Tribunal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jace, Vryn's Prodigy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Looter il-Kor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phantasmal Image", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Snapcaster Mage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Champion of Wits", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Man-o'-War", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nimble Obstructionist", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sea Gate Oracle", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spellseeker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vendilion Clique", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Glen Elendra Archmage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sower of Temptation", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Venser, Shaper Savant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Whirler Rogue", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mulldrifter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Aetherling", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Consecrated Sphinx", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jace, the Mind Sculptor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phyrexian Metamorph", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Torrential Gearhulk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ancestral Recall", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Brainstorm", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spell Pierce", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Counterspell", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Impulse", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jilt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Drain", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Remand", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Forbid", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thirst for Knowledge", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Cryptic Command", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fact or Fiction", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Force of Will", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mystic Confluence", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Condescend", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dig Through Time", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Time Walk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Compulsive Research", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tinker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bribery", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Upheaval", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Search for Azcanta", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Opposition", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Treachery", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blood Artist", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bloodghast", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dark Confidant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kitesail Freebooter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pack Rat", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Zulaport Cutthroat", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Liliana, Heretical Healer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ophiomancer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Plaguecrafter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vampire Nighthawk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Braids, Cabal Minion", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kalitas, Traitor of Ghet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ravenous Chupacabra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Custodi Lich", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Doom Whisperer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shriekmaw", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grave Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Griselbrand", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Liliana of the Veil", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Liliana, the Last Hope", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Entomb", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fatal Push", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vampiric Tutor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Diabolic Edict", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Doom Blade", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Go for the Throat", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dismember", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hero's Downfall", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Duress", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Inquisition of Kozilek", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Reanimate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thoughtseize", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Collective Brutality", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Demonic Tutor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Exhume", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hymn to Tourach", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Toxic Deluge", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Damnation", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mind Twist", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Animate Dead", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bitterblossom", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Necromancy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phyrexian Arena", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Recurring Nightmare", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Guide", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Welder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grim Lavamancer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Monastery Swiftspear", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Soul-Scar Mage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Zurgo Bellstriker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Earthshaker Khenra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Cratermaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hellspark Elemental", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kari Zev, Skyship Raider", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mogg War Marshal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Young Pyromancer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Rabblemaster", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Legion Warboss", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rampaging Ferocidon", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Flametongue Kavu", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hazoret the Fervent", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hellrider", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pia and Kiran Nalaar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Siege-Gang Commander", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thundermaw Hellkite", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Zealous Conscripts", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Inferno Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Chandra, Torch of Defiance", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Burst Lightning", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dead // Gone", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lightning Bolt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Abrade", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ancient Grudge", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Incinerate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Smash to Smithereens", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Risk Factor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fireblast", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Chain Lightning", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Faithless Looting", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Firebolt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Arc Trail", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Molten Rain", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wheel of Fortune", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fiery Confluence", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Burning of Xinye", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wildfire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Bombardment", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sulfuric Vortex", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Experimental Frenzy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Arbor Elf", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Birds of Paradise", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Elvish Mystic", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Joraga Treespeaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Llanowar Elves", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Noble Hierarch", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Duskwatch Recruiter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fauna Shaman", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lotus Cobra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rofellos, Llanowar Emissary", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sakura-Tribe Elder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scavenging Ooze", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tarmogoyf", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wall of Blossoms", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Eternal Witness", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Manglehorn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Reclamation Sage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tireless Tracker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Oracle of Mul Daya", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thrun, the Last Troll", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Acidic Slime", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Deranged Hermit", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thragtusk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Primeval Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Avenger of Zendikar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hornet Queen", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Craterhoof Behemoth", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Woodfall Primus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Garruk Relentless", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Garruk Wildspeaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nissa, Worldwaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Beast Within", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Farseek", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Cultivate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kodama's Reach", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Natural Order", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Green Sun's Zenith", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tooth and Nail", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fastbond", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Survival of the Fittest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sylvan Library", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Song of the Dryads", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Courser of Kruphix", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Geist of Saint Traft", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spell Queller", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Teferi, Hero of Dominaria", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fractured Identity", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("The Scarab God", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Baleful Strix", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Agony Warp", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Daretti, Ingenious Iconoclast", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Terminate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kolaghan's Command", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dreadbore", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bloodbraid Elf", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dragonlord Atarka", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gaddock Teeg", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Qasali Pridemage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kitchen Finks", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Knight of Autumn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dragonlord Dromoka", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("March of the Multitudes", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kambal, Consul of Allocation", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sorin, Solemn Visitor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vindicate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Deathrite Shaman", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Assassin's Trophy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Maelstrom Pulse", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Coiling Oracle", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Trygon Predator", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nissa, Steward of Elements", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dack Fayden", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Electrolyze", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Figure of Destiny", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ajani Vengeant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wear // Tear", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lightning Helix", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Emrakul, the Promised End", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Karn, Scion of Urza", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Karn Liberated", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bomat Courier", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phyrexian Revoker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scrapheap Scrounger", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spellskite", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Solemn Simulacrum", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Myr Battlesphere", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sundering Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hangarback Walker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Walking Ballista", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Black Lotus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Crypt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Emerald", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Jet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Pearl", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Ruby", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Sapphire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bonesplitter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Cursed Scroll", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Vault", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sensei's Divining Top", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Skullclamp", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sol Ring", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ankh of Mishra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Azorius Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dimir Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grim Monolith", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gruul Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Izzet Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lightning Greaves", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Orzhov Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rakdos Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Simic Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Smuggler's Copter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sorcerous Spyglass", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thorn of Amethyst", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Umezawa's Jitte", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Winter Orb", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Crucible of Worlds", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dimir Keyrune", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grafted Wargear", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of Feast and Famine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of Fire and Ice", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of Light and Shadow", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tangle Wire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vedalken Shackles", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Smokestack", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Batterskull", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Engineered Explosives", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ancestral Vision", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Arid Mesa", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Badlands", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bayou", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blood Crypt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bloodstained Mire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Breeding Pool", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Celestial Colonnade", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Creeping Tar Pit", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Field of Ruin", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Flooded Strand", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gaea's Cradle", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gavony Township", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Godless Shrine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hallowed Fountain", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hissing Quagmire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lavaclaw Reaches", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Library of Alexandria", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lumbering Falls", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Marsh Flats", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mishra's Factory", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Misty Rainforest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mutavault", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Needle Spires", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Overgrown Tomb", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Plateau", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Polluted Delta", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Raging Ravine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rishadan Port", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sacred Foundry", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Savannah", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scalding Tarn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scrubland", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shambling Vent", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Steam Vents", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Stirring Wildwood", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Stomping Ground", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Strip Mine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Taiga", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Temple Garden", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tolarian Academy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Treetop Village", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tropical Island", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tundra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Underground Sea", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Verdant Catacombs", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Volcanic Island", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wandering Fumarole", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wasteland", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Watery Grave", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Windswept Heath", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wooded Foothills", ""));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,556 @@
|
|||
package mage.tournament.cubes;
|
||||
|
||||
import mage.game.draft.DraftCube;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author themogwi
|
||||
*/
|
||||
public class VintageCubeDecember2018 extends DraftCube {
|
||||
|
||||
public VintageCubeDecember2018() {
|
||||
super("MTGO Vintage Cube December 2018");
|
||||
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dauntless Bodyguard", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kytheon, Hero of Akros", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mother of Runes", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Student of Warfare", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Adanto Vanguard", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Leonin Relic-Warder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Remorseful Cleric", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Selfless Spirit", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Soulfire Grand Master", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Stoneforge Mystic", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thalia, Guardian of Thraben", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wall of Omens", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Banisher Priest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blade Splicer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Brightling", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Brimaz, King of Oreskos", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Flickerwisp", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mirran Crusader", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Monastery Mentor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Recruiter of the Guard", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Silverblade Paladin", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Emeria Angel", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hero of Bladehold", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Linvala, Keeper of Silence", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Palace Jailer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Restoration Angel", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Angel of Invention", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Angel of Sanctions", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Archangel Avacyn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Baneslayer Angel", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lyra Dawnbringer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Reveillark", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sun Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Elesh Norn, Grand Cenobite", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Avacyn, Angel of Hope", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Iona, Shield of Emeria", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gideon of the Trials", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Elspeth, Knight-Errant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gideon, Ally of Zendikar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gideon Jura", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Elspeth, Sun's Champion", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Porcelain Legionnaire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Condemn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Enlightened Tutor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Tithe", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Path to Exile", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Swords to Plowshares", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Disenchant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Unexpectedly Absent", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Balance", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Council's Judgment", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lingering Souls", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spectral Procession", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Timely Reinforcements", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Armageddon", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Day of Judgment", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ravages of War", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wrath of God", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Terminus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Land Tax", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Legion's Landing", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Honor of the Pure", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Banishing Light", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("History of Benalia", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Oblivion Ring", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Faith's Fetters", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Moat", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Parallax Wave", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spear of Heliod", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Karakas", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Baral, Chief of Compliance", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jace, Vryn's Prodigy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Looter il-Kor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phantasmal Image", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Snapcaster Mage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thing in the Ice", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Arcane Artisan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Deceiver Exarch", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pestermite", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Trinket Mage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("True-Name Nemesis", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vendilion Clique", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Glen Elendra Archmage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sower of Temptation", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Venser, Shaper Savant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mulldrifter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Riftwing Cloudskate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Consecrated Sphinx", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Frost Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Palinchron", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jace Beleren", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jace, Architect of Thought", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jace, the Mind Sculptor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tamiyo, the Moon Sage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tezzeret the Seeker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phyrexian Metamorph", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Torrential Gearhulk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Inkwell Leviathan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ancestral Recall", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Brainstorm", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("High Tide", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mystical Tutor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spell Pierce", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blink of an Eye", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Brain Freeze", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Counterspell", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Daze", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Impulse", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Drain", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Leak", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Remand", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Disallow", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Frantic Search", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thirst for Knowledge", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Cryptic Command", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fact or Fiction", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gifts Ungiven", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Turnabout", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Force of Will", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gush", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mystic Confluence", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Repeal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nexus of Fate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dig Through Time", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ancestral Vision", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gitaxian Probe", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ponder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Preordain", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Chart a Course", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Time Walk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Compulsive Research", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Show and Tell", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Timetwister", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tinker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bribery", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mind's Desire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Time Spiral", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Upheaval", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Treasure Cruise", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Search for Azcanta", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Control Magic", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Opposition", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Treachery", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shelldock Isle", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tolarian Academy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Putrid Imp", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Brain Maggot", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dark Confidant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kitesail Freebooter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mesmeric Fiend", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Oona's Prowler", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pack Rat", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scrapheap Scrounger", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vampire Hexmage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bone Shredder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hypnotic Specter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ophiomancer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vampire Nighthawk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gonti, Lord of Luxury", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nekrataal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ravenous Chupacabra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Doom Whisperer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Puppeteer Clique", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shriekmaw", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Demonlord Belzenlok", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grave Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Massacre Wurm", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tasigur, the Golden Fang", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sheoldred, Whispering One", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Griselbrand", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Liliana of the Veil", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Liliana, Death's Majesty", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dark Ritual", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Entomb", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fatal Push", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vampiric Tutor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Cabal Ritual", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Cast Down", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Go for the Throat", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shallow Grave", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ultimate Price", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Corpse Dance", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dismember", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hero's Downfall", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Makeshift Mannequin", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vraska's Contempt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Duress", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Imperial Seal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Inquisition of Kozilek", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Reanimate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thoughtseize", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Collective Brutality", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Demonic Tutor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Exhume", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hymn to Tourach", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Night's Whisper", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Buried Alive", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grim Tutor", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Toxic Deluge", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Yawgmoth's Will", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Damnation", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Languish", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tendrils of Agony", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dark Petition", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Living Death", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Unburial Rites", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mind Twist", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Animate Dead", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Arguel's Blood Fast", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bitterblossom", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Necromancy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phyrexian Arena", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Recurring Nightmare", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Yawgmoth's Bargain", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Urborg, Tomb of Yawgmoth", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Firedrinker Satyr", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Guide", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Welder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grim Lavamancer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Jackal Pup", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Monastery Swiftspear", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Zurgo Bellstriker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Abbot of Keral Keep", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dire Fleet Daredevil", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Eidolon of the Great Revel", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Runaway Steam-Kin", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Young Pyromancer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Rabblemaster", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Imperial Recruiter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Magus of the Moon", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Manic Vandal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pia Nalaar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Avalanche Riders", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Flametongue Kavu", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hazoret the Fervent", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hellrider", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pia and Kiran Nalaar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rekindling Phoenix", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Glorybringer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Dark-Dwellers", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kiki-Jiki, Mirror Breaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Siege-Gang Commander", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thundermaw Hellkite", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Zealous Conscripts", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Inferno Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Chandra, Torch of Defiance", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Daretti, Scrap Savant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Koth of the Hammer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Chandra, Flamecaller", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Burst Lightning", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lightning Bolt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Abrade", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ancient Grudge", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Desperate Ritual", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Incinerate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lightning Strike", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Magma Jet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pyretic Ritual", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Char", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Seething Song", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Through the Breach", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fireblast", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Chain Lightning", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Faithless Looting", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Firebolt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Flame Slash", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mizzium Mortars", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pyroclasm", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Collective Defiance", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sweltering Suns", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wheel of Fortune", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Empty the Warrens", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fiery Confluence", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Burning of Xinye", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wildfire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bonfire of the Damned", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Flare", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sulfuric Vortex", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Experimental Frenzy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sneak Attack", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Splinter Twin", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Arbor Elf", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Avacyn's Pilgrim", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Birds of Paradise", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Elves of Deep Shadow", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Elvish Mystic", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fyndhorn Elves", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Joraga Treespeaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Llanowar Elves", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Noble Hierarch", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Devoted Druid", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fauna Shaman", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lotus Cobra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rofellos, Llanowar Emissary", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sakura-Tribe Elder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scavenging Ooze", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sylvan Caryatid", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wall of Blossoms", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wall of Roots", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Courser of Kruphix", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Eternal Witness", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Manglehorn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nissa, Vastwood Seer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ramunap Excavator", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Reclamation Sage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tireless Tracker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Yavimaya Elder", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Master of the Wild Hunt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Obstinate Baloth", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Oracle of Mul Daya", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Polukranos, World Eater", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thrun, the Last Troll", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Acidic Slime", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Deranged Hermit", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thragtusk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Whisperwood Elemental", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Carnage Tyrant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Primeval Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Avenger of Zendikar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Craterhoof Behemoth", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Terastodon", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Woodfall Primus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nissa, Voice of Zendikar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Garruk Relentless", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Garruk Wildspeaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Garruk, Primal Hunter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nissa, Worldwaker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vivien Reid", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Verdurous Gearhulk", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nature's Claim", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Beast Within", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Channel", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Regrowth", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kodama's Reach", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Search for Tomorrow", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Eureka", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Harmonize", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Natural Order", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Plow Under", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Primal Command", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Green Sun's Zenith", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tooth and Nail", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Genesis Wave", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Fastbond", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Oath of Druids", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Survival of the Fittest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sylvan Library", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Heartbeat of Spring", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gaea's Cradle", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Geist of Saint Traft", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spell Queller", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dragonlord Ojutai", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Teferi, Hero of Dominaria", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sphinx's Revelation", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Celestial Colonnade", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Flooded Strand", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hallowed Fountain", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Seachrome Coast", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tundra", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thief of Sanity", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hostage Taker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("The Scarab God", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ashiok, Nightmare Weaver", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Baleful Strix", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Creeping Tar Pit", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Darkslick Shores", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Polluted Delta", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Underground Sea", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Watery Grave", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Daretti, Ingenious Iconoclast", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Terminate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kolaghan's Command", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dreadbore", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rakdos's Return", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Badlands", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blackcleave Cliffs", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blood Crypt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bloodstained Mire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lavaclaw Reaches", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bloodbraid Elf", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Huntmaster of the Fells", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dragonlord Atarka", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Xenagos, the Reveler", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Manamorphose", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Copperline Gorge", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Raging Ravine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Stomping Ground", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Taiga", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wooded Foothills", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kitchen Finks", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Knight of Autumn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Knight of the Reliquary", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Trostani Discordant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mirari's Wake", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Razorverge Thicket", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Savannah", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Stirring Wildwood", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Temple Garden", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Windswept Heath", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tidehollow Sculler", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Anguished Unmaking", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vindicate", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Concealed Courtyard", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Godless Shrine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Marsh Flats", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scrubland", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shambling Vent", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vraska, Relic Seeker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Garruk, Apex Predator", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Abrupt Decay", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Assassin's Trophy", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Maelstrom Pulse", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bayou", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blooming Marsh", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hissing Quagmire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Overgrown Tomb", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Verdant Catacombs", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Edric, Spymaster of Trest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Trygon Predator", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mystic Snake", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kiora, the Crashing Wave", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shardless Agent", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Botanical Sanctum", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Breeding Pool", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lumbering Falls", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Misty Rainforest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tropical Island", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Goblin Electromancer", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dack Fayden", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Expansion // Explosion", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Izzet Charm", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thousand-Year Storm", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Scalding Tarn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Spirebluff Canal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Steam Vents", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Volcanic Island", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wandering Fumarole", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Figure of Destiny", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Aurelia, Exemplar of Justice", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ajani Vengeant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nahiri, the Harbinger", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lightning Helix", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Arid Mesa", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Inspiring Vantage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Needle Spires", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Plateau", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sacred Foundry", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sphinx of the Steel Wind", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nicol Bolas, Planeswalker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Leovold, Emissary of Trest", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Progenitus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kozilek, Butcher of Truth", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ulamog, the Ceaseless Hunger", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ulamog, the Infinite Gyre", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Emrakul, the Promised End", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Emrakul, the Aeons Torn", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Karn, Scion of Urza", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Karn Liberated", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ugin, the Spirit Dragon", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Hangarback Walker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Phyrexian Revoker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Metalworker", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lodestone Golem", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Solemn Simulacrum", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Kuldotha Forgemaster", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Duplicant", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wurmcoil Engine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Myr Battlesphere", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sundering Titan", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Walking Ballista", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Blightsteel Colossus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Black Lotus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Chrome Mox", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Everflowing Chalice", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lion's Eye Diamond", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lotus Bloom", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lotus Petal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Crypt", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Diamond", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Emerald", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Jet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Pearl", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Ruby", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mox Sapphire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Vault", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Relic of Progenitus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sensei's Divining Top", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Skullclamp", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sol Ring", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Azorius Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Boros Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Dimir Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Golgari Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Grim Monolith", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gruul Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Izzet Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Lightning Greaves", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Orzhov Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Pentad Prism", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rakdos Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Selesnya Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Shrine of Burning Rage", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Simic Signet", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Smuggler's Copter", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sorcerous Spyglass", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Umezawa's Jitte", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Winter Orb", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Basalt Monolith", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Coalition Relic", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Crucible of Worlds", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Oblivion Stone", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of Body and Mind", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of Feast and Famine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of Fire and Ice", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of Light and Shadow", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Sword of War and Peace", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Tangle Wire", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Vedalken Shackles", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Worn Powerstone", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Coercive Portal", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Smokestack", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Thran Dynamo", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Batterskull", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Gilded Lotus", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Memory Jar", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mindslaver", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Academy Ruins", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Ancient Tomb", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Bazaar of Baghdad", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Field of Ruin", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Library of Alexandria", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mana Confluence", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Maze of Ith", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mishra's Factory", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mishra's Workshop", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Mutavault", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Nykthos, Shrine to Nyx", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Rishadan Port", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Strip Mine", ""));
|
||||
cubeCards.add(new DraftCube.CardIdentity("Wasteland", ""));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -134,6 +134,8 @@
|
|||
<draftCube name="MTGO Vintage Cube June 2017" jar="mage-tournament-booster-draft.jar" className="mage.tournament.cubes.VintageCubeJune2017"/>
|
||||
<draftCube name="MTGO Vintage Cube December 2017" jar="mage-tournament-booster-draft.jar" className="mage.tournament.cubes.VintageCubeDecember2017"/>
|
||||
<draftCube name="MTGO Vintage Cube June 2018" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.VintageCubeJune2018"/>
|
||||
<draftCube name="MTGO Vintage Cube December 2018" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.VintageCubeDecember2018"/>
|
||||
<draftCube name="SCG Con Cube 2018 December" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.ScgConCube2018December"/>
|
||||
<draftCube name="The Peasant's Toolbox" jar="mage-tournament-booster-draft.jar" className="mage.tournament.cubes.PeasantsToolboxCube"/>
|
||||
<draftCube name="www.MTGCube.com" jar="mage-tournament-booster-draft.jar" className="mage.tournament.cubes.MTGCube"/>
|
||||
<draftCube name="Cube From Deck" jar="mage-tournament-booster-draft.jar" className="mage.tournament.cubes.CubeFromDeck"/>
|
||||
|
|
|
|||
|
|
@ -128,6 +128,8 @@
|
|||
<draftCube name="MTGO Vintage Cube June 2017" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.VintageCubeJune2017"/>
|
||||
<draftCube name="MTGO Vintage Cube December 2017" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.VintageCubeDecember2017"/>
|
||||
<draftCube name="MTGO Vintage Cube June 2018" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.VintageCubeJune2018"/>
|
||||
<draftCube name="MTGO Vintage Cube December 2018" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.VintageCubeDecember2018"/>
|
||||
<draftCube name="SCG Con Cube 2018 December" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.ScgConCube2018December"/>
|
||||
<draftCube name="The Peasant's Toolbox" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.PeasantsToolboxCube"/>
|
||||
<draftCube name="www.MTGCube.com" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.MTGCube"/>
|
||||
<draftCube name="Cube From Deck" jar="mage-tournament-booster-draft-${project.version}.jar" className="mage.tournament.cubes.CubeFromDeck"/>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import mage.cards.ExpansionSet;
|
|||
import mage.cards.Sets;
|
||||
import mage.cards.repository.CardScanner;
|
||||
import mage.cards.repository.PluginClassloaderRegistery;
|
||||
import mage.cards.repository.RepositoryUtil;
|
||||
import mage.game.match.MatchType;
|
||||
import mage.game.tournament.TournamentType;
|
||||
import mage.interfaces.MageServer;
|
||||
|
|
@ -88,6 +89,10 @@ public final class Main {
|
|||
logger.info("Done.");
|
||||
}
|
||||
|
||||
// db init and updates checks (e.g. cleanup cards db on new version)
|
||||
RepositoryUtil.bootstrapLocalDb();
|
||||
logger.info("Done.");
|
||||
|
||||
logger.info("Loading extension packages...");
|
||||
if (!extensionFolder.exists()) {
|
||||
if (!extensionFolder.mkdirs()) {
|
||||
|
|
|
|||
|
|
@ -1,19 +1,7 @@
|
|||
package mage.server.util;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
|
|
@ -25,6 +13,16 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.util.RandomUtil;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author JayDi85
|
||||
*/
|
||||
|
|
@ -111,6 +109,9 @@ public final class SystemUtil {
|
|||
|
||||
for (UUID cardID : cardsList) {
|
||||
Card card = game.getCard(cardID);
|
||||
if (card == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// basic info (card + set)
|
||||
String cardInfo = card.getName() + " - " + card.getExpansionSetCode();
|
||||
|
|
@ -225,7 +226,7 @@ public final class SystemUtil {
|
|||
* <br/>
|
||||
* <b>Implementation note:</b><br/>
|
||||
* 1. Read init.txt line by line<br/>
|
||||
* 2. Parse line using for searching groups like: [group 1]
|
||||
* 2. Parse line using for searching groups like: [group 1]
|
||||
* 3. Parse line using the following format: line ::=
|
||||
* <zone>:<nickname>:<card name>:<amount><br/>
|
||||
* 4. If zone equals to 'hand', add card to player's library<br/>
|
||||
|
|
@ -537,8 +538,8 @@ public final class SystemUtil {
|
|||
/**
|
||||
* Get a diff between two dates
|
||||
*
|
||||
* @param date1 the oldest date
|
||||
* @param date2 the newest date
|
||||
* @param date1 the oldest date
|
||||
* @param date2 the newest date
|
||||
* @param timeUnit the unit in which you want the diff
|
||||
* @return the diff value, in the provided unit
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
|
|
@ -21,8 +19,9 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Styxo
|
||||
*/
|
||||
public final class AAT1 extends CardImpl {
|
||||
|
|
@ -74,7 +73,8 @@ public final class AAT1 extends CardImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (event.getPlayerId().equals(game.getControllerId(sourceId))
|
||||
if (card != null
|
||||
&& event.getPlayerId().equals(game.getControllerId(sourceId))
|
||||
&& card.isCreature()
|
||||
&& game.getState().getZone(card.getId()) == Zone.GRAVEYARD
|
||||
&& event.getData().equals("repair")) {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,26 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.CostAdjuster;
|
||||
import mage.abilities.costs.common.DiscardTargetCost;
|
||||
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.effects.common.discard.DiscardCardYouChooseTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPlayer;
|
||||
import mage.target.common.TargetCardInHand;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class AbandonHope extends CardImpl {
|
||||
|
|
@ -29,7 +29,7 @@ public final class AbandonHope extends CardImpl {
|
|||
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{1}{B}");
|
||||
|
||||
// As an additional cost to cast Abandon Hope, discard X cards.
|
||||
Ability ability = new SimpleStaticAbility(Zone.ALL, new AbandonHopeRuleEffect());
|
||||
Ability ability = new SimpleStaticAbility(Zone.ALL, new InfoEffect("As an additional cost to cast this spell, discard X cards"));
|
||||
ability.setRuleAtTheTop(true);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
@ -37,44 +37,27 @@ public final class AbandonHope extends CardImpl {
|
|||
ManacostVariableValue manaX = new ManacostVariableValue();
|
||||
this.getSpellAbility().addEffect(new DiscardCardYouChooseTargetEffect(manaX, TargetController.ANY));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
this.getSpellAbility().setCostAdjuster(AbandonHopeAdjuster.instance);
|
||||
}
|
||||
|
||||
public AbandonHope(final AbandonHope card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
if (xValue > 0) {
|
||||
ability.addCost(new DiscardTargetCost(new TargetCardInHand(xValue, xValue, new FilterCard("cards"))));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbandonHope copy() {
|
||||
return new AbandonHope(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AbandonHopeRuleEffect extends OneShotEffect {
|
||||
|
||||
public AbandonHopeRuleEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "As an additional cost to cast this spell, discard X cards";
|
||||
}
|
||||
|
||||
public AbandonHopeRuleEffect(final AbandonHopeRuleEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
enum AbandonHopeAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public AbandonHopeRuleEffect copy() {
|
||||
return new AbandonHopeRuleEffect(this);
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
if (xValue > 0) {
|
||||
ability.addCost(new DiscardTargetCost(new TargetCardInHand(xValue, xValue, StaticFilters.FILTER_CARD_CARDS)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +1,12 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.asthought.PlayFromNotOwnHandZoneAllEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.cards.*;
|
||||
import mage.constants.*;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.AbilityPredicate;
|
||||
|
|
@ -31,8 +18,12 @@ import mage.game.permanent.Permanent;
|
|||
import mage.players.Player;
|
||||
import mage.watchers.Watcher;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public final class AbandonedSarcophagus extends CardImpl {
|
||||
|
|
@ -55,7 +46,7 @@ public final class AbandonedSarcophagus extends CardImpl {
|
|||
|
||||
}
|
||||
|
||||
public AbandonedSarcophagus(final AbandonedSarcophagus card) {
|
||||
private AbandonedSarcophagus(final AbandonedSarcophagus card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -67,15 +58,12 @@ public final class AbandonedSarcophagus extends CardImpl {
|
|||
|
||||
class AbandonedSarcophagusReplacementEffect extends ReplacementEffectImpl {
|
||||
|
||||
boolean cardHasCycling;
|
||||
boolean cardWasCycledThisTurn;
|
||||
|
||||
public AbandonedSarcophagusReplacementEffect() {
|
||||
AbandonedSarcophagusReplacementEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Exile);
|
||||
staticText = "If a card with cycling would be put into your graveyard from anywhere and it wasn't cycled, exile it instead";
|
||||
}
|
||||
|
||||
public AbandonedSarcophagusReplacementEffect(final AbandonedSarcophagusReplacementEffect effect) {
|
||||
private AbandonedSarcophagusReplacementEffect(final AbandonedSarcophagusReplacementEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -112,33 +100,33 @@ class AbandonedSarcophagusReplacementEffect extends ReplacementEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
cardWasCycledThisTurn = false;
|
||||
cardHasCycling = false;
|
||||
if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
|
||||
&& !game.isSimulation()) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
AbandonedSarcophagusWatcher watcher = (AbandonedSarcophagusWatcher) game.getState().getWatchers().get(AbandonedSarcophagusWatcher.class.getSimpleName());
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null
|
||||
&& watcher != null
|
||||
&& card.isOwnedBy(controller.getId())) {
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof CyclingAbility) {
|
||||
cardHasCycling = true;
|
||||
}
|
||||
}
|
||||
Cards cards = watcher.getCardsCycledThisTurn(controller.getId());
|
||||
for (Card c : cards.getCards(game)) {
|
||||
if (c == card) {
|
||||
cardWasCycledThisTurn = true;
|
||||
watcher.getCardsCycledThisTurn(controller.getId()).remove(card); //remove reference to the card as it is no longer needed
|
||||
}
|
||||
}
|
||||
return (!cardWasCycledThisTurn
|
||||
&& cardHasCycling);
|
||||
boolean cardWasCycledThisTurn = false;
|
||||
boolean cardHasCycling = false;
|
||||
if (!(((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) || game.isSimulation()) {
|
||||
return false;
|
||||
}
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
AbandonedSarcophagusWatcher watcher = game.getState().getWatcher(AbandonedSarcophagusWatcher.class);
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card == null
|
||||
|| controller == null
|
||||
|| watcher == null
|
||||
|| !card.isOwnedBy(controller.getId())) {
|
||||
return false;
|
||||
}
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
if (ability instanceof CyclingAbility) {
|
||||
cardHasCycling = true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
Cards cards = watcher.getCardsCycledThisTurn(controller.getId());
|
||||
for (Card c : cards.getCards(game)) {
|
||||
if (c == card) {
|
||||
cardWasCycledThisTurn = true;
|
||||
watcher.getCardsCycledThisTurn(controller.getId()).remove(card); //remove reference to the card as it is no longer needed
|
||||
}
|
||||
}
|
||||
return !cardWasCycledThisTurn && cardHasCycling;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -146,11 +134,11 @@ class AbandonedSarcophagusWatcher extends Watcher {
|
|||
|
||||
private final Map<UUID, Cards> cycledCardsThisTurn = new HashMap<>();
|
||||
|
||||
public AbandonedSarcophagusWatcher() {
|
||||
AbandonedSarcophagusWatcher() {
|
||||
super(AbandonedSarcophagusWatcher.class.getSimpleName(), WatcherScope.GAME);
|
||||
}
|
||||
|
||||
public AbandonedSarcophagusWatcher(final AbandonedSarcophagusWatcher watcher) {
|
||||
private AbandonedSarcophagusWatcher(final AbandonedSarcophagusWatcher watcher) {
|
||||
super(watcher);
|
||||
for (Entry<UUID, Cards> entry : watcher.cycledCardsThisTurn.entrySet()) {
|
||||
cycledCardsThisTurn.put(entry.getKey(), entry.getValue().copy());
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
|
|
@ -17,8 +14,10 @@ import mage.game.Game;
|
|||
import mage.game.events.GameEvent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author fireshoes
|
||||
*/
|
||||
public final class Abeyance extends CardImpl {
|
||||
|
|
@ -46,12 +45,13 @@ public final class Abeyance extends CardImpl {
|
|||
|
||||
class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
|
||||
|
||||
public AbeyanceEffect() {
|
||||
AbeyanceEffect() {
|
||||
super(Duration.EndOfTurn, Outcome.Detriment);
|
||||
staticText = "Until end of turn, target player can't cast instant or sorcery spells, and that player can't activate abilities that aren't mana abilities";
|
||||
staticText = "Until end of turn, target player can't cast instant or sorcery spells, " +
|
||||
"and that player can't activate abilities that aren't mana abilities";
|
||||
}
|
||||
|
||||
public AbeyanceEffect(final AbeyanceEffect effect) {
|
||||
private AbeyanceEffect(final AbeyanceEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -69,26 +69,29 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
public String getInfoMessage(Ability source, GameEvent event, Game game) {
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (mageObject != null) {
|
||||
return "You can't cast instant or sorcery spells or activate abilities that aren't mana abilities this turn (" + mageObject.getIdName() + ").";
|
||||
return "You can't cast instant or sorcery spells or activate abilities " +
|
||||
"that aren't mana abilities this turn (" + mageObject.getIdName() + ").";
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (source.getFirstTarget() != null && source.getFirstTarget().equals(event.getPlayerId())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
if (object.isInstant() || object.isSorcery()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) {
|
||||
Optional<Ability> ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
||||
if (ability.isPresent() && !(ability.get() instanceof ActivatedManaAbilityImpl)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (source.getFirstTarget() != null
|
||||
&& source.getFirstTarget().equals(event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (object == null) {
|
||||
return false;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL
|
||||
&& (object.isInstant() || object.isSorcery())) {
|
||||
return true;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.ACTIVATE_ABILITY) {
|
||||
Optional<Ability> ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
||||
return ability.isPresent() && !(ability.get() instanceof ActivatedManaAbilityImpl);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ public final class Abrade extends CardImpl {
|
|||
|
||||
// Destroy target artifact.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new DestroyTargetEffect());
|
||||
mode.getTargets().add(new TargetArtifactPermanent());
|
||||
mode.addEffect(new DestroyTargetEffect());
|
||||
mode.addTarget(new TargetArtifactPermanent());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ public final class AbunasChant extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new GainLifeEffect(5));
|
||||
//or prevent the next 5 damage that would be dealt to target creature this turn.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn, 5));
|
||||
mode.getTargets().add(new TargetCreaturePermanent());
|
||||
mode.addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, 5));
|
||||
mode.addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().getModes().addMode(mode);
|
||||
// Entwine {2}
|
||||
this.addAbility(new EntwineAbility("{2}"));
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class AbzanAscendancy extends CardImpl {
|
|||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(Predicates.not(new TokenPredicate()));
|
||||
filter.add(Predicates.not(TokenPredicate.instance));
|
||||
}
|
||||
|
||||
public AbzanAscendancy(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
|
@ -17,23 +16,23 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
|
|||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.filter.predicate.permanent.CounterPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class AbzanBattlePriest extends CardImpl {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent();
|
||||
|
||||
static {
|
||||
filter.add(new CardTypePredicate(CardType.CREATURE));
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(new CounterPredicate(CounterType.P1P1));
|
||||
}
|
||||
|
||||
static final String rule = "Each creature you control with a +1/+1 counter on it has lifelink";
|
||||
|
||||
public AbzanBattlePriest(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{W}");
|
||||
this.subtype.add(SubType.HUMAN);
|
||||
this.subtype.add(SubType.CLERIC);
|
||||
|
||||
|
|
@ -42,9 +41,15 @@ public final class AbzanBattlePriest extends CardImpl {
|
|||
|
||||
// Outlast {W}
|
||||
this.addAbility(new OutlastAbility(new ManaCostsImpl<>("{W}")));
|
||||
|
||||
|
||||
// Each creature you control with a +1/+1 counter on it has lifelink.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(LifelinkAbility.getInstance(), Duration.WhileOnBattlefield, filter, rule)));
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new GainAbilityAllEffect(
|
||||
LifelinkAbility.getInstance(), Duration.WhileOnBattlefield,
|
||||
filter, "Each creature you control with a +1/+1 counter on it has lifelink"
|
||||
)
|
||||
));
|
||||
}
|
||||
|
||||
public AbzanBattlePriest(final AbzanBattlePriest card) {
|
||||
|
|
|
|||
|
|
@ -39,14 +39,14 @@ public final class AbzanCharm extends CardImpl {
|
|||
|
||||
// *You draw two cards and you lose 2 life
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new DrawCardSourceControllerEffect(2));
|
||||
mode.getEffects().add(new LoseLifeSourceControllerEffect(2));
|
||||
mode.addEffect(new DrawCardSourceControllerEffect(2));
|
||||
mode.addEffect(new LoseLifeSourceControllerEffect(2));
|
||||
this.getSpellAbility().addMode(mode);
|
||||
|
||||
// *Distribute two +1/+1 counters among one or two target creatures.
|
||||
mode = new Mode();
|
||||
mode.getEffects().add(new DistributeCountersEffect(CounterType.P1P1, 2, false, "one or two target creatures"));
|
||||
mode.getTargets().add(new TargetCreaturePermanentAmount(2));
|
||||
mode.addEffect(new DistributeCountersEffect(CounterType.P1P1, 2, false, "one or two target creatures"));
|
||||
mode.addTarget(new TargetCreaturePermanentAmount(2));
|
||||
this.getSpellAbility().addMode(mode);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
|
|
@ -22,6 +20,8 @@ import mage.players.Player;
|
|||
import mage.target.Target;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author halljared
|
||||
*/
|
||||
|
|
@ -44,7 +44,7 @@ public final class AccursedWitch extends CardImpl {
|
|||
this.addAbility(new DiesTriggeredAbility(new AccursedWitchReturnTransformedEffect()));
|
||||
}
|
||||
|
||||
public AccursedWitch(final AccursedWitch card) {
|
||||
private AccursedWitch(final AccursedWitch card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -56,12 +56,12 @@ public final class AccursedWitch extends CardImpl {
|
|||
|
||||
class AccursedWitchReturnTransformedEffect extends OneShotEffect {
|
||||
|
||||
public AccursedWitchReturnTransformedEffect() {
|
||||
AccursedWitchReturnTransformedEffect() {
|
||||
super(Outcome.PutCardInPlay);
|
||||
this.staticText = "Put {this} from your graveyard onto the battlefield transformed";
|
||||
}
|
||||
|
||||
public AccursedWitchReturnTransformedEffect(final AccursedWitchReturnTransformedEffect effect) {
|
||||
private AccursedWitchReturnTransformedEffect(final AccursedWitchReturnTransformedEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -73,29 +73,27 @@ class AccursedWitchReturnTransformedEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
//note: should check for null after game.getCard
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
if (controller == null || !(game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD)) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||
//note: should check for null after game.getCard
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class AccursedWitchSpellsCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
public AccursedWitchSpellsCostReductionEffect() {
|
||||
AccursedWitchSpellsCostReductionEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment, CostModificationType.REDUCE_COST);
|
||||
this.staticText = "Spells your opponents cast that target {this} cost {1} less to cast.";
|
||||
}
|
||||
|
||||
protected AccursedWitchSpellsCostReductionEffect(AccursedWitchSpellsCostReductionEffect effect) {
|
||||
private AccursedWitchSpellsCostReductionEffect(AccursedWitchSpellsCostReductionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -107,17 +105,16 @@ class AccursedWitchSpellsCostReductionEffect extends CostModificationEffectImpl
|
|||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify instanceof SpellAbility) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {
|
||||
for (UUID modeId : abilityToModify.getModes().getSelectedModes()) {
|
||||
Mode mode = abilityToModify.getModes().get(modeId);
|
||||
for (Target target : mode.getTargets()) {
|
||||
for (UUID targetUUID : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetUUID);
|
||||
if (permanent != null && permanent.getId().equals(source.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (!(abilityToModify instanceof SpellAbility) || !game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {
|
||||
return false;
|
||||
}
|
||||
for (UUID modeId : abilityToModify.getModes().getSelectedModes()) {
|
||||
Mode mode = abilityToModify.getModes().get(modeId);
|
||||
for (Target target : mode.getTargets()) {
|
||||
for (UUID targetUUID : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(targetUUID);
|
||||
if (permanent != null && permanent.getId().equals(source.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
|
|
@ -25,8 +24,9 @@ import mage.players.Player;
|
|||
import mage.target.common.TargetCardInLibrary;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author L_J
|
||||
*/
|
||||
public final class AchHansRun extends CardImpl {
|
||||
|
|
@ -38,7 +38,7 @@ public final class AchHansRun extends CardImpl {
|
|||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD, new AchHansRunEffect(), TargetController.YOU, true));
|
||||
}
|
||||
|
||||
public AchHansRun(final AchHansRun card) {
|
||||
private AchHansRun(final AchHansRun card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
|
|
@ -50,12 +50,12 @@ public final class AchHansRun extends CardImpl {
|
|||
|
||||
class AchHansRunEffect extends OneShotEffect {
|
||||
|
||||
public AchHansRunEffect() {
|
||||
AchHansRunEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.staticText = "you may say \"Ach! Hans, run! It’s the …\" and the name of a creature card. If you do, search your library for a card with that name, put it onto the battlefield, then shuffle your library. That creature gains haste. Exile it at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public AchHansRunEffect(final AchHansRunEffect effect) {
|
||||
private AchHansRunEffect(final AchHansRunEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
|
@ -67,41 +67,41 @@ class AchHansRunEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
ChoiceImpl cardChoice = new ChoiceImpl(true);
|
||||
cardChoice.setChoices(CardRepository.instance.getCreatureNames());
|
||||
cardChoice.setMessage("Choose a creature card name");
|
||||
if (controller.choose(Outcome.Detriment, cardChoice, game)) {
|
||||
String cardName = cardChoice.getChoice();
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(controller.getLogName() + ": \"Ach! Hans, run! It's the " + cardName + "!\"");
|
||||
}
|
||||
FilterCard nameFilter = new FilterCard();
|
||||
nameFilter.add(new NamePredicate(cardName));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(1, 1, nameFilter);
|
||||
if (controller.searchLibrary(target, game)) {
|
||||
Card card = controller.getLibrary().remove(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
if (card != null && controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
Permanent creature = game.getPermanent(card.getId());
|
||||
if (creature != null) {
|
||||
// gains haste
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(creature, game));
|
||||
game.addEffect(effect, source);
|
||||
// Exile at begin of next end step
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect(null, null, Zone.BATTLEFIELD);
|
||||
exileEffect.setTargetPointer(new FixedTarget(creature, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
controller.shuffleLibrary(source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
if (controller == null) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
ChoiceImpl cardChoice = new ChoiceImpl(true);
|
||||
cardChoice.setChoices(CardRepository.instance.getCreatureNames());
|
||||
cardChoice.setMessage("Choose a creature card name");
|
||||
if (!controller.choose(Outcome.Detriment, cardChoice, game)) {
|
||||
return false;
|
||||
}
|
||||
String cardName = cardChoice.getChoice();
|
||||
game.informPlayers(controller.getLogName() + ": \"Ach! Hans, run! It's the " + cardName + "!\"");
|
||||
FilterCard nameFilter = new FilterCard();
|
||||
nameFilter.add(new NamePredicate(cardName));
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(1, 1, nameFilter);
|
||||
if (!controller.searchLibrary(target, game)) {
|
||||
return false;
|
||||
}
|
||||
Card card = controller.getLibrary().remove(target.getFirstTarget(), game);
|
||||
if (card == null || !controller.moveCards(card, Zone.BATTLEFIELD, source, game)) {
|
||||
return false;
|
||||
}
|
||||
Permanent creature = game.getPermanent(card.getId());
|
||||
if (creature == null) {
|
||||
return false;
|
||||
}
|
||||
// gains haste
|
||||
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
|
||||
effect.setTargetPointer(new FixedTarget(creature, game));
|
||||
game.addEffect(effect, source);
|
||||
// Exile at begin of next end step
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect(null, null, Zone.BATTLEFIELD);
|
||||
exileEffect.setTargetPointer(new FixedTarget(creature, game));
|
||||
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(exileEffect);
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
controller.shuffleLibrary(source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class AcidSpewerDragon extends CardImpl {
|
|||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("other Dragon creature you control");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(new SubtypePredicate(SubType.DRAGON));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,19 +98,19 @@ class AcolytesRewardEffect extends PreventionEffectImpl {
|
|||
result = true;
|
||||
}
|
||||
if (toPrevent > 0) {
|
||||
game.informPlayers(new StringBuilder("Acolyte's Reward ").append("prevented ").append(toPrevent).append(" to ").append(targetCreature.getName()).toString());
|
||||
game.informPlayers("Acolyte's Reward prevented " + toPrevent + " to " + targetCreature.getName());
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.PREVENTED_DAMAGE,
|
||||
source.getControllerId(), source.getSourceId(), source.getControllerId(), toPrevent));
|
||||
|
||||
Player targetPlayer = game.getPlayer(source.getTargets().get(1).getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.damage(toPrevent, source.getSourceId(), game, false, true);
|
||||
game.informPlayers(new StringBuilder("Acolyte's Reward ").append("deals ").append(toPrevent).append(" damage to ").append(targetPlayer.getLogName()).toString());
|
||||
game.informPlayers("Acolyte's Reward deals " + toPrevent + " damage to " + targetPlayer.getLogName());
|
||||
} else {
|
||||
Permanent targetDamageCreature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
|
||||
if (targetDamageCreature != null) {
|
||||
targetDamageCreature.damage(toPrevent, source.getSourceId(), game, false, true);
|
||||
game.informPlayers(new StringBuilder("Acolyte's Reward ").append("deals ").append(toPrevent).append(" damage to ").append(targetDamageCreature.getName()).toString());
|
||||
game.informPlayers("Acolyte's Reward deals " + toPrevent + " damage to " + targetDamageCreature.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ public final class ActiveVolcano extends CardImpl {
|
|||
|
||||
// or return target Island to its owner's hand.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new ReturnToHandTargetEffect());
|
||||
mode.getTargets().add(new TargetPermanent(filterIsland));
|
||||
mode.addEffect(new ReturnToHandTargetEffect());
|
||||
mode.addTarget(new TargetPermanent(filterIsland));
|
||||
this.getSpellAbility().addMode(mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class AdarkarValkyrie extends CardImpl {
|
|||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another creature");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AdarkarValkyrie(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,23 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SpellCastControllerTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.continuous.BoostControlledEffect;
|
||||
import mage.constants.*;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author JRHerlehy
|
||||
*/
|
||||
public final class AdelizTheCinderWind extends CardImpl {
|
||||
|
|
@ -34,7 +31,7 @@ public final class AdelizTheCinderWind extends CardImpl {
|
|||
|
||||
public AdelizTheCinderWind(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}{R}");
|
||||
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.HUMAN, SubType.WIZARD);
|
||||
this.power = new MageInt(2);
|
||||
|
|
@ -48,7 +45,7 @@ public final class AdelizTheCinderWind extends CardImpl {
|
|||
|
||||
// Whenever you cast an instant or sorcery spell, Wizards you control get +1/+1 until end of turn.
|
||||
Effect effect = new BoostControlledEffect(1, 1, Duration.EndOfTurn, filter);
|
||||
Ability ability = new SpellCastControllerTriggeredAbility(effect, StaticFilters.FILTER_SPELL_INSTANT_OR_SORCERY, false);
|
||||
Ability ability = new SpellCastControllerTriggeredAbility(effect, StaticFilters.FILTER_SPELL_AN_INSTANT_OR_SORCERY, false);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ class ControllerDealtDamageByPiratesPredicate implements Predicate<Permanent> {
|
|||
|
||||
@Override
|
||||
public boolean apply(Permanent input, Game game) {
|
||||
DamagedByPiratesWatcher watcher = (DamagedByPiratesWatcher) game.getState().getWatchers().get(DamagedByPiratesWatcher.class.getSimpleName());
|
||||
DamagedByPiratesWatcher watcher = game.getState().getWatcher(DamagedByPiratesWatcher.class);
|
||||
if (watcher != null) {
|
||||
return watcher.damagedByEnoughPirates(input.getControllerId(), game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class AdmonitionAngel extends CardImpl {
|
|||
private static final FilterPermanent filter = new FilterPermanent("nonland permanent other than Admonition Angel");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class AdviceFromTheFaeEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
MageObject mageObject = game.getObject(source.getSourceId());
|
||||
if (controller != null) {
|
||||
if (controller != null && mageObject != null) {
|
||||
Set<Card> topCards = controller.getLibrary().getTopCards(game, 5);
|
||||
Cards cardsFromLibrary = new CardsImpl();
|
||||
for (Card card : topCards) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class AegisAngel extends CardImpl {
|
|||
private static final FilterPermanent filter = new FilterPermanent("another target permanent");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AegisAngel(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public final class AegisAutomaton extends CardImpl {
|
|||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another target creature you control");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AegisAutomaton(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ public final class AerialGuide extends CardImpl {
|
|||
static final FilterAttackingCreature filter = new FilterAttackingCreature("another target attacking creature");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AerialGuide(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.keyword.AdaptEffect;
|
||||
import mage.abilities.keyword.AdaptAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
|
|
@ -29,9 +27,7 @@ public final class Aeromunculus extends CardImpl {
|
|||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// {2}{G}{U}: Adapt 1.
|
||||
this.addAbility(new SimpleActivatedAbility(
|
||||
new AdaptEffect(1), new ManaCostsImpl("{2}{G}{U}")
|
||||
));
|
||||
this.addAbility(new AdaptAbility(1, "{2}{G}{U}"));
|
||||
}
|
||||
|
||||
public Aeromunculus(final Aeromunculus card) {
|
||||
|
|
|
|||
|
|
@ -13,29 +13,42 @@ import mage.game.Game;
|
|||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import static mage.filter.StaticFilters.FILTER_PERMANENT_CREATURES;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author magenoxx_at_gmail.com
|
||||
*/
|
||||
public final class AetherBurst extends CardImpl {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("cards named Aether Burst");
|
||||
|
||||
static {
|
||||
filter.add(new NamePredicate("Aether Burst"));
|
||||
}
|
||||
|
||||
public AetherBurst(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||
|
||||
// Return up to X target creatures to their owners' hands, where X is one plus the number of cards named Aether Burst in all graveyards as you cast Aether Burst.
|
||||
this.getSpellAbility().addEffect(new DynamicReturnToHandTargetEffect());
|
||||
this.getSpellAbility().addTarget(new DynamicTargetCreaturePermanent());
|
||||
this.getSpellAbility().setTargetAdjuster(AetherBurstAdjuster.instance);
|
||||
}
|
||||
|
||||
|
||||
public AetherBurst(final AetherBurst card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherBurst copy() {
|
||||
return new AetherBurst(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum AetherBurstAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
private static final FilterCard filter = new FilterCard("cards named Aether Burst");
|
||||
|
||||
static {
|
||||
filter.add(new NamePredicate("Aether Burst"));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -55,15 +68,6 @@ public final class AetherBurst extends CardImpl {
|
|||
target.setMaxNumberOfTargets(amount + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public AetherBurst(final AetherBurst card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherBurst copy() {
|
||||
return new AetherBurst(this);
|
||||
}
|
||||
}
|
||||
|
||||
class DynamicTargetCreaturePermanent extends TargetPermanent {
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public final class AetherShockwave extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new TapAllEffect(filterSpirit));
|
||||
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new TapAllEffect(filterNonSpirit));
|
||||
mode.addEffect(new TapAllEffect(filterNonSpirit));
|
||||
this.getSpellAbility().addMode(mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class AetherbornMarauderEffect extends OneShotEffect {
|
|||
Permanent sourceObject = game.getPermanent(source.getSourceId());
|
||||
if (controller != null && sourceObject != null) {
|
||||
FilterControlledPermanent filter = new FilterControlledPermanent("permanent you control to remove +1/+1 counters from");
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(new CounterPredicate(CounterType.P1P1));
|
||||
boolean firstRun = true;
|
||||
while (game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game) > 0) {
|
||||
|
|
|
|||
|
|
@ -50,8 +50,11 @@ class AetherfluxReservoirDynamicValue implements DynamicValue {
|
|||
|
||||
@Override
|
||||
public int calculate(Game game, Ability sourceAbility, Effect effect) {
|
||||
CastSpellLastTurnWatcher watcher = (CastSpellLastTurnWatcher) game.getState().getWatchers().get(CastSpellLastTurnWatcher.class.getSimpleName());
|
||||
return watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId());
|
||||
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
|
||||
if(watcher != null) {
|
||||
return watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(sourceAbility.getControllerId());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class AethersquallAncient extends CardImpl {
|
|||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("other creatures");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AethersquallAncient(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
|
|
@ -21,17 +20,17 @@ import mage.filter.common.FilterCreaturePermanent;
|
|||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public final class AetherstormRoc extends CardImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
public AetherstormRoc(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{W}");
|
||||
this.subtype.add(SubType.BIRD);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
|
@ -47,30 +46,32 @@ public final class AetherstormRoc extends CardImpl {
|
|||
Ability ability = new AttacksTriggeredAbility(doIfCostPaidEffect, false,
|
||||
"Whenever {this} attacks you may pay {E}{E}. If you do, put a +1/+1 counter on it and tap up to one target creature defending player controls.");
|
||||
ability.addTarget(new TargetCreaturePermanent(0, 1, new FilterCreaturePermanent("creature defending player controls"), false));
|
||||
originalId = ability.getOriginalId();
|
||||
ability.setTargetAdjuster(AetherstormRocAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
|
||||
}
|
||||
|
||||
public AetherstormRoc(final AetherstormRoc card) {
|
||||
super(card);
|
||||
this.originalId = card.originalId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (ability.getOriginalId().equals(originalId)) {
|
||||
ability.getTargets().clear();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
||||
filter.add(new ControllerIdPredicate(defenderId));
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AetherstormRoc copy() {
|
||||
return new AetherstormRoc(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum AetherstormRocAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
ability.getTargets().clear();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player controls");
|
||||
UUID defenderId = game.getCombat().getDefenderId(ability.getSourceId());
|
||||
filter.add(new ControllerIdPredicate(defenderId));
|
||||
TargetCreaturePermanent target = new TargetCreaturePermanent(0, 1, filter, false);
|
||||
ability.addTarget(target);
|
||||
}
|
||||
}
|
||||
|
|
@ -31,8 +31,8 @@ public final class Afterburn extends CardImpl {
|
|||
|
||||
// Remove target creature from combat.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new RemoveFromCombatTargetEffect());
|
||||
mode.getTargets().add(new TargetCreaturePermanent());
|
||||
mode.addEffect(new RemoveFromCombatTargetEffect());
|
||||
mode.addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class AggravateRequirementEffect extends RequirementEffect {
|
|||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
DamagedByWatcher watcher = (DamagedByWatcher) game.getState().getWatchers().get(DamagedByWatcher.class.getSimpleName(), source.getSourceId());
|
||||
DamagedByWatcher watcher = game.getState().getWatcher(DamagedByWatcher.class, source.getSourceId());
|
||||
if (watcher != null) {
|
||||
return watcher.wasDamaged(permanent, game);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class AinokGuide extends CardImpl {
|
|||
|
||||
// * Search your library for a basic land card, reveal it, then shuffle your library and put that card on top of it.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true));
|
||||
mode.addEffect(new SearchLibraryPutOnLibraryEffect(new TargetCardInLibrary(StaticFilters.FILTER_CARD_BASIC_LAND), true, true));
|
||||
ability.addMode(mode);
|
||||
this.addAbility(ability);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ public final class AjaniSteadfast extends CardImpl {
|
|||
private static final FilterPlaneswalkerPermanent filter = new FilterPlaneswalkerPermanent("other planeswalker you control");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ public final class AjaniUnyielding extends CardImpl {
|
|||
static {
|
||||
nonlandPermanentFilter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
|
||||
planeswalkerFilter.add(new ControllerPredicate(TargetController.YOU));
|
||||
planeswalkerFilter.add(new AnotherPredicate());
|
||||
planeswalkerFilter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AjaniUnyielding(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public final class AkoumFlameseeker extends CardImpl {
|
|||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.ALLY));
|
||||
filter.add(Predicates.not(new TappedPredicate()));
|
||||
filter.add(Predicates.not(TappedPredicate.instance));
|
||||
}
|
||||
|
||||
public AkoumFlameseeker(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class AkroanConscriptor extends CardImpl {
|
|||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AkroanConscriptor(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public final class AkroanHoplite extends CardImpl {
|
|||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(new AttackingPredicate());
|
||||
filter.add(AttackingPredicate.instance);
|
||||
}
|
||||
|
||||
public AkroanHoplite(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ public final class AlabasterPotion extends CardImpl {
|
|||
this.getSpellAbility().addEffect(new GainLifeTargetEffect(new ManacostVariableValue()));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, new ManacostVariableValue()));
|
||||
mode.getTargets().add(new TargetAnyTarget());
|
||||
mode.addEffect(new PreventDamageToTargetEffect(Duration.EndOfTurn, false, true, new ManacostVariableValue()));
|
||||
mode.addTarget(new TargetAnyTarget());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public final class Alarum extends CardImpl {
|
|||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nonattacking creature");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new AttackingPredicate()));
|
||||
filter.add(Predicates.not(AttackingPredicate.instance));
|
||||
}
|
||||
|
||||
public Alarum(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class AlhammarretsArchiveReplacementEffect extends ReplacementEffectImpl {
|
|||
if (event.getPlayerId().equals(source.getControllerId())) {
|
||||
if (game.isActivePlayer(event.getPlayerId())
|
||||
&& game.getPhase().getStep().getType() == PhaseStep.DRAW) {
|
||||
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get(CardsDrawnDuringDrawStepWatcher.class.getSimpleName());
|
||||
CardsDrawnDuringDrawStepWatcher watcher = game.getState().getWatcher(CardsDrawnDuringDrawStepWatcher.class);
|
||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ class WellEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
int life = 2 * game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
|
||||
if (player != null) {
|
||||
int life = 2 * game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
|
||||
player.gainLife(life, game, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ public final class AlleyEvasion extends CardImpl {
|
|||
|
||||
// Return target creature you control to its owner's hand.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new ReturnToHandTargetEffect());
|
||||
mode.getTargets().add(new TargetControlledCreaturePermanent());
|
||||
mode.addEffect(new ReturnToHandTargetEffect());
|
||||
mode.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.getSpellAbility().addMode(mode);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class AllianceOfArmsEffect extends OneShotEffect {
|
|||
payed = true;
|
||||
}
|
||||
}
|
||||
game.informPlayers(new StringBuilder(player.getLogName()).append(" pays {").append(xValue).append("}.").toString());
|
||||
game.informPlayers(player.getLogName() + " pays {" + xValue + "}.");
|
||||
return xValue;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public final class AltarGolem extends CardImpl {
|
|||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("untapped creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new TappedPredicate()));
|
||||
filter.add(Predicates.not(TappedPredicate.instance));
|
||||
}
|
||||
|
||||
public AltarGolem(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public final class AltarOfTheBrood extends CardImpl {
|
|||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("another permanent");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AltarOfTheBrood(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
|
||||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.SourceIsSpellCondition;
|
||||
|
|
@ -17,29 +15,31 @@ import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 10/4/2004 The mana cost of the creatures being cast is still the stated cost on the card,
|
||||
* even though you did not pay the cost.
|
||||
* 10/4/2004 The mana cost of the creatures being cast is still the stated cost on the card,
|
||||
* even though you did not pay the cost.
|
||||
* 10/4/2004 Aluren checks the actual printed cost on the creature card, and is not affected
|
||||
* by things which allow you to cast the spell for less.
|
||||
* 10/4/2004 You can't choose to cast a creature as though it had flash via Aluren and still pay the mana cost.
|
||||
* You either cast the creature normally, or via Aluren without paying the mana cost.
|
||||
* 10/4/2004 You can't use Aluren when casting a creature using another alternate means,
|
||||
* such as the Morph ability.
|
||||
* 8/1/2008 If creature with X in its cost is cast this way, X can only be 0.
|
||||
*
|
||||
* by things which allow you to cast the spell for less.
|
||||
* 10/4/2004 You can't choose to cast a creature as though it had flash via Aluren and still pay the mana cost.
|
||||
* You either cast the creature normally, or via Aluren without paying the mana cost.
|
||||
* 10/4/2004 You can't use Aluren when casting a creature using another alternate means,
|
||||
* such as the Morph ability.
|
||||
* 8/1/2008 If creature with X in its cost is cast this way, X can only be 0.
|
||||
*
|
||||
* @author emerald000
|
||||
*/
|
||||
public final class Aluren extends CardImpl {
|
||||
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("creature cards with converted mana cost 3 or less");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 4));
|
||||
}
|
||||
|
||||
|
||||
public Aluren(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{G}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{G}");
|
||||
|
||||
|
||||
// Any player may play creature cards with converted mana cost 3 or less without paying their mana cost
|
||||
|
|
@ -63,15 +63,15 @@ public final class Aluren extends CardImpl {
|
|||
}
|
||||
|
||||
class AlurenRuleEffect extends ContinuousEffectImpl {
|
||||
|
||||
|
||||
private static final FilterCreatureCard filter = new FilterCreatureCard("creature cards with converted mana cost 3 or less");
|
||||
|
||||
|
||||
static {
|
||||
filter.add(new ConvertedManaCostPredicate(ComparisonType.FEWER_THAN, 4));
|
||||
}
|
||||
|
||||
private static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(null, SourceIsSpellCondition.instance, null, filter, true);
|
||||
|
||||
|
||||
private static AlternativeCostSourceAbility alternativeCastingCostAbility = new AlternativeCostSourceAbility(null, SourceIsSpellCondition.instance, null, filter, true);
|
||||
|
||||
public AlurenRuleEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "Any player may cast creature cards with converted mana cost 3 or less without paying their mana cost";
|
||||
|
|
@ -90,12 +90,12 @@ class AlurenRuleEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId: game.getState().getPlayersInRange(controller.getId(), game)){
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
player.getAlternativeSourceCosts().add(alternativeCastingCostAbility);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -110,47 +110,4 @@ class AlurenRuleEffect extends ContinuousEffectImpl {
|
|||
public boolean hasLayer(Layer layer) {
|
||||
return layer == Layer.RulesEffects;
|
||||
}
|
||||
}
|
||||
|
||||
//class AlurenEffect extends CostModificationEffectImpl {
|
||||
//
|
||||
// AlurenEffect() {
|
||||
// super(Duration.WhileOnBattlefield, Outcome.PlayForFree, CostModificationType.SET_COST);
|
||||
// this.staticText = "Any player may play creature cards with converted mana cost 3 or less without paying their mana cost";
|
||||
// }
|
||||
//
|
||||
// AlurenEffect(final AlurenEffect effect) {
|
||||
// super(effect);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
// SpellAbility spellAbility = (SpellAbility) abilityToModify;
|
||||
// spellAbility.getManaCostsToPay().clear();
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
// if (abilityToModify instanceof SpellAbility) {
|
||||
// Card sourceCard = game.getCard(abilityToModify.getSourceId());
|
||||
// StackObject stackObject = game.getStack().getStackObject(abilityToModify.getSourceId());
|
||||
// if (stackObject != null && stackObject instanceof Spell) {
|
||||
// if (sourceCard != null && sourceCard.isCreature() && sourceCard.getConvertedManaCost() <= 3) {
|
||||
// Player player = game.getPlayer(stackObject.getControllerId());
|
||||
// String message = "Cast " + sourceCard.getName() + " without paying its mana costs?";
|
||||
// if (player != null &&
|
||||
// (CardUtil.isCheckPlayableMode(abilityToModify) || player.chooseUse(outcome, message, game))) {
|
||||
// return true;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public AlurenEffect copy() {
|
||||
// return new AlurenEffect(this);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
|
@ -26,7 +26,7 @@ public final class AlwaysWatching extends CardImpl {
|
|||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("nontoken creatures");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new TokenPredicate()));
|
||||
filter.add(Predicates.not(TokenPredicate.instance));
|
||||
}
|
||||
|
||||
public AlwaysWatching(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public final class AmbushKrotiq extends CardImpl {
|
|||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another creature you control");
|
||||
|
||||
static {
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AmbushKrotiq(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public class AminatouTheFateShifter extends CardImpl {
|
|||
|
||||
static {
|
||||
filter.add(new OwnerPredicate(TargetController.YOU));
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AminatouTheFateShifter(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
90
Mage.Sets/src/mage/cards/a/Amplifire.java
Normal file
90
Mage.Sets/src/mage/cards/a/Amplifire.java
Normal file
|
|
@ -0,0 +1,90 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.SetPowerToughnessSourceEffect;
|
||||
import mage.cards.*;
|
||||
import mage.constants.*;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class Amplifire extends CardImpl {
|
||||
|
||||
public Amplifire(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}{R}");
|
||||
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// At the beginning of your upkeep, reveal cards from the top of your library until you reveal a creature card. Until your next turn, Amplifire's base power becomes twice that card's power and its base toughness becomes twice that card's toughness. Put the revealed cards on the bottom of your library in a random order.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(
|
||||
new AmplifireEffect(), TargetController.YOU, false
|
||||
));
|
||||
}
|
||||
|
||||
private Amplifire(final Amplifire card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Amplifire copy() {
|
||||
return new Amplifire(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AmplifireEffect extends OneShotEffect {
|
||||
|
||||
AmplifireEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "reveal cards from the top of your library until you reveal a creature card. " +
|
||||
"Until your next turn, {this}'s base power becomes twice that card's power " +
|
||||
"and its base toughness becomes twice that card's toughness. " +
|
||||
"Put the revealed cards on the bottom of your library in a random order.";
|
||||
}
|
||||
|
||||
private AmplifireEffect(final AmplifireEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AmplifireEffect copy() {
|
||||
return new AmplifireEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Cards cards = new CardsImpl();
|
||||
Card lastCard = null;
|
||||
for (Card card : player.getLibrary().getCards(game)) {
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
if (card.isCreature()) {
|
||||
lastCard = card;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
player.revealCards(source, cards, game);
|
||||
if (lastCard != null) {
|
||||
game.addEffect(new SetPowerToughnessSourceEffect(
|
||||
2 * lastCard.getPower().getValue(),
|
||||
2 * lastCard.getToughness().getValue(),
|
||||
Duration.UntilYourNextTurn
|
||||
), source);
|
||||
}
|
||||
player.putCardsOnBottomOfLibrary(cards, game, source, false);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -34,7 +34,7 @@ public final class AnaBattlemage extends CardImpl {
|
|||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("untapped creature");
|
||||
static {
|
||||
filter.add(Predicates.not(new TappedPredicate()));
|
||||
filter.add(Predicates.not(TappedPredicate.instance));
|
||||
}
|
||||
|
||||
public AnaBattlemage(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ public final class AnabaAncestor extends CardImpl {
|
|||
|
||||
static {
|
||||
filter.add(new SubtypePredicate(SubType.MINOTAUR));
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AnabaAncestor(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
|
|
@ -25,8 +25,8 @@ public final class AnafenzaKinTreeSpirit extends CardImpl {
|
|||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another nontoken creature");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.not(new TokenPredicate()));
|
||||
filter.add(new AnotherPredicate());
|
||||
filter.add(Predicates.not(TokenPredicate.instance));
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public AnafenzaKinTreeSpirit(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue