mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
[refactoring][minor] Replaced all tabs with four spaces.
This commit is contained in:
parent
e646e4768d
commit
239a4fb100
2891 changed files with 79411 additions and 79411 deletions
|
|
@ -38,35 +38,35 @@ import mage.sets.Sets;
|
|||
*/
|
||||
public class DecDeckImporter extends DeckImporterImpl {
|
||||
|
||||
@Override
|
||||
protected void readLine(String line, DeckCardLists deckList) {
|
||||
if (line.length() == 0 || line.startsWith("//")) return;
|
||||
boolean sideboard = false;
|
||||
if (line.startsWith("SB:")) {
|
||||
line = line.substring(3).trim();
|
||||
sideboard = true;
|
||||
}
|
||||
int delim = line.indexOf(' ');
|
||||
String lineNum = line.substring(0, delim).trim();
|
||||
String lineName = line.substring(delim).trim();
|
||||
try {
|
||||
int num = Integer.parseInt(lineNum);
|
||||
Card card = Sets.findCard(lineName);
|
||||
if (card == null)
|
||||
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
|
||||
else {
|
||||
String cardName = card.getClass().getCanonicalName();
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (!sideboard)
|
||||
deckList.getCards().add(cardName);
|
||||
else
|
||||
deckList.getSideboard().add(cardName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void readLine(String line, DeckCardLists deckList) {
|
||||
if (line.length() == 0 || line.startsWith("//")) return;
|
||||
boolean sideboard = false;
|
||||
if (line.startsWith("SB:")) {
|
||||
line = line.substring(3).trim();
|
||||
sideboard = true;
|
||||
}
|
||||
int delim = line.indexOf(' ');
|
||||
String lineNum = line.substring(0, delim).trim();
|
||||
String lineName = line.substring(delim).trim();
|
||||
try {
|
||||
int num = Integer.parseInt(lineNum);
|
||||
Card card = Sets.findCard(lineName);
|
||||
if (card == null)
|
||||
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
|
||||
else {
|
||||
String cardName = card.getClass().getCanonicalName();
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (!sideboard)
|
||||
deckList.getCards().add(cardName);
|
||||
else
|
||||
deckList.getSideboard().add(cardName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ import mage.cards.decks.DeckCardLists;
|
|||
*/
|
||||
public interface DeckImporter {
|
||||
|
||||
public DeckCardLists importDeck(String file);
|
||||
public String getErrors();
|
||||
public DeckCardLists importDeck(String file);
|
||||
public String getErrors();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,44 +39,44 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public abstract class DeckImporterImpl implements DeckImporter {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(DeckImporterImpl.class);
|
||||
protected StringBuilder sbMessage = new StringBuilder();
|
||||
protected int lineCount;
|
||||
private final static Logger logger = Logger.getLogger(DeckImporterImpl.class);
|
||||
protected StringBuilder sbMessage = new StringBuilder();
|
||||
protected int lineCount;
|
||||
|
||||
@Override
|
||||
public DeckCardLists importDeck(String file) {
|
||||
File f = new File(file);
|
||||
DeckCardLists deckList = new DeckCardLists();
|
||||
lineCount = 0;
|
||||
sbMessage.setLength(0);
|
||||
try {
|
||||
Scanner scanner = new Scanner(f);
|
||||
try {
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine().trim();
|
||||
lineCount++;
|
||||
readLine(line, deckList);
|
||||
}
|
||||
if (sbMessage.length() > 0) {
|
||||
@Override
|
||||
public DeckCardLists importDeck(String file) {
|
||||
File f = new File(file);
|
||||
DeckCardLists deckList = new DeckCardLists();
|
||||
lineCount = 0;
|
||||
sbMessage.setLength(0);
|
||||
try {
|
||||
Scanner scanner = new Scanner(f);
|
||||
try {
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.nextLine().trim();
|
||||
lineCount++;
|
||||
readLine(line, deckList);
|
||||
}
|
||||
if (sbMessage.length() > 0) {
|
||||
logger.fatal(sbMessage);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logger.fatal(null, ex);
|
||||
}
|
||||
finally {
|
||||
scanner.close();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.fatal(null, ex);
|
||||
}
|
||||
return deckList;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
logger.fatal(null, ex);
|
||||
}
|
||||
finally {
|
||||
scanner.close();
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
logger.fatal(null, ex);
|
||||
}
|
||||
return deckList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getErrors(){
|
||||
return sbMessage.toString();
|
||||
}
|
||||
|
||||
protected abstract void readLine(String line, DeckCardLists deckList);
|
||||
protected abstract void readLine(String line, DeckCardLists deckList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,51 +39,51 @@ import mage.sets.Sets;
|
|||
*/
|
||||
public class MWSDeckImporter extends DeckImporterImpl {
|
||||
|
||||
@Override
|
||||
protected void readLine(String line, DeckCardLists deckList) {
|
||||
if (line.length() == 0 || line.startsWith("//")) return;
|
||||
boolean sideboard = false;
|
||||
if (line.startsWith("SB:")) {
|
||||
line = line.substring(3).trim();
|
||||
sideboard = true;
|
||||
}
|
||||
int delim = line.indexOf(' ');
|
||||
String lineNum = line.substring(0, delim).trim();
|
||||
String setCode = "";
|
||||
if (line.indexOf('[') != -1 ) {
|
||||
int setStart = line.indexOf('[') + 1;
|
||||
int setEnd = line.indexOf(']');
|
||||
setCode = line.substring(setStart, setEnd).trim();
|
||||
delim = setEnd;
|
||||
}
|
||||
String lineName = line.substring(delim + 1).trim();
|
||||
try {
|
||||
int num = Integer.parseInt(lineNum);
|
||||
ExpansionSet set = null;
|
||||
if (setCode.length() > 0)
|
||||
set = Sets.findSet(setCode);
|
||||
Card card;
|
||||
if (set != null) {
|
||||
card = set.findCard(lineName);
|
||||
}
|
||||
else {
|
||||
card = Sets.findCard(lineName);
|
||||
}
|
||||
if (card == null)
|
||||
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
|
||||
else {
|
||||
String cardName = card.getClass().getCanonicalName();
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (!sideboard)
|
||||
deckList.getCards().add(cardName);
|
||||
else
|
||||
deckList.getSideboard().add(cardName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void readLine(String line, DeckCardLists deckList) {
|
||||
if (line.length() == 0 || line.startsWith("//")) return;
|
||||
boolean sideboard = false;
|
||||
if (line.startsWith("SB:")) {
|
||||
line = line.substring(3).trim();
|
||||
sideboard = true;
|
||||
}
|
||||
int delim = line.indexOf(' ');
|
||||
String lineNum = line.substring(0, delim).trim();
|
||||
String setCode = "";
|
||||
if (line.indexOf('[') != -1 ) {
|
||||
int setStart = line.indexOf('[') + 1;
|
||||
int setEnd = line.indexOf(']');
|
||||
setCode = line.substring(setStart, setEnd).trim();
|
||||
delim = setEnd;
|
||||
}
|
||||
String lineName = line.substring(delim + 1).trim();
|
||||
try {
|
||||
int num = Integer.parseInt(lineNum);
|
||||
ExpansionSet set = null;
|
||||
if (setCode.length() > 0)
|
||||
set = Sets.findSet(setCode);
|
||||
Card card;
|
||||
if (set != null) {
|
||||
card = set.findCard(lineName);
|
||||
}
|
||||
else {
|
||||
card = Sets.findCard(lineName);
|
||||
}
|
||||
if (card == null)
|
||||
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
|
||||
else {
|
||||
String cardName = card.getClass().getCanonicalName();
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (!sideboard)
|
||||
deckList.getCards().add(cardName);
|
||||
else
|
||||
deckList.getSideboard().add(cardName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,36 +38,36 @@ import mage.sets.Sets;
|
|||
*/
|
||||
public class TxtDeckImporter extends DeckImporterImpl {
|
||||
|
||||
private boolean sideboard = false;
|
||||
private boolean sideboard = false;
|
||||
|
||||
@Override
|
||||
protected void readLine(String line, DeckCardLists deckList) {
|
||||
if (line.length() == 0 || line.startsWith("//")) return;
|
||||
if (line.startsWith("Sideboard")) {
|
||||
sideboard = true;
|
||||
return;
|
||||
}
|
||||
int delim = line.indexOf(' ');
|
||||
String lineNum = line.substring(0, delim).trim();
|
||||
String lineName = line.substring(delim).trim();
|
||||
try {
|
||||
int num = Integer.parseInt(lineNum);
|
||||
Card card = Sets.findCard(lineName);
|
||||
if (card == null)
|
||||
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
|
||||
else {
|
||||
String cardName = card.getClass().getCanonicalName();
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (!sideboard)
|
||||
deckList.getCards().add(cardName);
|
||||
else
|
||||
deckList.getSideboard().add(cardName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void readLine(String line, DeckCardLists deckList) {
|
||||
if (line.length() == 0 || line.startsWith("//")) return;
|
||||
if (line.startsWith("Sideboard")) {
|
||||
sideboard = true;
|
||||
return;
|
||||
}
|
||||
int delim = line.indexOf(' ');
|
||||
String lineNum = line.substring(0, delim).trim();
|
||||
String lineName = line.substring(delim).trim();
|
||||
try {
|
||||
int num = Integer.parseInt(lineNum);
|
||||
Card card = Sets.findCard(lineName);
|
||||
if (card == null)
|
||||
sbMessage.append("Could not find card: '").append(lineName).append("' at line ").append(lineCount).append("\n");
|
||||
else {
|
||||
String cardName = card.getClass().getCanonicalName();
|
||||
for (int i = 0; i < num; i++) {
|
||||
if (!sideboard)
|
||||
deckList.getCards().add(cardName);
|
||||
else
|
||||
deckList.getSideboard().add(cardName);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NumberFormatException nfe) {
|
||||
sbMessage.append("Invalid number: ").append(lineNum).append(" at line ").append(lineCount).append("\n");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,22 +38,22 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class AlaraReborn extends ExpansionSet {
|
||||
|
||||
private static final AlaraReborn fINSTANCE = new AlaraReborn();
|
||||
private static final AlaraReborn fINSTANCE = new AlaraReborn();
|
||||
|
||||
public static AlaraReborn getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static AlaraReborn getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private AlaraReborn() {
|
||||
super("Alara Reborn", "ARB", "seticon_mtgarb", "mage.sets.alarareborn", new GregorianCalendar(2009, 3, 25).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Shards of Alara";
|
||||
this.parentSet = ShardsOfAlara.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private AlaraReborn() {
|
||||
super("Alara Reborn", "ARB", "seticon_mtgarb", "mage.sets.alarareborn", new GregorianCalendar(2009, 3, 25).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Shards of Alara";
|
||||
this.parentSet = ShardsOfAlara.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import java.util.GregorianCalendar;
|
|||
public class Apocalypse extends ExpansionSet {
|
||||
private static final Apocalypse fINSTANCE = new Apocalypse();
|
||||
|
||||
public static Apocalypse getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Apocalypse getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Apocalypse() {
|
||||
super("Apocalypse", "APC", "", "mage.sets.apocalypse", new GregorianCalendar(2001, 5, 1).getTime(), Constants.SetType.EXPANSION);
|
||||
|
|
|
|||
|
|
@ -8,19 +8,19 @@ import java.util.GregorianCalendar;
|
|||
public class ChampionsOfKamigawa extends ExpansionSet {
|
||||
private static final ChampionsOfKamigawa fINSTANCE = new ChampionsOfKamigawa();
|
||||
|
||||
public static ChampionsOfKamigawa getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static ChampionsOfKamigawa getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private ChampionsOfKamigawa() {
|
||||
super("Champions of Kamigawa", "CHK", "", "mage.sets.championsofkamigawa", new GregorianCalendar(2004, 9, 1).getTime(), Constants.SetType.EXPANSION);
|
||||
this.blockName = "Kamigawa";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,22 +38,22 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class Conflux extends ExpansionSet {
|
||||
|
||||
private static final Conflux fINSTANCE = new Conflux();
|
||||
private static final Conflux fINSTANCE = new Conflux();
|
||||
|
||||
public static Conflux getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Conflux getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Conflux() {
|
||||
super("Conflux", "CON", "seticon_conflux", "mage.sets.conflux", new GregorianCalendar(2009, 0, 31).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Shards of Alara";
|
||||
this.parentSet = ShardsOfAlara.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private Conflux() {
|
||||
super("Conflux", "CON", "seticon_conflux", "mage.sets.conflux", new GregorianCalendar(2009, 0, 31).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Shards of Alara";
|
||||
this.parentSet = ShardsOfAlara.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,10 +47,10 @@ public class DarkAscension extends ExpansionSet {
|
|||
super("Dark Ascension", "DKA", "seticon_mtgdka", "mage.sets.darkascension", new GregorianCalendar(2012, 1, 3).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Innistrad";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,9 +9,9 @@ public class Darksteel extends ExpansionSet {
|
|||
|
||||
private static final Darksteel fINSTANCE = new Darksteel();
|
||||
|
||||
public static Darksteel getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Darksteel getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
public Darksteel() {
|
||||
super("Darksteel", "DST", "", "mage.sets.darksteel", new GregorianCalendar(2004, 1, 6).getTime(), Constants.SetType.EXPANSION);
|
||||
|
|
|
|||
|
|
@ -42,9 +42,9 @@ public class Dissension extends ExpansionSet {
|
|||
|
||||
private static final Dissension fINSTANCE = new Dissension();
|
||||
|
||||
public static Dissension getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Dissension getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Dissension() {
|
||||
super("Dissension", "DIS", "", "mage.sets.dissension", new GregorianCalendar(2006, 4, 5).getTime(), Constants.SetType.EXPANSION);
|
||||
|
|
|
|||
|
|
@ -6,20 +6,20 @@ import mage.cards.ExpansionSet;
|
|||
|
||||
public class EighthEdition extends ExpansionSet {
|
||||
|
||||
private static final EighthEdition fINSTANCE = new EighthEdition();
|
||||
private static final EighthEdition fINSTANCE = new EighthEdition();
|
||||
|
||||
public static EighthEdition getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static EighthEdition getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private EighthEdition() {
|
||||
super("Eighth Edition", "8ED", "", "mage.sets.eighthedition", new GregorianCalendar(2003, 7, 28).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private EighthEdition() {
|
||||
super("Eighth Edition", "8ED", "", "mage.sets.eighthedition", new GregorianCalendar(2003, 7, 28).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import java.util.GregorianCalendar;
|
|||
public class ElspethvsTezzeret extends ExpansionSet {
|
||||
private static final ElspethvsTezzeret fINSTANCE = new ElspethvsTezzeret();
|
||||
|
||||
public static ElspethvsTezzeret getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static ElspethvsTezzeret getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private ElspethvsTezzeret() {
|
||||
super("Duel Decks: Elspeth vs. Tezzeret", "DDF", "", "mage.sets.elspethvstezzeret", new GregorianCalendar(2010, 8, 3).getTime(), Constants.SetType.REPRINT);
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import java.util.GregorianCalendar;
|
|||
public class Eventide extends ExpansionSet {
|
||||
private static final Eventide fINSTANCE = new Eventide();
|
||||
|
||||
public static Eventide getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Eventide getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Eventide() {
|
||||
super("Eventide", "EVE", "", "mage.sets.eventide", new GregorianCalendar(2008, 6, 25).getTime(), Constants.SetType.EXPANSION);
|
||||
|
|
|
|||
|
|
@ -6,20 +6,20 @@ import mage.cards.ExpansionSet;
|
|||
|
||||
public class FifthEdition extends ExpansionSet {
|
||||
|
||||
private static final FifthEdition fINSTANCE = new FifthEdition();
|
||||
private static final FifthEdition fINSTANCE = new FifthEdition();
|
||||
|
||||
public static FifthEdition getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static FifthEdition getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private FifthEdition() {
|
||||
super("Fifth Edition", "5ED", "", "mage.sets.fifthedition", new GregorianCalendar(1997, 3, 1).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private FifthEdition() {
|
||||
super("Fifth Edition", "5ED", "", "mage.sets.fifthedition", new GregorianCalendar(1997, 3, 1).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -42,9 +42,9 @@ import java.util.GregorianCalendar;
|
|||
public class Guildpact extends ExpansionSet {
|
||||
private static final Guildpact fINSTANCE = new Guildpact();
|
||||
|
||||
public static Guildpact getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Guildpact getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Guildpact() {
|
||||
super("Guildpact", "GPT", "", "mage.sets.guildpact", new GregorianCalendar(2006, 1, 3).getTime(), Constants.SetType.EXPANSION);
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ import java.util.GregorianCalendar;
|
|||
public class Guru extends ExpansionSet {
|
||||
private static final Guru fINSTANCE = new Guru();
|
||||
|
||||
public static Guru getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Guru getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Guru() {
|
||||
//TODO find correct release date, wiki don't known anything about this expansion
|
||||
|
|
|
|||
|
|
@ -38,18 +38,18 @@ import mage.cards.ExpansionSet;
|
|||
public class Invasion extends ExpansionSet {
|
||||
private static final Invasion fINSTANCE = new Invasion();
|
||||
|
||||
public static Invasion getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Invasion getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Invasion() {
|
||||
super("Invasion", "INV", "", "mage.sets.invasion", new GregorianCalendar(2000, 9, 2).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Invasion";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,20 +38,20 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class Magic2010 extends ExpansionSet {
|
||||
|
||||
private static final Magic2010 fINSTANCE = new Magic2010();
|
||||
private static final Magic2010 fINSTANCE = new Magic2010();
|
||||
|
||||
public static Magic2010 getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Magic2010 getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Magic2010() {
|
||||
super("Magic 2010", "M10", "seticon_M10", "mage.sets.magic2010", new GregorianCalendar(2009, 6, 17).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private Magic2010() {
|
||||
super("Magic 2010", "M10", "seticon_M10", "mage.sets.magic2010", new GregorianCalendar(2009, 6, 17).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,20 +38,20 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class Magic2011 extends ExpansionSet {
|
||||
|
||||
private static final Magic2011 fINSTANCE = new Magic2011();
|
||||
private static final Magic2011 fINSTANCE = new Magic2011();
|
||||
|
||||
public static Magic2011 getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Magic2011 getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Magic2011() {
|
||||
super("Magic 2011", "M11", "seticon_M11", "mage.sets.magic2011", new GregorianCalendar(2010, 6, 16).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private Magic2011() {
|
||||
super("Magic 2011", "M11", "seticon_M11", "mage.sets.magic2011", new GregorianCalendar(2010, 6, 16).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,18 +8,18 @@ import java.util.GregorianCalendar;
|
|||
public class Mirrodin extends ExpansionSet {
|
||||
private static final Mirrodin fINSTANCE = new Mirrodin();
|
||||
|
||||
public static Mirrodin getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Mirrodin getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Mirrodin() {
|
||||
super("Mirrodin", "MRD", "", "mage.sets.mirrodin", new GregorianCalendar(2003, 9, 2).getTime(), Constants.SetType.EXPANSION);
|
||||
this.blockName = "Mirrodin";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,21 +39,21 @@ import java.util.GregorianCalendar;
|
|||
*/
|
||||
public class MirrodinBesieged extends ExpansionSet {
|
||||
|
||||
private static final MirrodinBesieged fINSTANCE = new MirrodinBesieged();
|
||||
private static final MirrodinBesieged fINSTANCE = new MirrodinBesieged();
|
||||
|
||||
public static MirrodinBesieged getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static MirrodinBesieged getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private MirrodinBesieged() {
|
||||
super("Mirrodin Besieged", "MBS", "seticon_mtgmbs", "mage.sets.mirrodinbesieged", new GregorianCalendar(2011, 1, 4).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Mirrodin Besieged";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private MirrodinBesieged() {
|
||||
super("Mirrodin Besieged", "MBS", "seticon_mtgmbs", "mage.sets.mirrodinbesieged", new GregorianCalendar(2011, 1, 4).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Mirrodin Besieged";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,18 +8,18 @@ import java.util.GregorianCalendar;
|
|||
public class NewPhyrexia extends ExpansionSet {
|
||||
private static final NewPhyrexia fINSTANCE = new NewPhyrexia();
|
||||
|
||||
public static NewPhyrexia getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static NewPhyrexia getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private NewPhyrexia() {
|
||||
private NewPhyrexia() {
|
||||
super("New Phyrexia", "NPH", "", "mage.sets.newphyrexia", new GregorianCalendar(2011, 4, 4).getTime(), Constants.SetType.EXPANSION);
|
||||
this.blockName = "Mirrodin Besieged";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,20 +6,20 @@ import mage.cards.ExpansionSet;
|
|||
|
||||
public class NinthEdition extends ExpansionSet {
|
||||
|
||||
private static final NinthEdition fINSTANCE = new NinthEdition();
|
||||
private static final NinthEdition fINSTANCE = new NinthEdition();
|
||||
|
||||
public static NinthEdition getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static NinthEdition getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private NinthEdition() {
|
||||
super("Ninth Edition", "9ED", "", "mage.sets.ninthedition", new GregorianCalendar(2005, 7, 29).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private NinthEdition() {
|
||||
super("Ninth Edition", "9ED", "", "mage.sets.ninthedition", new GregorianCalendar(2005, 7, 29).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -8,18 +8,18 @@ import java.util.GregorianCalendar;
|
|||
public class Onslaught extends ExpansionSet {
|
||||
private static final Onslaught fINSTANCE = new Onslaught();
|
||||
|
||||
public static Onslaught getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Onslaught getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Onslaught() {
|
||||
super("Onslaught", "ONS", "", "mage.sets.onslaught", new GregorianCalendar(2002, 10, 7).getTime(), Constants.SetType.EXPANSION);
|
||||
this.blockName = "Onslaught";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -38,14 +38,14 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class Planechase extends ExpansionSet {
|
||||
|
||||
private static final Planechase fINSTANCE = new Planechase();
|
||||
private static final Planechase fINSTANCE = new Planechase();
|
||||
|
||||
public static Planechase getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Planechase getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Planechase() {
|
||||
super("Planechase", "HOP", "", "mage.sets.planechase", new GregorianCalendar(2009, 8, 4).getTime(), SetType.REPRINT);
|
||||
}
|
||||
private Planechase() {
|
||||
super("Planechase", "HOP", "", "mage.sets.planechase", new GregorianCalendar(2009, 8, 4).getTime(), SetType.REPRINT);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ public class RavnicaCityOfGuilds extends ExpansionSet {
|
|||
this.blockName = "Ravnika";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,22 +38,22 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class RiseOfTheEldrazi extends ExpansionSet {
|
||||
|
||||
private static final RiseOfTheEldrazi fINSTANCE = new RiseOfTheEldrazi();
|
||||
private static final RiseOfTheEldrazi fINSTANCE = new RiseOfTheEldrazi();
|
||||
|
||||
public static RiseOfTheEldrazi getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static RiseOfTheEldrazi getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private RiseOfTheEldrazi() {
|
||||
super("Rise of the Eldrazi", "ROE", "seticon_ROE", "mage.sets.riseoftheeldrazi", new GregorianCalendar(2010, 3, 17).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Zendikar";
|
||||
this.parentSet = Zendikar.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private RiseOfTheEldrazi() {
|
||||
super("Rise of the Eldrazi", "ROE", "seticon_ROE", "mage.sets.riseoftheeldrazi", new GregorianCalendar(2010, 3, 17).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Zendikar";
|
||||
this.parentSet = Zendikar.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,21 +39,21 @@ import java.util.GregorianCalendar;
|
|||
*/
|
||||
public class ScarsOfMirrodin extends ExpansionSet {
|
||||
|
||||
private static final ScarsOfMirrodin fINSTANCE = new ScarsOfMirrodin();
|
||||
private static final ScarsOfMirrodin fINSTANCE = new ScarsOfMirrodin();
|
||||
|
||||
public static ScarsOfMirrodin getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static ScarsOfMirrodin getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private ScarsOfMirrodin() {
|
||||
super("Scars of Mirrodin", "SOM", "seticon_mtgsom", "mage.sets.scarsofmirrodin", new GregorianCalendar(2010, 10, 1).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Mirrodin Besieged";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private ScarsOfMirrodin() {
|
||||
super("Scars of Mirrodin", "SOM", "seticon_mtgsom", "mage.sets.scarsofmirrodin", new GregorianCalendar(2010, 10, 1).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Mirrodin Besieged";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,25 +49,25 @@ import java.util.*;
|
|||
*/
|
||||
public class Sets extends HashMap<String, ExpansionSet> {
|
||||
|
||||
private final static Logger logger = Logger.getLogger(Sets.class);
|
||||
private static final Sets fINSTANCE = new Sets();
|
||||
private static Set<String> names;
|
||||
private static Set<String> nonLandNames;
|
||||
private static Set<String> creatureTypes;
|
||||
private static List<Card> cards;
|
||||
private final static Logger logger = Logger.getLogger(Sets.class);
|
||||
private static final Sets fINSTANCE = new Sets();
|
||||
private static Set<String> names;
|
||||
private static Set<String> nonLandNames;
|
||||
private static Set<String> creatureTypes;
|
||||
private static List<Card> cards;
|
||||
private static Map<String, Card> cardMap;
|
||||
protected static Random rnd = new Random();
|
||||
|
||||
public static Sets getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Sets getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Sets() {
|
||||
names = new TreeSet<String>();
|
||||
nonLandNames = new TreeSet<String>();
|
||||
cards = new ArrayList<Card>();
|
||||
private Sets() {
|
||||
names = new TreeSet<String>();
|
||||
nonLandNames = new TreeSet<String>();
|
||||
cards = new ArrayList<Card>();
|
||||
cardMap = new HashMap<String, Card>();
|
||||
creatureTypes = new TreeSet<String>();
|
||||
creatureTypes = new TreeSet<String>();
|
||||
this.addSet(AlaraReborn.getInstance());
|
||||
this.addSet(Apocalypse.getInstance());
|
||||
this.addSet(AvacynRestored.getInstance());
|
||||
|
|
@ -116,11 +116,11 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
this.addSet(Weatherlight.getInstance());
|
||||
this.addSet(Worldwake.getInstance());
|
||||
this.addSet(Zendikar.getInstance());
|
||||
}
|
||||
}
|
||||
|
||||
private void addSet(ExpansionSet set) {
|
||||
this.put(set.getCode(), set);
|
||||
}
|
||||
private void addSet(ExpansionSet set) {
|
||||
this.put(set.getCode(), set);
|
||||
}
|
||||
|
||||
private static void loadCards() {
|
||||
if (cards.isEmpty()) {
|
||||
|
|
@ -148,33 +148,33 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
}
|
||||
}
|
||||
|
||||
public static Set<String> getCardNames() {
|
||||
public static Set<String> getCardNames() {
|
||||
if (names.isEmpty()) {
|
||||
loadCards();
|
||||
}
|
||||
return names;
|
||||
}
|
||||
return names;
|
||||
}
|
||||
|
||||
public static Set<String> getNonLandCardNames() {
|
||||
public static Set<String> getNonLandCardNames() {
|
||||
if (nonLandNames.isEmpty()) {
|
||||
loadCards();
|
||||
}
|
||||
return nonLandNames;
|
||||
}
|
||||
return nonLandNames;
|
||||
}
|
||||
|
||||
public static Set<String> getCreatureTypes() {
|
||||
public static Set<String> getCreatureTypes() {
|
||||
if (creatureTypes.isEmpty()) {
|
||||
loadCards();
|
||||
}
|
||||
return creatureTypes;
|
||||
}
|
||||
return creatureTypes;
|
||||
}
|
||||
|
||||
public static Card getRandomCard() {
|
||||
public static Card getRandomCard() {
|
||||
if (cards.isEmpty()) {
|
||||
loadCards();
|
||||
}
|
||||
return cards.get(rnd.nextInt(cards.size()));
|
||||
}
|
||||
return cards.get(rnd.nextInt(cards.size()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generates card pool of cardsCount cards that have manacost of allowed colors.
|
||||
|
|
@ -187,25 +187,25 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
List<Card> cardPool = new ArrayList<Card>();
|
||||
|
||||
int count = 0;
|
||||
int tries = 0;
|
||||
while (count < cardsCount) {
|
||||
Card card = getRandomCard();
|
||||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
if (cardFitsChosenColors(card, allowedColors)) {
|
||||
cardPool.add(card);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
tries++;
|
||||
if (tries > 4096) { // to avoid infinite loop
|
||||
throw new IllegalStateException("Not enough cards for chosen colors to generate deck: " + allowedColors);
|
||||
}
|
||||
}
|
||||
int tries = 0;
|
||||
while (count < cardsCount) {
|
||||
Card card = getRandomCard();
|
||||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
if (cardFitsChosenColors(card, allowedColors)) {
|
||||
cardPool.add(card);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
tries++;
|
||||
if (tries > 4096) { // to avoid infinite loop
|
||||
throw new IllegalStateException("Not enough cards for chosen colors to generate deck: " + allowedColors);
|
||||
}
|
||||
}
|
||||
|
||||
return cardPool;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Check that card can be played using chosen (allowed) colors.
|
||||
*
|
||||
* @param card
|
||||
|
|
@ -213,64 +213,64 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
* @return
|
||||
*/
|
||||
private static boolean cardFitsChosenColors(Card card, List<ColoredManaSymbol> allowedColors) {
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (!card.getSupertype().contains("Basic")) {
|
||||
int score = 0;
|
||||
for (Mana mana : card.getMana()) {
|
||||
for (ColoredManaSymbol color : allowedColors) {
|
||||
score += mana.getColor(color);
|
||||
}
|
||||
}
|
||||
if (score > 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (String symbol : card.getManaCost().getSymbols()) {
|
||||
boolean found = false;
|
||||
symbol = symbol.replace("{", "").replace("}", "");
|
||||
if (isColoredMana(symbol)) {
|
||||
for (ColoredManaSymbol allowed : allowedColors) {
|
||||
if (allowed.toString().equals(symbol)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (!card.getSupertype().contains("Basic")) {
|
||||
int score = 0;
|
||||
for (Mana mana : card.getMana()) {
|
||||
for (ColoredManaSymbol color : allowedColors) {
|
||||
score += mana.getColor(color);
|
||||
}
|
||||
}
|
||||
if (score > 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (String symbol : card.getManaCost().getSymbols()) {
|
||||
boolean found = false;
|
||||
symbol = symbol.replace("{", "").replace("}", "");
|
||||
if (isColoredMana(symbol)) {
|
||||
for (ColoredManaSymbol allowed : allowedColors) {
|
||||
if (allowed.toString().equals(symbol)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected static boolean isColoredMana(String symbol) {
|
||||
return symbol.equals("W") || symbol.equals("G") || symbol.equals("U") || symbol.equals("B") || symbol.equals("R");
|
||||
}
|
||||
|
||||
public static Deck generateDeck() {
|
||||
List<ColoredManaSymbol> allowedColors = new ArrayList<ColoredManaSymbol>();
|
||||
int numColors = rnd.nextInt(2) + 1;
|
||||
public static Deck generateDeck() {
|
||||
List<ColoredManaSymbol> allowedColors = new ArrayList<ColoredManaSymbol>();
|
||||
int numColors = rnd.nextInt(2) + 1;
|
||||
int cardPoolSize = 60;
|
||||
if (numColors > 2) {
|
||||
cardPoolSize += 20;
|
||||
}
|
||||
Deck deck = new Deck();
|
||||
Deck deck = new Deck();
|
||||
|
||||
return deck;
|
||||
}
|
||||
return deck;
|
||||
}
|
||||
|
||||
public static Card findCard(String name) {
|
||||
for (ExpansionSet set: fINSTANCE.values()) {
|
||||
Card card = set.findCard(name);
|
||||
if (card != null)
|
||||
return card;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static Card findCard(String name) {
|
||||
for (ExpansionSet set: fINSTANCE.values()) {
|
||||
Card card = set.findCard(name);
|
||||
if (card != null)
|
||||
return card;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Card findCard(String name, boolean random) {
|
||||
if (!random) {
|
||||
|
|
@ -289,15 +289,15 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
return CardImpl.createCard(cardClassName);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Card findCard(String expansionsetCode, int cardNum) {
|
||||
if (cardMap.containsKey(expansionsetCode + Integer.toString(cardNum))) {
|
||||
return cardMap.get(expansionsetCode + Integer.toString(cardNum));
|
||||
}
|
||||
if (fINSTANCE.containsKey(expansionsetCode)) {
|
||||
ExpansionSet set = fINSTANCE.get(expansionsetCode);
|
||||
if (fINSTANCE.containsKey(expansionsetCode)) {
|
||||
ExpansionSet set = fINSTANCE.get(expansionsetCode);
|
||||
Card card = set.findCard(cardNum);
|
||||
if (card != null) {
|
||||
cardMap.put(expansionsetCode + Integer.toString(cardNum), card);
|
||||
|
|
@ -305,67 +305,67 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
}
|
||||
}
|
||||
logger.warn("Could not find card: set=" + expansionsetCode + "cardNum=" + Integer.toString(cardNum));
|
||||
return null;
|
||||
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
public static Card createCard(Class clazz) {
|
||||
try {
|
||||
Constructor<?> con = clazz.getConstructor(new Class[]{UUID.class});
|
||||
return (Card) con.newInstance(new Object[] {null});
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("Error creating card:" + clazz.getName(), ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
public static Card createCard(Class clazz) {
|
||||
try {
|
||||
Constructor<?> con = clazz.getConstructor(new Class[]{UUID.class});
|
||||
return (Card) con.newInstance(new Object[] {null});
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("Error creating card:" + clazz.getName(), ex);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ExpansionSet findSet(String code) {
|
||||
if (fINSTANCE.containsKey(code))
|
||||
return fINSTANCE.get(code);
|
||||
return null;
|
||||
}
|
||||
public static ExpansionSet findSet(String code) {
|
||||
if (fINSTANCE.containsKey(code))
|
||||
return fINSTANCE.get(code);
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void saveDeck(String file, DeckCardLists deck) throws FileNotFoundException {
|
||||
PrintWriter out = new PrintWriter(file);
|
||||
Map<String, Integer> deckCards = new HashMap<String, Integer>();
|
||||
Map<String, Integer> sideboard = new HashMap<String, Integer>();
|
||||
try {
|
||||
if (deck.getName() != null && deck.getName().length() > 0)
|
||||
out.println("NAME:" + deck.getName());
|
||||
if (deck.getAuthor() != null && deck.getAuthor().length() > 0)
|
||||
out.println("AUTHOR:" + deck.getAuthor());
|
||||
for (String cardClass: deck.getCards()) {
|
||||
if (deckCards.containsKey(cardClass)) {
|
||||
deckCards.put(cardClass, deckCards.get(cardClass) + 1);
|
||||
}
|
||||
else {
|
||||
deckCards.put(cardClass, 1);
|
||||
}
|
||||
}
|
||||
for (String cardClass: deck.getSideboard()) {
|
||||
if (sideboard.containsKey(cardClass)) {
|
||||
sideboard.put(cardClass, sideboard.get(cardClass) + 1);
|
||||
}
|
||||
else {
|
||||
sideboard.put(cardClass, 1);
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, Integer> entry: deckCards.entrySet()) {
|
||||
Card card = CardImpl.createCard(entry.getKey());
|
||||
if (card != null) {
|
||||
out.printf("%d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName());
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, Integer> entry: sideboard.entrySet()) {
|
||||
Card card = CardImpl.createCard(entry.getKey());
|
||||
if (card != null) {
|
||||
out.printf("SB: %d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
public static void saveDeck(String file, DeckCardLists deck) throws FileNotFoundException {
|
||||
PrintWriter out = new PrintWriter(file);
|
||||
Map<String, Integer> deckCards = new HashMap<String, Integer>();
|
||||
Map<String, Integer> sideboard = new HashMap<String, Integer>();
|
||||
try {
|
||||
if (deck.getName() != null && deck.getName().length() > 0)
|
||||
out.println("NAME:" + deck.getName());
|
||||
if (deck.getAuthor() != null && deck.getAuthor().length() > 0)
|
||||
out.println("AUTHOR:" + deck.getAuthor());
|
||||
for (String cardClass: deck.getCards()) {
|
||||
if (deckCards.containsKey(cardClass)) {
|
||||
deckCards.put(cardClass, deckCards.get(cardClass) + 1);
|
||||
}
|
||||
else {
|
||||
deckCards.put(cardClass, 1);
|
||||
}
|
||||
}
|
||||
for (String cardClass: deck.getSideboard()) {
|
||||
if (sideboard.containsKey(cardClass)) {
|
||||
sideboard.put(cardClass, sideboard.get(cardClass) + 1);
|
||||
}
|
||||
else {
|
||||
sideboard.put(cardClass, 1);
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, Integer> entry: deckCards.entrySet()) {
|
||||
Card card = CardImpl.createCard(entry.getKey());
|
||||
if (card != null) {
|
||||
out.printf("%d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName());
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, Integer> entry: sideboard.entrySet()) {
|
||||
Card card = CardImpl.createCard(entry.getKey());
|
||||
if (card != null) {
|
||||
out.printf("SB: %d [%s:%d] %s%n", entry.getValue(), card.getExpansionSetCode(), card.getCardNumber(), card.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,21 +38,21 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class ShardsOfAlara extends ExpansionSet {
|
||||
|
||||
private static final ShardsOfAlara fINSTANCE = new ShardsOfAlara();
|
||||
private static final ShardsOfAlara fINSTANCE = new ShardsOfAlara();
|
||||
|
||||
public static ShardsOfAlara getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static ShardsOfAlara getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private ShardsOfAlara() {
|
||||
super("Shards of Alara", "ALA", "seticon_mtgala", "mage.sets.shardsofalara", new GregorianCalendar(2008, 8, 27).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Shards of Alara";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private ShardsOfAlara() {
|
||||
super("Shards of Alara", "ALA", "seticon_mtgala", "mage.sets.shardsofalara", new GregorianCalendar(2008, 8, 27).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Shards of Alara";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,17 +8,17 @@ import java.util.GregorianCalendar;
|
|||
public class Tempest extends ExpansionSet {
|
||||
private static final Tempest fINSTANCE = new Tempest();
|
||||
|
||||
public static Tempest getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Tempest getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Tempest() {
|
||||
super("Tempest", "TMP", "", "mage.sets.tempest", new GregorianCalendar(1997, 9, 1).getTime(), Constants.SetType.EXPANSION);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,20 +38,20 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class Tenth extends ExpansionSet {
|
||||
|
||||
private static final Tenth fINSTANCE = new Tenth();
|
||||
private static final Tenth fINSTANCE = new Tenth();
|
||||
|
||||
public static Tenth getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Tenth getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Tenth() {
|
||||
super("Tenth Edition", "10E", "exp_symbol_mtg10e", "mage.sets.tenth", new GregorianCalendar(2007, 6, 14).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private Tenth() {
|
||||
super("Tenth Edition", "10E", "exp_symbol_mtg10e", "mage.sets.tenth", new GregorianCalendar(2007, 6, 14).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,20 +7,20 @@ import java.util.GregorianCalendar;
|
|||
|
||||
public class TimeSpiral extends ExpansionSet {
|
||||
|
||||
private static final TimeSpiral fINSTANCE = new TimeSpiral();
|
||||
private static final TimeSpiral fINSTANCE = new TimeSpiral();
|
||||
|
||||
public static TimeSpiral getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static TimeSpiral getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private TimeSpiral() {
|
||||
super("Time Spiral", "TSP", "", "mage.sets.timespiral", new GregorianCalendar(2006, 9, 9).getTime(), Constants.SetType.EXPANSION);
|
||||
this.blockName = "Time Spiral";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private TimeSpiral() {
|
||||
super("Time Spiral", "TSP", "", "mage.sets.timespiral", new GregorianCalendar(2006, 9, 9).getTime(), Constants.SetType.EXPANSION);
|
||||
this.blockName = "Time Spiral";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,20 +39,20 @@ import java.util.GregorianCalendar;
|
|||
*/
|
||||
public class UrzasLegacy extends ExpansionSet {
|
||||
|
||||
private static final UrzasLegacy fINSTANCE = new UrzasLegacy();
|
||||
private static final UrzasLegacy fINSTANCE = new UrzasLegacy();
|
||||
|
||||
public static UrzasLegacy getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static UrzasLegacy getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private UrzasLegacy() {
|
||||
super("Urza's Legacy", "ULG", "exp_symbol_mtgulg", "mage.sets.urzaslegacy", new GregorianCalendar(1999, 2, 6).getTime(), SetType.EXPANSION);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private UrzasLegacy() {
|
||||
super("Urza's Legacy", "ULG", "exp_symbol_mtgulg", "mage.sets.urzaslegacy", new GregorianCalendar(1999, 2, 6).getTime(), SetType.EXPANSION);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,20 +38,20 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class UrzasSaga extends ExpansionSet {
|
||||
|
||||
private static final UrzasSaga fINSTANCE = new UrzasSaga();
|
||||
private static final UrzasSaga fINSTANCE = new UrzasSaga();
|
||||
|
||||
public static UrzasSaga getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static UrzasSaga getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private UrzasSaga() {
|
||||
super("Urza's Saga", "USG", "exp_symbol_mtgusg", "mage.sets.urzassaga", new GregorianCalendar(1998, 10, 1).getTime(), SetType.EXPANSION);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private UrzasSaga() {
|
||||
super("Urza's Saga", "USG", "exp_symbol_mtgusg", "mage.sets.urzassaga", new GregorianCalendar(1998, 10, 1).getTime(), SetType.EXPANSION);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,20 +39,20 @@ import java.util.GregorianCalendar;
|
|||
*/
|
||||
public class Weatherlight extends ExpansionSet {
|
||||
|
||||
private static final Weatherlight fINSTANCE = new Weatherlight();
|
||||
private static final Weatherlight fINSTANCE = new Weatherlight();
|
||||
|
||||
public static Weatherlight getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Weatherlight getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Weatherlight() {
|
||||
super("Weatherlight", "WTH", "exp_symbol_mtgwth", "mage.sets.weatherlight", new GregorianCalendar(1997, 5, 31).getTime(), SetType.EXPANSION);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
private Weatherlight() {
|
||||
super("Weatherlight", "WTH", "exp_symbol_mtgwth", "mage.sets.weatherlight", new GregorianCalendar(1997, 5, 31).getTime(), SetType.EXPANSION);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,22 +38,22 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class Worldwake extends ExpansionSet {
|
||||
|
||||
private static final Worldwake fINSTANCE = new Worldwake();
|
||||
private static final Worldwake fINSTANCE = new Worldwake();
|
||||
|
||||
public static Worldwake getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Worldwake getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Worldwake() {
|
||||
super("Worldwake", "WWK", "seticon_WWK", "mage.sets.worldwake", new GregorianCalendar(2010, 0, 30).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Zendikar";
|
||||
this.parentSet = Zendikar.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private Worldwake() {
|
||||
super("Worldwake", "WWK", "seticon_WWK", "mage.sets.worldwake", new GregorianCalendar(2010, 0, 30).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Zendikar";
|
||||
this.parentSet = Zendikar.getInstance();
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 0;
|
||||
this.numBoosterCommon = 11;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,21 +38,21 @@ import mage.cards.ExpansionSet;
|
|||
*/
|
||||
public class Zendikar extends ExpansionSet {
|
||||
|
||||
private static final Zendikar fINSTANCE = new Zendikar();
|
||||
private static final Zendikar fINSTANCE = new Zendikar();
|
||||
|
||||
public static Zendikar getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
public static Zendikar getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Zendikar() {
|
||||
super("Zendikar", "ZEN", "seticon_ZEN", "mage.sets.zendikar", new GregorianCalendar(2009, 8, 26).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Zendikar";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
private Zendikar() {
|
||||
super("Zendikar", "ZEN", "seticon_ZEN", "mage.sets.zendikar", new GregorianCalendar(2009, 8, 26).getTime(), SetType.EXPANSION);
|
||||
this.blockName = "Zendikar";
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,25 +51,25 @@ import mage.cards.CardImpl;
|
|||
*/
|
||||
public class BehemothSledge extends CardImpl<BehemothSledge> {
|
||||
|
||||
public BehemothSledge(UUID ownerId) {
|
||||
super(ownerId, 65, "Behemoth Sledge", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Equipment");
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
|
||||
}
|
||||
public BehemothSledge(UUID ownerId) {
|
||||
super(ownerId, 65, "Behemoth Sledge", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Equipment");
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(3)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(TrampleAbility.getInstance(), Constants.AttachmentType.EQUIPMENT)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(2, 2)));
|
||||
}
|
||||
|
||||
protected BehemothSledge(BehemothSledge me) {
|
||||
super(me);
|
||||
}
|
||||
protected BehemothSledge(BehemothSledge me) {
|
||||
super(me);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BehemothSledge copy() {
|
||||
return new BehemothSledge(this);
|
||||
}
|
||||
@Override
|
||||
public BehemothSledge copy() {
|
||||
return new BehemothSledge(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,23 +42,23 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class BituminousBlast extends CardImpl<BituminousBlast> {
|
||||
|
||||
public BituminousBlast(UUID ownerId) {
|
||||
super(ownerId, 34, "Bituminous Blast", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
|
||||
this.addAbility(new CascadeAbility());
|
||||
}
|
||||
public BituminousBlast(UUID ownerId) {
|
||||
super(ownerId, 34, "Bituminous Blast", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{3}{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
|
||||
this.addAbility(new CascadeAbility());
|
||||
}
|
||||
|
||||
public BituminousBlast(final BituminousBlast card) {
|
||||
super(card);
|
||||
}
|
||||
public BituminousBlast(final BituminousBlast card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BituminousBlast copy() {
|
||||
return new BituminousBlast(this);
|
||||
}
|
||||
@Override
|
||||
public BituminousBlast copy() {
|
||||
return new BituminousBlast(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,26 +43,26 @@ import mage.cards.CardImpl;
|
|||
*/
|
||||
public class BloodbraidElf extends CardImpl<BloodbraidElf> {
|
||||
|
||||
public BloodbraidElf(UUID ownerId) {
|
||||
super(ownerId, 50, "Bloodbraid Elf", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.subtype.add("Elf");
|
||||
this.subtype.add("Berserker");
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
this.addAbility(new CascadeAbility());
|
||||
}
|
||||
public BloodbraidElf(UUID ownerId) {
|
||||
super(ownerId, 50, "Bloodbraid Elf", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.subtype.add("Elf");
|
||||
this.subtype.add("Berserker");
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
this.addAbility(new CascadeAbility());
|
||||
}
|
||||
|
||||
public BloodbraidElf(final BloodbraidElf card) {
|
||||
super(card);
|
||||
}
|
||||
public BloodbraidElf(final BloodbraidElf card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BloodbraidElf copy() {
|
||||
return new BloodbraidElf(this);
|
||||
}
|
||||
@Override
|
||||
public BloodbraidElf copy() {
|
||||
return new BloodbraidElf(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,38 +75,38 @@ public class Brainbite extends CardImpl<Brainbite> {
|
|||
|
||||
class BrainbiteEffect extends OneShotEffect<BrainbiteEffect> {
|
||||
|
||||
public BrainbiteEffect() {
|
||||
super(Constants.Outcome.Discard);
|
||||
staticText = "Target opponent reveals his or her hand. You choose a card from it. That player discards that card";
|
||||
}
|
||||
public BrainbiteEffect() {
|
||||
super(Constants.Outcome.Discard);
|
||||
staticText = "Target opponent reveals his or her hand. You choose a card from it. That player discards that card";
|
||||
}
|
||||
|
||||
public BrainbiteEffect(final BrainbiteEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
public BrainbiteEffect(final BrainbiteEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.revealCards("Brainbite", player.getHand(), game);
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard());
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
player.revealCards("Brainbite", player.getHand(), game);
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
TargetCard target = new TargetCard(Constants.Zone.PICK, new FilterCard());
|
||||
target.setRequired(true);
|
||||
if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) {
|
||||
Card card = player.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
return player.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
if (you.choose(Constants.Outcome.Benefit, player.getHand(), target, game)) {
|
||||
Card card = player.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
return player.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrainbiteEffect copy() {
|
||||
return new BrainbiteEffect(this);
|
||||
}
|
||||
@Override
|
||||
public BrainbiteEffect copy() {
|
||||
return new BrainbiteEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,8 @@ public class CapturedSunlight extends CardImpl<CapturedSunlight> {
|
|||
public CapturedSunlight (UUID ownerId) {
|
||||
super(ownerId, 66, "Captured Sunlight", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(4));
|
||||
this.addAbility(new CascadeAbility());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ public class DenyReality extends CardImpl<DenyReality> {
|
|||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.getSpellAbility().addTarget(new TargetPermanent());
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
this.addAbility(new CascadeAbility());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ public class FieldmistBorderpost extends CardImpl<FieldmistBorderpost> {
|
|||
public FieldmistBorderpost (UUID ownerId) {
|
||||
super(ownerId, 5, "Fieldmist Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{W}{U}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlue(true);
|
||||
Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION);
|
||||
this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost));
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
|
|
|||
|
|
@ -92,11 +92,11 @@ class FiligreeAngelEffect extends OneShotEffect<FiligreeAngelEffect> {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
if (player != null) {
|
||||
int life = game.getBattlefield().count(filter, source.getControllerId(), game) * 3;
|
||||
player.gainLife(life, game);
|
||||
}
|
||||
return true;
|
||||
player.gainLife(life, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -52,94 +52,94 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class FinestHour extends CardImpl<FinestHour> {
|
||||
|
||||
public FinestHour(UUID ownerId) {
|
||||
super(ownerId, 126, "Finest Hour", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{W}{U}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setWhite(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
this.addAbility(new ExaltedAbility());
|
||||
this.addAbility(new FinestHourAbility());
|
||||
}
|
||||
public FinestHour(UUID ownerId) {
|
||||
super(ownerId, 126, "Finest Hour", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}{W}{U}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setWhite(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
this.addAbility(new ExaltedAbility());
|
||||
this.addAbility(new FinestHourAbility());
|
||||
}
|
||||
|
||||
public FinestHour(final FinestHour card) {
|
||||
super(card);
|
||||
}
|
||||
public FinestHour(final FinestHour card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinestHour copy() {
|
||||
return new FinestHour(this);
|
||||
}
|
||||
@Override
|
||||
public FinestHour copy() {
|
||||
return new FinestHour(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FinestHourAbility extends TriggeredAbilityImpl<FinestHourAbility> {
|
||||
|
||||
public FinestHourAbility() {
|
||||
super(Zone.BATTLEFIELD, new FinestHourEffect());
|
||||
}
|
||||
public FinestHourAbility() {
|
||||
super(Zone.BATTLEFIELD, new FinestHourEffect());
|
||||
}
|
||||
|
||||
public FinestHourAbility(final FinestHourAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
public FinestHourAbility(final FinestHourAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinestHourAbility copy() {
|
||||
return new FinestHourAbility(this);
|
||||
}
|
||||
@Override
|
||||
public FinestHourAbility copy() {
|
||||
return new FinestHourAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (checkInterveningIfClause(game) && game.getActivePlayerId().equals(this.controllerId)) {
|
||||
if (event.getType() == EventType.DECLARED_ATTACKERS) {
|
||||
if (game.getCombat().attacksAlone()) {
|
||||
this.addTarget(new TargetCreaturePermanent());
|
||||
getTargets().get(0).add(game.getCombat().getAttackers().get(0), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (checkInterveningIfClause(game) && game.getActivePlayerId().equals(this.controllerId)) {
|
||||
if (event.getType() == EventType.DECLARED_ATTACKERS) {
|
||||
if (game.getCombat().attacksAlone()) {
|
||||
this.addTarget(new TargetCreaturePermanent());
|
||||
getTargets().get(0).add(game.getCombat().getAttackers().get(0), game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
return game.getTurn().getPhase(TurnPhase.COMBAT).getCount() == 0;
|
||||
}
|
||||
@Override
|
||||
public boolean checkInterveningIfClause(Game game) {
|
||||
return game.getTurn().getPhase(TurnPhase.COMBAT).getCount() == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature you control attacks alone, if it's the first combat phase of the turn, untap that creature. After this phase, there is an additional combat phase.";
|
||||
}
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature you control attacks alone, if it's the first combat phase of the turn, untap that creature. After this phase, there is an additional combat phase.";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class FinestHourEffect extends OneShotEffect<FinestHourEffect> {
|
||||
|
||||
public FinestHourEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
public FinestHourEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
|
||||
public FinestHourEffect(final FinestHourEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
public FinestHourEffect(final FinestHourEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FinestHourEffect copy() {
|
||||
return new FinestHourEffect(this);
|
||||
}
|
||||
@Override
|
||||
public FinestHourEffect copy() {
|
||||
return new FinestHourEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.untap(game);
|
||||
game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent != null) {
|
||||
permanent.untap(game);
|
||||
game.getState().getTurnMods().add(new TurnMod(source.getControllerId(), TurnPhase.COMBAT, null, false));
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -64,8 +64,8 @@ public class FirewildBorderpost extends CardImpl<FirewildBorderpost> {
|
|||
public FirewildBorderpost (UUID ownerId) {
|
||||
super(ownerId, 54, "Firewild Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION);
|
||||
this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost));
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
|
|
|||
|
|
@ -94,16 +94,16 @@ class GlassdustHulkTriggeredAbility extends TriggeredAbilityImpl<GlassdustHulkTr
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && !event.getTargetId().equals(this.getSourceId())) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
if (zEvent.getToZone() == Constants.Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.ARTIFACT)
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
|
||||
if (zEvent.getToZone() == Constants.Zone.BATTLEFIELD) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.ARTIFACT)
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -52,9 +52,9 @@ public class GloryscaleViashino extends CardImpl<GloryscaleViashino> {
|
|||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Viashino");
|
||||
this.subtype.add("Soldier");
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
this.addAbility(new GloryscaleViashinoAbility());
|
||||
|
|
@ -88,12 +88,12 @@ class GloryscaleViashinoAbility extends TriggeredAbilityImpl<GloryscaleViashinoA
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.getColor().isMulticolored() && event.getPlayerId().equals(getControllerId())) {
|
||||
return true;
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && spell.getColor().isMulticolored() && event.getPlayerId().equals(getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -50,8 +50,8 @@ public class IdentityCrisis extends CardImpl<IdentityCrisis> {
|
|||
public IdentityCrisis (UUID ownerId) {
|
||||
super(ownerId, 81, "Identity Crisis", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{W}{W}{B}{B}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlack(true);
|
||||
this.getSpellAbility().addEffect(new IdentityCrisisEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -66,11 +66,11 @@ public class LichLordOfUnx extends CardImpl<LichLordOfUnx> {
|
|||
this.subtype.add("Zombie");
|
||||
this.subtype.add("Wizard");
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
|
||||
Ability ability = new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new CreateTokenEffect(new ZombieWizardToken()), new ManaCostsImpl("{U}{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
|
@ -100,6 +100,6 @@ class ZombieWizardToken extends Token {
|
|||
subtype.add("Zombie");
|
||||
subtype.add("Wizard");
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ public class LorescaleCoatl extends CardImpl<LorescaleCoatl> {
|
|||
super(ownerId, 101, "Lorescale Coatl", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{U}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Snake");
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
|
||||
this.addAbility(new DrawCardTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,9 +51,9 @@ public class MadrushCyclops extends CardImpl<MadrushCyclops> {
|
|||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Cyclops");
|
||||
this.subtype.add("Warrior");
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityControlledEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, new FilterControlledCreaturePermanent())));
|
||||
|
|
|
|||
|
|
@ -41,22 +41,22 @@ import mage.target.common.TargetNonlandPermanent;
|
|||
*/
|
||||
public class MaelstromPulse extends CardImpl<MaelstromPulse> {
|
||||
|
||||
public MaelstromPulse(UUID ownerId) {
|
||||
super(ownerId, 92, "Maelstrom Pulse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setGreen(true);
|
||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
this.getSpellAbility().addEffect(new DestroyAllNamedPermanentsEffect());
|
||||
}
|
||||
public MaelstromPulse(UUID ownerId) {
|
||||
super(ownerId, 92, "Maelstrom Pulse", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{B}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setGreen(true);
|
||||
this.getSpellAbility().addTarget(new TargetNonlandPermanent());
|
||||
this.getSpellAbility().addEffect(new DestroyAllNamedPermanentsEffect());
|
||||
}
|
||||
|
||||
public MaelstromPulse(final MaelstromPulse card) {
|
||||
super(card);
|
||||
}
|
||||
public MaelstromPulse(final MaelstromPulse card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MaelstromPulse copy() {
|
||||
return new MaelstromPulse(this);
|
||||
}
|
||||
@Override
|
||||
public MaelstromPulse copy() {
|
||||
return new MaelstromPulse(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,14 +56,14 @@ public class MagefireWings extends CardImpl<MagefireWings> {
|
|||
super(ownerId, 88, "Magefire Wings", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Aura");
|
||||
this.color.setBlue(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setRed(true);
|
||||
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(2, 0, Duration.WhileOnBattlefield)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FlyingAbility.getInstance(), Constants.AttachmentType.AURA)));
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ public class MarisisTwinclaws extends CardImpl<MarisisTwinclaws> {
|
|||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Cat");
|
||||
this.subtype.add("Warrior");
|
||||
this.color.setWhite(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(4);
|
||||
this.addAbility(DoubleStrikeAbility.getInstance());
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ public class MistveinBorderpost extends CardImpl<MistveinBorderpost> {
|
|||
public MistveinBorderpost (UUID ownerId) {
|
||||
super(ownerId, 27, "Mistvein Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{U}{B}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION);
|
||||
this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost));
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ public class NemesisOfReason extends CardImpl<NemesisOfReason> {
|
|||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Leviathan");
|
||||
this.subtype.add("Horror");
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(7);
|
||||
this.addAbility(new NemesisOfReasonTriggeredAbility());
|
||||
|
|
@ -90,9 +90,9 @@ class NemesisOfReasonTriggeredAbility extends TriggeredAbilityImpl<NemesisOfReas
|
|||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -49,14 +49,14 @@ public class NulltreadGargantuan extends CardImpl<NulltreadGargantuan> {
|
|||
super(ownerId, 102, "Nulltread Gargantuan", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{U}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Beast");
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(6);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new PutOnLibraryTargetEffect(true), false);
|
||||
Target target = new TargetControlledCreaturePermanent();
|
||||
target.setRequired(true);
|
||||
target.setNotTarget(true);
|
||||
Target target = new TargetControlledCreaturePermanent();
|
||||
target.setRequired(true);
|
||||
target.setNotTarget(true);
|
||||
ability.addTarget(target);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,25 +46,25 @@ import mage.cards.CardImpl;
|
|||
*/
|
||||
public class PutridLeech extends CardImpl<PutridLeech> {
|
||||
|
||||
public PutridLeech(UUID ownerId) {
|
||||
super(ownerId, 95, "Putrid Leech", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setGreen(true);
|
||||
this.subtype.add("Zombie");
|
||||
this.subtype.add("Leech");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new PayLifeCost(2)));
|
||||
}
|
||||
public PutridLeech(UUID ownerId) {
|
||||
super(ownerId, 95, "Putrid Leech", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setGreen(true);
|
||||
this.subtype.add("Zombie");
|
||||
this.subtype.add("Leech");
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
this.addAbility(new ActivateOncePerTurnActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(2, 2, Duration.EndOfTurn), new PayLifeCost(2)));
|
||||
}
|
||||
|
||||
public PutridLeech(final PutridLeech card) {
|
||||
super(card);
|
||||
}
|
||||
public PutridLeech(final PutridLeech card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PutridLeech copy() {
|
||||
return new PutridLeech(this);
|
||||
}
|
||||
@Override
|
||||
public PutridLeech copy() {
|
||||
return new PutridLeech(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class SewnEyeDrake extends CardImpl<SewnEyeDrake> {
|
|||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Zombie");
|
||||
this.subtype.add("Drake");
|
||||
this.color.setBlack(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setRed(true);
|
||||
this.power = new MageInt(3);
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ public class SigiledBehemoth extends CardImpl<SigiledBehemoth> {
|
|||
super(ownerId, 79, "Sigiled Behemoth", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{4}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Beast");
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(4);
|
||||
this.addAbility(new ExaltedAbility());
|
||||
|
|
|
|||
|
|
@ -47,33 +47,33 @@ import mage.filter.FilterSpell;
|
|||
*/
|
||||
public class SpellbreakerBehemoth extends CardImpl<SpellbreakerBehemoth> {
|
||||
|
||||
private static FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater");
|
||||
private static FilterSpell filter = new FilterSpell("Creature spells you control with power 5 or greater");
|
||||
|
||||
static {
|
||||
filter.getCardType().add(CardType.CREATURE);
|
||||
filter.setPower(5);
|
||||
}
|
||||
static {
|
||||
filter.getCardType().add(CardType.CREATURE);
|
||||
filter.setPower(5);
|
||||
}
|
||||
|
||||
public SpellbreakerBehemoth(UUID ownerId) {
|
||||
super(ownerId, 60, "Spellbreaker Behemoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.subtype.add("Beast");
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
public SpellbreakerBehemoth(UUID ownerId) {
|
||||
super(ownerId, 60, "Spellbreaker Behemoth", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{R}{G}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.subtype.add("Beast");
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(5);
|
||||
|
||||
this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantCounterControlledEffect(filter, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
this.addAbility(new SimpleStaticAbility(Zone.STACK, new CantCounterSourceEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantCounterControlledEffect(filter, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public SpellbreakerBehemoth(final SpellbreakerBehemoth card) {
|
||||
super(card);
|
||||
}
|
||||
public SpellbreakerBehemoth(final SpellbreakerBehemoth card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellbreakerBehemoth copy() {
|
||||
return new SpellbreakerBehemoth(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpellbreakerBehemoth copy() {
|
||||
return new SpellbreakerBehemoth(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,8 +45,8 @@ public class SphinxOfTheSteelWind extends CardImpl<SphinxOfTheSteelWind> {
|
|||
private static FilterCard filter = new FilterCard("red and from green");
|
||||
|
||||
static {
|
||||
filter.setUseColor(true);
|
||||
filter.getColor().setRed(true);
|
||||
filter.setUseColor(true);
|
||||
filter.getColor().setRed(true);
|
||||
filter.getColor().setGreen(true);
|
||||
filter.setScopeColor(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
|
@ -55,9 +55,9 @@ public class SphinxOfTheSteelWind extends CardImpl<SphinxOfTheSteelWind> {
|
|||
super(ownerId, 110, "Sphinx of the Steel Wind", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{5}{W}{U}{B}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Sphinx");
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
|
|
|||
|
|
@ -53,8 +53,8 @@ public class StunSniper extends CardImpl<StunSniper> {
|
|||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Archer");
|
||||
this.color.setRed(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new GenericManaCost(1));
|
||||
|
|
|
|||
|
|
@ -41,22 +41,22 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class Terminate extends CardImpl<Terminate> {
|
||||
|
||||
public Terminate(UUID ownerId) {
|
||||
super(ownerId, 46, "Terminate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
|
||||
}
|
||||
public Terminate(UUID ownerId) {
|
||||
super(ownerId, 46, "Terminate", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect(true));
|
||||
}
|
||||
|
||||
public Terminate(final Terminate card) {
|
||||
super(card);
|
||||
}
|
||||
public Terminate(final Terminate card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Terminate copy() {
|
||||
return new Terminate(this);
|
||||
}
|
||||
@Override
|
||||
public Terminate copy() {
|
||||
return new Terminate(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ public class VeinfireBorderpost extends CardImpl<VeinfireBorderpost> {
|
|||
public VeinfireBorderpost (UUID ownerId) {
|
||||
super(ownerId, 48, "Veinfire Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setRed(true);
|
||||
Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION);
|
||||
this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost));
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
|
|
|||
|
|
@ -50,66 +50,66 @@ import mage.target.common.TargetCreatureOrPlayer;
|
|||
*/
|
||||
public class VengefulRebirth extends CardImpl<VengefulRebirth> {
|
||||
|
||||
public VengefulRebirth(UUID ownerId) {
|
||||
super(ownerId, 62, "Vengeful Rebirth", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard());
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
this.getSpellAbility().addEffect(new VengefulRebirthEffect());
|
||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||
}
|
||||
public VengefulRebirth(UUID ownerId) {
|
||||
super(ownerId, 62, "Vengeful Rebirth", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{4}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard());
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
this.getSpellAbility().addEffect(new VengefulRebirthEffect());
|
||||
this.getSpellAbility().addEffect(ExileSpellEffect.getInstance());
|
||||
}
|
||||
|
||||
public VengefulRebirth(final VengefulRebirth card) {
|
||||
super(card);
|
||||
}
|
||||
public VengefulRebirth(final VengefulRebirth card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VengefulRebirth copy() {
|
||||
return new VengefulRebirth(this);
|
||||
}
|
||||
@Override
|
||||
public VengefulRebirth copy() {
|
||||
return new VengefulRebirth(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class VengefulRebirthEffect extends OneShotEffect<VengefulRebirthEffect> {
|
||||
|
||||
public VengefulRebirthEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "Return target card from your graveyard to your hand. If you return a nonland card to your hand this way, {this} deals damage equal to that card's converted mana cost to target creature or player";
|
||||
}
|
||||
public VengefulRebirthEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
staticText = "Return target card from your graveyard to your hand. If you return a nonland card to your hand this way, {this} deals damage equal to that card's converted mana cost to target creature or player";
|
||||
}
|
||||
|
||||
public VengefulRebirthEffect(final VengefulRebirthEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
public VengefulRebirthEffect(final VengefulRebirthEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VengefulRebirthEffect copy() {
|
||||
return new VengefulRebirthEffect(this);
|
||||
}
|
||||
@Override
|
||||
public VengefulRebirthEffect copy() {
|
||||
return new VengefulRebirthEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Card card = (Card)game.getObject(source.getFirstTarget());
|
||||
if (player.removeFromGraveyard(card, game)) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0));
|
||||
if (permanent != null) {
|
||||
permanent.damage(damage, source.getSourceId(), game, true, false);
|
||||
return true;
|
||||
}
|
||||
Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0));
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Card card = (Card)game.getObject(source.getFirstTarget());
|
||||
if (player.removeFromGraveyard(card, game)) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
int damage = card.getManaCost().convertedManaCost();
|
||||
if (!card.getCardType().contains(CardType.LAND)) {
|
||||
Permanent permanent = game.getPermanent(source.getTargets().get(1).getTargets().get(0));
|
||||
if (permanent != null) {
|
||||
permanent.damage(damage, source.getSourceId(), game, true, false);
|
||||
return true;
|
||||
}
|
||||
Player targetPlayer = game.getPlayer(source.getTargets().get(1).getTargets().get(0));
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.damage(damage, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,8 +57,8 @@ public class VithianRenegades extends CardImpl<VithianRenegades> {
|
|||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Shaman");
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect());
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ public class WildfieldBorderpost extends CardImpl<WildfieldBorderpost> {
|
|||
public WildfieldBorderpost (UUID ownerId) {
|
||||
super(ownerId, 80, "Wildfield Borderpost", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{1}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
Cost cost = new CompositeCost(new GenericManaCost(1), new ReturnToHandTargetCost(new TargetControlledPermanent(filter)), COST_DESCRIPTION);
|
||||
this.getSpellAbility().addAlternativeCost(new AlternativeCostImpl(ALTERNATIVE_COST_DESCRIPTION, cost));
|
||||
this.addAbility(new EntersBattlefieldTappedAbility());
|
||||
|
|
|
|||
|
|
@ -47,8 +47,8 @@ public class WingedCoatl extends CardImpl<WingedCoatl> {
|
|||
super(ownerId, 105, "Winged Coatl", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{G}{U}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Snake");
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlue(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
this.addAbility(FlashAbility.getInstance());
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ public class DeathGrasp extends CardImpl<DeathGrasp> {
|
|||
public DeathGrasp (UUID ownerId) {
|
||||
super(ownerId, 95, "Death Grasp", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{X}{W}{B}");
|
||||
this.expansionSetCode = "APC";
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlack(true);
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(new ManacostVariableValue()));
|
||||
this.getSpellAbility().addEffect(new GainLifeEffect(new ManacostVariableValue()));
|
||||
this.getSpellAbility().addTarget(new TargetCreatureOrPlayer());
|
||||
|
|
|
|||
|
|
@ -57,11 +57,11 @@ public class ManaclesOfDecay extends CardImpl<ManaclesOfDecay> {
|
|||
this.subtype.add("Aura");
|
||||
this.color.setWhite(true);
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ManaclesOfDecayFirstEffect()));
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.BoostCreature));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new ManaclesOfDecayFirstEffect()));
|
||||
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new BoostEnchantedEffect(-1, -1, Constants.Duration.EndOfTurn), new ColoredManaCost(Constants.ColoredManaSymbol.B)));
|
||||
this.addAbility(new SimpleActivatedAbility(Constants.Zone.BATTLEFIELD, new ManaclesOfDecaySecondEffect(), new ColoredManaCost(Constants.ColoredManaSymbol.R)));
|
||||
|
||||
|
|
@ -79,53 +79,53 @@ public class ManaclesOfDecay extends CardImpl<ManaclesOfDecay> {
|
|||
|
||||
class ManaclesOfDecayFirstEffect extends RestrictionEffect<ManaclesOfDecayFirstEffect> {
|
||||
|
||||
public ManaclesOfDecayFirstEffect() {
|
||||
super(Constants.Duration.WhileOnBattlefield);
|
||||
staticText = "Enchanted creature can't attack";
|
||||
}
|
||||
public ManaclesOfDecayFirstEffect() {
|
||||
super(Constants.Duration.WhileOnBattlefield);
|
||||
staticText = "Enchanted creature can't attack";
|
||||
}
|
||||
|
||||
public ManaclesOfDecayFirstEffect(final ManaclesOfDecayFirstEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
public ManaclesOfDecayFirstEffect(final ManaclesOfDecayFirstEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAttachments().contains((source.getSourceId()))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAttachments().contains((source.getSourceId()))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canAttack(Game game) {
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canAttack(Game game) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ManaclesOfDecayFirstEffect copy() {
|
||||
return new ManaclesOfDecayFirstEffect(this);
|
||||
}
|
||||
@Override
|
||||
public ManaclesOfDecayFirstEffect copy() {
|
||||
return new ManaclesOfDecayFirstEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ManaclesOfDecaySecondEffect extends RestrictionEffect<ManaclesOfDecaySecondEffect> {
|
||||
|
||||
public ManaclesOfDecaySecondEffect() {
|
||||
super(Constants.Duration.EndOfTurn);
|
||||
staticText = "Enchanted creature can't block until end of turn";
|
||||
}
|
||||
public ManaclesOfDecaySecondEffect() {
|
||||
super(Constants.Duration.EndOfTurn);
|
||||
staticText = "Enchanted creature can't block until end of turn";
|
||||
}
|
||||
|
||||
public ManaclesOfDecaySecondEffect(final ManaclesOfDecaySecondEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
public ManaclesOfDecaySecondEffect(final ManaclesOfDecaySecondEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAttachments().contains((source.getSourceId()))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getAttachments().contains((source.getSourceId()))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
|
|
@ -133,8 +133,8 @@ class ManaclesOfDecaySecondEffect extends RestrictionEffect<ManaclesOfDecaySecon
|
|||
}
|
||||
|
||||
@Override
|
||||
public ManaclesOfDecaySecondEffect copy() {
|
||||
return new ManaclesOfDecaySecondEffect(this);
|
||||
}
|
||||
public ManaclesOfDecaySecondEffect copy() {
|
||||
return new ManaclesOfDecaySecondEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -44,8 +44,8 @@ public class Vindicate extends CardImpl<Vindicate> {
|
|||
public Vindicate (UUID ownerId) {
|
||||
super(ownerId, 126, "Vindicate", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{1}{W}{B}");
|
||||
this.expansionSetCode = "APC";
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.color.setBlack(true);
|
||||
this.getSpellAbility().addEffect(new DestroyTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPermanent());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class AngelOfGlorysRise extends CardImpl<AngelOfGlorysRise> {
|
|||
this.toughness = new MageInt(6);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// When Angel of Glory's Rise enters the battlefield, exile all Zombies, then return all Human creature cards from your graveyard to the battlefield.
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new AngelOfGlorysRiseEffect());
|
||||
this.addAbility(ability);
|
||||
|
|
@ -78,10 +78,10 @@ public class AngelOfGlorysRise extends CardImpl<AngelOfGlorysRise> {
|
|||
}
|
||||
|
||||
class AngelOfGlorysRiseEffect extends OneShotEffect<AngelOfGlorysRiseEffect> {
|
||||
|
||||
|
||||
private static final FilterCreatureCard filterHuman = new FilterCreatureCard();
|
||||
private static final FilterCreaturePermanent filterZombie = new FilterCreaturePermanent();
|
||||
|
||||
|
||||
static {
|
||||
filterZombie.getSubtype().add("Zombie");
|
||||
filterZombie.setScopeSubtype(Filter.ComparisonScope.Any);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ import java.util.UUID;
|
|||
public class AngelOfJubilation extends CardImpl<AngelOfJubilation> {
|
||||
|
||||
private final static FilterCreaturePermanent filterNonBlack = new FilterCreaturePermanent("nonblack creatures");
|
||||
|
||||
|
||||
static {
|
||||
filterNonBlack.setUseColor(true);
|
||||
filterNonBlack.setColor(ObjectColor.BLACK);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ import java.util.UUID;
|
|||
public class CavernOfSouls extends CardImpl<CavernOfSouls> {
|
||||
|
||||
private static final String ruleText = "As Cavern of Souls enters the battlefield, choose a creature type";
|
||||
|
||||
|
||||
public CavernOfSouls(UUID ownerId) {
|
||||
super(ownerId, 226, "Cavern of Souls", Rarity.RARE, new CardType[]{CardType.LAND}, "");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ import java.util.UUID;
|
|||
public class DemonlordOfAshmouth extends CardImpl<DemonlordOfAshmouth> {
|
||||
|
||||
private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent(" another creature");
|
||||
|
||||
|
||||
static {
|
||||
filter.setAnother(true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class DivineDeflection extends CardImpl<DivineDeflection> {
|
|||
class DivineDeflectionPreventDamageTargetEffect extends PreventionEffectImpl<DivineDeflectionPreventDamageTargetEffect> {
|
||||
|
||||
private int amount = -1;
|
||||
|
||||
|
||||
public DivineDeflectionPreventDamageTargetEffect(Constants.Duration duration) {
|
||||
super(duration);
|
||||
staticText = "Prevent the next X damage that would be dealt to you and/or permanents you control this turn. If damage is prevented this way, {this} deals that much damage to target creature or player";
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ import java.util.UUID;
|
|||
public class DruidsFamiliar extends CardImpl<DruidsFamiliar> {
|
||||
|
||||
private static final String ruleText = "As long as {this} is paired with another creature, each of those creatures gets +2/+2";
|
||||
|
||||
|
||||
public DruidsFamiliar(UUID ownerId) {
|
||||
super(ownerId, 175, "Druid's Familiar", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{3}{G}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class Fettergeist extends CardImpl<Fettergeist> {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// At the beginning of your upkeep, sacrifice Fettergeist unless you pay {1} for each other creature you control.
|
||||
this.addAbility(new BeginningOfUpkeepTriggeredAbility(new FettergeistUnlessPaysEffect(), Constants.TargetController.YOU, false));
|
||||
|
||||
|
|
|
|||
|
|
@ -48,14 +48,14 @@ import java.util.UUID;
|
|||
public class GhostlyFlicker extends CardImpl<GhostlyFlicker> {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("artifacts, creatures, and/or lands you control");
|
||||
|
||||
|
||||
static {
|
||||
filter.getCardType().add(CardType.CREATURE);
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
filter.getCardType().add(CardType.ARTIFACT);
|
||||
filter.setScopeCardType(Filter.ComparisonScope.Any);
|
||||
}
|
||||
|
||||
|
||||
public GhostlyFlicker(UUID ownerId) {
|
||||
super(ownerId, 57, "Ghostly Flicker", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{U}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public class HolyJusticiar extends CardImpl<HolyJusticiar> {
|
|||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public HolyJusticiar(final HolyJusticiar card) {
|
||||
|
|
@ -78,16 +78,16 @@ public class HolyJusticiar extends CardImpl<HolyJusticiar> {
|
|||
}
|
||||
|
||||
class HolyJusticiarEffect extends OneShotEffect<HolyJusticiarEffect> {
|
||||
|
||||
|
||||
public HolyJusticiarEffect() {
|
||||
super(Outcome.Detriment);
|
||||
staticText = "Tap target creature. If that creature is a Zombie, exile it";
|
||||
}
|
||||
|
||||
|
||||
public HolyJusticiarEffect(final HolyJusticiarEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent creature = game.getPermanent(source.getFirstTarget());
|
||||
|
|
@ -102,7 +102,7 @@ class HolyJusticiarEffect extends OneShotEffect<HolyJusticiarEffect> {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public HolyJusticiarEffect copy() {
|
||||
return new HolyJusticiarEffect(this);
|
||||
|
|
|
|||
|
|
@ -46,11 +46,11 @@ import java.util.UUID;
|
|||
public class KessigMalcontents extends CardImpl<KessigMalcontents> {
|
||||
|
||||
private static final FilterControlledPermanent filter = new FilterControlledPermanent("Humans you control");
|
||||
|
||||
|
||||
static {
|
||||
filter.getSubtype().add("Human");
|
||||
}
|
||||
|
||||
|
||||
public KessigMalcontents(UUID ownerId) {
|
||||
super(ownerId, 142, "Kessig Malcontents", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ import mage.game.events.GameEvent;
|
|||
* @author jeffwadsworth
|
||||
*/
|
||||
public class LoneRevenant extends CardImpl<LoneRevenant> {
|
||||
|
||||
|
||||
public LoneRevenant(UUID ownerId) {
|
||||
super(ownerId, 64, "Lone Revenant", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
@ -67,7 +67,7 @@ public class LoneRevenant extends CardImpl<LoneRevenant> {
|
|||
this.toughness = new MageInt(4);
|
||||
|
||||
this.addAbility(HexproofAbility.getInstance());
|
||||
|
||||
|
||||
// Whenever Lone Revenant deals combat damage to a player, if you control no other creatures, look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order.
|
||||
this.addAbility(new LoneRevenantTriggeredAbility());
|
||||
}
|
||||
|
|
@ -83,13 +83,13 @@ public class LoneRevenant extends CardImpl<LoneRevenant> {
|
|||
}
|
||||
|
||||
class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl<LoneRevenantTriggeredAbility> {
|
||||
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
|
||||
|
||||
public LoneRevenantTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new LoneRevenantEffect());
|
||||
}
|
||||
|
||||
|
||||
public LoneRevenantTriggeredAbility(final LoneRevenantTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
|
@ -105,7 +105,7 @@ class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl<LoneRevenantTrig
|
|||
&& ((DamagedPlayerEvent) event).isCombatDamage()) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
int number = game.getBattlefield().countAll(filter, controllerId, game);
|
||||
|
||||
|
||||
if (permanent != null && number != 1) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -119,7 +119,7 @@ class LoneRevenantTriggeredAbility extends TriggeredAbilityImpl<LoneRevenantTrig
|
|||
}
|
||||
|
||||
class LoneRevenantEffect extends OneShotEffect<LoneRevenantEffect> {
|
||||
|
||||
|
||||
public LoneRevenantEffect() {
|
||||
super(Constants.Outcome.DrawCard);
|
||||
this.staticText = "Whenever Lone Revenant deals combat damage to a player, if you control no other creatures, look at the top four cards of your library. Put one of them into your hand and the rest on the bottom of your library in any order";
|
||||
|
|
|
|||
|
|
@ -55,10 +55,10 @@ public class MidvastProtector extends CardImpl<MidvastProtector> {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Midvast Protector enters the battlefield, target creature you control gains protection from the color of your choice until end of turn.
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainProtectionFromColorTargetEffect(Constants.Duration.EndOfTurn), false);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
ability.addChoice(new ChoiceColor());
|
||||
this.addAbility(ability);
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new GainProtectionFromColorTargetEffect(Constants.Duration.EndOfTurn), false);
|
||||
ability.addTarget(new TargetControlledCreaturePermanent());
|
||||
ability.addChoice(new ChoiceColor());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public MidvastProtector(final MidvastProtector card) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class MisthollowGriffin extends CardImpl<MisthollowGriffin> {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// You may cast Misthollow Griffin from exile.
|
||||
this.addAbility(new SimpleStaticAbility(Constants.Zone.EXILED, new MisthollowGriffinPlayEffect()));
|
||||
}
|
||||
|
|
@ -72,28 +72,28 @@ public class MisthollowGriffin extends CardImpl<MisthollowGriffin> {
|
|||
}
|
||||
|
||||
class MisthollowGriffinPlayEffect extends AsThoughEffectImpl<MisthollowGriffinPlayEffect> {
|
||||
|
||||
public MisthollowGriffinPlayEffect() {
|
||||
super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit);
|
||||
staticText = "You may cast Misthollow Griffin from exile";
|
||||
}
|
||||
|
||||
public MisthollowGriffinPlayEffect(final MisthollowGriffinPlayEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
public MisthollowGriffinPlayEffect() {
|
||||
super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfGame, Constants.Outcome.Benefit);
|
||||
staticText = "You may cast Misthollow Griffin from exile";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
public MisthollowGriffinPlayEffect(final MisthollowGriffinPlayEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MisthollowGriffinPlayEffect copy() {
|
||||
return new MisthollowGriffinPlayEffect(this);
|
||||
}
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, Game game) {
|
||||
@Override
|
||||
public MisthollowGriffinPlayEffect copy() {
|
||||
return new MisthollowGriffinPlayEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID sourceId, Ability source, Game game) {
|
||||
if (sourceId.equals(source.getSourceId())) {
|
||||
Card card = game.getCard(source.getSourceId());
|
||||
if (card != null && card.getOwnerId().equals(source.getControllerId()) && game.getState().getZone(source.getSourceId()) == Constants.Zone.EXILED) {
|
||||
|
|
@ -101,5 +101,5 @@ class MisthollowGriffinPlayEffect extends AsThoughEffectImpl<MisthollowGriffinPl
|
|||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -58,7 +58,7 @@ public class MoonlightGeist extends CardImpl<MoonlightGeist> {
|
|||
this.toughness = new MageInt(1);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
|
||||
// {3}{W}: Prevent all combat damage that would be dealt to and dealt by Moonlight Geist this turn.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new PreventCombatDamageSourceEffect(Duration.EndOfTurn), new ManaCostsImpl("{3}{W}"));
|
||||
ability.addEffect(new PreventCombatDamageFromSourceEffect(Duration.EndOfTurn));
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import mage.target.Target;
|
|||
* @author jeffwadsworth
|
||||
*/
|
||||
public class Outwit extends CardImpl<Outwit> {
|
||||
|
||||
|
||||
private static FilterSpell filter = new FilterSpell("spell that targets a player");
|
||||
|
||||
public Outwit(UUID ownerId) {
|
||||
|
|
@ -63,7 +63,7 @@ public class Outwit extends CardImpl<Outwit> {
|
|||
|
||||
// Counter target spell that targets a player.
|
||||
this.getSpellAbility().addEffect(new CounterTargetEffect());
|
||||
this.getSpellAbility().addTarget(new CustomTargetSpell(filter));
|
||||
this.getSpellAbility().addTarget(new CustomTargetSpell(filter));
|
||||
}
|
||||
|
||||
public Outwit(final Outwit card) {
|
||||
|
|
@ -80,88 +80,88 @@ public class Outwit extends CardImpl<Outwit> {
|
|||
|
||||
protected FilterSpell filter;
|
||||
|
||||
public CustomTargetSpell() {
|
||||
public CustomTargetSpell() {
|
||||
this(1, 1, new FilterSpell());
|
||||
}
|
||||
}
|
||||
|
||||
public CustomTargetSpell(FilterSpell filter) {
|
||||
public CustomTargetSpell(FilterSpell filter) {
|
||||
this(1, 1, filter);
|
||||
}
|
||||
}
|
||||
|
||||
public CustomTargetSpell(int numTargets, FilterSpell filter) {
|
||||
public CustomTargetSpell(int numTargets, FilterSpell filter) {
|
||||
this(numTargets, numTargets, filter);
|
||||
}
|
||||
}
|
||||
|
||||
public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) {
|
||||
public CustomTargetSpell(int minNumTargets, int maxNumTargets, FilterSpell filter) {
|
||||
this.minNumberOfTargets = minNumTargets;
|
||||
this.maxNumberOfTargets = maxNumTargets;
|
||||
this.zone = Constants.Zone.STACK;
|
||||
this.filter = filter;
|
||||
this.targetName = filter.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
public CustomTargetSpell(final CustomTargetSpell target) {
|
||||
public CustomTargetSpell(final CustomTargetSpell target) {
|
||||
super(target);
|
||||
this.filter = target.filter.copy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
return canChoose(sourceControllerId, game);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
@Override
|
||||
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
return possibleTargets(sourceControllerId, game);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
if (super.canTarget(id, source, game)) {
|
||||
if (targetsPlayer(id, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceControllerId, Game game) {
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceControllerId, Game game) {
|
||||
int count = 0;
|
||||
for (StackObject stackObject : game.getStack()) {
|
||||
if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) {
|
||||
if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) {
|
||||
if (targetsPlayer(stackObject.getId(), game)) {
|
||||
count++;
|
||||
if (count >= this.minNumberOfTargets)
|
||||
if (count >= this.minNumberOfTargets)
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
|
||||
@Override
|
||||
public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
|
||||
Set<UUID> possibleTargets = new HashSet<UUID>();
|
||||
for (StackObject stackObject : game.getStack()) {
|
||||
if (stackObject instanceof Spell && filter.match((Spell) stackObject, game)) {
|
||||
if (targetsPlayer(stackObject.getId(), game)) {
|
||||
possibleTargets.add(stackObject.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return possibleTargets;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
@Override
|
||||
public Filter getFilter() {
|
||||
return filter;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean targetsPlayer(UUID id, Game game) {
|
||||
private boolean targetsPlayer(UUID id, Game game) {
|
||||
StackObject spell = game.getStack().getStackObject(id);
|
||||
if (spell != null) {
|
||||
Ability ability = spell.getStackAbility();
|
||||
Ability ability = spell.getStackAbility();
|
||||
if (ability != null && !ability.getTargets().isEmpty()) {
|
||||
for (Target target : ability.getTargets()) {
|
||||
for (UUID playerId : target.getTargets()) {
|
||||
|
|
@ -174,11 +174,11 @@ public class Outwit extends CardImpl<Outwit> {
|
|||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public CustomTargetSpell copy() {
|
||||
@Override
|
||||
public CustomTargetSpell copy() {
|
||||
return new CustomTargetSpell(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -52,7 +52,7 @@ import java.util.UUID;
|
|||
public class PredatorsGambit extends CardImpl<PredatorsGambit> {
|
||||
|
||||
private static final String rule = "Enchanted creature has intimidate as long as its controller controls no other creatures";
|
||||
|
||||
|
||||
public PredatorsGambit(UUID ownerId) {
|
||||
super(ownerId, 117, "Predator's Gambit", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class RidersOfGavonyGainAbilityControlledEffect extends ContinuousEffectImpl<Rid
|
|||
static {
|
||||
filter.getSubtype().add("Human");
|
||||
}
|
||||
|
||||
|
||||
protected FilterPermanent protectionFilter;
|
||||
|
||||
public RidersOfGavonyGainAbilityControlledEffect() {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ public class SpectralPrison extends CardImpl<SpectralPrison> {
|
|||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Constants.Outcome.Detriment));
|
||||
|
||||
|
||||
// Enchanted creature doesn't untap during its controller's untap step.
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class StolenGoodsEffect extends OneShotEffect<StolenGoodsEffect> {
|
|||
class StolenGoodsCastFromExileEffect extends AsThoughEffectImpl<StolenGoodsCastFromExileEffect> {
|
||||
|
||||
private UUID cardId;
|
||||
|
||||
|
||||
public StolenGoodsCastFromExileEffect(UUID cardId) {
|
||||
super(Constants.AsThoughEffectType.CAST, Constants.Duration.EndOfTurn, Constants.Outcome.Benefit);
|
||||
staticText = "You may cast card from exile";
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ import java.util.UUID;
|
|||
public class TriumphOfCruelty extends CardImpl<TriumphOfCruelty> {
|
||||
|
||||
private static final String ruleText = "target opponent discards a card if you control the creature with the greatest power or tied for the greatest power";
|
||||
|
||||
|
||||
public TriumphOfCruelty(UUID ownerId) {
|
||||
super(ownerId, 122, "Triumph of Cruelty", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ import java.util.UUID;
|
|||
public class TrustedForcemage extends CardImpl<TrustedForcemage> {
|
||||
|
||||
private static final String ruleText = "As long as {this} is paired with another creature, each of those creatures gets +1/+1";
|
||||
|
||||
|
||||
public TrustedForcemage(UUID ownerId) {
|
||||
super(ownerId, 199, "Trusted Forcemage", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
this.expansionSetCode = "AVR";
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class AkkiBlizzardHerder extends CardImpl<AkkiBlizzardHerder> {
|
|||
static {
|
||||
filter.getCardType().add(CardType.LAND);
|
||||
}
|
||||
|
||||
|
||||
public AkkiBlizzardHerder(UUID ownerId) {
|
||||
super(ownerId, 91, "Akki Blizzard-Herder", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
this.expansionSetCode = "BOK";
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ import mage.game.permanent.token.SpiritToken;
|
|||
public class BakuAltar extends CardImpl<BakuAltar> {
|
||||
|
||||
private final static FilterSpiritOrArcaneCard filter = new FilterSpiritOrArcaneCard();
|
||||
|
||||
|
||||
public BakuAltar(UUID ownerId) {
|
||||
super(ownerId, 152, "Baku Altar", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||
this.expansionSetCode = "BOK";
|
||||
|
|
|
|||
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