mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
CardDb is more forgiving to incomplete card scripts
This commit is contained in:
@@ -75,8 +75,9 @@ final class CardFace implements ICardCharacteristics {
|
|||||||
this.iToughness = StringUtils.isNumeric(this.toughness) ? Integer.parseInt(this.toughness) : 0;
|
this.iToughness = StringUtils.isNumeric(this.toughness) ? Integer.parseInt(this.toughness) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void calculateColor() { // Most scripts do not specify color explicitly
|
public void checkFieldsAndAssignMissingOnes() { // Most scripts do not specify color explicitly
|
||||||
if ( null == oracleText ) { System.err.println(name + " has no Oracle text"); oracleText = ""; }
|
if ( null == oracleText ) { System.err.println(name + " has no Oracle text. Assigned empty line."); oracleText = ""; }
|
||||||
|
if ( setsPrinted.isEmpty() ) { System.err.println(name + " was not assigned any set. Assigned CardEdition.UNKNOWN."); setsPrinted.put(CardEdition.UNKNOWN.getCode(), new CardInSet(CardRarity.Common, 1, null) ) ; }
|
||||||
if ( manaCost == null && color == null ) System.err.println(name + " has neither ManaCost nor Color");
|
if ( manaCost == null && color == null ) System.err.println(name + " has neither ManaCost nor Color");
|
||||||
if ( color == null ) color = ColorSet.fromManaCost(manaCost);
|
if ( color == null ) color = ColorSet.fromManaCost(manaCost);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,8 +87,8 @@ public class CardRulesReader {
|
|||||||
*/
|
*/
|
||||||
public final CardRules getCard() {
|
public final CardRules getCard() {
|
||||||
CardAiHints cah = new CardAiHints(removedFromAIDecks, removedFromRandomDecks, hints, needs );
|
CardAiHints cah = new CardAiHints(removedFromAIDecks, removedFromRandomDecks, hints, needs );
|
||||||
faces[0].calculateColor();
|
faces[0].checkFieldsAndAssignMissingOnes();
|
||||||
if ( null != faces[1] ) faces[1].calculateColor();
|
if ( null != faces[1] ) faces[1].checkFieldsAndAssignMissingOnes();
|
||||||
final CardRules result = new CardRules(faces, altMode, cah, originalScript);
|
final CardRules result = new CardRules(faces, altMode, cah, originalScript);
|
||||||
result.setDlUrls(pictureUrl);
|
result.setDlUrls(pictureUrl);
|
||||||
if ( StringUtils.isNotBlank(handLife))
|
if ( StringUtils.isNotBlank(handLife))
|
||||||
|
|||||||
Reference in New Issue
Block a user