mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Added frameStyle Characteristic for cards
* Added FrameStyle Enum containing a list of styles that cards can be rendered in. * Added getFrameStyle() getter to Card interface. * Implemented getFrameStyle() for various concrete implementations of Card.
This commit is contained in:
parent
0ea9d33211
commit
b549dfe0dc
12 changed files with 115 additions and 3 deletions
|
|
@ -7,6 +7,7 @@ import mage.abilities.Abilities;
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
|
import mage.cards.FrameStyle;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
|
|
||||||
|
|
@ -38,6 +39,8 @@ public interface MageObject extends MageItem, Serializable {
|
||||||
|
|
||||||
ObjectColor getFrameColor(Game game);
|
ObjectColor getFrameColor(Game game);
|
||||||
|
|
||||||
|
FrameStyle getFrameStyle();
|
||||||
|
|
||||||
ManaCosts<ManaCost> getManaCost();
|
ManaCosts<ManaCost> getManaCost();
|
||||||
|
|
||||||
int getConvertedManaCost();
|
int getConvertedManaCost();
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.keyword.ChangelingAbility;
|
import mage.abilities.keyword.ChangelingAbility;
|
||||||
import mage.abilities.mana.ManaAbility;
|
import mage.abilities.mana.ManaAbility;
|
||||||
|
import mage.cards.FrameStyle;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.util.CardUtil;
|
import mage.util.CardUtil;
|
||||||
|
|
@ -52,6 +53,7 @@ public abstract class MageObjectImpl implements MageObject {
|
||||||
protected ManaCosts<ManaCost> manaCost;
|
protected ManaCosts<ManaCost> manaCost;
|
||||||
protected ObjectColor color;
|
protected ObjectColor color;
|
||||||
protected ObjectColor frameColor;
|
protected ObjectColor frameColor;
|
||||||
|
protected FrameStyle frameStyle;
|
||||||
protected List<CardType> cardType = new ArrayList<>();
|
protected List<CardType> cardType = new ArrayList<>();
|
||||||
protected List<String> subtype = new ArrayList<>();
|
protected List<String> subtype = new ArrayList<>();
|
||||||
protected List<String> supertype = new ArrayList<>();
|
protected List<String> supertype = new ArrayList<>();
|
||||||
|
|
@ -71,6 +73,7 @@ public abstract class MageObjectImpl implements MageObject {
|
||||||
toughness = new MageInt(0);
|
toughness = new MageInt(0);
|
||||||
color = new ObjectColor();
|
color = new ObjectColor();
|
||||||
frameColor = new ObjectColor();
|
frameColor = new ObjectColor();
|
||||||
|
frameStyle = FrameStyle.M15_NORMAL;
|
||||||
manaCost = new ManaCostsImpl<>("");
|
manaCost = new ManaCostsImpl<>("");
|
||||||
abilities = new AbilitiesImpl<>();
|
abilities = new AbilitiesImpl<>();
|
||||||
}
|
}
|
||||||
|
|
@ -82,6 +85,7 @@ public abstract class MageObjectImpl implements MageObject {
|
||||||
text = object.text;
|
text = object.text;
|
||||||
color = object.color.copy();
|
color = object.color.copy();
|
||||||
frameColor = object.frameColor.copy();
|
frameColor = object.frameColor.copy();
|
||||||
|
frameStyle = object.frameStyle;
|
||||||
power = object.power.copy();
|
power = object.power.copy();
|
||||||
toughness = object.toughness.copy();
|
toughness = object.toughness.copy();
|
||||||
abilities = object.abilities.copy();
|
abilities = object.abilities.copy();
|
||||||
|
|
@ -221,6 +225,11 @@ public abstract class MageObjectImpl implements MageObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FrameStyle getFrameStyle() {
|
||||||
|
return frameStyle;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManaCosts<ManaCost> getManaCost() {
|
public ManaCosts<ManaCost> getManaCost() {
|
||||||
return manaCost;
|
return manaCost;
|
||||||
|
|
|
||||||
58
Mage/src/main/java/mage/cards/FrameStyle.java
Normal file
58
Mage/src/main/java/mage/cards/FrameStyle.java
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
/*
|
||||||
|
* 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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* General type of card
|
||||||
|
*/
|
||||||
|
public enum BorderType {
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -30,6 +30,7 @@ public class MockCard extends CardImpl {
|
||||||
this.subtype = card.getSubTypes();
|
this.subtype = card.getSubTypes();
|
||||||
this.supertype = card.getSupertypes();
|
this.supertype = card.getSupertypes();
|
||||||
|
|
||||||
|
|
||||||
this.usesVariousArt = card.usesVariousArt();
|
this.usesVariousArt = card.usesVariousArt();
|
||||||
|
|
||||||
this.manaCost = new ManaCostsImpl(join(card.getManaCosts()));
|
this.manaCost = new ManaCostsImpl(join(card.getManaCosts()));
|
||||||
|
|
@ -37,6 +38,7 @@ public class MockCard extends CardImpl {
|
||||||
this.color = card.getColor();
|
this.color = card.getColor();
|
||||||
|
|
||||||
this.frameColor = card.getFrameColor();
|
this.frameColor = card.getFrameColor();
|
||||||
|
this.frameStyle = card.getFrameStyle();
|
||||||
|
|
||||||
this.splitCard = card.isSplitCard();
|
this.splitCard = card.isSplitCard();
|
||||||
this.flipCard = card.isFlipCard();
|
this.flipCard = card.isFlipCard();
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import mage.cards.FrameStyle;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Rarity;
|
import mage.constants.Rarity;
|
||||||
import mage.ObjectColor;
|
import mage.ObjectColor;
|
||||||
|
|
@ -100,6 +101,8 @@ public class CardInfo {
|
||||||
@DatabaseField
|
@DatabaseField
|
||||||
protected String frameColor;
|
protected String frameColor;
|
||||||
@DatabaseField
|
@DatabaseField
|
||||||
|
protected String frameStyle;
|
||||||
|
@DatabaseField
|
||||||
protected boolean splitCard;
|
protected boolean splitCard;
|
||||||
@DatabaseField
|
@DatabaseField
|
||||||
protected boolean splitCardHalf;
|
protected boolean splitCardHalf;
|
||||||
|
|
@ -138,6 +141,7 @@ public class CardInfo {
|
||||||
this.secondSideName = secondSide.getName();
|
this.secondSideName = secondSide.getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.frameStyle = card.getFrameStyle().toString();
|
||||||
this.frameColor = card.getFrameColor(null).toString();
|
this.frameColor = card.getFrameColor(null).toString();
|
||||||
this.blue = card.getColor(null).isBlue();
|
this.blue = card.getColor(null).isBlue();
|
||||||
this.black = card.getColor(null).isBlack();
|
this.black = card.getColor(null).isBlack();
|
||||||
|
|
@ -227,6 +231,10 @@ public class CardInfo {
|
||||||
return new ObjectColor(frameColor);
|
return new ObjectColor(frameColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public FrameStyle getFrameStyle() {
|
||||||
|
return FrameStyle.valueOf(this.frameStyle);
|
||||||
|
}
|
||||||
|
|
||||||
private String joinList(List<String> items) {
|
private String joinList(List<String> items) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (Object item : items) {
|
for (Object item : items) {
|
||||||
|
|
|
||||||
|
|
@ -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 JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE";
|
||||||
private static final String VERSION_ENTITY_NAME = "card";
|
private static final String VERSION_ENTITY_NAME = "card";
|
||||||
// raise this if db structure was changed
|
// 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
|
// 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 = 58;
|
||||||
|
|
||||||
private Dao<CardInfo, Object> cardDao;
|
private Dao<CardInfo, Object> cardDao;
|
||||||
private Set<String> classNames;
|
private Set<String> classNames;
|
||||||
|
|
||||||
private final TreeSet<String> landTypes = new TreeSet();
|
private final TreeSet<String> landTypes = new TreeSet();
|
||||||
|
|
||||||
private CardRepository() {
|
CardRepository() {
|
||||||
File file = new File("db");
|
File file = new File("db");
|
||||||
if (!file.exists()) {
|
if (!file.exists()) {
|
||||||
file.mkdirs();
|
file.mkdirs();
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ import mage.abilities.common.CastCommanderAbility;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
import mage.cards.FrameStyle;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.util.GameLog;
|
import mage.util.GameLog;
|
||||||
|
|
@ -150,6 +151,11 @@ public class Commander implements CommandObject {
|
||||||
return card.getFrameColor(game);
|
return card.getFrameColor(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FrameStyle getFrameStyle() {
|
||||||
|
return card.getFrameStyle();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManaCosts<ManaCost> getManaCost() {
|
public ManaCosts<ManaCost> getManaCost() {
|
||||||
return card.getManaCost();
|
return card.getManaCost();
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ import mage.abilities.Ability;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCosts;
|
import mage.abilities.costs.mana.ManaCosts;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
import mage.cards.FrameStyle;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.util.GameLog;
|
import mage.util.GameLog;
|
||||||
|
|
@ -55,6 +56,7 @@ public class Emblem implements CommandObject {
|
||||||
private UUID id;
|
private UUID id;
|
||||||
private UUID controllerId;
|
private UUID controllerId;
|
||||||
private UUID sourceId;
|
private UUID sourceId;
|
||||||
|
private FrameStyle frameStyle;
|
||||||
private Abilities<Ability> abilites = new AbilitiesImpl<>();
|
private Abilities<Ability> abilites = new AbilitiesImpl<>();
|
||||||
private String expansionSetCodeForImage = null;
|
private String expansionSetCodeForImage = null;
|
||||||
|
|
||||||
|
|
@ -65,11 +67,17 @@ public class Emblem implements CommandObject {
|
||||||
public Emblem(final Emblem emblem) {
|
public Emblem(final Emblem emblem) {
|
||||||
this.id = emblem.id;
|
this.id = emblem.id;
|
||||||
this.name = emblem.name;
|
this.name = emblem.name;
|
||||||
|
this.frameStyle = emblem.frameStyle;
|
||||||
this.controllerId = emblem.controllerId;
|
this.controllerId = emblem.controllerId;
|
||||||
this.sourceId = emblem.sourceId;
|
this.sourceId = emblem.sourceId;
|
||||||
this.abilites = emblem.abilites.copy();
|
this.abilites = emblem.abilites.copy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FrameStyle getFrameStyle() {
|
||||||
|
return frameStyle;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void assignNewId() {
|
public void assignNewId() {
|
||||||
this.id = UUID.randomUUID();
|
this.id = UUID.randomUUID();
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,7 @@ public class PermanentCard extends PermanentImpl {
|
||||||
this.cardType.addAll(card.getCardType());
|
this.cardType.addAll(card.getCardType());
|
||||||
this.color = card.getColor(null).copy();
|
this.color = card.getColor(null).copy();
|
||||||
this.frameColor = card.getFrameColor(null).copy();
|
this.frameColor = card.getFrameColor(null).copy();
|
||||||
|
this.frameStyle = card.getFrameStyle();
|
||||||
this.manaCost = card.getManaCost().copy();
|
this.manaCost = card.getManaCost().copy();
|
||||||
if (card instanceof PermanentCard) {
|
if (card instanceof PermanentCard) {
|
||||||
this.maxLevelCounters = ((PermanentCard) card).maxLevelCounters;
|
this.maxLevelCounters = ((PermanentCard) card).maxLevelCounters;
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ public class PermanentToken extends PermanentImpl {
|
||||||
this.cardType = token.getCardType();
|
this.cardType = token.getCardType();
|
||||||
this.color = token.getColor(game).copy();
|
this.color = token.getColor(game).copy();
|
||||||
this.frameColor = token.getFrameColor(game);
|
this.frameColor = token.getFrameColor(game);
|
||||||
|
this.frameStyle = token.getFrameStyle();
|
||||||
this.power.modifyBaseValue(token.getPower().getBaseValueModified());
|
this.power.modifyBaseValue(token.getPower().getBaseValueModified());
|
||||||
this.toughness.modifyBaseValue(token.getToughness().getBaseValueModified());
|
this.toughness.modifyBaseValue(token.getToughness().getBaseValueModified());
|
||||||
this.supertype = token.getSupertype();
|
this.supertype = token.getSupertype();
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ import mage.abilities.keyword.BestowAbility;
|
||||||
import mage.abilities.keyword.MorphAbility;
|
import mage.abilities.keyword.MorphAbility;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardsImpl;
|
import mage.cards.CardsImpl;
|
||||||
|
import mage.cards.FrameStyle;
|
||||||
import mage.cards.SplitCard;
|
import mage.cards.SplitCard;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
|
|
@ -77,6 +78,7 @@ public class Spell extends StackObjImpl implements Card {
|
||||||
private final Card card;
|
private final Card card;
|
||||||
private final ObjectColor color;
|
private final ObjectColor color;
|
||||||
private final ObjectColor frameColor;
|
private final ObjectColor frameColor;
|
||||||
|
private final FrameStyle frameStyle;
|
||||||
private final SpellAbility ability;
|
private final SpellAbility ability;
|
||||||
private final Zone fromZone;
|
private final Zone fromZone;
|
||||||
private final UUID id;
|
private final UUID id;
|
||||||
|
|
@ -90,6 +92,7 @@ public class Spell extends StackObjImpl implements Card {
|
||||||
this.card = card;
|
this.card = card;
|
||||||
this.color = card.getColor(null).copy();
|
this.color = card.getColor(null).copy();
|
||||||
this.frameColor = card.getFrameColor(null).copy();
|
this.frameColor = card.getFrameColor(null).copy();
|
||||||
|
this.frameStyle = card.getFrameStyle();
|
||||||
id = ability.getId();
|
id = ability.getId();
|
||||||
this.ability = ability;
|
this.ability = ability;
|
||||||
this.ability.setControllerId(controllerId);
|
this.ability.setControllerId(controllerId);
|
||||||
|
|
@ -131,6 +134,7 @@ public class Spell extends StackObjImpl implements Card {
|
||||||
this.faceDown = spell.faceDown;
|
this.faceDown = spell.faceDown;
|
||||||
this.color = spell.color.copy();
|
this.color = spell.color.copy();
|
||||||
this.frameColor = spell.color.copy();
|
this.frameColor = spell.color.copy();
|
||||||
|
this.frameStyle = spell.frameStyle;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean activate(Game game, boolean noMana) {
|
public boolean activate(Game game, boolean noMana) {
|
||||||
|
|
@ -492,6 +496,11 @@ public class Spell extends StackObjImpl implements Card {
|
||||||
return frameColor;
|
return frameColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FrameStyle getFrameStyle() {
|
||||||
|
return frameStyle;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManaCosts<ManaCost> getManaCost() {
|
public ManaCosts<ManaCost> getManaCost() {
|
||||||
return card.getManaCost();
|
return card.getManaCost();
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,7 @@ import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
import mage.abilities.effects.Effect;
|
import mage.abilities.effects.Effect;
|
||||||
import mage.abilities.effects.Effects;
|
import mage.abilities.effects.Effects;
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
|
import mage.cards.FrameStyle;
|
||||||
import mage.constants.AbilityType;
|
import mage.constants.AbilityType;
|
||||||
import mage.constants.AbilityWord;
|
import mage.constants.AbilityWord;
|
||||||
import mage.constants.CardType;
|
import mage.constants.CardType;
|
||||||
|
|
@ -198,6 +199,12 @@ public class StackAbility extends StackObjImpl implements Ability {
|
||||||
return ability.getSourceObject(game).getFrameColor(game);
|
return ability.getSourceObject(game).getFrameColor(game);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FrameStyle getFrameStyle() {
|
||||||
|
// Abilities all use the same frame
|
||||||
|
return FrameStyle.M15_NORMAL;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManaCosts<ManaCost> getManaCost() {
|
public ManaCosts<ManaCost> getManaCost() {
|
||||||
return emptyCost;
|
return emptyCost;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue