Merge pull request #2234 from stravant/master

Characteristic-Based rendering initial release completed unless further bugs come up before then.
This commit is contained in:
Mark Langen 2016-09-07 23:16:10 -06:00 committed by GitHub
commit 8d90f4558d
70 changed files with 518 additions and 115 deletions

View file

@ -66,6 +66,9 @@ public class CardPanelRenderImpl extends CardPanel {
if (!a.getExpansionSetCode().equals(b.getExpansionSetCode())) {
return false;
}
if (a.getFrameStyle() != b.getFrameStyle()) {
return false;
}
if (a.getCounters() == null) {
if (b.getCounters() != null) {
return false;
@ -121,6 +124,7 @@ public class CardPanelRenderImpl extends CardPanel {
sb.append((char) (this.view.isPlayable() ? 1 : 0));
sb.append((char) (this.view.isCanAttack() ? 1 : 0));
sb.append((char) (this.view.isFaceDown() ? 1 : 0));
sb.append((char) this.view.getFrameStyle().ordinal());
if (this.view instanceof PermanentView) {
sb.append((char) (((PermanentView) this.view).hasSummoningSickness() ? 1 : 0));
sb.append((char) (((PermanentView) this.view).getDamage()));
@ -378,6 +382,24 @@ public class CardPanelRenderImpl extends CardPanel {
}
}
@Override
public void setSelected(boolean selected) {
if (selected != isSelected()) {
super.setSelected(selected);
// Invalidate our render
cardImage = null;
}
}
@Override
public void setChoosable(boolean choosable) {
if (choosable != isChoosable()) {
super.setChoosable(choosable);
// Invalidate our render
cardImage = null;
}
}
@Override
public Image getImage() {
if (artImage != null) {

View file

@ -20,8 +20,9 @@ import java.awt.font.LineBreakMeasurer;
import java.awt.font.TextAttribute;
import java.awt.font.TextLayout;
import java.awt.font.TextMeasurer;
import java.awt.geom.RoundRectangle2D;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.RasterFormatException;
import java.io.IOException;
import java.net.URL;
import java.text.AttributedCharacterIterator;
@ -159,12 +160,17 @@ public class ModernCardRenderer extends CardRenderer {
// How far down the card is the type line placed?
protected static float TYPE_LINE_Y_FRAC = 0.57f; // x cardHeight
protected static float TYPE_LINE_Y_FRAC_TOKEN = 0.70f;
protected static float TYPE_LINE_Y_FRAC_FULL_ART = 0.74f;
protected int typeLineY;
// Possible sizes of rules text font
protected static int[] RULES_TEXT_FONT_SIZES = {24, 18, 15, 12, 9};
// How large is the box text, and how far is it down the boxes
protected int boxTextHeight;
protected int boxTextOffset;
protected Font boxTextFont;
protected Font boxTextFontNarrow;
// How large is the P/T text, and how far is it down the boxes
protected int ptTextHeight;
@ -202,29 +208,26 @@ public class ModernCardRenderer extends CardRenderer {
BOX_HEIGHT_FRAC * cardHeight);
// Type line at
if (cardView.isToken()) {
typeLineY = (int) (TYPE_LINE_Y_FRAC_TOKEN * cardHeight);
} else {
typeLineY = (int) (TYPE_LINE_Y_FRAC * cardHeight);
}
typeLineY = (int)(getTypeLineYFrac() * cardHeight);
// Box text height
boxTextHeight = getTextHeightForBoxHeight(boxHeight);
boxTextOffset = (boxHeight - boxTextHeight) / 2;
boxTextFont = BASE_BELEREN_FONT.deriveFont(Font.PLAIN, boxTextHeight);
// Not using Beleren for now because it looks bad at small font sizes. Maybe we want to in the future?
//boxTextFont = BASE_BELEREN_FONT.deriveFont(Font.PLAIN, boxTextHeight);
boxTextFont = new Font("Arial", Font.PLAIN, boxTextHeight);
boxTextFontNarrow = new Font("Arial Narrow", Font.PLAIN, boxTextHeight);
// Box text height
ptTextHeight = getPTTextHeightForLineHeight(boxHeight);
ptTextOffset = (boxHeight - ptTextHeight) / 2;
// Beleren font does work well for numbers though
ptTextFont = BASE_BELEREN_FONT.deriveFont(Font.PLAIN, ptTextHeight);
}
@Override
protected void drawBorder(Graphics2D g) {
// Draw border as one rounded rectangle
g.setColor(Color.black);
g.fillRoundRect(0, 0, cardWidth, cardHeight, cornerRadius, cornerRadius);
// Selection Borders
Color borderColor;
if (isSelected) {
@ -233,11 +236,17 @@ public class ModernCardRenderer extends CardRenderer {
borderColor = new Color(250, 250, 0, 230);
} else if (cardView.isPlayable()) {
borderColor = new Color(153, 102, 204, 200);
} else if (cardView instanceof PermanentView && ((PermanentView) cardView).isCanAttack()) {
} else if (cardView.isCanAttack()) {
borderColor = new Color(0, 0, 255, 230);
} else {
borderColor = null;
borderColor = Color.BLACK;
}
// Draw border as one rounded rectangle
g.setColor(borderColor);
g.fillRoundRect(0, 0, cardWidth, cardHeight, cornerRadius, cornerRadius);
/* // Separate selection highlight border from card itself. Not used right now
if (borderColor != null) {
float hwidth = borderWidth / 2.0f;
Graphics2D g2 = (Graphics2D) g.create();
@ -251,6 +260,7 @@ public class ModernCardRenderer extends CardRenderer {
g2.draw(rect);
g2.dispose();
}
*/
}
@Override
@ -283,19 +293,63 @@ public class ModernCardRenderer extends CardRenderer {
}
}
/**
* Get the region to slice out of a source art image for the card
* @return
*/
private Rectangle2D getArtRect() {
Rectangle2D rect;
if (cardView.getFrameStyle().isFullArt() || cardView.isToken()) {
rect = new Rectangle2D.Float(.079f, .11f, .84f, .63f);
} else {
rect = new Rectangle2D.Float(.079f, .11f, .84f, .42f);
}
return rect;
}
private float getTypeLineYFrac() {
if (cardView.isToken()) {
return TYPE_LINE_Y_FRAC_TOKEN;
} else if (cardView.getFrameStyle().isFullArt()) {
return TYPE_LINE_Y_FRAC_FULL_ART;
} else {
return TYPE_LINE_Y_FRAC;
}
}
@Override
protected void drawArt(Graphics2D g) {
if (artImage != null && !cardView.isFaceDown()) {
int imgWidth = artImage.getWidth();
int imgHeight = artImage.getHeight();
Rectangle2D artRect = getArtRect();
// Perform a process to make sure that the art is scaled uniformly to fill the frame, cutting
// off the minimum amount necessary to make it completely fill the frame without "squashing" it.
double fullCardImgWidth = artImage.getWidth();
double fullCardImgHeight = artImage.getHeight();
double artWidth = artRect.getWidth() * fullCardImgWidth;
double artHeight = artRect.getHeight() * fullCardImgHeight;
double targetWidth = contentWidth - 2;
double targetHeight = typeLineY - totalContentInset - boxHeight;
double targetAspect = targetWidth / targetHeight;
if (targetAspect * artHeight < artWidth) {
// Trim off some width
artWidth = targetAspect * artHeight;
} else {
// Trim off some height
artHeight = artWidth / targetAspect;
}
try {
BufferedImage subImg
= artImage.getSubimage(
(int) (.079 * imgWidth), (int) (.11 * imgHeight),
(int) (.84 * imgWidth), (int) (.42 * imgHeight));
(int) (artRect.getX() * fullCardImgWidth), (int) (artRect.getY() * fullCardImgHeight),
(int) artWidth, (int) artHeight);
g.drawImage(subImg,
totalContentInset + 1, totalContentInset + boxHeight,
contentWidth - 2, typeLineY - totalContentInset - boxHeight,
(int) targetWidth, (int) targetHeight,
null);
} catch (RasterFormatException e) {
// At very small card sizes we may encounter a problem with rounding error making the rect not fit
}
}
}
@ -414,12 +468,23 @@ public class ModernCardRenderer extends CardRenderer {
} else {
nameStr = cardView.getName();
}
if (!nameStr.isEmpty()) {
AttributedString str = new AttributedString(nameStr);
str.addAttribute(TextAttribute.FONT, boxTextFont);
TextMeasurer measure = new TextMeasurer(str.getIterator(), g.getFontRenderContext());
TextLayout layout = measure.getLayout(0, measure.getLineBreakIndex(0, availableWidth));
int breakIndex = measure.getLineBreakIndex(0, availableWidth);
if (breakIndex < nameStr.length()) {
str = new AttributedString(nameStr);
str.addAttribute(TextAttribute.FONT, boxTextFontNarrow);
measure = new TextMeasurer(str.getIterator(), g.getFontRenderContext());
breakIndex = measure.getLineBreakIndex(0, availableWidth);
}
if (breakIndex > 0) {
TextLayout layout = measure.getLayout(0, breakIndex);
g.setColor(getBoxTextColor());
layout.draw(g, x, y + boxTextOffset + boxTextHeight - 1);
}
}
// Draw the mana symbols
if (!cardView.isAbility() && !cardView.isFaceDown()) {
@ -455,11 +520,20 @@ public class ModernCardRenderer extends CardRenderer {
AttributedString str = new AttributedString(types);
str.addAttribute(TextAttribute.FONT, boxTextFont);
TextMeasurer measure = new TextMeasurer(str.getIterator(), g.getFontRenderContext());
TextLayout layout = measure.getLayout(0, measure.getLineBreakIndex(0, availableWidth));
int breakIndex = measure.getLineBreakIndex(0, availableWidth);
if (breakIndex < types.length()) {
str = new AttributedString(types);
str.addAttribute(TextAttribute.FONT, boxTextFontNarrow);
measure = new TextMeasurer(str.getIterator(), g.getFontRenderContext());
breakIndex = measure.getLineBreakIndex(0, availableWidth);
}
if (breakIndex > 0) {
TextLayout layout = measure.getLayout(0, breakIndex);
g.setColor(getBoxTextColor());
layout.draw(g, x, y + boxTextOffset + boxTextHeight - 1);
}
}
}
// Draw the P/T and/or Loyalty boxes
protected void drawBottomRight(Graphics2D g, Paint borderPaint, Color fill) {
@ -475,7 +549,7 @@ public class ModernCardRenderer extends CardRenderer {
int partWidth = (int) Math.max(30, 0.20f * cardWidth);
// Is it a creature?
if (cardView.getCardTypes().contains(CardType.CREATURE)) {
if (cardView.getCardTypes().contains(CardType.CREATURE) || cardView.getSubTypes().contains("Vehicle")) {
int x = cardWidth - borderWidth - partWidth;
// Draw PT box
@ -500,12 +574,7 @@ public class ModernCardRenderer extends CardRenderer {
g.drawString(ptText,
x + (partWidth - ptTextWidth) / 2, curY - ptTextOffset - 1);
// Does it have damage on it?
if ((cardView instanceof PermanentView) && ((PermanentView) cardView).getDamage() > 0) {
// Show marked damage
}
// Advance
curY -= boxHeight;
}
@ -583,95 +652,92 @@ public class ModernCardRenderer extends CardRenderer {
// Draw the card's textbox in a given rect
protected boolean loyaltyAbilityColorToggle = false;
protected void drawRulesText(Graphics2D g, int x, int y, int w, int h) {
// Initial font size to try to render at
Font font = new Font("Arial", Font.PLAIN, 12);
Font fontItalic = new Font("Arial", Font.ITALIC, 12);
// Handle the keyword rules
boolean hasKeywords = !textboxKeywords.isEmpty();
String keywordRulesString = getKeywordRulesString();
AttributedString keywordRulesAttributed = new AttributedString(keywordRulesString);
if (hasKeywords) {
keywordRulesAttributed.addAttribute(TextAttribute.FONT, font);
private class RuleLayout {
public List<AttributedString> attributedRules;
public int remainingHeight;
public boolean fits;
public Font font;
public Font fontItalic;
}
// Get the total height
/**
* Figure out if a given text size will work for laying out the rules in a card textbox
*/
protected RuleLayout layoutRules(Graphics2D g, List<TextboxRule> rules, int w, int h, int fontSize) {
// The fonts to try
Font font = new Font("Arial", Font.PLAIN, fontSize);
Font fontItalic = new Font("Arial", Font.ITALIC, fontSize);
// Get the total height of the rules
List<AttributedString> attributedRules = new ArrayList<>();
boolean useSmallFont = false;
boolean fits = true;
int remaining = h;
{
if (hasKeywords) {
remaining -= drawSingleRule(g, keywordRulesAttributed, null, 0, 0, w, remaining, false);
}
for (TextboxRule rule : textboxRules) {
for (TextboxRule rule : rules) {
AttributedString attributed = rule.generateAttributedString(font, fontItalic);
attributedRules.add(attributed);
remaining -= drawSingleRule(g, attributed, rule, 0, 0, w, remaining, false);
remaining -= drawSingleRule(g, attributed, rule, 0, 0, w, remaining, /*doDraw=*/false);
if (remaining < 0) {
useSmallFont = true;
fits = false;
break;
}
}
// Return the information
RuleLayout layout = new RuleLayout();
layout.attributedRules = attributedRules;
layout.remainingHeight = remaining;
layout.fits = fits;
layout.font = font;
layout.fontItalic = fontItalic;
return layout;
}
// If there wasn't enough room, try using a smaller font
if (useSmallFont) {
font = new Font("Arial", Font.PLAIN, 9);
fontItalic = new Font("Arial", Font.ITALIC, 9);
if (hasKeywords) {
keywordRulesAttributed = new AttributedString(keywordRulesString);
keywordRulesAttributed.addAttribute(TextAttribute.FONT, font);
protected void drawRulesText(Graphics2D g, int x, int y, int w, int h) {
// Gather all rules to render
List<TextboxRule> allRules = new ArrayList<>(textboxRules);
// Add the keyword rule if there are any keywords
if (!textboxKeywords.isEmpty()) {
String keywordRulesString = getKeywordRulesString();
TextboxRule keywordsRule = new TextboxRule(keywordRulesString, new ArrayList<TextboxRule.AttributeRegion>());
allRules.add(keywordsRule);
}
// Clear out the attributed rules and reatribute them with the new font size
attributedRules.clear();
for (TextboxRule rule : textboxRules) {
AttributedString attributed = rule.generateAttributedString(font, fontItalic);
attributedRules.add(attributed);
}
// Go through possible font sizes in descending order to find the best fit
RuleLayout bestLayout = null;
for (int fontSize: RULES_TEXT_FONT_SIZES) {
bestLayout = layoutRules(g, allRules, w, h, fontSize);
// Get the new spacing for the small text
remaining = h;
if (hasKeywords) {
remaining -= drawSingleRule(g, keywordRulesAttributed, null, 0, 0, w, remaining, false);
}
for (TextboxRule rule : textboxRules) {
AttributedString attributed = rule.generateAttributedString(font, fontItalic);
attributedRules.add(attributed);
remaining -= drawSingleRule(g, attributed, rule, 0, 0, w, remaining, false);
if (remaining < 0) {
useSmallFont = true;
// Stop, we found a good fit
if (bestLayout.fits) {
break;
}
}
// Nothing to draw
if (bestLayout == null) {
return;
}
// Do we have room for additional spacing between the parts of text?
// If so, calculate the spacing based on how much space was left over
int spacing;
if (remaining <= 0) {
spacing = 0;
// Do we have room for additional padding between the parts of text?
// If so, calculate the padding based on how much space was left over
int padding;
if (bestLayout.fits) {
padding = (int) (((float)bestLayout.remainingHeight) / (1 + allRules.size()));
} else {
spacing = (int) (remaining / (hasKeywords
? (textboxRules.size() + 2)
: (textboxRules.size() + 1)));
// When the text doesn't fit to begin with there's no room for padding
padding = 0;
}
// Do the actual draw
loyaltyAbilityColorToggle = false;
g.setColor(Color.black);
int curY = y + spacing;
if (hasKeywords) {
int adv = drawSingleRule(g, keywordRulesAttributed, null, x, curY, w, h, true);
curY += adv + spacing;
h -= adv;
}
for (int i = 0; i < textboxRules.size(); ++i) {
TextboxRule rule = textboxRules.get(i);
AttributedString attributedRule = attributedRules.get(i);
int curY = y + padding;
for (int i = 0; i < bestLayout.attributedRules.size(); ++i) {
AttributedString attributedRule = bestLayout.attributedRules.get(i);
TextboxRule rule = allRules.get(i);
int adv = drawSingleRule(g, attributedRule, rule, x, curY, w, h, true);
curY += adv + spacing;
curY += adv + padding;
h -= adv;
if (h < 0) {
break;
@ -710,7 +776,8 @@ public class ModernCardRenderer extends CardRenderer {
AttributedCharacterIterator newLineCheck = text.getIterator();
while (measure.getPosition() < textIter.getEndIndex()) {
// Advance iterator to next line break
char ch = newLineCheck.setIndex(measure.getPosition());
newLineCheck.setIndex(measure.getPosition());
char ch;
while ((ch = newLineCheck.next()) != CharacterIterator.DONE) {
if (ch == '\n') {
break;

View file

@ -30,12 +30,14 @@ package mage.view;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Mode;
import mage.abilities.SpellAbility;
import mage.abilities.costs.mana.ManaCosts;
import mage.cards.Card;
import mage.cards.FrameStyle;
import mage.cards.SplitCard;
import mage.constants.AbilityType;
import mage.constants.CardType;
@ -53,6 +55,7 @@ import mage.game.stack.Spell;
import mage.game.stack.StackAbility;
import mage.target.Target;
import mage.target.Targets;
import org.apache.log4j.Logger;
/**
* @author BetaSteward_at_googlemail.com
@ -74,6 +77,7 @@ public class CardView extends SimpleCardView {
protected List<String> superTypes;
protected ObjectColor color;
protected ObjectColor frameColor;
protected FrameStyle frameStyle;
protected List<String> manaCost;
protected int convertedManaCost;
protected Rarity rarity;
@ -336,6 +340,9 @@ public class CardView extends SimpleCardView {
// Frame color
this.frameColor = card.getFrameColor(game);
// Frame style
this.frameStyle = card.getFrameStyle();
// Get starting loyalty
this.startingLoyalty = "" + card.getStartingLoyalty();
}
@ -384,6 +391,8 @@ public class CardView extends SimpleCardView {
}
// Frame color
this.frameColor = object.getFrameColor(null);
// Frame style
this.frameStyle = object.getFrameStyle();
// Starting loyalty. Must be extracted from an ability
this.startingLoyalty = "" + object.getStartingLoyalty();
}
@ -401,6 +410,7 @@ public class CardView extends SimpleCardView {
this.displayName = name;
this.rules = emblem.getRules();
// emblem images are always with common (black) symbol
this.frameStyle = FrameStyle.M15_NORMAL;
this.expansionSetCode = emblem.getExpansionSetCode();
this.rarity = Rarity.COMMON;
}
@ -426,6 +436,7 @@ public class CardView extends SimpleCardView {
this.superTypes = new ArrayList<>();
this.color = new ObjectColor();
this.frameColor = new ObjectColor();
this.frameStyle = FrameStyle.M15_NORMAL;
this.manaCost = new ArrayList<>();
this.convertedManaCost = 0;
@ -472,6 +483,7 @@ public class CardView extends SimpleCardView {
this.superTypes = token.getSupertype();
this.color = token.getColor(null);
this.frameColor = token.getFrameColor(null);
this.frameStyle = token.getFrameStyle();
this.manaCost = token.getManaCost().getSymbols();
this.rarity = Rarity.NA;
this.type = token.getTokenType();
@ -560,6 +572,10 @@ public class CardView extends SimpleCardView {
return frameColor;
}
public FrameStyle getFrameStyle() {
return frameStyle;
}
public List<String> getManaCost() {
return manaCost;
}

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Forest10 extends mage.cards.basiclands.Forest {
public Forest10(UUID ownerId) {
super(ownerId, "274b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Forest10(final Forest10 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Forest6 extends mage.cards.basiclands.Forest {
public Forest6(UUID ownerId) {
super(ownerId, "270b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Forest6(final Forest6 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Forest7 extends mage.cards.basiclands.Forest {
public Forest7(UUID ownerId) {
super(ownerId, "271b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Forest7(final Forest7 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Forest8 extends mage.cards.basiclands.Forest {
public Forest8(UUID ownerId) {
super(ownerId, "272b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Forest8(final Forest8 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Forest9 extends mage.cards.basiclands.Forest {
public Forest9(UUID ownerId) {
super(ownerId, "273b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Forest9(final Forest9 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Island10 extends mage.cards.basiclands.Island {
public Island10(UUID ownerId) {
super(ownerId, "259b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Island10(final Island10 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Island6 extends mage.cards.basiclands.Island {
public Island6(UUID ownerId) {
super(ownerId, "255b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Island6(final Island6 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Island7 extends mage.cards.basiclands.Island {
public Island7(UUID ownerId) {
super(ownerId, "256b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Island7(final Island7 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Island8 extends mage.cards.basiclands.Island {
public Island8(UUID ownerId) {
super(ownerId, "257b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Island8(final Island8 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Island9 extends mage.cards.basiclands.Island {
public Island9(UUID ownerId) {
super(ownerId, "258b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Island9(final Island9 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Mountain10 extends mage.cards.basiclands.Mountain {
public Mountain10(UUID ownerId) {
super(ownerId, "269b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Mountain10(final Mountain10 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Mountain6 extends mage.cards.basiclands.Mountain {
public Mountain6(UUID ownerId) {
super(ownerId, "265b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Mountain6(final Mountain6 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Mountain7 extends mage.cards.basiclands.Mountain {
public Mountain7(UUID ownerId) {
super(ownerId, "266b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Mountain7(final Mountain7 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Mountain8 extends mage.cards.basiclands.Mountain {
public Mountain8(UUID ownerId) {
super(ownerId, "267b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Mountain8(final Mountain8 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Mountain9 extends mage.cards.basiclands.Mountain {
public Mountain9(UUID ownerId) {
super(ownerId, "268b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Mountain9(final Mountain9 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Plains10 extends mage.cards.basiclands.Plains {
public Plains10(UUID ownerId) {
super(ownerId, "254b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Plains10(final Plains10 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Plains6 extends mage.cards.basiclands.Plains {
public Plains6(UUID ownerId) {
super(ownerId, "250b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Plains6(final Plains6 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Plains7 extends mage.cards.basiclands.Plains {
public Plains7(UUID ownerId) {
super(ownerId, "251b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Plains7(final Plains7 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Plains8 extends mage.cards.basiclands.Plains {
public Plains8(UUID ownerId) {
super(ownerId, "252b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Plains8(final Plains8 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Plains9 extends mage.cards.basiclands.Plains {
public Plains9(UUID ownerId) {
super(ownerId, "253b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Plains9(final Plains9 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Swamp10 extends mage.cards.basiclands.Swamp {
public Swamp10(UUID ownerId) {
super(ownerId, "264b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Swamp10(final Swamp10 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Swamp6 extends mage.cards.basiclands.Swamp {
public Swamp6(UUID ownerId) {
super(ownerId, "260b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Swamp6(final Swamp6 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Swamp7 extends mage.cards.basiclands.Swamp {
public Swamp7(UUID ownerId) {
super(ownerId, "261b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Swamp7(final Swamp7 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Swamp8 extends mage.cards.basiclands.Swamp {
public Swamp8(UUID ownerId) {
super(ownerId, "262b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Swamp8(final Swamp8 card) {

View file

@ -27,6 +27,8 @@
*/
package mage.sets.battleforzendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Swamp9 extends mage.cards.basiclands.Swamp {
public Swamp9(UUID ownerId) {
super(ownerId, "263b");
this.expansionSetCode = "BFZ";
this.frameStyle = FrameStyle.BFZ_FULL_ART_BASIC;
}
public Swamp9(final Swamp9 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unglued;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Forest extends mage.cards.basiclands.Forest {
public Forest(UUID ownerId) {
super(ownerId, 88);
this.expansionSetCode = "UGL";
this.frameStyle = FrameStyle.UGL_FULL_ART_BASIC;
}
public Forest(final Forest card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unglued;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Island extends mage.cards.basiclands.Island {
public Island(UUID ownerId) {
super(ownerId, 85);
this.expansionSetCode = "UGL";
this.frameStyle = FrameStyle.UGL_FULL_ART_BASIC;
}
public Island(final Island card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unglued;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Mountain extends mage.cards.basiclands.Mountain {
public Mountain(UUID ownerId) {
super(ownerId, 87);
this.expansionSetCode = "UGL";
this.frameStyle = FrameStyle.UGL_FULL_ART_BASIC;
}
public Mountain(final Mountain card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unglued;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Plains extends mage.cards.basiclands.Plains {
public Plains(UUID ownerId) {
super(ownerId, 84);
this.expansionSetCode = "UGL";
this.frameStyle = FrameStyle.UGL_FULL_ART_BASIC;
}
public Plains(final Plains card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unglued;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Swamp extends mage.cards.basiclands.Swamp {
public Swamp(UUID ownerId) {
super(ownerId, 86);
this.expansionSetCode = "UGL";
this.frameStyle = FrameStyle.UGL_FULL_ART_BASIC;
}
public Swamp(final Swamp card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unhinged;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -38,6 +40,7 @@ public class Forest extends mage.cards.basiclands.Forest {
public Forest(UUID ownerId) {
super(ownerId, 140);
this.expansionSetCode = "UNH";
this.frameStyle = FrameStyle.UNH_FULL_ART_BASIC;
}
public Forest(final Forest card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unhinged;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Island extends mage.cards.basiclands.Island {
public Island(UUID ownerId) {
super(ownerId, 137);
this.expansionSetCode = "UNH";
this.frameStyle = FrameStyle.UNH_FULL_ART_BASIC;
}
public Island(final Island card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unhinged;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Mountain extends mage.cards.basiclands.Mountain {
public Mountain(UUID ownerId) {
super(ownerId, 139);
this.expansionSetCode = "UNH";
this.frameStyle = FrameStyle.UNH_FULL_ART_BASIC;
}
public Mountain(final Mountain card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unhinged;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Plains extends mage.cards.basiclands.Plains {
public Plains(UUID ownerId) {
super(ownerId, 136);
this.expansionSetCode = "UNH";
this.frameStyle = FrameStyle.UNH_FULL_ART_BASIC;
}
public Plains(final Plains card) {

View file

@ -28,6 +28,8 @@
package mage.sets.unhinged;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Swamp extends mage.cards.basiclands.Swamp {
public Swamp(UUID ownerId) {
super(ownerId, 138);
this.expansionSetCode = "UNH";
this.frameStyle = FrameStyle.UNH_FULL_ART_BASIC;
}
public Swamp(final Swamp card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Forest1 extends mage.cards.basiclands.Forest {
public Forest1(UUID ownerId) {
super(ownerId, 246);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Forest1(final Forest1 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Forest2 extends mage.cards.basiclands.Forest {
public Forest2(UUID ownerId) {
super(ownerId, 247);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Forest2(final Forest2 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Forest3 extends mage.cards.basiclands.Forest {
public Forest3(UUID ownerId) {
super(ownerId, 248);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Forest3(final Forest3 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Forest4 extends mage.cards.basiclands.Forest {
public Forest4(UUID ownerId) {
super(ownerId, 249);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Forest4(final Forest4 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Island1 extends mage.cards.basiclands.Island {
public Island1(UUID ownerId) {
super(ownerId, 234);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Island1(final Island1 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Island2 extends mage.cards.basiclands.Island {
public Island2(UUID ownerId) {
super(ownerId, 235);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Island2(final Island2 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Island3 extends mage.cards.basiclands.Island {
public Island3(UUID ownerId) {
super(ownerId, 236);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Island3(final Island3 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Island4 extends mage.cards.basiclands.Island {
public Island4(UUID ownerId) {
super(ownerId, 237);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Island4(final Island4 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Mountain1 extends mage.cards.basiclands.Mountain {
public Mountain1(UUID ownerId) {
super(ownerId, 242);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Mountain1(final Mountain1 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Mountain2 extends mage.cards.basiclands.Mountain {
public Mountain2(UUID ownerId) {
super(ownerId, 243);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Mountain2(final Mountain2 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Mountain3 extends mage.cards.basiclands.Mountain {
public Mountain3(UUID ownerId) {
super(ownerId, 244);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Mountain3(final Mountain3 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Mountain4 extends mage.cards.basiclands.Mountain {
public Mountain4(UUID ownerId) {
super(ownerId, 245);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Mountain4(final Mountain4 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Plains1 extends mage.cards.basiclands.Plains {
public Plains1(UUID ownerId) {
super(ownerId, 230);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Plains1(final Plains1 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Plains2 extends mage.cards.basiclands.Plains {
public Plains2(UUID ownerId) {
super(ownerId, 231);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Plains2(final Plains2 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Plains3 extends mage.cards.basiclands.Plains {
public Plains3(UUID ownerId) {
super(ownerId, 232);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Plains3(final Plains3 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Plains4 extends mage.cards.basiclands.Plains {
public Plains4(UUID ownerId) {
super(ownerId, 233);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Plains4(final Plains4 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Swamp1 extends mage.cards.basiclands.Swamp {
public Swamp1(UUID ownerId) {
super(ownerId, 238);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Swamp1(final Swamp1 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Swamp2 extends mage.cards.basiclands.Swamp {
public Swamp2(UUID ownerId) {
super(ownerId, 239);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Swamp2(final Swamp2 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Swamp3 extends mage.cards.basiclands.Swamp {
public Swamp3(UUID ownerId) {
super(ownerId, 240);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Swamp3(final Swamp3 card) {

View file

@ -28,6 +28,8 @@
package mage.sets.zendikar;
import mage.cards.FrameStyle;
import java.util.UUID;
/**
@ -39,6 +41,7 @@ public class Swamp4 extends mage.cards.basiclands.Swamp {
public Swamp4(UUID ownerId) {
super(ownerId, 241);
this.expansionSetCode = "ZEN";
this.frameStyle = FrameStyle.ZEN_FULL_ART_BASIC;
}
public Swamp4(final Swamp4 card) {

View file

@ -7,6 +7,7 @@ import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.cards.FrameStyle;
import mage.constants.CardType;
import mage.game.Game;
@ -38,6 +39,8 @@ public interface MageObject extends MageItem, Serializable {
ObjectColor getFrameColor(Game game);
FrameStyle getFrameStyle();
ManaCosts<ManaCost> getManaCost();
int getConvertedManaCost();

View file

@ -39,6 +39,7 @@ import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.keyword.ChangelingAbility;
import mage.abilities.mana.ManaAbility;
import mage.cards.FrameStyle;
import mage.constants.CardType;
import mage.game.Game;
import mage.util.CardUtil;
@ -52,6 +53,7 @@ public abstract class MageObjectImpl implements MageObject {
protected ManaCosts<ManaCost> manaCost;
protected ObjectColor color;
protected ObjectColor frameColor;
protected FrameStyle frameStyle;
protected List<CardType> cardType = new ArrayList<>();
protected List<String> subtype = new ArrayList<>();
protected List<String> supertype = new ArrayList<>();
@ -71,6 +73,7 @@ public abstract class MageObjectImpl implements MageObject {
toughness = new MageInt(0);
color = new ObjectColor();
frameColor = new ObjectColor();
frameStyle = FrameStyle.M15_NORMAL;
manaCost = new ManaCostsImpl<>("");
abilities = new AbilitiesImpl<>();
}
@ -82,6 +85,7 @@ public abstract class MageObjectImpl implements MageObject {
text = object.text;
color = object.color.copy();
frameColor = object.frameColor.copy();
frameStyle = object.frameStyle;
power = object.power.copy();
toughness = object.toughness.copy();
abilities = object.abilities.copy();
@ -221,6 +225,11 @@ public abstract class MageObjectImpl implements MageObject {
}
}
@Override
public FrameStyle getFrameStyle() {
return frameStyle;
}
@Override
public ManaCosts<ManaCost> getManaCost() {
return manaCost;

View file

@ -0,0 +1,79 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.cards;
/**
*
* @author StravantUser
*/
public enum FrameStyle {
/**
* The default card frame, normal M15 card frames
*/
M15_NORMAL(BorderType.M15, false),
/**
* Battle for Zendkiar full art basic lands
*/
BFZ_FULL_ART_BASIC(BorderType.M15, true),
/**
* Zenkikar full art lands
*/
ZEN_FULL_ART_BASIC(BorderType.MOD, true),
/**
* Unhinged full art lands
*/
UNH_FULL_ART_BASIC(BorderType.SPC, true),
/**
* Unglued full art lands
*/
UGL_FULL_ART_BASIC(BorderType.SPC, true);
/**
* General type of card
*/
public enum BorderType {
/**
* Various specialty borders
* EG: Unhinged, Unglued
*/
SPC,
/**
* Old border cards
*/
OLD,
/**
* Modern border cards (8th -> Theros)
*/
MOD,
/**
* M15 border cards (M14 -> current)
*/
M15
}
private BorderType borderType;
private boolean isFullArt;
public BorderType getBorderType() {
return borderType;
}
public boolean isFullArt() {
return isFullArt;
}
FrameStyle(BorderType borderType, boolean isFullArt) {
this.borderType = borderType;
this.isFullArt = isFullArt;
}
}

View file

@ -30,6 +30,7 @@ public class MockCard extends CardImpl {
this.subtype = card.getSubTypes();
this.supertype = card.getSupertypes();
this.usesVariousArt = card.usesVariousArt();
this.manaCost = new ManaCostsImpl(join(card.getManaCosts()));
@ -37,6 +38,7 @@ public class MockCard extends CardImpl {
this.color = card.getColor();
this.frameColor = card.getFrameColor();
this.frameStyle = card.getFrameStyle();
this.splitCard = card.isSplitCard();
this.flipCard = card.isFlipCard();

View file

@ -36,6 +36,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mage.cards.FrameStyle;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.ObjectColor;
@ -100,6 +101,8 @@ public class CardInfo {
@DatabaseField
protected String frameColor;
@DatabaseField
protected String frameStyle;
@DatabaseField
protected boolean splitCard;
@DatabaseField
protected boolean splitCardHalf;
@ -138,6 +141,7 @@ public class CardInfo {
this.secondSideName = secondSide.getName();
}
this.frameStyle = card.getFrameStyle().toString();
this.frameColor = card.getFrameColor(null).toString();
this.blue = card.getColor(null).isBlue();
this.black = card.getColor(null).isBlack();
@ -227,6 +231,10 @@ public class CardInfo {
return new ObjectColor(frameColor);
}
public FrameStyle getFrameStyle() {
return FrameStyle.valueOf(this.frameStyle);
}
private String joinList(List<String> items) {
StringBuilder sb = new StringBuilder();
for (Object item : items) {

View file

@ -62,16 +62,16 @@ public enum CardRepository {
private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE";
private static final String VERSION_ENTITY_NAME = "card";
// raise this if db structure was changed
private static final long CARD_DB_VERSION = 46;
private static final long CARD_DB_VERSION = 47;
// raise this if new cards were added to the server
private static final long CARD_CONTENT_VERSION = 57;
private static final long CARD_CONTENT_VERSION = 59;
private Dao<CardInfo, Object> cardDao;
private Set<String> classNames;
private final TreeSet<String> landTypes = new TreeSet();
private CardRepository() {
CardRepository() {
File file = new File("db");
if (!file.exists()) {
file.mkdirs();

View file

@ -39,6 +39,7 @@ import mage.abilities.common.CastCommanderAbility;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.cards.Card;
import mage.cards.FrameStyle;
import mage.constants.CardType;
import mage.game.Game;
import mage.util.GameLog;
@ -150,6 +151,11 @@ public class Commander implements CommandObject {
return card.getFrameColor(game);
}
@Override
public FrameStyle getFrameStyle() {
return card.getFrameStyle();
}
@Override
public ManaCosts<ManaCost> getManaCost() {
return card.getManaCost();

View file

@ -38,6 +38,7 @@ import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
import mage.abilities.costs.mana.ManaCosts;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.cards.FrameStyle;
import mage.constants.CardType;
import mage.game.Game;
import mage.util.GameLog;
@ -55,6 +56,7 @@ public class Emblem implements CommandObject {
private UUID id;
private UUID controllerId;
private UUID sourceId;
private FrameStyle frameStyle;
private Abilities<Ability> abilites = new AbilitiesImpl<>();
private String expansionSetCodeForImage = null;
@ -65,11 +67,17 @@ public class Emblem implements CommandObject {
public Emblem(final Emblem emblem) {
this.id = emblem.id;
this.name = emblem.name;
this.frameStyle = emblem.frameStyle;
this.controllerId = emblem.controllerId;
this.sourceId = emblem.sourceId;
this.abilites = emblem.abilites.copy();
}
@Override
public FrameStyle getFrameStyle() {
return frameStyle;
}
@Override
public void assignNewId() {
this.id = UUID.randomUUID();

View file

@ -119,6 +119,7 @@ public class PermanentCard extends PermanentImpl {
this.cardType.addAll(card.getCardType());
this.color = card.getColor(null).copy();
this.frameColor = card.getFrameColor(null).copy();
this.frameStyle = card.getFrameStyle();
this.manaCost = card.getManaCost().copy();
if (card instanceof PermanentCard) {
this.maxLevelCounters = ((PermanentCard) card).maxLevelCounters;

View file

@ -83,6 +83,7 @@ public class PermanentToken extends PermanentImpl {
this.cardType = token.getCardType();
this.color = token.getColor(game).copy();
this.frameColor = token.getFrameColor(game);
this.frameStyle = token.getFrameStyle();
this.power.modifyBaseValue(token.getPower().getBaseValueModified());
this.toughness.modifyBaseValue(token.getToughness().getBaseValueModified());
this.supertype = token.getSupertype();

View file

@ -46,6 +46,7 @@ import mage.abilities.keyword.BestowAbility;
import mage.abilities.keyword.MorphAbility;
import mage.cards.Card;
import mage.cards.CardsImpl;
import mage.cards.FrameStyle;
import mage.cards.SplitCard;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -77,6 +78,7 @@ public class Spell extends StackObjImpl implements Card {
private final Card card;
private final ObjectColor color;
private final ObjectColor frameColor;
private final FrameStyle frameStyle;
private final SpellAbility ability;
private final Zone fromZone;
private final UUID id;
@ -90,6 +92,7 @@ public class Spell extends StackObjImpl implements Card {
this.card = card;
this.color = card.getColor(null).copy();
this.frameColor = card.getFrameColor(null).copy();
this.frameStyle = card.getFrameStyle();
id = ability.getId();
this.ability = ability;
this.ability.setControllerId(controllerId);
@ -131,6 +134,7 @@ public class Spell extends StackObjImpl implements Card {
this.faceDown = spell.faceDown;
this.color = spell.color.copy();
this.frameColor = spell.color.copy();
this.frameStyle = spell.frameStyle;
}
public boolean activate(Game game, boolean noMana) {
@ -492,6 +496,11 @@ public class Spell extends StackObjImpl implements Card {
return frameColor;
}
@Override
public FrameStyle getFrameStyle() {
return frameStyle;
}
@Override
public ManaCosts<ManaCost> getManaCost() {
return card.getManaCost();

View file

@ -49,6 +49,7 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.Effects;
import mage.cards.Card;
import mage.cards.FrameStyle;
import mage.constants.AbilityType;
import mage.constants.AbilityWord;
import mage.constants.CardType;
@ -198,6 +199,12 @@ public class StackAbility extends StackObjImpl implements Ability {
return ability.getSourceObject(game).getFrameColor(game);
}
@Override
public FrameStyle getFrameStyle() {
// Abilities all use the same frame
return FrameStyle.M15_NORMAL;
}
@Override
public ManaCosts<ManaCost> getManaCost() {
return emptyCost;