mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 19:28:01 +00:00
- Added Call to Arms
This commit is contained in:
@@ -1117,6 +1117,13 @@ public class CardFactoryUtil {
|
||||
return doXMath(getMostProminentCreatureTypeSize(list), m, c);
|
||||
}
|
||||
|
||||
if (l[0].startsWith("SecondMostProminentColor")) {
|
||||
String restriction = l[0].split(" ")[1];
|
||||
List<Card> list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), restriction, cc, c);
|
||||
int[] colorSize = SortColorsFromList(list);
|
||||
return doXMath(colorSize[colorSize.length - 2], m, c);
|
||||
}
|
||||
|
||||
if (l[0].startsWith("RolledThisTurn")) {
|
||||
return game.getPhaseHandler().getPlanarDiceRolledthisTurn();
|
||||
}
|
||||
@@ -1822,6 +1829,33 @@ public class CardFactoryUtil {
|
||||
return mask;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* SortColorsFromList.
|
||||
* </p>
|
||||
*
|
||||
* @param list
|
||||
* a {@link forge.CardList} object.
|
||||
* @return a List.
|
||||
*/
|
||||
public static int[] SortColorsFromList(final List<Card> list) {
|
||||
int cntColors = MagicColor.WUBRG.length;
|
||||
final int[] map = new int[cntColors];
|
||||
for(int i = 0; i < cntColors; i++) {
|
||||
map[i] = 0;
|
||||
}
|
||||
|
||||
for (final Card crd : list) {
|
||||
ColorSet color = CardUtil.getColors(crd);
|
||||
for(int i = 0; i < cntColors; i++) {
|
||||
if( color.hasAnyColor(MagicColor.WUBRG[i]))
|
||||
map[i]++;
|
||||
}
|
||||
} // for
|
||||
Arrays.sort(map);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getMostProminentColorsFromList.
|
||||
|
||||
Reference in New Issue
Block a user