mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
* Token images - added possibility to set a original set for the token to get the correct token image if it does not exist for the card itself. Fixed a lot of not found token images. Some more have to be corrected.
This commit is contained in:
parent
fbde29afd6
commit
a1ba324dba
27 changed files with 101 additions and 54 deletions
|
@ -6,14 +6,9 @@
|
|||
|
||||
package org.mage.plugins.card.dl.sources;
|
||||
|
||||
|
||||
import com.google.common.collect.AbstractIterator;
|
||||
import org.mage.plugins.card.dl.DownloadJob;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.*;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import org.mage.plugins.card.dl.DownloadJob;
|
||||
import static org.mage.plugins.card.dl.DownloadJob.fromURL;
|
||||
import static org.mage.plugins.card.dl.DownloadJob.toFile;
|
||||
|
||||
|
@ -30,6 +25,7 @@ public class DirectLinksForDownload implements Iterable<DownloadJob> {
|
|||
private static final Map<String, String> directLinks = new LinkedHashMap<String, String>();
|
||||
|
||||
public static final String cardbackFilename = "cardback.jpg";
|
||||
public static final String tokenFrameFilename = "tokenFrame.png";
|
||||
|
||||
static {
|
||||
directLinks.put(cardbackFilename, backsideUrl);
|
||||
|
|
|
@ -9,6 +9,7 @@ public class CardDownloadData {
|
|||
private String name;
|
||||
private String downloadName;
|
||||
private String set;
|
||||
private String tokenSetCode;
|
||||
private Integer collectorId;
|
||||
private Integer type;
|
||||
private boolean token;
|
||||
|
@ -20,15 +21,15 @@ public class CardDownloadData {
|
|||
private boolean usesVariousArt;
|
||||
private boolean isType2;
|
||||
|
||||
public CardDownloadData(String name, String set, Integer collectorId, boolean usesVariousArt, Integer type) {
|
||||
this(name, set, collectorId, usesVariousArt, type, false);
|
||||
public CardDownloadData(String name, String set, Integer collectorId, boolean usesVariousArt, Integer type, String tokenSetCode) {
|
||||
this(name, set, collectorId, usesVariousArt, type, tokenSetCode, false);
|
||||
}
|
||||
|
||||
public CardDownloadData(String name, String set, Integer collectorId, boolean usesVariousArt, Integer type, boolean token) {
|
||||
this(name, set, collectorId, usesVariousArt, type, token, false, false);
|
||||
public CardDownloadData(String name, String set, Integer collectorId, boolean usesVariousArt, Integer type, String tokenSetCode, boolean token) {
|
||||
this(name, set, collectorId, usesVariousArt, type, tokenSetCode, token, false, false);
|
||||
}
|
||||
|
||||
public CardDownloadData(String name, String set, Integer collectorId, boolean usesVariousArt, Integer type, boolean token, boolean twoFacedCard, boolean secondSide) {
|
||||
public CardDownloadData(String name, String set, Integer collectorId, boolean usesVariousArt, Integer type, String tokenSetCode, boolean token, boolean twoFacedCard, boolean secondSide) {
|
||||
this.name = name;
|
||||
this.set = set;
|
||||
this.collectorId = collectorId;
|
||||
|
@ -37,6 +38,7 @@ public class CardDownloadData {
|
|||
this.token = token;
|
||||
this.twoFacedCard = twoFacedCard;
|
||||
this.secondSide = secondSide;
|
||||
this.tokenSetCode = tokenSetCode;
|
||||
}
|
||||
|
||||
public CardDownloadData(final CardDownloadData card) {
|
||||
|
@ -48,6 +50,7 @@ public class CardDownloadData {
|
|||
this.secondSide = card.secondSide;
|
||||
this.type = card.type;
|
||||
this.usesVariousArt = card.usesVariousArt;
|
||||
this.tokenSetCode = card.tokenSetCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -117,6 +120,14 @@ public class CardDownloadData {
|
|||
this.set = set;
|
||||
}
|
||||
|
||||
public String getTokenSetCode() {
|
||||
return tokenSetCode;
|
||||
}
|
||||
|
||||
public void setTokenSetCode(String tokenSetCode) {
|
||||
this.tokenSetCode = tokenSetCode;
|
||||
}
|
||||
|
||||
public boolean isToken() {
|
||||
return token;
|
||||
}
|
||||
|
|
|
@ -196,7 +196,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
TFile file;
|
||||
for (CardInfo card : allCards) {
|
||||
if (card.getCardNumber() > 0 && !card.getSetCode().isEmpty()) {
|
||||
CardDownloadData url = new CardDownloadData(card.getName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, false, card.isDoubleFaced(), card.isNightCard());
|
||||
CardDownloadData url = new CardDownloadData(card.getName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, "", false, card.isDoubleFaced(), card.isNightCard());
|
||||
file = new TFile(CardImageUtils.generateImagePath(url));
|
||||
if (!file.exists()) {
|
||||
return true;
|
||||
|
@ -234,7 +234,7 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
if (card.getCardNumber() > 0 && !card.getSetCode().isEmpty()
|
||||
&& !ignoreUrls.contains(card.getSetCode())) {
|
||||
String cardName = card.getName();
|
||||
CardDownloadData url = new CardDownloadData(cardName, card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, false, card.isDoubleFaced(), card.isNightCard());
|
||||
CardDownloadData url = new CardDownloadData(cardName, card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, "", false, card.isDoubleFaced(), card.isNightCard());
|
||||
if (url.getUsesVariousArt()) {
|
||||
url.setDownloadName(createDownloadName(card));
|
||||
}
|
||||
|
@ -251,14 +251,14 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
if (card.getSecondSideName() == null || card.getSecondSideName().trim().isEmpty()) {
|
||||
throw new IllegalStateException("Second side card can't have empty name.");
|
||||
}
|
||||
url = new CardDownloadData(card.getSecondSideName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, false, card.isDoubleFaced(), true);
|
||||
url = new CardDownloadData(card.getSecondSideName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, "", false, card.isDoubleFaced(), true);
|
||||
allCardsUrls.add(url);
|
||||
}
|
||||
if (card.isFlipCard()) {
|
||||
if (card.getFlipCardName() == null || card.getFlipCardName().trim().isEmpty()) {
|
||||
throw new IllegalStateException("Flipped card can't have empty name.");
|
||||
}
|
||||
url = new CardDownloadData(card.getFlipCardName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, false, card.isDoubleFaced(), card.isNightCard());
|
||||
url = new CardDownloadData(card.getFlipCardName(), card.getSetCode(), card.getCardNumber(), card.usesVariousArt(), 0, "", false, card.isDoubleFaced(), card.isNightCard());
|
||||
url.setFlipCard(true);
|
||||
url.setFlippedSide(true);
|
||||
allCardsUrls.add(url);
|
||||
|
@ -330,15 +330,15 @@ public class DownloadPictures extends DefaultBoundedRangeModel implements Runnab
|
|||
if (params.length >= 4) {
|
||||
if (params[1].toLowerCase().equals("generate") && params[2].startsWith("TOK:")) {
|
||||
String set = params[2].substring(4);
|
||||
CardDownloadData card = new CardDownloadData(params[3], set, 0, false, 0, true);
|
||||
CardDownloadData card = new CardDownloadData(params[3], set, 0, false, 0, "", true);
|
||||
list.add(card);
|
||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM:")) {
|
||||
String set = params[2].substring(7);
|
||||
CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, 0, false,0, true);
|
||||
CardDownloadData card = new CardDownloadData("Emblem " + params[3], set, 0, false,0, "", true);
|
||||
list.add(card);
|
||||
} else if (params[1].toLowerCase().equals("generate") && params[2].startsWith("EMBLEM-:")) {
|
||||
String set = params[2].substring(8);
|
||||
CardDownloadData card = new CardDownloadData(params[3] + " Emblem", set, 0, false, 0, true);
|
||||
CardDownloadData card = new CardDownloadData(params[3] + " Emblem", set, 0, false, 0, "", true);
|
||||
list.add(card);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -49,7 +49,7 @@ public class ImageCache {
|
|||
* Common pattern for keys.
|
||||
* Format: "<cardname>#<setname>#<collectorID>"
|
||||
*/
|
||||
private static final Pattern KEY_PATTERN = Pattern.compile("(.*)#(.*)#(.*)#(.*)");
|
||||
private static final Pattern KEY_PATTERN = Pattern.compile("(.*)#(.*)#(.*)#(.*)#(.*)");
|
||||
|
||||
static {
|
||||
imageCache = new MapMaker().softValues().makeComputingMap(new Function<String, BufferedImage>() {
|
||||
|
@ -73,15 +73,16 @@ public class ImageCache {
|
|||
String set = m.group(2);
|
||||
Integer type = Integer.parseInt(m.group(3));
|
||||
Integer collectorId = Integer.parseInt(m.group(4));
|
||||
String tokenSetCode = m.group(5);
|
||||
|
||||
CardDownloadData info = new CardDownloadData(name, set, collectorId, usesVariousArt, type);
|
||||
CardDownloadData info = new CardDownloadData(name, set, collectorId, usesVariousArt, type, tokenSetCode);
|
||||
|
||||
String path;
|
||||
if (collectorId == 0) {
|
||||
info.setToken(true);
|
||||
path = CardImageUtils.generateTokenImagePath(info);
|
||||
if (path == null) {
|
||||
path = DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.cardbackFilename;
|
||||
path = DirectLinksForDownload.outDir + File.separator + DirectLinksForDownload.tokenFrameFilename;
|
||||
}
|
||||
} else {
|
||||
path = CardImageUtils.generateImagePath(info);
|
||||
|
@ -194,11 +195,12 @@ public class ImageCache {
|
|||
* Returns the map key for a card, without any suffixes for the image size.
|
||||
*/
|
||||
private static String getKey(CardView card) {
|
||||
String set = card.getExpansionSetCode();
|
||||
int type = card.getType();
|
||||
String key = card.getName() + "#" + set + "#" + type + "#" + String.valueOf(card.getCardNumber());
|
||||
|
||||
return key;
|
||||
StringBuilder sb = new StringBuilder(card.getName()).append("#");
|
||||
sb.append(card.getExpansionSetCode()).append("#");
|
||||
sb.append(card.getType()).append("#");
|
||||
sb.append(card.getCardNumber()).append("#");
|
||||
sb.append(card.getTokenSetCode() == null ? "":card.getTokenSetCode());
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,12 +1,9 @@
|
|||
package org.mage.plugins.card.utils;
|
||||
|
||||
import de.schlichtherle.truezip.file.TFile;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.HashMap;
|
||||
import mage.client.constants.Constants;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import org.mage.plugins.card.dl.sources.DirectLinksForDownload;
|
||||
import org.mage.plugins.card.images.CardDownloadData;
|
||||
import org.mage.plugins.card.properties.SettingsManager;
|
||||
|
||||
|
@ -27,11 +24,10 @@ public class CardImageUtils {
|
|||
String filePath = getTokenImagePath(card);
|
||||
TFile file = new TFile(filePath);
|
||||
|
||||
// Issue #329
|
||||
/*if (!file.exists()) {
|
||||
if (!file.exists() && card.getTokenSetCode() != null) {
|
||||
filePath = searchForCardImage(card);
|
||||
file = new TFile(filePath);
|
||||
}*/
|
||||
}
|
||||
|
||||
if (file.exists()) {
|
||||
pathCache.put(card, filePath);
|
||||
|
@ -65,16 +61,23 @@ public class CardImageUtils {
|
|||
TFile file;
|
||||
String path;
|
||||
CardDownloadData c = new CardDownloadData(card);
|
||||
|
||||
for (String set : SettingsManager.getIntance().getTokenLookupOrder()) {
|
||||
c.setSet(set);
|
||||
path = getTokenImagePath(c);
|
||||
file = new TFile(path);
|
||||
if (file.exists()) {
|
||||
pathCache.put(card, path);
|
||||
return path;
|
||||
}
|
||||
c.setSet(card.getTokenSetCode());
|
||||
path = getTokenImagePath(c);
|
||||
file = new TFile(path);
|
||||
if (file.exists()) {
|
||||
pathCache.put(card, path);
|
||||
return path;
|
||||
}
|
||||
|
||||
// for (String set : SettingsManager.getIntance().getTokenLookupOrder()) {
|
||||
// c.setSet(set);
|
||||
// path = getTokenImagePath(c);
|
||||
// file = new TFile(path);
|
||||
// if (file.exists()) {
|
||||
// pathCache.put(card, path);
|
||||
// return path;
|
||||
// }
|
||||
// }
|
||||
return "";
|
||||
}
|
||||
|
||||
|
@ -91,8 +94,8 @@ public class CardImageUtils {
|
|||
|
||||
private static String getImageDir(CardDownloadData card, String imagesPath) {
|
||||
if (card.getSet() == null) {
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
String set = updateSet(card.getSet(), false).toUpperCase();
|
||||
String imagesDir = (imagesPath != null ? imagesPath : Constants.IO.imageBaseDir);
|
||||
if (card.isToken()) {
|
||||
|
|
|
@ -109,7 +109,7 @@ public class CardView extends SimpleCardView {
|
|||
}
|
||||
|
||||
public CardView(Card card) {
|
||||
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt());
|
||||
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt(), card.getTokenSetCode());
|
||||
|
||||
// no information available for face down cards
|
||||
if (this.faceDown) {
|
||||
|
@ -223,7 +223,7 @@ public class CardView extends SimpleCardView {
|
|||
}
|
||||
|
||||
public CardView(MageObject object) {
|
||||
super(object.getId(), "", 0, false, false);
|
||||
super(object.getId(), "", 0, false, false, "");
|
||||
this.name = object.getName();
|
||||
this.displayName = object.getName();
|
||||
if (object instanceof Permanent) {
|
||||
|
@ -267,7 +267,7 @@ public class CardView extends SimpleCardView {
|
|||
}
|
||||
|
||||
protected CardView() {
|
||||
super(null, "", 0, false, false);
|
||||
super(null, "", 0, false, false, "");
|
||||
}
|
||||
|
||||
public CardView(EmblemView emblem) {
|
||||
|
@ -282,7 +282,7 @@ public class CardView extends SimpleCardView {
|
|||
}
|
||||
|
||||
public CardView(boolean empty) {
|
||||
super(null, "", 0, false, false);
|
||||
super(null, "", 0, false, false, "");
|
||||
if (!empty) {
|
||||
throw new IllegalArgumentException("Not supported.");
|
||||
}
|
||||
|
@ -314,7 +314,7 @@ public class CardView extends SimpleCardView {
|
|||
}
|
||||
|
||||
CardView(Token token) {
|
||||
super(token.getId(), "", 0, false, false);
|
||||
super(token.getId(), "", 0, false, false, "");
|
||||
this.isToken = true;
|
||||
this.id = token.getId();
|
||||
this.name = token.getName();
|
||||
|
@ -330,6 +330,7 @@ public class CardView extends SimpleCardView {
|
|||
this.manaCost = token.getManaCost().getSymbols();
|
||||
this.rarity = Rarity.NA;
|
||||
this.type = token.getTokenType();
|
||||
this.tokenSetCode = token.getOriginalExpansionSetCode();
|
||||
}
|
||||
|
||||
protected final void setTargets(Targets targets) {
|
||||
|
|
|
@ -46,7 +46,7 @@ public class LookedAtView implements Serializable {
|
|||
public LookedAtView(String name, Cards cards, Game game) {
|
||||
this.name = name;
|
||||
for (Card card: cards.getCards(game)) {
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown()));
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown(), card.getTokenSetCode()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,7 @@ public class PermanentView extends CardView {
|
|||
if (isToken()) {
|
||||
original = new CardView(((PermanentToken)permanent).getToken());
|
||||
original.expansionSetCode = permanent.getExpansionSetCode();
|
||||
tokenSetCode = original.getTokenSetCode();
|
||||
}
|
||||
else {
|
||||
if (card != null) {
|
||||
|
|
|
@ -79,7 +79,7 @@ public class PlayerView implements Serializable {
|
|||
this.hasPriority = player.getId().equals(state.getPriorityPlayerId());
|
||||
this.hasLeft = player.hasLeft();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
graveyard.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown()));
|
||||
graveyard.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown(), card.getTokenSetCode()));
|
||||
}
|
||||
for (Permanent permanent: state.getBattlefield().getAllPermanents()) {
|
||||
if (showInBattlefield(permanent, state)) {
|
||||
|
|
|
@ -45,7 +45,7 @@ public class RevealedView implements Serializable {
|
|||
public RevealedView(String name, Cards cards, Game game) {
|
||||
this.name = name;
|
||||
for (Card card: cards.getCards(game)) {
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown()));
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown(), card.getTokenSetCode()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,16 +38,18 @@ import java.util.UUID;
|
|||
public class SimpleCardView implements Serializable {
|
||||
protected UUID id;
|
||||
protected String expansionSetCode;
|
||||
protected String tokenSetCode;
|
||||
protected int cardNumber;
|
||||
protected boolean faceDown;
|
||||
protected boolean usesVariousArt;
|
||||
|
||||
public SimpleCardView(UUID id, String expansionSetCode, int cardNumber, boolean faceDown, boolean usesVariousArt) {
|
||||
public SimpleCardView(UUID id, String expansionSetCode, int cardNumber, boolean faceDown, boolean usesVariousArt, String tokenSetCode) {
|
||||
this.id = id;
|
||||
this.expansionSetCode = expansionSetCode;
|
||||
this.cardNumber = cardNumber;
|
||||
this.faceDown = faceDown;
|
||||
this.usesVariousArt = usesVariousArt;
|
||||
this.tokenSetCode = tokenSetCode;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
|
@ -69,4 +71,9 @@ public class SimpleCardView implements Serializable {
|
|||
public boolean getUsesVariousArt() {
|
||||
return usesVariousArt;
|
||||
}
|
||||
|
||||
public String getTokenSetCode() {
|
||||
return tokenSetCode;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SimpleCardsView extends LinkedHashMap<UUID, SimpleCardView> {
|
|||
|
||||
public SimpleCardsView(Collection<Card> cards) {
|
||||
for (Card card: cards) {
|
||||
this.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt()));
|
||||
this.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt(), card.getTokenSetCode()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -110,6 +110,8 @@ class SpiritBlueToken extends Token {
|
|||
color.setBlue(true);
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
setTokenType(2);
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -77,6 +77,8 @@ public class AdventOfTheWurm extends CardImpl<AdventOfTheWurm> {
|
|||
toughness = new MageInt(5);
|
||||
|
||||
addAbility(TrampleAbility.getInstance());
|
||||
// for image
|
||||
setOriginalExpansionSetCode("RTR");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -90,5 +90,6 @@ class BirdToken extends Token {
|
|||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
setOriginalExpansionSetCode("RTR");
|
||||
}
|
||||
}
|
|
@ -85,5 +85,6 @@ class RhinoToken extends Token {
|
|||
power = new MageInt(4);
|
||||
toughness = new MageInt(4);
|
||||
addAbility(TrampleAbility.getInstance());
|
||||
setOriginalExpansionSetCode("RTR");
|
||||
}
|
||||
}
|
|
@ -114,5 +114,6 @@ class OozeToken extends Token {
|
|||
color.setGreen(true);
|
||||
power = new MageInt(0);
|
||||
toughness = new MageInt(0);
|
||||
setOriginalExpansionSetCode("RTR");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,5 +113,6 @@ class MysticGenesisOozeToken extends Token {
|
|||
subtype.add("Ooze");
|
||||
power = new MageInt(0);
|
||||
toughness = new MageInt(0);
|
||||
setOriginalExpansionSetCode("RTR");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,6 +58,7 @@ public interface Card extends MageObject {
|
|||
List<String> getRules();
|
||||
List<Watcher> getWatchers();
|
||||
String getExpansionSetCode();
|
||||
String getTokenSetCode();
|
||||
void setExpansionSetCode(String expansionSetCode);
|
||||
void setFaceDown(boolean value);
|
||||
boolean isFaceDown();
|
||||
|
|
|
@ -63,6 +63,7 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
protected int cardNumber;
|
||||
protected List<Watcher> watchers = new ArrayList<Watcher>();
|
||||
protected String expansionSetCode;
|
||||
protected String tokenSetCode;
|
||||
protected Rarity rarity;
|
||||
protected boolean faceDown;
|
||||
protected boolean canTransform;
|
||||
|
@ -251,6 +252,11 @@ public abstract class CardImpl<T extends CardImpl<T>> extends MageObjectImpl<T>
|
|||
return expansionSetCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTokenSetCode() {
|
||||
return tokenSetCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpansionSetCode(String expansionSetCode) {
|
||||
this.expansionSetCode = expansionSetCode;
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
package mage.game.permanent.token;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.constants.CardType;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -45,6 +45,7 @@ public class BeastToken extends Token {
|
|||
subtype.add("Beast");
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(3);
|
||||
setOriginalExpansionSetCode("LRW");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ public class CentaurToken extends Token {
|
|||
subtype.add("Centaur");
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(3);
|
||||
setOriginalExpansionSetCode("RTR");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -47,5 +47,6 @@ public class InsectInfectToken extends Token {
|
|||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
addAbility(InfectAbility.getInstance());
|
||||
setOriginalExpansionSetCode("SOM");
|
||||
}
|
||||
}
|
|
@ -19,5 +19,6 @@ public class KnightToken extends Token {
|
|||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
this.addAbility(VigilanceAbility.getInstance());
|
||||
setOriginalExpansionSetCode("RTR");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,5 +44,6 @@ public class SpiritWhiteToken extends Token {
|
|||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
addAbility(FlyingAbility.getInstance());
|
||||
this.setOriginalExpansionSetCode("SHM");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public class WolfToken extends Token {
|
|||
power = new MageInt(2);
|
||||
toughness = new MageInt(2);
|
||||
setTokenType(Type.SECOND.code);
|
||||
this.setOriginalExpansionSetCode("ISD");
|
||||
}
|
||||
|
||||
public WolfToken(Token.Type type) {
|
||||
|
|
|
@ -452,6 +452,11 @@ public class Spell<T extends Spell<T>> implements StackObject, Card {
|
|||
return card.getExpansionSetCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTokenSetCode() {
|
||||
return card.getTokenSetCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpansionSetCode(String expansionSetCode) {}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue