mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
[Un-cards] DeckLimit keyword + Cardboard Carapace
This commit is contained in:
@@ -569,4 +569,14 @@ public final class CardRules implements ICardCharacteristics {
|
||||
public boolean hasKeyword(final String k) {
|
||||
return Iterables.contains(mainPart.getKeywords(), k);
|
||||
}
|
||||
|
||||
public Integer getKeywordMagnitude(final String k) {
|
||||
for (final String inst : mainPart.getKeywords()) {
|
||||
final String[] parts = inst.split(":");
|
||||
if (parts[0].equals(k) && StringUtils.isNumeric(parts[1])) {
|
||||
return Integer.valueOf(parts[1]);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -375,13 +375,7 @@ public enum DeckFormat {
|
||||
|
||||
public static Integer canHaveSpecificNumberInDeck(final IPaperCard card) {
|
||||
// Ideally, this would be parsed during card parsing and set this value
|
||||
if (card.getRules().hasKeyword("A deck can have up to seven cards named CARDNAME.")) {
|
||||
return 7;
|
||||
} else if (card.getRules().hasKeyword("Megalegendary")) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return null;
|
||||
return card.getRules().getKeywordMagnitude("DeckLimit");
|
||||
}
|
||||
|
||||
public static String getPlaneSectionConformanceProblem(final CardPool planes) {
|
||||
|
||||
Reference in New Issue
Block a user