mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
AbilityUtils support for Count$CardNumTypes / Count$RememberedCardNumTypes
This commit is contained in:
@@ -1966,6 +1966,15 @@ public class AbilityUtils {
|
|||||||
if (sq[0].contains("CardSumPT")) {
|
if (sq[0].contains("CardSumPT")) {
|
||||||
return doXMath((c.getNetPower() + c.getNetToughness()), expr, c, ctb);
|
return doXMath((c.getNetPower() + c.getNetToughness()), expr, c, ctb);
|
||||||
}
|
}
|
||||||
|
if (sq[0].contains("CardNumTypes")) {
|
||||||
|
Card ce;
|
||||||
|
if (sq[0].contains("Remembered")) {
|
||||||
|
ce = (Card) c.getFirstRemembered();
|
||||||
|
} else {
|
||||||
|
ce = c;
|
||||||
|
}
|
||||||
|
return doXMath(getNumberOfTypes(ce), expr, c, ctb);
|
||||||
|
}
|
||||||
|
|
||||||
if (sq[0].contains("CardNumColors")) {
|
if (sq[0].contains("CardNumColors")) {
|
||||||
return doXMath(CardUtil.getColors(c).countColors(), expr, c, ctb);
|
return doXMath(CardUtil.getColors(c).countColors(), expr, c, ctb);
|
||||||
@@ -3647,6 +3656,12 @@ public class AbilityUtils {
|
|||||||
return someCards;
|
return someCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getNumberOfTypes(final Card card) {
|
||||||
|
EnumSet<CardType.CoreType> types = EnumSet.noneOf(CardType.CoreType.class);
|
||||||
|
Iterables.addAll(types, card.getType().getCoreTypes());
|
||||||
|
return types.size();
|
||||||
|
}
|
||||||
|
|
||||||
public static int getCardTypesFromList(final CardCollectionView list) {
|
public static int getCardTypesFromList(final CardCollectionView list) {
|
||||||
EnumSet<CardType.CoreType> types = EnumSet.noneOf(CardType.CoreType.class);
|
EnumSet<CardType.CoreType> types = EnumSet.noneOf(CardType.CoreType.class);
|
||||||
for (Card c1 : list) {
|
for (Card c1 : list) {
|
||||||
|
|||||||
Reference in New Issue
Block a user