mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
CardRules support multiple specialize faces
This commit is contained in:
@@ -43,6 +43,11 @@ public final class CardRules implements ICardCharacteristics {
|
|||||||
private CardSplitType splitType;
|
private CardSplitType splitType;
|
||||||
private ICardFace mainPart;
|
private ICardFace mainPart;
|
||||||
private ICardFace otherPart;
|
private ICardFace otherPart;
|
||||||
|
private ICardFace wSpecialize;
|
||||||
|
private ICardFace uSpecialize;
|
||||||
|
private ICardFace bSpecialize;
|
||||||
|
private ICardFace rSpecialize;
|
||||||
|
private ICardFace gSpecialize;
|
||||||
private CardAiHints aiHints;
|
private CardAiHints aiHints;
|
||||||
private ColorSet colorIdentity;
|
private ColorSet colorIdentity;
|
||||||
private ColorSet deckbuildingColors;
|
private ColorSet deckbuildingColors;
|
||||||
@@ -54,6 +59,12 @@ public final class CardRules implements ICardCharacteristics {
|
|||||||
splitType = altMode;
|
splitType = altMode;
|
||||||
mainPart = faces[0];
|
mainPart = faces[0];
|
||||||
otherPart = faces[1];
|
otherPart = faces[1];
|
||||||
|
wSpecialize = faces[2];
|
||||||
|
uSpecialize = faces[3];
|
||||||
|
bSpecialize = faces[4];
|
||||||
|
rSpecialize = faces[5];
|
||||||
|
gSpecialize = faces[6];
|
||||||
|
|
||||||
aiHints = cah;
|
aiHints = cah;
|
||||||
meldWith = "";
|
meldWith = "";
|
||||||
partnerWith = "";
|
partnerWith = "";
|
||||||
@@ -74,6 +85,11 @@ public final class CardRules implements ICardCharacteristics {
|
|||||||
splitType = newRules.splitType;
|
splitType = newRules.splitType;
|
||||||
mainPart = newRules.mainPart;
|
mainPart = newRules.mainPart;
|
||||||
otherPart = newRules.otherPart;
|
otherPart = newRules.otherPart;
|
||||||
|
wSpecialize = newRules.wSpecialize;
|
||||||
|
uSpecialize = newRules.uSpecialize;
|
||||||
|
bSpecialize = newRules.bSpecialize;
|
||||||
|
rSpecialize = newRules.rSpecialize;
|
||||||
|
gSpecialize = newRules.gSpecialize;
|
||||||
aiHints = newRules.aiHints;
|
aiHints = newRules.aiHints;
|
||||||
colorIdentity = newRules.colorIdentity;
|
colorIdentity = newRules.colorIdentity;
|
||||||
meldWith = newRules.meldWith;
|
meldWith = newRules.meldWith;
|
||||||
@@ -132,6 +148,22 @@ public final class CardRules implements ICardCharacteristics {
|
|||||||
return otherPart;
|
return otherPart;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ICardFace getWSpecialize() {
|
||||||
|
return wSpecialize;
|
||||||
|
}
|
||||||
|
public ICardFace getUSpecialize() {
|
||||||
|
return uSpecialize;
|
||||||
|
}
|
||||||
|
public ICardFace getBSpecialize() {
|
||||||
|
return bSpecialize;
|
||||||
|
}
|
||||||
|
public ICardFace getRSpecialize() {
|
||||||
|
return rSpecialize;
|
||||||
|
}
|
||||||
|
public ICardFace getGSpecialize() {
|
||||||
|
return gSpecialize;
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
switch (splitType.getAggregationMethod()) {
|
switch (splitType.getAggregationMethod()) {
|
||||||
case COMBINE:
|
case COMBINE:
|
||||||
@@ -335,7 +367,7 @@ public final class CardRules implements ICardCharacteristics {
|
|||||||
// Reads cardname.txt
|
// Reads cardname.txt
|
||||||
public static class Reader {
|
public static class Reader {
|
||||||
// fields to build
|
// fields to build
|
||||||
private CardFace[] faces = new CardFace[] { null, null };
|
private CardFace[] faces = new CardFace[] { null, null, null, null, null, null, null };
|
||||||
private int curFace = 0;
|
private int curFace = 0;
|
||||||
private CardSplitType altMode = CardSplitType.None;
|
private CardSplitType altMode = CardSplitType.None;
|
||||||
private String meldWith = "";
|
private String meldWith = "";
|
||||||
@@ -518,6 +550,18 @@ public final class CardRules implements ICardCharacteristics {
|
|||||||
case 'S':
|
case 'S':
|
||||||
if ("S".equals(key)) {
|
if ("S".equals(key)) {
|
||||||
this.faces[this.curFace].addStaticAbility(value);
|
this.faces[this.curFace].addStaticAbility(value);
|
||||||
|
} else if (key.startsWith("SPECIALIZE")) {
|
||||||
|
if (value.equals("WHITE")) {
|
||||||
|
this.curFace = 2;
|
||||||
|
} else if (value.equals("BLUE")) {
|
||||||
|
this.curFace = 3;
|
||||||
|
} else if (value.equals("BLACK")) {
|
||||||
|
this.curFace = 4;
|
||||||
|
} else if (value.equals("RED")) {
|
||||||
|
this.curFace = 5;
|
||||||
|
} else if (value.equals("GREEN")) {
|
||||||
|
this.curFace = 6;
|
||||||
|
}
|
||||||
} else if ("SVar".equals(key)) {
|
} else if ("SVar".equals(key)) {
|
||||||
if (null == value) throw new IllegalArgumentException("SVar has no variable name");
|
if (null == value) throw new IllegalArgumentException("SVar has no variable name");
|
||||||
|
|
||||||
@@ -600,7 +644,7 @@ public final class CardRules implements ICardCharacteristics {
|
|||||||
|
|
||||||
public static CardRules getUnsupportedCardNamed(String name) {
|
public static CardRules getUnsupportedCardNamed(String name) {
|
||||||
CardAiHints cah = new CardAiHints(true, true, true, null, null, null);
|
CardAiHints cah = new CardAiHints(true, true, true, null, null, null);
|
||||||
CardFace[] faces = { new CardFace(name), null};
|
CardFace[] faces = { new CardFace(name), null, null, null, null, null, null};
|
||||||
faces[0].setColor(ColorSet.fromMask(0));
|
faces[0].setColor(ColorSet.fromMask(0));
|
||||||
faces[0].setType(CardType.parse("", false));
|
faces[0].setType(CardType.parse("", false));
|
||||||
faces[0].setOracleText("This card is not supported by Forge. Whenever you start a game with this card, it will be bugged.");
|
faces[0].setOracleText("This card is not supported by Forge. Whenever you start a game with this card, it will be bugged.");
|
||||||
|
|||||||
Reference in New Issue
Block a user